weston-1.9.0/0000775000175000017500000000000012600133270010035 500000000000000weston-1.9.0/desktop-shell/0000775000175000017500000000000012600133270012613 500000000000000weston-1.9.0/desktop-shell/input-panel.c0000664000175000017500000002670112556771651015166 00000000000000/* * Copyright © 2010-2012 Intel Corporation * Copyright © 2011-2012 Collabora, Ltd. * Copyright © 2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include "shell.h" #include "desktop-shell-server-protocol.h" #include "input-method-server-protocol.h" #include "shared/helpers.h" struct input_panel_surface { struct wl_resource *resource; struct wl_signal destroy_signal; struct desktop_shell *shell; struct wl_list link; struct weston_surface *surface; struct weston_view *view; struct wl_listener surface_destroy_listener; struct weston_view_animation *anim; struct weston_output *output; uint32_t panel; }; static void input_panel_slide_done(struct weston_view_animation *animation, void *data) { struct input_panel_surface *ipsurf = data; ipsurf->anim = NULL; } static void show_input_panel_surface(struct input_panel_surface *ipsurf) { struct desktop_shell *shell = ipsurf->shell; struct weston_seat *seat; struct weston_surface *focus; float x, y; wl_list_for_each(seat, &shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard || !keyboard->focus) continue; focus = weston_surface_get_main_surface(keyboard->focus); ipsurf->output = focus->output; x = ipsurf->output->x + (ipsurf->output->width - ipsurf->surface->width) / 2; y = ipsurf->output->y + ipsurf->output->height - ipsurf->surface->height; weston_view_set_position(ipsurf->view, x, y); } weston_layer_entry_insert(&shell->input_panel_layer.view_list, &ipsurf->view->layer_link); weston_view_geometry_dirty(ipsurf->view); weston_view_update_transform(ipsurf->view); weston_surface_damage(ipsurf->surface); if (ipsurf->anim) weston_view_animation_destroy(ipsurf->anim); ipsurf->anim = weston_slide_run(ipsurf->view, ipsurf->surface->height * 0.9, 0, input_panel_slide_done, ipsurf); } static void show_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, show_input_panel_listener); struct input_panel_surface *ipsurf, *next; shell->text_input.surface = (struct weston_surface*)data; if (shell->showing_input_panels) return; shell->showing_input_panels = true; if (!shell->locked) wl_list_insert(&shell->compositor->cursor_layer.link, &shell->input_panel_layer.link); wl_list_for_each_safe(ipsurf, next, &shell->input_panel.surfaces, link) { if (ipsurf->surface->width == 0) continue; show_input_panel_surface(ipsurf); } } static void hide_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, hide_input_panel_listener); struct weston_view *view, *next; if (!shell->showing_input_panels) return; shell->showing_input_panels = false; if (!shell->locked) wl_list_remove(&shell->input_panel_layer.link); wl_list_for_each_safe(view, next, &shell->input_panel_layer.view_list.link, layer_link.link) weston_view_unmap(view); } static void update_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, update_input_panel_listener); memcpy(&shell->text_input.cursor_rectangle, data, sizeof(pixman_box32_t)); } static int input_panel_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "input panel"); } static void input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct input_panel_surface *ip_surface = surface->configure_private; struct desktop_shell *shell = ip_surface->shell; struct weston_view *view; float x, y; if (surface->width == 0) return; if (ip_surface->panel) { view = get_default_view(shell->text_input.surface); if (view == NULL) return; x = view->geometry.x + shell->text_input.cursor_rectangle.x2; y = view->geometry.y + shell->text_input.cursor_rectangle.y2; } else { x = ip_surface->output->x + (ip_surface->output->width - surface->width) / 2; y = ip_surface->output->y + ip_surface->output->height - surface->height; } weston_view_set_position(ip_surface->view, x, y); if (!weston_surface_is_mapped(surface) && shell->showing_input_panels) show_input_panel_surface(ip_surface); } static void destroy_input_panel_surface(struct input_panel_surface *input_panel_surface) { wl_signal_emit(&input_panel_surface->destroy_signal, input_panel_surface); wl_list_remove(&input_panel_surface->surface_destroy_listener.link); wl_list_remove(&input_panel_surface->link); input_panel_surface->surface->configure = NULL; weston_surface_set_label_func(input_panel_surface->surface, NULL); weston_view_destroy(input_panel_surface->view); free(input_panel_surface); } static struct input_panel_surface * get_input_panel_surface(struct weston_surface *surface) { if (surface->configure == input_panel_configure) { return surface->configure_private; } else { return NULL; } } static void input_panel_handle_surface_destroy(struct wl_listener *listener, void *data) { struct input_panel_surface *ipsurface = container_of(listener, struct input_panel_surface, surface_destroy_listener); if (ipsurface->resource) { wl_resource_destroy(ipsurface->resource); } else { destroy_input_panel_surface(ipsurface); } } static struct input_panel_surface * create_input_panel_surface(struct desktop_shell *shell, struct weston_surface *surface) { struct input_panel_surface *input_panel_surface; input_panel_surface = calloc(1, sizeof *input_panel_surface); if (!input_panel_surface) return NULL; surface->configure = input_panel_configure; surface->configure_private = input_panel_surface; weston_surface_set_label_func(surface, input_panel_get_label); input_panel_surface->shell = shell; input_panel_surface->surface = surface; input_panel_surface->view = weston_view_create(surface); wl_signal_init(&input_panel_surface->destroy_signal); input_panel_surface->surface_destroy_listener.notify = input_panel_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &input_panel_surface->surface_destroy_listener); wl_list_init(&input_panel_surface->link); return input_panel_surface; } static void input_panel_surface_set_toplevel(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource, uint32_t position) { struct input_panel_surface *input_panel_surface = wl_resource_get_user_data(resource); struct desktop_shell *shell = input_panel_surface->shell; wl_list_insert(&shell->input_panel.surfaces, &input_panel_surface->link); input_panel_surface->output = wl_resource_get_user_data(output_resource); input_panel_surface->panel = 0; } static void input_panel_surface_set_overlay_panel(struct wl_client *client, struct wl_resource *resource) { struct input_panel_surface *input_panel_surface = wl_resource_get_user_data(resource); struct desktop_shell *shell = input_panel_surface->shell; wl_list_insert(&shell->input_panel.surfaces, &input_panel_surface->link); input_panel_surface->panel = 1; } static const struct wl_input_panel_surface_interface input_panel_surface_implementation = { input_panel_surface_set_toplevel, input_panel_surface_set_overlay_panel }; static void destroy_input_panel_surface_resource(struct wl_resource *resource) { struct input_panel_surface *ipsurf = wl_resource_get_user_data(resource); destroy_input_panel_surface(ipsurf); } static void input_panel_get_input_panel_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct desktop_shell *shell = wl_resource_get_user_data(resource); struct input_panel_surface *ipsurf; if (get_input_panel_surface(surface)) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "wl_input_panel::get_input_panel_surface already requested"); return; } ipsurf = create_input_panel_surface(shell, surface); if (!ipsurf) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "surface->configure already set"); return; } ipsurf->resource = wl_resource_create(client, &wl_input_panel_surface_interface, 1, id); wl_resource_set_implementation(ipsurf->resource, &input_panel_surface_implementation, ipsurf, destroy_input_panel_surface_resource); } static const struct wl_input_panel_interface input_panel_implementation = { input_panel_get_input_panel_surface }; static void unbind_input_panel(struct wl_resource *resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); shell->input_panel.binding = NULL; } static void bind_input_panel(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct desktop_shell *shell = data; struct wl_resource *resource; resource = wl_resource_create(client, &wl_input_panel_interface, 1, id); if (shell->input_panel.binding == NULL) { wl_resource_set_implementation(resource, &input_panel_implementation, shell, unbind_input_panel); shell->input_panel.binding = resource; return; } wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "interface object already bound"); } void input_panel_destroy(struct desktop_shell *shell) { wl_list_remove(&shell->show_input_panel_listener.link); wl_list_remove(&shell->hide_input_panel_listener.link); } int input_panel_setup(struct desktop_shell *shell) { struct weston_compositor *ec = shell->compositor; shell->show_input_panel_listener.notify = show_input_panels; wl_signal_add(&ec->show_input_panel_signal, &shell->show_input_panel_listener); shell->hide_input_panel_listener.notify = hide_input_panels; wl_signal_add(&ec->hide_input_panel_signal, &shell->hide_input_panel_listener); shell->update_input_panel_listener.notify = update_input_panels; wl_signal_add(&ec->update_input_panel_signal, &shell->update_input_panel_listener); wl_list_init(&shell->input_panel.surfaces); if (wl_global_create(shell->compositor->wl_display, &wl_input_panel_interface, 1, shell, bind_input_panel) == NULL) return -1; return 0; } weston-1.9.0/desktop-shell/shell.h0000664000175000017500000001440412552061177014032 00000000000000/* * Copyright © 2010-2012 Intel Corporation * Copyright © 2011-2012 Collabora, Ltd. * Copyright © 2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include "compositor.h" #include "desktop-shell-server-protocol.h" enum animation_type { ANIMATION_NONE, ANIMATION_ZOOM, ANIMATION_FADE, ANIMATION_DIM_LAYER, }; enum fade_type { FADE_IN, FADE_OUT }; enum exposay_target_state { EXPOSAY_TARGET_OVERVIEW, /* show all windows */ EXPOSAY_TARGET_CANCEL, /* return to normal, same focus */ EXPOSAY_TARGET_SWITCH, /* return to normal, switch focus */ }; enum exposay_layout_state { EXPOSAY_LAYOUT_INACTIVE = 0, /* normal desktop */ EXPOSAY_LAYOUT_ANIMATE_TO_INACTIVE, /* in transition to normal */ EXPOSAY_LAYOUT_OVERVIEW, /* show all windows */ EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW, /* in transition to all windows */ }; struct exposay_output { int num_surfaces; int grid_size; int surface_size; int hpadding_outer; int vpadding_outer; int padding_inner; }; struct exposay { /* XXX: Make these exposay_surfaces. */ struct weston_view *focus_prev; struct weston_view *focus_current; struct weston_view *clicked; struct workspace *workspace; struct weston_seat *seat; struct wl_list surface_list; struct weston_keyboard_grab grab_kbd; struct weston_pointer_grab grab_ptr; enum exposay_target_state state_target; enum exposay_layout_state state_cur; int in_flight; /* number of animations still running */ int row_current; int column_current; struct exposay_output *cur_output; bool mod_pressed; bool mod_invalid; }; struct focus_surface { struct weston_surface *surface; struct weston_view *view; struct weston_transform workspace_transform; }; struct workspace { struct weston_layer layer; struct wl_list focus_list; struct wl_listener seat_destroyed_listener; struct focus_surface *fsurf_front; struct focus_surface *fsurf_back; struct weston_view_animation *focus_animation; }; struct shell_output { struct desktop_shell *shell; struct weston_output *output; struct exposay_output eoutput; struct wl_listener destroy_listener; struct wl_list link; }; struct desktop_shell { struct weston_compositor *compositor; struct wl_listener idle_listener; struct wl_listener wake_listener; struct wl_listener destroy_listener; struct wl_listener show_input_panel_listener; struct wl_listener hide_input_panel_listener; struct wl_listener update_input_panel_listener; struct weston_layer fullscreen_layer; struct weston_layer panel_layer; struct weston_layer background_layer; struct weston_layer lock_layer; struct weston_layer input_panel_layer; struct wl_listener pointer_focus_listener; struct weston_surface *grab_surface; struct { struct wl_client *client; struct wl_resource *desktop_shell; struct wl_listener client_destroy_listener; unsigned deathcount; uint32_t deathstamp; } child; bool locked; bool showing_input_panels; bool prepare_event_sent; struct text_backend *text_backend; struct { struct weston_surface *surface; pixman_box32_t cursor_rectangle; } text_input; struct weston_surface *lock_surface; struct wl_listener lock_surface_listener; struct { struct wl_array array; unsigned int current; unsigned int num; struct wl_list client_list; struct weston_animation animation; struct wl_list anim_sticky_list; int anim_dir; uint32_t anim_timestamp; double anim_current; struct workspace *anim_from; struct workspace *anim_to; } workspaces; struct { struct wl_resource *binding; struct wl_list surfaces; } input_panel; struct { struct weston_view *view; struct weston_view_animation *animation; enum fade_type type; struct wl_event_source *startup_timer; } fade; struct exposay exposay; uint32_t binding_modifier; uint32_t exposay_modifier; enum animation_type win_animation_type; enum animation_type win_close_animation_type; enum animation_type startup_animation_type; enum animation_type focus_animation_type; struct weston_layer minimized_layer; struct wl_listener seat_create_listener; struct wl_listener output_create_listener; struct wl_listener output_move_listener; struct wl_list output_list; enum desktop_shell_panel_position panel_position; char *client; struct timespec startup_time; }; struct weston_output * get_default_output(struct weston_compositor *compositor); struct weston_view * get_default_view(struct weston_surface *surface); struct shell_surface * get_shell_surface(struct weston_surface *surface); struct workspace * get_current_workspace(struct desktop_shell *shell); void lower_fullscreen_layer(struct desktop_shell *shell, struct weston_output *lowering_output); void activate(struct desktop_shell *shell, struct weston_surface *es, struct weston_seat *seat, bool configure); void exposay_binding(struct weston_keyboard *keyboard, enum weston_keyboard_modifier modifier, void *data); int input_panel_setup(struct desktop_shell *shell); void input_panel_destroy(struct desktop_shell *shell); typedef void (*shell_for_each_layer_func_t)(struct desktop_shell *, struct weston_layer *, void *); void shell_for_each_layer(struct desktop_shell *shell, shell_for_each_layer_func_t func, void *data); weston-1.9.0/desktop-shell/exposay.c0000664000175000017500000004722212560760452014413 00000000000000/* * Copyright © 2010-2012 Intel Corporation * Copyright © 2011-2012 Collabora, Ltd. * Copyright © 2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include "shell.h" #include "shared/helpers.h" struct exposay_surface { struct desktop_shell *shell; struct exposay_output *eoutput; struct weston_surface *surface; struct weston_view *view; struct wl_listener view_destroy_listener; struct wl_list link; int x; int y; int width; int height; double scale; int row; int column; /* The animations only apply a transformation for their own lifetime, * and don't have an option to indefinitely maintain the * transformation in a steady state - so, we apply our own once the * animation has finished. */ struct weston_transform transform; }; static void exposay_set_state(struct desktop_shell *shell, enum exposay_target_state state, struct weston_seat *seat); static void exposay_check_state(struct desktop_shell *shell); static void exposay_surface_destroy(struct exposay_surface *esurface) { wl_list_remove(&esurface->link); wl_list_remove(&esurface->view_destroy_listener.link); if (esurface->shell->exposay.focus_current == esurface->view) esurface->shell->exposay.focus_current = NULL; if (esurface->shell->exposay.focus_prev == esurface->view) esurface->shell->exposay.focus_prev = NULL; free(esurface); } static void exposay_in_flight_inc(struct desktop_shell *shell) { shell->exposay.in_flight++; } static void exposay_in_flight_dec(struct desktop_shell *shell) { if (--shell->exposay.in_flight > 0) return; exposay_check_state(shell); } static void exposay_animate_in_done(struct weston_view_animation *animation, void *data) { struct exposay_surface *esurface = data; wl_list_insert(&esurface->view->geometry.transformation_list, &esurface->transform.link); weston_matrix_init(&esurface->transform.matrix); weston_matrix_scale(&esurface->transform.matrix, esurface->scale, esurface->scale, 1.0f); weston_matrix_translate(&esurface->transform.matrix, esurface->x - esurface->view->geometry.x, esurface->y - esurface->view->geometry.y, 0); weston_view_geometry_dirty(esurface->view); weston_compositor_schedule_repaint(esurface->view->surface->compositor); exposay_in_flight_dec(esurface->shell); } static void exposay_animate_in(struct exposay_surface *esurface) { exposay_in_flight_inc(esurface->shell); weston_move_scale_run(esurface->view, esurface->x - esurface->view->geometry.x, esurface->y - esurface->view->geometry.y, 1.0, esurface->scale, 0, exposay_animate_in_done, esurface); } static void exposay_animate_out_done(struct weston_view_animation *animation, void *data) { struct exposay_surface *esurface = data; struct desktop_shell *shell = esurface->shell; exposay_surface_destroy(esurface); exposay_in_flight_dec(shell); } static void exposay_animate_out(struct exposay_surface *esurface) { exposay_in_flight_inc(esurface->shell); /* Remove the static transformation set up by * exposay_transform_in_done(). */ wl_list_remove(&esurface->transform.link); weston_view_geometry_dirty(esurface->view); weston_move_scale_run(esurface->view, esurface->x - esurface->view->geometry.x, esurface->y - esurface->view->geometry.y, 1.0, esurface->scale, 1, exposay_animate_out_done, esurface); } static void exposay_highlight_surface(struct desktop_shell *shell, struct exposay_surface *esurface) { struct weston_view *view = esurface->view; if (shell->exposay.focus_current == view) return; shell->exposay.row_current = esurface->row; shell->exposay.column_current = esurface->column; shell->exposay.cur_output = esurface->eoutput; activate(shell, view->surface, shell->exposay.seat, false); shell->exposay.focus_current = view; } static int exposay_is_animating(struct desktop_shell *shell) { if (shell->exposay.state_cur == EXPOSAY_LAYOUT_INACTIVE || shell->exposay.state_cur == EXPOSAY_LAYOUT_OVERVIEW) return 0; return (shell->exposay.in_flight > 0); } static void exposay_pick(struct desktop_shell *shell, int x, int y) { struct exposay_surface *esurface; if (exposay_is_animating(shell)) return; wl_list_for_each(esurface, &shell->exposay.surface_list, link) { if (x < esurface->x || x > esurface->x + esurface->width) continue; if (y < esurface->y || y > esurface->y + esurface->height) continue; exposay_highlight_surface(shell, esurface); return; } } static void handle_view_destroy(struct wl_listener *listener, void *data) { struct exposay_surface *esurface = container_of(listener, struct exposay_surface, view_destroy_listener); exposay_surface_destroy(esurface); } /* Pretty lame layout for now; just tries to make a square. Should take * aspect ratio into account really. Also needs to be notified of surface * addition and removal and adjust layout/animate accordingly. */ static enum exposay_layout_state exposay_layout(struct desktop_shell *shell, struct shell_output *shell_output) { struct workspace *workspace = shell->exposay.workspace; struct weston_output *output = shell_output->output; struct exposay_output *eoutput = &shell_output->eoutput; struct weston_view *view; struct exposay_surface *esurface, *highlight = NULL; int w, h; int i; int last_row_removed = 0; eoutput->num_surfaces = 0; wl_list_for_each(view, &workspace->layer.view_list.link, layer_link.link) { if (!get_shell_surface(view->surface)) continue; if (view->output != output) continue; eoutput->num_surfaces++; } if (eoutput->num_surfaces == 0) { eoutput->grid_size = 0; eoutput->hpadding_outer = 0; eoutput->vpadding_outer = 0; eoutput->padding_inner = 0; eoutput->surface_size = 0; return EXPOSAY_LAYOUT_OVERVIEW; } /* Lay the grid out as square as possible, losing surfaces from the * bottom row if required. Start with fixed padding of a 10% margin * around the outside and 80px internal padding between surfaces, and * maximise the area made available to surfaces after this, but only * to a maximum of 1/3rd the total output size. * * If we can't make a square grid, add one extra row at the bottom * which will have a smaller number of columns. * * XXX: Surely there has to be a better way to express this maths, * right?! */ eoutput->grid_size = floor(sqrtf(eoutput->num_surfaces)); if (pow(eoutput->grid_size, 2) != eoutput->num_surfaces) eoutput->grid_size++; last_row_removed = pow(eoutput->grid_size, 2) - eoutput->num_surfaces; eoutput->hpadding_outer = (output->width / 10); eoutput->vpadding_outer = (output->height / 10); eoutput->padding_inner = 80; w = output->width - (eoutput->hpadding_outer * 2); w -= eoutput->padding_inner * (eoutput->grid_size - 1); w /= eoutput->grid_size; h = output->height - (eoutput->vpadding_outer * 2); h -= eoutput->padding_inner * (eoutput->grid_size - 1); h /= eoutput->grid_size; eoutput->surface_size = (w < h) ? w : h; if (eoutput->surface_size > (output->width / 2)) eoutput->surface_size = output->width / 2; if (eoutput->surface_size > (output->height / 2)) eoutput->surface_size = output->height / 2; i = 0; wl_list_for_each(view, &workspace->layer.view_list.link, layer_link.link) { int pad; pad = eoutput->surface_size + eoutput->padding_inner; if (!get_shell_surface(view->surface)) continue; if (view->output != output) continue; esurface = malloc(sizeof(*esurface)); if (!esurface) { exposay_set_state(shell, EXPOSAY_TARGET_CANCEL, shell->exposay.seat); break; } wl_list_insert(&shell->exposay.surface_list, &esurface->link); esurface->shell = shell; esurface->eoutput = eoutput; esurface->view = view; esurface->row = i / eoutput->grid_size; esurface->column = i % eoutput->grid_size; esurface->x = output->x + eoutput->hpadding_outer; esurface->x += pad * esurface->column; esurface->y = output->y + eoutput->vpadding_outer; esurface->y += pad * esurface->row; if (esurface->row == eoutput->grid_size - 1) esurface->x += (eoutput->surface_size + eoutput->padding_inner) * last_row_removed / 2; if (view->surface->width > view->surface->height) esurface->scale = eoutput->surface_size / (float) view->surface->width; else esurface->scale = eoutput->surface_size / (float) view->surface->height; esurface->width = view->surface->width * esurface->scale; esurface->height = view->surface->height * esurface->scale; if (shell->exposay.focus_current == esurface->view) highlight = esurface; exposay_animate_in(esurface); /* We want our destroy handler to be after the animation * destroy handler in the list, this way when the view is * destroyed, the animation can safely call the animation * completion callback before we free the esurface in our * destroy handler. */ esurface->view_destroy_listener.notify = handle_view_destroy; wl_signal_add(&view->destroy_signal, &esurface->view_destroy_listener); i++; } if (highlight) { shell->exposay.focus_current = NULL; exposay_highlight_surface(shell, highlight); } weston_compositor_schedule_repaint(shell->compositor); return EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW; } static void exposay_focus(struct weston_pointer_grab *grab) { } static void exposay_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct desktop_shell *shell = container_of(grab, struct desktop_shell, exposay.grab_ptr); weston_pointer_move(grab->pointer, x, y); exposay_pick(shell, wl_fixed_to_int(grab->pointer->x), wl_fixed_to_int(grab->pointer->y)); } static void exposay_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct desktop_shell *shell = container_of(grab, struct desktop_shell, exposay.grab_ptr); struct weston_seat *seat = grab->pointer->seat; enum wl_pointer_button_state state = state_w; if (button != BTN_LEFT) return; /* Store the surface we clicked on, and don't do anything if we end up * releasing on a different surface. */ if (state == WL_POINTER_BUTTON_STATE_PRESSED) { shell->exposay.clicked = shell->exposay.focus_current; return; } if (shell->exposay.focus_current == shell->exposay.clicked) exposay_set_state(shell, EXPOSAY_TARGET_SWITCH, seat); else shell->exposay.clicked = NULL; } static void exposay_pointer_grab_cancel(struct weston_pointer_grab *grab) { struct desktop_shell *shell = container_of(grab, struct desktop_shell, exposay.grab_ptr); exposay_set_state(shell, EXPOSAY_TARGET_CANCEL, shell->exposay.seat); } static const struct weston_pointer_grab_interface exposay_ptr_grab = { exposay_focus, exposay_motion, exposay_button, exposay_pointer_grab_cancel, }; static int exposay_maybe_move(struct desktop_shell *shell, int row, int column) { struct exposay_surface *esurface; wl_list_for_each(esurface, &shell->exposay.surface_list, link) { if (esurface->eoutput != shell->exposay.cur_output || esurface->row != row || esurface->column != column) continue; exposay_highlight_surface(shell, esurface); return 1; } return 0; } static void exposay_key(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state_w) { struct weston_seat *seat = grab->keyboard->seat; struct desktop_shell *shell = container_of(grab, struct desktop_shell, exposay.grab_kbd); enum wl_keyboard_key_state state = state_w; if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (key) { case KEY_ESC: exposay_set_state(shell, EXPOSAY_TARGET_CANCEL, seat); break; case KEY_ENTER: exposay_set_state(shell, EXPOSAY_TARGET_SWITCH, seat); break; case KEY_UP: exposay_maybe_move(shell, shell->exposay.row_current - 1, shell->exposay.column_current); break; case KEY_DOWN: /* Special case for trying to move to the bottom row when it * has fewer items than all the others. */ if (!exposay_maybe_move(shell, shell->exposay.row_current + 1, shell->exposay.column_current) && shell->exposay.row_current < (shell->exposay.cur_output->grid_size - 1)) { exposay_maybe_move(shell, shell->exposay.row_current + 1, (shell->exposay.cur_output->num_surfaces % shell->exposay.cur_output->grid_size) - 1); } break; case KEY_LEFT: exposay_maybe_move(shell, shell->exposay.row_current, shell->exposay.column_current - 1); break; case KEY_RIGHT: exposay_maybe_move(shell, shell->exposay.row_current, shell->exposay.column_current + 1); break; case KEY_TAB: /* Try to move right, then down (and to the leftmost column), * then if all else fails, to the top left. */ if (!exposay_maybe_move(shell, shell->exposay.row_current, shell->exposay.column_current + 1) && !exposay_maybe_move(shell, shell->exposay.row_current + 1, 0)) exposay_maybe_move(shell, 0, 0); break; default: break; } } static void exposay_modifier(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct desktop_shell *shell = container_of(grab, struct desktop_shell, exposay.grab_kbd); struct weston_seat *seat = (struct weston_seat *) grab->keyboard->seat; /* We want to know when mod has been pressed and released. * FIXME: There is a problem here: if mod is pressed, then a key * is pressed and released, then mod is released, we will treat that * as if only mod had been pressed and released. */ if (seat->modifier_state) { if (seat->modifier_state == shell->binding_modifier) { shell->exposay.mod_pressed = true; } else { shell->exposay.mod_invalid = true; } } else { if (shell->exposay.mod_pressed && !shell->exposay.mod_invalid) exposay_set_state(shell, EXPOSAY_TARGET_CANCEL, seat); shell->exposay.mod_invalid = false; shell->exposay.mod_pressed = false; } return; } static void exposay_cancel(struct weston_keyboard_grab *grab) { struct desktop_shell *shell = container_of(grab, struct desktop_shell, exposay.grab_kbd); exposay_set_state(shell, EXPOSAY_TARGET_CANCEL, shell->exposay.seat); } static const struct weston_keyboard_grab_interface exposay_kbd_grab = { exposay_key, exposay_modifier, exposay_cancel, }; /** * Called when the transition from overview -> inactive has completed. */ static enum exposay_layout_state exposay_set_inactive(struct desktop_shell *shell) { struct weston_seat *seat = shell->exposay.seat; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (pointer) weston_pointer_end_grab(pointer); if (keyboard) { weston_keyboard_end_grab(keyboard); if (keyboard->input_method_resource) keyboard->grab = &keyboard->input_method_grab; } return EXPOSAY_LAYOUT_INACTIVE; } /** * Begins the transition from overview to inactive. */ static enum exposay_layout_state exposay_transition_inactive(struct desktop_shell *shell, int switch_focus) { struct exposay_surface *esurface; /* Call activate() before we start the animations to avoid * animating back the old state and then immediately transitioning * to the new. */ if (switch_focus && shell->exposay.focus_current) activate(shell, shell->exposay.focus_current->surface, shell->exposay.seat, true); else if (shell->exposay.focus_prev) activate(shell, shell->exposay.focus_prev->surface, shell->exposay.seat, true); wl_list_for_each(esurface, &shell->exposay.surface_list, link) exposay_animate_out(esurface); weston_compositor_schedule_repaint(shell->compositor); return EXPOSAY_LAYOUT_ANIMATE_TO_INACTIVE; } static enum exposay_layout_state exposay_transition_active(struct desktop_shell *shell) { struct weston_seat *seat = shell->exposay.seat; struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct shell_output *shell_output; bool animate = false; shell->exposay.workspace = get_current_workspace(shell); shell->exposay.focus_prev = get_default_view(keyboard->focus); shell->exposay.focus_current = get_default_view(keyboard->focus); shell->exposay.clicked = NULL; wl_list_init(&shell->exposay.surface_list); lower_fullscreen_layer(shell, NULL); shell->exposay.grab_kbd.interface = &exposay_kbd_grab; weston_keyboard_start_grab(keyboard, &shell->exposay.grab_kbd); weston_keyboard_set_focus(keyboard, NULL); shell->exposay.grab_ptr.interface = &exposay_ptr_grab; if (pointer) { weston_pointer_start_grab(pointer, &shell->exposay.grab_ptr); weston_pointer_clear_focus(pointer); } wl_list_for_each(shell_output, &shell->output_list, link) { enum exposay_layout_state state; state = exposay_layout(shell, shell_output); if (state == EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW) animate = true; } return animate ? EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW : EXPOSAY_LAYOUT_OVERVIEW; } static void exposay_check_state(struct desktop_shell *shell) { enum exposay_layout_state state_new = shell->exposay.state_cur; int do_switch = 0; /* Don't do anything whilst animations are running, just store up * target state changes and only act on them when the animations have * completed. */ if (exposay_is_animating(shell)) return; switch (shell->exposay.state_target) { case EXPOSAY_TARGET_OVERVIEW: switch (shell->exposay.state_cur) { case EXPOSAY_LAYOUT_OVERVIEW: goto out; case EXPOSAY_LAYOUT_ANIMATE_TO_OVERVIEW: state_new = EXPOSAY_LAYOUT_OVERVIEW; break; default: state_new = exposay_transition_active(shell); break; } break; case EXPOSAY_TARGET_SWITCH: do_switch = 1; /* fallthrough */ case EXPOSAY_TARGET_CANCEL: switch (shell->exposay.state_cur) { case EXPOSAY_LAYOUT_INACTIVE: goto out; case EXPOSAY_LAYOUT_ANIMATE_TO_INACTIVE: state_new = exposay_set_inactive(shell); break; default: state_new = exposay_transition_inactive(shell, do_switch); break; } break; } out: shell->exposay.state_cur = state_new; } static void exposay_set_state(struct desktop_shell *shell, enum exposay_target_state state, struct weston_seat *seat) { shell->exposay.state_target = state; shell->exposay.seat = seat; exposay_check_state(shell); } void exposay_binding(struct weston_keyboard *keyboard, enum weston_keyboard_modifier modifier, void *data) { struct desktop_shell *shell = data; exposay_set_state(shell, EXPOSAY_TARGET_OVERVIEW, keyboard->seat); } weston-1.9.0/desktop-shell/shell.c0000664000175000017500000054034612576021107014031 00000000000000/* * Copyright © 2010-2012 Intel Corporation * Copyright © 2011-2012 Collabora, Ltd. * Copyright © 2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "shell.h" #include "desktop-shell-server-protocol.h" #include "workspaces-server-protocol.h" #include "shared/config-parser.h" #include "shared/helpers.h" #include "xdg-shell-server-protocol.h" #define DEFAULT_NUM_WORKSPACES 1 #define DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH 200 #ifndef static_assert #define static_assert(cond, msg) #endif struct focus_state { struct weston_seat *seat; struct workspace *ws; struct weston_surface *keyboard_focus; struct wl_list link; struct wl_listener seat_destroy_listener; struct wl_listener surface_destroy_listener; }; enum shell_surface_type { SHELL_SURFACE_NONE, SHELL_SURFACE_TOPLEVEL, SHELL_SURFACE_POPUP, SHELL_SURFACE_XWAYLAND }; struct shell_client; /* * Surface stacking and ordering. * * This is handled using several linked lists of surfaces, organised into * ‘layers’. The layers are ordered, and each of the surfaces in one layer are * above all of the surfaces in the layer below. The set of layers is static and * in the following order (top-most first): * • Lock layer (only ever displayed on its own) * • Cursor layer * • Input panel layer * • Fullscreen layer * • Panel layer * • Workspace layers * • Background layer * * The list of layers may be manipulated to remove whole layers of surfaces from * display. For example, when locking the screen, all layers except the lock * layer are removed. * * A surface’s layer is modified on configuring the surface, in * set_surface_type() (which is only called when the surface’s type change is * _committed_). If a surface’s type changes (e.g. when making a window * fullscreen) its layer changes too. * * In order to allow popup and transient surfaces to be correctly stacked above * their parent surfaces, each surface tracks both its parent surface, and a * linked list of its children. When a surface’s layer is updated, so are the * layers of its children. Note that child surfaces are *not* the same as * subsurfaces — child/parent surfaces are purely for maintaining stacking * order. * * The children_link list of siblings of a surface (i.e. those surfaces which * have the same parent) only contains weston_surfaces which have a * shell_surface. Stacking is not implemented for non-shell_surface * weston_surfaces. This means that the following implication does *not* hold: * (shsurf->parent != NULL) ⇒ !wl_list_is_empty(shsurf->children_link) */ struct shell_surface { struct wl_resource *resource; struct wl_signal destroy_signal; struct shell_client *owner; struct wl_resource *owner_resource; struct weston_surface *surface; struct weston_view *view; int32_t last_width, last_height; struct wl_listener surface_destroy_listener; struct wl_listener resource_destroy_listener; struct weston_surface *parent; struct wl_list children_list; /* child surfaces of this one */ struct wl_list children_link; /* sibling surfaces of this one */ struct desktop_shell *shell; enum shell_surface_type type; char *title, *class; int32_t saved_x, saved_y; int32_t saved_width, saved_height; bool saved_position_valid; bool saved_size_valid; bool saved_rotation_valid; int unresponsive, grabbed; uint32_t resize_edges; struct { struct weston_transform transform; struct weston_matrix rotation; } rotation; struct { struct wl_list grab_link; int32_t x, y; struct shell_seat *shseat; uint32_t serial; } popup; struct { int32_t x, y; uint32_t flags; } transient; struct { enum wl_shell_surface_fullscreen_method type; struct weston_transform transform; /* matrix from x, y */ uint32_t framerate; struct weston_view *black_view; } fullscreen; struct weston_transform workspace_transform; struct weston_output *fullscreen_output; struct weston_output *output; struct wl_list link; const struct weston_shell_client *client; struct surface_state { bool maximized; bool fullscreen; bool relative; bool lowered; } state, next_state, requested_state; /* surface states */ bool state_changed; bool state_requested; struct { int32_t x, y, width, height; } geometry, next_geometry; bool has_set_geometry, has_next_geometry; int focus_count; bool destroying; }; struct shell_grab { struct weston_pointer_grab grab; struct shell_surface *shsurf; struct wl_listener shsurf_destroy_listener; }; struct shell_touch_grab { struct weston_touch_grab grab; struct shell_surface *shsurf; struct wl_listener shsurf_destroy_listener; struct weston_touch *touch; }; struct weston_move_grab { struct shell_grab base; wl_fixed_t dx, dy; bool client_initiated; }; struct weston_touch_move_grab { struct shell_touch_grab base; int active; wl_fixed_t dx, dy; }; struct rotate_grab { struct shell_grab base; struct weston_matrix rotation; struct { float x; float y; } center; }; struct shell_seat { struct weston_seat *seat; struct wl_listener seat_destroy_listener; struct weston_surface *focused_surface; struct wl_listener caps_changed_listener; struct wl_listener pointer_focus_listener; struct wl_listener keyboard_focus_listener; struct { struct weston_pointer_grab grab; struct weston_touch_grab touch_grab; struct wl_list surfaces_list; struct wl_client *client; int32_t initial_up; enum { POINTER, TOUCH } type; } popup_grab; }; struct shell_client { struct wl_resource *resource; struct wl_client *client; struct desktop_shell *shell; struct wl_listener destroy_listener; struct wl_event_source *ping_timer; uint32_t ping_serial; int unresponsive; struct wl_list surface_list; }; static struct desktop_shell * shell_surface_get_shell(struct shell_surface *shsurf); static void surface_rotate(struct shell_surface *surface, struct weston_pointer *pointer); static void shell_fade_startup(struct desktop_shell *shell); static struct shell_seat * get_shell_seat(struct weston_seat *seat); static void get_output_panel_size(struct desktop_shell *shell, struct weston_output *output, int *width, int *height); static void shell_surface_update_child_surface_layers(struct shell_surface *shsurf); static bool shell_surface_is_wl_shell_surface(struct shell_surface *shsurf); static bool shell_surface_is_xdg_surface(struct shell_surface *shsurf); static bool shell_surface_is_xdg_popup(struct shell_surface *shsurf); static void shell_surface_set_parent(struct shell_surface *shsurf, struct weston_surface *parent); static int shell_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { struct shell_surface *shsurf; const char *typestr[] = { [SHELL_SURFACE_NONE] = "unidentified", [SHELL_SURFACE_TOPLEVEL] = "top-level", [SHELL_SURFACE_POPUP] = "popup", [SHELL_SURFACE_XWAYLAND] = "Xwayland", }; const char *t, *c; shsurf = get_shell_surface(surface); if (!shsurf) return snprintf(buf, len, "unidentified window"); t = shsurf->title; c = shsurf->class; return snprintf(buf, len, "%s window%s%s%s%s%s", typestr[shsurf->type], t ? " '" : "", t ?: "", t ? "'" : "", c ? " of " : "", c ?: ""); } static bool shell_surface_is_top_fullscreen(struct shell_surface *shsurf) { struct desktop_shell *shell; struct weston_view *view; struct shell_surface *top_fs_shsurf = NULL; shell = shell_surface_get_shell(shsurf); if (wl_list_empty(&shell->fullscreen_layer.view_list.link)) return false; /* Find topmost shsurf on the same fullscreen output on which shsurf * is displaying. We don't care about other outputs. */ wl_list_for_each(view, &shell->fullscreen_layer.view_list.link, layer_link.link) { struct shell_surface *cand_shsurf = get_shell_surface(view->surface); if (cand_shsurf && (cand_shsurf->fullscreen_output == shsurf->fullscreen_output)) { top_fs_shsurf = cand_shsurf; break; } } return (shsurf == top_fs_shsurf); } static void destroy_shell_grab_shsurf(struct wl_listener *listener, void *data) { struct shell_grab *grab; grab = container_of(listener, struct shell_grab, shsurf_destroy_listener); grab->shsurf = NULL; } struct weston_view * get_default_view(struct weston_surface *surface) { struct shell_surface *shsurf; struct weston_view *view; if (!surface || wl_list_empty(&surface->views)) return NULL; shsurf = get_shell_surface(surface); if (shsurf) return shsurf->view; wl_list_for_each(view, &surface->views, surface_link) if (weston_view_is_mapped(view)) return view; return container_of(surface->views.next, struct weston_view, surface_link); } static void popup_grab_end(struct weston_pointer *pointer); static void touch_popup_grab_end(struct weston_touch *touch); static void shell_grab_start(struct shell_grab *grab, const struct weston_pointer_grab_interface *interface, struct shell_surface *shsurf, struct weston_pointer *pointer, enum desktop_shell_cursor cursor) { struct desktop_shell *shell = shsurf->shell; struct weston_touch *touch = weston_seat_get_touch(pointer->seat); popup_grab_end(pointer); if (touch) touch_popup_grab_end(touch); grab->grab.interface = interface; grab->shsurf = shsurf; grab->shsurf_destroy_listener.notify = destroy_shell_grab_shsurf; wl_signal_add(&shsurf->destroy_signal, &grab->shsurf_destroy_listener); shsurf->grabbed = 1; weston_pointer_start_grab(pointer, &grab->grab); if (shell->child.desktop_shell) { desktop_shell_send_grab_cursor(shell->child.desktop_shell, cursor); weston_pointer_set_focus(pointer, get_default_view(shell->grab_surface), wl_fixed_from_int(0), wl_fixed_from_int(0)); } } static void get_output_panel_size(struct desktop_shell *shell, struct weston_output *output, int *width, int *height) { struct weston_view *view; *width = 0; *height = 0; if (!output) return; wl_list_for_each(view, &shell->panel_layer.view_list.link, layer_link.link) { float x, y; if (view->surface->output != output) continue; switch (shell->panel_position) { case DESKTOP_SHELL_PANEL_POSITION_TOP: case DESKTOP_SHELL_PANEL_POSITION_BOTTOM: weston_view_to_global_float(view, view->surface->width, 0, &x, &y); *width = (int)x - output->x; *height = view->surface->height + (int) y - output->y; return; case DESKTOP_SHELL_PANEL_POSITION_LEFT: case DESKTOP_SHELL_PANEL_POSITION_RIGHT: weston_view_to_global_float(view, 0, view->surface->height, &x, &y); *width = view->surface->width + (int)x - output->x; *height = (int)y - output->y; return; default: /* we've already set width and height to * fallback values. */ break; } } /* the correct view wasn't found */ } static void get_output_work_area(struct desktop_shell *shell, struct weston_output *output, pixman_rectangle32_t *area) { int32_t panel_width = 0, panel_height = 0; area->x = output->x; area->y = output->y; get_output_panel_size(shell, output, &panel_width, &panel_height); switch (shell->panel_position) { case DESKTOP_SHELL_PANEL_POSITION_TOP: default: area->y += panel_height; case DESKTOP_SHELL_PANEL_POSITION_BOTTOM: area->width = output->width; area->height = output->height - panel_height; break; case DESKTOP_SHELL_PANEL_POSITION_LEFT: area->x += panel_width; case DESKTOP_SHELL_PANEL_POSITION_RIGHT: area->width = output->width - panel_width; area->height = output->height; break; } } static struct shell_surface * find_toplevel_surface(struct shell_surface *in_surface) { struct shell_surface *surface = in_surface; if (!surface) return NULL; while (surface->parent) surface = get_shell_surface(surface->parent); /* If no top level surface was found, just use whatever surface was originally provided. */ if (!surface || surface->type != SHELL_SURFACE_TOPLEVEL) surface = in_surface; return surface; } static void send_configure_for_surface(struct shell_surface *shsurf) { int32_t width, height; struct surface_state *state; if (shsurf->state_requested) state = &shsurf->requested_state; else if (shsurf->state_changed) state = &shsurf->next_state; else state = &shsurf->state; if (state->fullscreen) { width = shsurf->output->width; height = shsurf->output->height; } else if (state->maximized) { struct desktop_shell *shell; pixman_rectangle32_t area; shell = shell_surface_get_shell(shsurf); get_output_work_area(shell, shsurf->output, &area); width = area.width; height = area.height; } else if (shsurf->resize_edges) { width = shsurf->geometry.width; height = shsurf->geometry.height; } else { width = 0; height = 0; } shsurf->client->send_configure(shsurf->surface, width, height); } static void shell_surface_state_changed(struct shell_surface *shsurf) { if (shell_surface_is_xdg_surface(shsurf)) send_configure_for_surface(shsurf); } static void shell_grab_end(struct shell_grab *grab) { if (grab->shsurf) { wl_list_remove(&grab->shsurf_destroy_listener.link); grab->shsurf->grabbed = 0; if (grab->shsurf->resize_edges) { grab->shsurf->resize_edges = 0; shell_surface_state_changed(grab->shsurf); } } weston_pointer_end_grab(grab->grab.pointer); } static void shell_touch_grab_start(struct shell_touch_grab *grab, const struct weston_touch_grab_interface *interface, struct shell_surface *shsurf, struct weston_touch *touch) { struct desktop_shell *shell = shsurf->shell; struct weston_pointer *pointer = weston_seat_get_pointer(touch->seat); touch_popup_grab_end(touch); if (pointer) popup_grab_end(pointer); grab->grab.interface = interface; grab->shsurf = shsurf; grab->shsurf_destroy_listener.notify = destroy_shell_grab_shsurf; wl_signal_add(&shsurf->destroy_signal, &grab->shsurf_destroy_listener); grab->touch = touch; shsurf->grabbed = 1; weston_touch_start_grab(touch, &grab->grab); if (shell->child.desktop_shell) weston_touch_set_focus(touch, get_default_view(shell->grab_surface)); } static void shell_touch_grab_end(struct shell_touch_grab *grab) { if (grab->shsurf) { wl_list_remove(&grab->shsurf_destroy_listener.link); grab->shsurf->grabbed = 0; } weston_touch_end_grab(grab->touch); } static void center_on_output(struct weston_view *view, struct weston_output *output); static enum weston_keyboard_modifier get_modifier(char *modifier) { if (!modifier) return MODIFIER_SUPER; if (!strcmp("ctrl", modifier)) return MODIFIER_CTRL; else if (!strcmp("alt", modifier)) return MODIFIER_ALT; else if (!strcmp("super", modifier)) return MODIFIER_SUPER; else return MODIFIER_SUPER; } static enum animation_type get_animation_type(char *animation) { if (!animation) return ANIMATION_NONE; if (!strcmp("zoom", animation)) return ANIMATION_ZOOM; else if (!strcmp("fade", animation)) return ANIMATION_FADE; else if (!strcmp("dim-layer", animation)) return ANIMATION_DIM_LAYER; else return ANIMATION_NONE; } static void shell_configuration(struct desktop_shell *shell) { struct weston_config_section *section; char *s, *client; int ret; section = weston_config_get_section(shell->compositor->config, "shell", NULL, NULL); ret = asprintf(&client, "%s/%s", weston_config_get_libexec_dir(), WESTON_SHELL_CLIENT); if (ret < 0) client = NULL; weston_config_section_get_string(section, "client", &s, client); free(client); shell->client = s; weston_config_section_get_string(section, "binding-modifier", &s, "super"); shell->binding_modifier = get_modifier(s); free(s); weston_config_section_get_string(section, "exposay-modifier", &s, "none"); if (strcmp(s, "none") == 0) shell->exposay_modifier = 0; else shell->exposay_modifier = get_modifier(s); free(s); weston_config_section_get_string(section, "animation", &s, "none"); shell->win_animation_type = get_animation_type(s); free(s); weston_config_section_get_string(section, "close-animation", &s, "fade"); shell->win_close_animation_type = get_animation_type(s); free(s); weston_config_section_get_string(section, "startup-animation", &s, "fade"); shell->startup_animation_type = get_animation_type(s); free(s); if (shell->startup_animation_type == ANIMATION_ZOOM) shell->startup_animation_type = ANIMATION_NONE; weston_config_section_get_string(section, "focus-animation", &s, "none"); shell->focus_animation_type = get_animation_type(s); free(s); weston_config_section_get_uint(section, "num-workspaces", &shell->workspaces.num, DEFAULT_NUM_WORKSPACES); } struct weston_output * get_default_output(struct weston_compositor *compositor) { return container_of(compositor->output_list.next, struct weston_output, link); } static int focus_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "focus highlight effect for output %s", surface->output->name); } /* no-op func for checking focus surface */ static void focus_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy) { } static struct focus_surface * get_focus_surface(struct weston_surface *surface) { if (surface->configure == focus_surface_configure) return surface->configure_private; else return NULL; } static bool is_focus_surface (struct weston_surface *es) { return (es->configure == focus_surface_configure); } static bool is_focus_view (struct weston_view *view) { return is_focus_surface (view->surface); } static struct focus_surface * create_focus_surface(struct weston_compositor *ec, struct weston_output *output) { struct focus_surface *fsurf = NULL; struct weston_surface *surface = NULL; fsurf = malloc(sizeof *fsurf); if (!fsurf) return NULL; fsurf->surface = weston_surface_create(ec); surface = fsurf->surface; if (surface == NULL) { free(fsurf); return NULL; } surface->configure = focus_surface_configure; surface->output = output; surface->configure_private = fsurf; weston_surface_set_label_func(surface, focus_surface_get_label); fsurf->view = weston_view_create(surface); if (fsurf->view == NULL) { weston_surface_destroy(surface); free(fsurf); return NULL; } fsurf->view->output = output; weston_surface_set_size(surface, output->width, output->height); weston_view_set_position(fsurf->view, output->x, output->y); weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0); pixman_region32_fini(&surface->opaque); pixman_region32_init_rect(&surface->opaque, output->x, output->y, output->width, output->height); pixman_region32_fini(&surface->input); pixman_region32_init(&surface->input); wl_list_init(&fsurf->workspace_transform.link); return fsurf; } static void focus_surface_destroy(struct focus_surface *fsurf) { weston_surface_destroy(fsurf->surface); free(fsurf); } static void focus_animation_done(struct weston_view_animation *animation, void *data) { struct workspace *ws = data; ws->focus_animation = NULL; } static void focus_state_destroy(struct focus_state *state) { wl_list_remove(&state->seat_destroy_listener.link); wl_list_remove(&state->surface_destroy_listener.link); free(state); } static void focus_state_seat_destroy(struct wl_listener *listener, void *data) { struct focus_state *state = container_of(listener, struct focus_state, seat_destroy_listener); wl_list_remove(&state->link); focus_state_destroy(state); } static void focus_state_surface_destroy(struct wl_listener *listener, void *data) { struct focus_state *state = container_of(listener, struct focus_state, surface_destroy_listener); struct desktop_shell *shell; struct weston_surface *main_surface, *next; struct weston_view *view; main_surface = weston_surface_get_main_surface(state->keyboard_focus); next = NULL; wl_list_for_each(view, &state->ws->layer.view_list.link, layer_link.link) { if (view->surface == main_surface) continue; if (is_focus_view(view)) continue; next = view->surface; break; } /* if the focus was a sub-surface, activate its main surface */ if (main_surface != state->keyboard_focus) next = main_surface; shell = state->seat->compositor->shell_interface.shell; if (next) { state->keyboard_focus = NULL; activate(shell, next, state->seat, true); } else { if (shell->focus_animation_type == ANIMATION_DIM_LAYER) { if (state->ws->focus_animation) weston_view_animation_destroy(state->ws->focus_animation); state->ws->focus_animation = weston_fade_run( state->ws->fsurf_front->view, state->ws->fsurf_front->view->alpha, 0.0, 300, focus_animation_done, state->ws); } wl_list_remove(&state->link); focus_state_destroy(state); } } static struct focus_state * focus_state_create(struct weston_seat *seat, struct workspace *ws) { struct focus_state *state; state = malloc(sizeof *state); if (state == NULL) return NULL; state->keyboard_focus = NULL; state->ws = ws; state->seat = seat; wl_list_insert(&ws->focus_list, &state->link); state->seat_destroy_listener.notify = focus_state_seat_destroy; state->surface_destroy_listener.notify = focus_state_surface_destroy; wl_signal_add(&seat->destroy_signal, &state->seat_destroy_listener); wl_list_init(&state->surface_destroy_listener.link); return state; } static struct focus_state * ensure_focus_state(struct desktop_shell *shell, struct weston_seat *seat) { struct workspace *ws = get_current_workspace(shell); struct focus_state *state; wl_list_for_each(state, &ws->focus_list, link) if (state->seat == seat) break; if (&state->link == &ws->focus_list) state = focus_state_create(seat, ws); return state; } static void focus_state_set_focus(struct focus_state *state, struct weston_surface *surface) { if (state->keyboard_focus) { wl_list_remove(&state->surface_destroy_listener.link); wl_list_init(&state->surface_destroy_listener.link); } state->keyboard_focus = surface; if (surface) wl_signal_add(&surface->destroy_signal, &state->surface_destroy_listener); } static void restore_focus_state(struct desktop_shell *shell, struct workspace *ws) { struct focus_state *state, *next; struct weston_surface *surface; struct wl_list pending_seat_list; struct weston_seat *seat, *next_seat; /* Temporarily steal the list of seats so that we can keep * track of the seats we've already processed */ wl_list_init(&pending_seat_list); wl_list_insert_list(&pending_seat_list, &shell->compositor->seat_list); wl_list_init(&shell->compositor->seat_list); wl_list_for_each_safe(state, next, &ws->focus_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(state->seat); wl_list_remove(&state->seat->link); wl_list_insert(&shell->compositor->seat_list, &state->seat->link); if (!keyboard) continue; surface = state->keyboard_focus; weston_keyboard_set_focus(keyboard, surface); } /* For any remaining seats that we don't have a focus state * for we'll reset the keyboard focus to NULL */ wl_list_for_each_safe(seat, next_seat, &pending_seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); wl_list_insert(&shell->compositor->seat_list, &seat->link); if (!keyboard) continue; weston_keyboard_set_focus(keyboard, NULL); } } static void replace_focus_state(struct desktop_shell *shell, struct workspace *ws, struct weston_seat *seat) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct focus_state *state; wl_list_for_each(state, &ws->focus_list, link) { if (state->seat == seat) { focus_state_set_focus(state, keyboard->focus); return; } } } static void drop_focus_state(struct desktop_shell *shell, struct workspace *ws, struct weston_surface *surface) { struct focus_state *state; wl_list_for_each(state, &ws->focus_list, link) if (state->keyboard_focus == surface) focus_state_set_focus(state, NULL); } static void animate_focus_change(struct desktop_shell *shell, struct workspace *ws, struct weston_view *from, struct weston_view *to) { struct weston_output *output; bool focus_surface_created = false; /* FIXME: Only support dim animation using two layers */ if (from == to || shell->focus_animation_type != ANIMATION_DIM_LAYER) return; output = get_default_output(shell->compositor); if (ws->fsurf_front == NULL && (from || to)) { ws->fsurf_front = create_focus_surface(shell->compositor, output); if (ws->fsurf_front == NULL) return; ws->fsurf_front->view->alpha = 0.0; ws->fsurf_back = create_focus_surface(shell->compositor, output); if (ws->fsurf_back == NULL) { focus_surface_destroy(ws->fsurf_front); return; } ws->fsurf_back->view->alpha = 0.0; focus_surface_created = true; } else { weston_layer_entry_remove(&ws->fsurf_front->view->layer_link); weston_layer_entry_remove(&ws->fsurf_back->view->layer_link); } if (ws->focus_animation) { weston_view_animation_destroy(ws->focus_animation); ws->focus_animation = NULL; } if (to) weston_layer_entry_insert(&to->layer_link, &ws->fsurf_front->view->layer_link); else if (from) weston_layer_entry_insert(&ws->layer.view_list, &ws->fsurf_front->view->layer_link); if (focus_surface_created) { ws->focus_animation = weston_fade_run( ws->fsurf_front->view, ws->fsurf_front->view->alpha, 0.4, 300, focus_animation_done, ws); } else if (from) { weston_layer_entry_insert(&from->layer_link, &ws->fsurf_back->view->layer_link); ws->focus_animation = weston_stable_fade_run( ws->fsurf_front->view, 0.0, ws->fsurf_back->view, 0.4, focus_animation_done, ws); } else if (to) { weston_layer_entry_insert(&ws->layer.view_list, &ws->fsurf_back->view->layer_link); ws->focus_animation = weston_stable_fade_run( ws->fsurf_front->view, 0.0, ws->fsurf_back->view, 0.4, focus_animation_done, ws); } } static void workspace_destroy(struct workspace *ws) { struct focus_state *state, *next; wl_list_for_each_safe(state, next, &ws->focus_list, link) focus_state_destroy(state); if (ws->fsurf_front) focus_surface_destroy(ws->fsurf_front); if (ws->fsurf_back) focus_surface_destroy(ws->fsurf_back); free(ws); } static void seat_destroyed(struct wl_listener *listener, void *data) { struct weston_seat *seat = data; struct focus_state *state, *next; struct workspace *ws = container_of(listener, struct workspace, seat_destroyed_listener); wl_list_for_each_safe(state, next, &ws->focus_list, link) if (state->seat == seat) wl_list_remove(&state->link); } static struct workspace * workspace_create(void) { struct workspace *ws = malloc(sizeof *ws); if (ws == NULL) return NULL; weston_layer_init(&ws->layer, NULL); wl_list_init(&ws->focus_list); wl_list_init(&ws->seat_destroyed_listener.link); ws->seat_destroyed_listener.notify = seat_destroyed; ws->fsurf_front = NULL; ws->fsurf_back = NULL; ws->focus_animation = NULL; return ws; } static int workspace_is_empty(struct workspace *ws) { return wl_list_empty(&ws->layer.view_list.link); } static struct workspace * get_workspace(struct desktop_shell *shell, unsigned int index) { struct workspace **pws = shell->workspaces.array.data; assert(index < shell->workspaces.num); pws += index; return *pws; } struct workspace * get_current_workspace(struct desktop_shell *shell) { return get_workspace(shell, shell->workspaces.current); } static void activate_workspace(struct desktop_shell *shell, unsigned int index) { struct workspace *ws; ws = get_workspace(shell, index); wl_list_insert(&shell->panel_layer.link, &ws->layer.link); shell->workspaces.current = index; } static unsigned int get_output_height(struct weston_output *output) { return abs(output->region.extents.y1 - output->region.extents.y2); } static void view_translate(struct workspace *ws, struct weston_view *view, double d) { struct weston_transform *transform; if (is_focus_view(view)) { struct focus_surface *fsurf = get_focus_surface(view->surface); transform = &fsurf->workspace_transform; } else { struct shell_surface *shsurf = get_shell_surface(view->surface); transform = &shsurf->workspace_transform; } if (wl_list_empty(&transform->link)) wl_list_insert(view->geometry.transformation_list.prev, &transform->link); weston_matrix_init(&transform->matrix); weston_matrix_translate(&transform->matrix, 0.0, d, 0.0); weston_view_geometry_dirty(view); } static void workspace_translate_out(struct workspace *ws, double fraction) { struct weston_view *view; unsigned int height; double d; wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) { height = get_output_height(view->surface->output); d = height * fraction; view_translate(ws, view, d); } } static void workspace_translate_in(struct workspace *ws, double fraction) { struct weston_view *view; unsigned int height; double d; wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) { height = get_output_height(view->surface->output); if (fraction > 0) d = -(height - height * fraction); else d = height + height * fraction; view_translate(ws, view, d); } } static void broadcast_current_workspace_state(struct desktop_shell *shell) { struct wl_resource *resource; wl_resource_for_each(resource, &shell->workspaces.client_list) workspace_manager_send_state(resource, shell->workspaces.current, shell->workspaces.num); } static void reverse_workspace_change_animation(struct desktop_shell *shell, unsigned int index, struct workspace *from, struct workspace *to) { shell->workspaces.current = index; shell->workspaces.anim_to = to; shell->workspaces.anim_from = from; shell->workspaces.anim_dir = -1 * shell->workspaces.anim_dir; shell->workspaces.anim_timestamp = 0; weston_compositor_schedule_repaint(shell->compositor); } static void workspace_deactivate_transforms(struct workspace *ws) { struct weston_view *view; struct weston_transform *transform; wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) { if (is_focus_view(view)) { struct focus_surface *fsurf = get_focus_surface(view->surface); transform = &fsurf->workspace_transform; } else { struct shell_surface *shsurf = get_shell_surface(view->surface); transform = &shsurf->workspace_transform; } if (!wl_list_empty(&transform->link)) { wl_list_remove(&transform->link); wl_list_init(&transform->link); } weston_view_geometry_dirty(view); } } static void finish_workspace_change_animation(struct desktop_shell *shell, struct workspace *from, struct workspace *to) { struct weston_view *view; weston_compositor_schedule_repaint(shell->compositor); /* Views that extend past the bottom of the output are still * visible after the workspace animation ends but before its layer * is hidden. In that case, we need to damage below those views so * that the screen is properly repainted. */ wl_list_for_each(view, &from->layer.view_list.link, layer_link.link) weston_view_damage_below(view); wl_list_remove(&shell->workspaces.animation.link); workspace_deactivate_transforms(from); workspace_deactivate_transforms(to); shell->workspaces.anim_to = NULL; wl_list_remove(&shell->workspaces.anim_from->layer.link); } static void animate_workspace_change_frame(struct weston_animation *animation, struct weston_output *output, uint32_t msecs) { struct desktop_shell *shell = container_of(animation, struct desktop_shell, workspaces.animation); struct workspace *from = shell->workspaces.anim_from; struct workspace *to = shell->workspaces.anim_to; uint32_t t; double x, y; if (workspace_is_empty(from) && workspace_is_empty(to)) { finish_workspace_change_animation(shell, from, to); return; } if (shell->workspaces.anim_timestamp == 0) { if (shell->workspaces.anim_current == 0.0) shell->workspaces.anim_timestamp = msecs; else shell->workspaces.anim_timestamp = msecs - /* Invers of movement function 'y' below. */ (asin(1.0 - shell->workspaces.anim_current) * DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH * M_2_PI); } t = msecs - shell->workspaces.anim_timestamp; /* * x = [0, π/2] * y(x) = sin(x) */ x = t * (1.0/DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH) * M_PI_2; y = sin(x); if (t < DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH) { weston_compositor_schedule_repaint(shell->compositor); workspace_translate_out(from, shell->workspaces.anim_dir * y); workspace_translate_in(to, shell->workspaces.anim_dir * y); shell->workspaces.anim_current = y; weston_compositor_schedule_repaint(shell->compositor); } else finish_workspace_change_animation(shell, from, to); } static void animate_workspace_change(struct desktop_shell *shell, unsigned int index, struct workspace *from, struct workspace *to) { struct weston_output *output; int dir; if (index > shell->workspaces.current) dir = -1; else dir = 1; shell->workspaces.current = index; shell->workspaces.anim_dir = dir; shell->workspaces.anim_from = from; shell->workspaces.anim_to = to; shell->workspaces.anim_current = 0.0; shell->workspaces.anim_timestamp = 0; output = container_of(shell->compositor->output_list.next, struct weston_output, link); wl_list_insert(&output->animation_list, &shell->workspaces.animation.link); wl_list_insert(from->layer.link.prev, &to->layer.link); workspace_translate_in(to, 0); restore_focus_state(shell, to); weston_compositor_schedule_repaint(shell->compositor); } static void update_workspace(struct desktop_shell *shell, unsigned int index, struct workspace *from, struct workspace *to) { shell->workspaces.current = index; wl_list_insert(&from->layer.link, &to->layer.link); wl_list_remove(&from->layer.link); } static void change_workspace(struct desktop_shell *shell, unsigned int index) { struct workspace *from; struct workspace *to; struct focus_state *state; if (index == shell->workspaces.current) return; /* Don't change workspace when there is any fullscreen surfaces. */ if (!wl_list_empty(&shell->fullscreen_layer.view_list.link)) return; from = get_current_workspace(shell); to = get_workspace(shell, index); if (shell->workspaces.anim_from == to && shell->workspaces.anim_to == from) { restore_focus_state(shell, to); reverse_workspace_change_animation(shell, index, from, to); broadcast_current_workspace_state(shell); return; } if (shell->workspaces.anim_to != NULL) finish_workspace_change_animation(shell, shell->workspaces.anim_from, shell->workspaces.anim_to); restore_focus_state(shell, to); if (shell->focus_animation_type != ANIMATION_NONE) { wl_list_for_each(state, &from->focus_list, link) if (state->keyboard_focus) animate_focus_change(shell, from, get_default_view(state->keyboard_focus), NULL); wl_list_for_each(state, &to->focus_list, link) if (state->keyboard_focus) animate_focus_change(shell, to, NULL, get_default_view(state->keyboard_focus)); } if (workspace_is_empty(to) && workspace_is_empty(from)) update_workspace(shell, index, from, to); else animate_workspace_change(shell, index, from, to); broadcast_current_workspace_state(shell); } static bool workspace_has_only(struct workspace *ws, struct weston_surface *surface) { struct wl_list *list = &ws->layer.view_list.link; struct wl_list *e; if (wl_list_empty(list)) return false; e = list->next; if (e->next != list) return false; return container_of(e, struct weston_view, layer_link.link)->surface == surface; } static void move_surface_to_workspace(struct desktop_shell *shell, struct shell_surface *shsurf, uint32_t workspace) { struct workspace *from; struct workspace *to; struct weston_seat *seat; struct weston_surface *focus; struct weston_view *view; if (workspace == shell->workspaces.current) return; view = get_default_view(shsurf->surface); if (!view) return; assert(weston_surface_get_main_surface(view->surface) == view->surface); if (workspace >= shell->workspaces.num) workspace = shell->workspaces.num - 1; from = get_current_workspace(shell); to = get_workspace(shell, workspace); weston_layer_entry_remove(&view->layer_link); weston_layer_entry_insert(&to->layer.view_list, &view->layer_link); shell_surface_update_child_surface_layers(shsurf); drop_focus_state(shell, from, view->surface); wl_list_for_each(seat, &shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard) continue; focus = weston_surface_get_main_surface(keyboard->focus); if (focus == view->surface) weston_keyboard_set_focus(keyboard, NULL); } weston_view_damage_below(view); } static void take_surface_to_workspace_by_seat(struct desktop_shell *shell, struct weston_seat *seat, unsigned int index) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_surface *surface; struct weston_view *view; struct shell_surface *shsurf; struct workspace *from; struct workspace *to; struct focus_state *state; surface = weston_surface_get_main_surface(keyboard->focus); view = get_default_view(surface); if (view == NULL || index == shell->workspaces.current || is_focus_view(view)) return; from = get_current_workspace(shell); to = get_workspace(shell, index); weston_layer_entry_remove(&view->layer_link); weston_layer_entry_insert(&to->layer.view_list, &view->layer_link); shsurf = get_shell_surface(surface); if (shsurf != NULL) shell_surface_update_child_surface_layers(shsurf); replace_focus_state(shell, to, seat); drop_focus_state(shell, from, surface); if (shell->workspaces.anim_from == to && shell->workspaces.anim_to == from) { wl_list_remove(&to->layer.link); wl_list_insert(from->layer.link.prev, &to->layer.link); reverse_workspace_change_animation(shell, index, from, to); broadcast_current_workspace_state(shell); return; } if (shell->workspaces.anim_to != NULL) finish_workspace_change_animation(shell, shell->workspaces.anim_from, shell->workspaces.anim_to); if (workspace_is_empty(from) && workspace_has_only(to, surface)) update_workspace(shell, index, from, to); else { if (shsurf != NULL && wl_list_empty(&shsurf->workspace_transform.link)) wl_list_insert(&shell->workspaces.anim_sticky_list, &shsurf->workspace_transform.link); animate_workspace_change(shell, index, from, to); } broadcast_current_workspace_state(shell); state = ensure_focus_state(shell, seat); if (state != NULL) focus_state_set_focus(state, surface); } static void workspace_manager_move_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource, uint32_t workspace) { struct desktop_shell *shell = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct weston_surface *main_surface; struct shell_surface *shell_surface; main_surface = weston_surface_get_main_surface(surface); shell_surface = get_shell_surface(main_surface); if (shell_surface == NULL) return; move_surface_to_workspace(shell, shell_surface, workspace); } static const struct workspace_manager_interface workspace_manager_implementation = { workspace_manager_move_surface, }; static void unbind_resource(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); } static void bind_workspace_manager(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct desktop_shell *shell = data; struct wl_resource *resource; resource = wl_resource_create(client, &workspace_manager_interface, 1, id); if (resource == NULL) { weston_log("couldn't add workspace manager object"); return; } wl_resource_set_implementation(resource, &workspace_manager_implementation, shell, unbind_resource); wl_list_insert(&shell->workspaces.client_list, wl_resource_get_link(resource)); workspace_manager_send_state(resource, shell->workspaces.current, shell->workspaces.num); } static void touch_move_grab_down(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { } static void touch_move_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id) { struct weston_touch_move_grab *move = (struct weston_touch_move_grab *) container_of( grab, struct shell_touch_grab, grab); if (touch_id == 0) move->active = 0; if (grab->touch->num_tp == 0) { shell_touch_grab_end(&move->base); free(move); } } static void touch_move_grab_motion(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct weston_touch_move_grab *move = (struct weston_touch_move_grab *) grab; struct shell_surface *shsurf = move->base.shsurf; struct weston_surface *es; int dx = wl_fixed_to_int(grab->touch->grab_x + move->dx); int dy = wl_fixed_to_int(grab->touch->grab_y + move->dy); if (!shsurf || !move->active) return; es = shsurf->surface; weston_view_set_position(shsurf->view, dx, dy); weston_compositor_schedule_repaint(es->compositor); } static void touch_move_grab_frame(struct weston_touch_grab *grab) { } static void touch_move_grab_cancel(struct weston_touch_grab *grab) { struct weston_touch_move_grab *move = (struct weston_touch_move_grab *) container_of( grab, struct shell_touch_grab, grab); shell_touch_grab_end(&move->base); free(move); } static const struct weston_touch_grab_interface touch_move_grab_interface = { touch_move_grab_down, touch_move_grab_up, touch_move_grab_motion, touch_move_grab_frame, touch_move_grab_cancel, }; static int surface_touch_move(struct shell_surface *shsurf, struct weston_touch *touch) { struct weston_touch_move_grab *move; if (!shsurf) return -1; if (shsurf->state.fullscreen || shsurf->state.maximized) return 0; move = malloc(sizeof *move); if (!move) return -1; move->active = 1; move->dx = wl_fixed_from_double(shsurf->view->geometry.x) - touch->grab_x; move->dy = wl_fixed_from_double(shsurf->view->geometry.y) - touch->grab_y; shell_touch_grab_start(&move->base, &touch_move_grab_interface, shsurf, touch); return 0; } static void noop_grab_focus(struct weston_pointer_grab *grab) { } static void constrain_position(struct weston_move_grab *move, int *cx, int *cy) { struct shell_surface *shsurf = move->base.shsurf; struct weston_pointer *pointer = move->base.grab.pointer; int x, y, bottom; const int safety = 50; pixman_rectangle32_t area; x = wl_fixed_to_int(pointer->x + move->dx); y = wl_fixed_to_int(pointer->y + move->dy); if (shsurf->shell->panel_position == DESKTOP_SHELL_PANEL_POSITION_TOP) { get_output_work_area(shsurf->shell, shsurf->surface->output, &area); bottom = y + shsurf->geometry.height + shsurf->geometry.y; if (bottom - safety < area.y) y = area.y + safety - shsurf->geometry.height - shsurf->geometry.y; if (move->client_initiated && y + shsurf->geometry.y < area.y) y = area.y - shsurf->geometry.y; } *cx = x; *cy = y; } static void move_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct weston_move_grab *move = (struct weston_move_grab *) grab; struct weston_pointer *pointer = grab->pointer; struct shell_surface *shsurf = move->base.shsurf; int cx, cy; weston_pointer_move(pointer, x, y); if (!shsurf) return; constrain_position(move, &cx, &cy); weston_view_set_position(shsurf->view, cx, cy); weston_compositor_schedule_repaint(shsurf->surface->compositor); } static void move_grab_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct shell_grab *shell_grab = container_of(grab, struct shell_grab, grab); struct weston_pointer *pointer = grab->pointer; enum wl_pointer_button_state state = state_w; if (pointer->button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { shell_grab_end(shell_grab); free(grab); } } static void move_grab_cancel(struct weston_pointer_grab *grab) { struct shell_grab *shell_grab = container_of(grab, struct shell_grab, grab); shell_grab_end(shell_grab); free(grab); } static const struct weston_pointer_grab_interface move_grab_interface = { noop_grab_focus, move_grab_motion, move_grab_button, move_grab_cancel, }; static int surface_move(struct shell_surface *shsurf, struct weston_pointer *pointer, bool client_initiated) { struct weston_move_grab *move; if (!shsurf) return -1; shsurf = find_toplevel_surface(shsurf); if (shsurf->grabbed || shsurf->state.fullscreen || shsurf->state.maximized) return 0; move = malloc(sizeof *move); if (!move) return -1; move->dx = wl_fixed_from_double(shsurf->view->geometry.x) - pointer->grab_x; move->dy = wl_fixed_from_double(shsurf->view->geometry.y) - pointer->grab_y; move->client_initiated = client_initiated; shell_grab_start(&move->base, &move_grab_interface, shsurf, pointer, DESKTOP_SHELL_CURSOR_MOVE); return 0; } static void common_surface_move(struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial) { struct weston_seat *seat = wl_resource_get_user_data(seat_resource); struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_touch *touch = weston_seat_get_touch(seat); struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_surface *surface; if (pointer && pointer->focus && pointer->button_count > 0 && pointer->grab_serial == serial) { surface = weston_surface_get_main_surface(pointer->focus->surface); if ((surface == shsurf->surface) && (surface_move(shsurf, pointer, true) < 0)) wl_resource_post_no_memory(resource); } else if (touch && touch->focus && touch->grab_serial == serial) { surface = weston_surface_get_main_surface(touch->focus->surface); if ((surface == shsurf->surface) && (surface_touch_move(shsurf, touch) < 0)) wl_resource_post_no_memory(resource); } } static void shell_surface_move(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial) { common_surface_move(resource, seat_resource, serial); } struct weston_resize_grab { struct shell_grab base; uint32_t edges; int32_t width, height; }; static void resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct weston_resize_grab *resize = (struct weston_resize_grab *) grab; struct weston_pointer *pointer = grab->pointer; struct shell_surface *shsurf = resize->base.shsurf; int32_t width, height; wl_fixed_t from_x, from_y; wl_fixed_t to_x, to_y; weston_pointer_move(pointer, x, y); if (!shsurf) return; weston_view_from_global_fixed(shsurf->view, pointer->grab_x, pointer->grab_y, &from_x, &from_y); weston_view_from_global_fixed(shsurf->view, pointer->x, pointer->y, &to_x, &to_y); width = resize->width; if (resize->edges & WL_SHELL_SURFACE_RESIZE_LEFT) { width += wl_fixed_to_int(from_x - to_x); } else if (resize->edges & WL_SHELL_SURFACE_RESIZE_RIGHT) { width += wl_fixed_to_int(to_x - from_x); } height = resize->height; if (resize->edges & WL_SHELL_SURFACE_RESIZE_TOP) { height += wl_fixed_to_int(from_y - to_y); } else if (resize->edges & WL_SHELL_SURFACE_RESIZE_BOTTOM) { height += wl_fixed_to_int(to_y - from_y); } if (width < 1) width = 1; if (height < 1) height = 1; shsurf->client->send_configure(shsurf->surface, width, height); } static void send_configure(struct weston_surface *surface, int32_t width, int32_t height) { struct shell_surface *shsurf = get_shell_surface(surface); assert(shsurf); if (shsurf->resource) wl_shell_surface_send_configure(shsurf->resource, shsurf->resize_edges, width, height); } static const struct weston_shell_client shell_client = { send_configure }; static void resize_grab_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct weston_resize_grab *resize = (struct weston_resize_grab *) grab; struct weston_pointer *pointer = grab->pointer; enum wl_pointer_button_state state = state_w; if (pointer->button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { shell_grab_end(&resize->base); free(grab); } } static void resize_grab_cancel(struct weston_pointer_grab *grab) { struct weston_resize_grab *resize = (struct weston_resize_grab *) grab; shell_grab_end(&resize->base); free(grab); } static const struct weston_pointer_grab_interface resize_grab_interface = { noop_grab_focus, resize_grab_motion, resize_grab_button, resize_grab_cancel, }; /* * Returns the bounding box of a surface and all its sub-surfaces, * in the surface coordinates system. */ static void surface_subsurfaces_boundingbox(struct weston_surface *surface, int32_t *x, int32_t *y, int32_t *w, int32_t *h) { pixman_region32_t region; pixman_box32_t *box; struct weston_subsurface *subsurface; pixman_region32_init_rect(®ion, 0, 0, surface->width, surface->height); wl_list_for_each(subsurface, &surface->subsurface_list, parent_link) { pixman_region32_union_rect(®ion, ®ion, subsurface->position.x, subsurface->position.y, subsurface->surface->width, subsurface->surface->height); } box = pixman_region32_extents(®ion); if (x) *x = box->x1; if (y) *y = box->y1; if (w) *w = box->x2 - box->x1; if (h) *h = box->y2 - box->y1; pixman_region32_fini(®ion); } static int surface_resize(struct shell_surface *shsurf, struct weston_pointer *pointer, uint32_t edges) { struct weston_resize_grab *resize; const unsigned resize_topbottom = WL_SHELL_SURFACE_RESIZE_TOP | WL_SHELL_SURFACE_RESIZE_BOTTOM; const unsigned resize_leftright = WL_SHELL_SURFACE_RESIZE_LEFT | WL_SHELL_SURFACE_RESIZE_RIGHT; const unsigned resize_any = resize_topbottom | resize_leftright; if (shsurf->grabbed || shsurf->state.fullscreen || shsurf->state.maximized) return 0; /* Check for invalid edge combinations. */ if (edges == WL_SHELL_SURFACE_RESIZE_NONE || edges > resize_any || (edges & resize_topbottom) == resize_topbottom || (edges & resize_leftright) == resize_leftright) return 0; resize = malloc(sizeof *resize); if (!resize) return -1; resize->edges = edges; resize->width = shsurf->geometry.width; resize->height = shsurf->geometry.height; shsurf->resize_edges = edges; shell_surface_state_changed(shsurf); shell_grab_start(&resize->base, &resize_grab_interface, shsurf, pointer, edges); return 0; } static void common_surface_resize(struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, uint32_t edges) { struct weston_seat *seat = wl_resource_get_user_data(seat_resource); struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_surface *surface; if (!pointer || pointer->button_count == 0 || pointer->grab_serial != serial || pointer->focus == NULL) return; surface = weston_surface_get_main_surface(pointer->focus->surface); if (surface != shsurf->surface) return; if (surface_resize(shsurf, pointer, edges) < 0) wl_resource_post_no_memory(resource); } static void shell_surface_resize(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, uint32_t edges) { common_surface_resize(resource, seat_resource, serial, edges); } static void busy_cursor_grab_focus(struct weston_pointer_grab *base) { struct shell_grab *grab = (struct shell_grab *) base; struct weston_pointer *pointer = base->pointer; struct weston_view *view; wl_fixed_t sx, sy; view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (!grab->shsurf || grab->shsurf->surface != view->surface) { shell_grab_end(grab); free(grab); } } static void busy_cursor_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { weston_pointer_move(grab->pointer, x, y); } static void busy_cursor_grab_button(struct weston_pointer_grab *base, uint32_t time, uint32_t button, uint32_t state) { struct shell_grab *grab = (struct shell_grab *) base; struct shell_surface *shsurf = grab->shsurf; struct weston_pointer *pointer = grab->grab.pointer; struct weston_seat *seat = pointer->seat; if (shsurf && button == BTN_LEFT && state) { activate(shsurf->shell, shsurf->surface, seat, true); surface_move(shsurf, pointer, false); } else if (shsurf && button == BTN_RIGHT && state) { activate(shsurf->shell, shsurf->surface, seat, true); surface_rotate(shsurf, pointer); } } static void busy_cursor_grab_cancel(struct weston_pointer_grab *base) { struct shell_grab *grab = (struct shell_grab *) base; shell_grab_end(grab); free(grab); } static const struct weston_pointer_grab_interface busy_cursor_grab_interface = { busy_cursor_grab_focus, busy_cursor_grab_motion, busy_cursor_grab_button, busy_cursor_grab_cancel, }; static void set_busy_cursor(struct shell_surface *shsurf, struct weston_pointer *pointer) { struct shell_grab *grab; if (pointer->grab->interface == &busy_cursor_grab_interface) return; grab = malloc(sizeof *grab); if (!grab) return; shell_grab_start(grab, &busy_cursor_grab_interface, shsurf, pointer, DESKTOP_SHELL_CURSOR_BUSY); /* Mark the shsurf as ungrabbed so that button binding is able * to move it. */ shsurf->grabbed = 0; } static void end_busy_cursor(struct weston_compositor *compositor, struct wl_client *client) { struct shell_grab *grab; struct weston_seat *seat; wl_list_for_each(seat, &compositor->seat_list, link) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (!pointer) continue; grab = (struct shell_grab *) pointer->grab; if (grab->grab.interface == &busy_cursor_grab_interface && grab->shsurf->resource && wl_resource_get_client(grab->shsurf->resource) == client) { shell_grab_end(grab); free(grab); } } } static void handle_shell_client_destroy(struct wl_listener *listener, void *data); static int xdg_ping_timeout_handler(void *data) { struct shell_client *sc = data; struct weston_seat *seat; struct shell_surface *shsurf; /* Client is not responding */ sc->unresponsive = 1; wl_list_for_each(seat, &sc->shell->compositor->seat_list, link) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (!pointer || !pointer->focus || !pointer->focus->surface->resource) continue; shsurf = get_shell_surface(pointer->focus->surface); if (shsurf && wl_resource_get_client(shsurf->resource) == sc->client) set_busy_cursor(shsurf, pointer); } return 1; } static void handle_xdg_ping(struct shell_surface *shsurf, uint32_t serial) { struct weston_compositor *compositor = shsurf->shell->compositor; struct shell_client *sc = shsurf->owner; struct wl_event_loop *loop; static const int ping_timeout = 200; if (sc->unresponsive) { xdg_ping_timeout_handler(sc); return; } sc->ping_serial = serial; loop = wl_display_get_event_loop(compositor->wl_display); if (sc->ping_timer == NULL) sc->ping_timer = wl_event_loop_add_timer(loop, xdg_ping_timeout_handler, sc); if (sc->ping_timer == NULL) return; wl_event_source_timer_update(sc->ping_timer, ping_timeout); if (shell_surface_is_xdg_surface(shsurf) || shell_surface_is_xdg_popup(shsurf)) xdg_shell_send_ping(sc->resource, serial); else if (shell_surface_is_wl_shell_surface(shsurf)) wl_shell_surface_send_ping(shsurf->resource, serial); } static void ping_handler(struct weston_surface *surface, uint32_t serial) { struct shell_surface *shsurf = get_shell_surface(surface); if (!shsurf) return; if (!shsurf->resource) return; if (shsurf->surface == shsurf->shell->grab_surface) return; handle_xdg_ping(shsurf, serial); } static void handle_pointer_focus(struct wl_listener *listener, void *data) { struct weston_pointer *pointer = data; struct weston_view *view = pointer->focus; struct weston_compositor *compositor; uint32_t serial; if (!view) return; compositor = view->surface->compositor; serial = wl_display_next_serial(compositor->wl_display); ping_handler(view->surface, serial); } static void shell_surface_lose_keyboard_focus(struct shell_surface *shsurf) { if (--shsurf->focus_count == 0) shell_surface_state_changed(shsurf); } static void shell_surface_gain_keyboard_focus(struct shell_surface *shsurf) { if (shsurf->focus_count++ == 0) shell_surface_state_changed(shsurf); } static void handle_keyboard_focus(struct wl_listener *listener, void *data) { struct weston_keyboard *keyboard = data; struct shell_seat *seat = get_shell_seat(keyboard->seat); if (seat->focused_surface) { struct shell_surface *shsurf = get_shell_surface(seat->focused_surface); if (shsurf) shell_surface_lose_keyboard_focus(shsurf); } seat->focused_surface = keyboard->focus; if (seat->focused_surface) { struct shell_surface *shsurf = get_shell_surface(seat->focused_surface); if (shsurf) shell_surface_gain_keyboard_focus(shsurf); } } static void shell_client_pong(struct shell_client *sc, uint32_t serial) { if (sc->ping_serial != serial) return; sc->unresponsive = 0; end_busy_cursor(sc->shell->compositor, sc->client); if (sc->ping_timer) { wl_event_source_remove(sc->ping_timer); sc->ping_timer = NULL; } } static void shell_surface_pong(struct wl_client *client, struct wl_resource *resource, uint32_t serial) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct shell_client *sc = shsurf->owner; shell_client_pong(sc, serial); } static void set_title(struct shell_surface *shsurf, const char *title) { free(shsurf->title); shsurf->title = strdup(title); shsurf->surface->timeline.force_refresh = 1; } static void set_pid(struct shell_surface *shsurf, pid_t pid) { /* We have no use for it */ } static void set_type(struct shell_surface *shsurf, enum shell_surface_type t) { shsurf->type = t; shsurf->surface->timeline.force_refresh = 1; } static void set_window_geometry(struct shell_surface *shsurf, int32_t x, int32_t y, int32_t width, int32_t height) { shsurf->next_geometry.x = x; shsurf->next_geometry.y = y; shsurf->next_geometry.width = width; shsurf->next_geometry.height = height; shsurf->has_next_geometry = true; } static void shell_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); set_title(shsurf, title); } static void shell_surface_set_class(struct wl_client *client, struct wl_resource *resource, const char *class) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); free(shsurf->class); shsurf->class = strdup(class); shsurf->surface->timeline.force_refresh = 1; } static void restore_output_mode(struct weston_output *output) { if (output->original_mode) weston_output_mode_switch_to_native(output); } static void restore_all_output_modes(struct weston_compositor *compositor) { struct weston_output *output; wl_list_for_each(output, &compositor->output_list, link) restore_output_mode(output); } /* The surface will be inserted into the list immediately after the link * returned by this function (i.e. will be stacked immediately above the * returned link). */ static struct weston_layer_entry * shell_surface_calculate_layer_link (struct shell_surface *shsurf) { struct workspace *ws; struct weston_view *parent; switch (shsurf->type) { case SHELL_SURFACE_XWAYLAND: return &shsurf->shell->fullscreen_layer.view_list; case SHELL_SURFACE_NONE: return NULL; case SHELL_SURFACE_POPUP: case SHELL_SURFACE_TOPLEVEL: if (shsurf->state.fullscreen && !shsurf->state.lowered) { return &shsurf->shell->fullscreen_layer.view_list; } else if (shsurf->parent) { /* Move the surface to its parent layer so * that surfaces which are transient for * fullscreen surfaces don't get hidden by the * fullscreen surfaces. */ /* TODO: Handle a parent with multiple views */ parent = get_default_view(shsurf->parent); if (parent) return container_of(parent->layer_link.link.prev, struct weston_layer_entry, link); } /* Move the surface to a normal workspace layer so that surfaces * which were previously fullscreen or transient are no longer * rendered on top. */ ws = get_current_workspace(shsurf->shell); return &ws->layer.view_list; } assert(0 && "Unknown shell surface type"); } static void shell_surface_update_child_surface_layers (struct shell_surface *shsurf) { struct shell_surface *child; struct weston_layer_entry *prev; /* Move the child layers to the same workspace as shsurf. They will be * stacked above shsurf. */ wl_list_for_each_reverse(child, &shsurf->children_list, children_link) { if (shsurf->view->layer_link.link.prev != &child->view->layer_link.link) { weston_view_damage_below(child->view); weston_view_geometry_dirty(child->view); prev = container_of(shsurf->view->layer_link.link.prev, struct weston_layer_entry, link); weston_layer_entry_remove(&child->view->layer_link); weston_layer_entry_insert(prev, &child->view->layer_link); weston_view_geometry_dirty(child->view); weston_surface_damage(child->surface); /* Recurse. We don’t expect this to recurse very far (if * at all) because that would imply we have transient * (or popup) children of transient surfaces, which * would be unusual. */ shell_surface_update_child_surface_layers(child); } } } /* Update the surface’s layer. Mark both the old and new views as having dirty * geometry to ensure the changes are redrawn. * * If any child surfaces exist and are mapped, ensure they’re in the same layer * as this surface. */ static void shell_surface_update_layer(struct shell_surface *shsurf) { struct weston_layer_entry *new_layer_link; new_layer_link = shell_surface_calculate_layer_link(shsurf); if (new_layer_link == NULL) return; if (new_layer_link == &shsurf->view->layer_link) return; weston_view_geometry_dirty(shsurf->view); weston_layer_entry_remove(&shsurf->view->layer_link); weston_layer_entry_insert(new_layer_link, &shsurf->view->layer_link); weston_view_geometry_dirty(shsurf->view); weston_surface_damage(shsurf->surface); shell_surface_update_child_surface_layers(shsurf); } static void shell_surface_set_parent(struct shell_surface *shsurf, struct weston_surface *parent) { shsurf->parent = parent; wl_list_remove(&shsurf->children_link); wl_list_init(&shsurf->children_link); /* Insert into the parent surface’s child list. */ if (parent != NULL) { struct shell_surface *parent_shsurf = get_shell_surface(parent); if (parent_shsurf != NULL) wl_list_insert(&parent_shsurf->children_list, &shsurf->children_link); } } static void shell_surface_set_output(struct shell_surface *shsurf, struct weston_output *output) { struct weston_surface *es = shsurf->surface; /* get the default output, if the client set it as NULL check whether the ouput is available */ if (output) shsurf->output = output; else if (es->output) shsurf->output = es->output; else shsurf->output = get_default_output(es->compositor); } static void surface_clear_next_states(struct shell_surface *shsurf) { shsurf->next_state.maximized = false; shsurf->next_state.fullscreen = false; if ((shsurf->next_state.maximized != shsurf->state.maximized) || (shsurf->next_state.fullscreen != shsurf->state.fullscreen)) shsurf->state_changed = true; } static void set_toplevel(struct shell_surface *shsurf) { shell_surface_set_parent(shsurf, NULL); surface_clear_next_states(shsurf); set_type(shsurf, SHELL_SURFACE_TOPLEVEL); /* The layer_link is updated in set_surface_type(), * called from configure. */ } static void shell_surface_set_toplevel(struct wl_client *client, struct wl_resource *resource) { struct shell_surface *surface = wl_resource_get_user_data(resource); set_toplevel(surface); } static void set_transient(struct shell_surface *shsurf, struct weston_surface *parent, int x, int y, uint32_t flags) { assert(parent != NULL); shell_surface_set_parent(shsurf, parent); surface_clear_next_states(shsurf); shsurf->transient.x = x; shsurf->transient.y = y; shsurf->transient.flags = flags; shsurf->next_state.relative = true; shsurf->state_changed = true; set_type(shsurf, SHELL_SURFACE_TOPLEVEL); /* The layer_link is updated in set_surface_type(), * called from configure. */ } static void shell_surface_set_transient(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource, int x, int y, uint32_t flags) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_surface *parent = wl_resource_get_user_data(parent_resource); set_transient(shsurf, parent, x, y, flags); } static void set_fullscreen(struct shell_surface *shsurf, uint32_t method, uint32_t framerate, struct weston_output *output) { shell_surface_set_output(shsurf, output); set_type(shsurf, SHELL_SURFACE_TOPLEVEL); shsurf->fullscreen_output = shsurf->output; shsurf->fullscreen.type = method; shsurf->fullscreen.framerate = framerate; send_configure_for_surface(shsurf); } static void weston_view_set_initial_position(struct weston_view *view, struct desktop_shell *shell); static void unset_fullscreen(struct shell_surface *shsurf) { /* Unset the fullscreen output, driver configuration and transforms. */ if (shsurf->fullscreen.type == WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER && shell_surface_is_top_fullscreen(shsurf)) { restore_output_mode(shsurf->fullscreen_output); } shsurf->fullscreen.type = WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT; shsurf->fullscreen.framerate = 0; wl_list_remove(&shsurf->fullscreen.transform.link); wl_list_init(&shsurf->fullscreen.transform.link); if (shsurf->fullscreen.black_view) weston_surface_destroy(shsurf->fullscreen.black_view->surface); shsurf->fullscreen.black_view = NULL; if (shsurf->saved_position_valid) weston_view_set_position(shsurf->view, shsurf->saved_x, shsurf->saved_y); else weston_view_set_initial_position(shsurf->view, shsurf->shell); if (shsurf->saved_rotation_valid) { wl_list_insert(&shsurf->view->geometry.transformation_list, &shsurf->rotation.transform.link); shsurf->saved_rotation_valid = false; } /* Layer is updated in set_surface_type(). */ } static void shell_surface_set_fullscreen(struct wl_client *client, struct wl_resource *resource, uint32_t method, uint32_t framerate, struct wl_resource *output_resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_output *output; if (output_resource) output = wl_resource_get_user_data(output_resource); else output = NULL; shell_surface_set_parent(shsurf, NULL); surface_clear_next_states(shsurf); shsurf->next_state.fullscreen = true; shsurf->state_changed = true; set_fullscreen(shsurf, method, framerate, output); } static void set_popup(struct shell_surface *shsurf, struct weston_surface *parent, struct weston_seat *seat, uint32_t serial, int32_t x, int32_t y) { assert(parent != NULL); shsurf->popup.shseat = get_shell_seat(seat); shsurf->popup.serial = serial; shsurf->popup.x = x; shsurf->popup.y = y; set_type(shsurf, SHELL_SURFACE_POPUP); } static void shell_surface_set_popup(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, struct wl_resource *parent_resource, int32_t x, int32_t y, uint32_t flags) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_surface *parent = wl_resource_get_user_data(parent_resource); shell_surface_set_parent(shsurf, parent); surface_clear_next_states(shsurf); set_popup(shsurf, parent, wl_resource_get_user_data(seat_resource), serial, x, y); } static void unset_maximized(struct shell_surface *shsurf) { /* undo all maximized things here */ shsurf->output = get_default_output(shsurf->surface->compositor); if (shsurf->saved_position_valid) weston_view_set_position(shsurf->view, shsurf->saved_x, shsurf->saved_y); else weston_view_set_initial_position(shsurf->view, shsurf->shell); if (shsurf->saved_rotation_valid) { wl_list_insert(&shsurf->view->geometry.transformation_list, &shsurf->rotation.transform.link); shsurf->saved_rotation_valid = false; } /* Layer is updated in set_surface_type(). */ } static void set_minimized(struct weston_surface *surface) { struct shell_surface *shsurf; struct workspace *current_ws; struct weston_seat *seat; struct weston_surface *focus; struct weston_view *view; view = get_default_view(surface); if (!view) return; assert(weston_surface_get_main_surface(view->surface) == view->surface); shsurf = get_shell_surface(surface); current_ws = get_current_workspace(shsurf->shell); weston_layer_entry_remove(&view->layer_link); weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link); drop_focus_state(shsurf->shell, current_ws, view->surface); wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard) continue; focus = weston_surface_get_main_surface(keyboard->focus); if (focus == view->surface) weston_keyboard_set_focus(keyboard, NULL); } shell_surface_update_child_surface_layers(shsurf); weston_view_damage_below(view); } static void shell_surface_set_maximized(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_output *output; surface_clear_next_states(shsurf); shsurf->next_state.maximized = true; shsurf->state_changed = true; set_type(shsurf, SHELL_SURFACE_TOPLEVEL); shell_surface_set_parent(shsurf, NULL); if (output_resource) output = wl_resource_get_user_data(output_resource); else output = NULL; shell_surface_set_output(shsurf, output); send_configure_for_surface(shsurf); } /* This is only ever called from set_surface_type(), so there’s no need to * update layer_links here, since they’ll be updated when we return. */ static int reset_surface_type(struct shell_surface *surface) { if (surface->state.fullscreen) unset_fullscreen(surface); if (surface->state.maximized) unset_maximized(surface); return 0; } static void set_full_output(struct shell_surface *shsurf) { shsurf->saved_x = shsurf->view->geometry.x; shsurf->saved_y = shsurf->view->geometry.y; shsurf->saved_width = shsurf->surface->width; shsurf->saved_height = shsurf->surface->height; shsurf->saved_size_valid = true; shsurf->saved_position_valid = true; if (!wl_list_empty(&shsurf->rotation.transform.link)) { wl_list_remove(&shsurf->rotation.transform.link); wl_list_init(&shsurf->rotation.transform.link); weston_view_geometry_dirty(shsurf->view); shsurf->saved_rotation_valid = true; } } static void set_surface_type(struct shell_surface *shsurf) { struct weston_surface *pes = shsurf->parent; struct weston_view *pev = get_default_view(pes); reset_surface_type(shsurf); shsurf->state = shsurf->next_state; shsurf->state_changed = false; switch (shsurf->type) { case SHELL_SURFACE_TOPLEVEL: if (shsurf->state.maximized || shsurf->state.fullscreen) { set_full_output(shsurf); } else if (shsurf->state.relative && pev) { weston_view_set_position(shsurf->view, pev->geometry.x + shsurf->transient.x, pev->geometry.y + shsurf->transient.y); } break; case SHELL_SURFACE_XWAYLAND: weston_view_set_position(shsurf->view, shsurf->transient.x, shsurf->transient.y); break; case SHELL_SURFACE_POPUP: case SHELL_SURFACE_NONE: default: break; } /* Update the surface’s layer. */ shell_surface_update_layer(shsurf); } static struct desktop_shell * shell_surface_get_shell(struct shell_surface *shsurf) { return shsurf->shell; } static int black_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { struct weston_surface *fs_surface = surface->configure_private; int n; int rem; int ret; n = snprintf(buf, len, "black background surface for "); if (n < 0) return n; rem = (int)len - n; if (rem < 0) rem = 0; if (fs_surface->get_label) ret = fs_surface->get_label(fs_surface, buf + n, rem); else ret = snprintf(buf + n, rem, ""); if (ret < 0) return n; return n + ret; } static void black_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy); static struct weston_view * create_black_surface(struct weston_compositor *ec, struct weston_surface *fs_surface, float x, float y, int w, int h) { struct weston_surface *surface = NULL; struct weston_view *view; surface = weston_surface_create(ec); if (surface == NULL) { weston_log("no memory\n"); return NULL; } view = weston_view_create(surface); if (surface == NULL) { weston_log("no memory\n"); weston_surface_destroy(surface); return NULL; } surface->configure = black_surface_configure; surface->configure_private = fs_surface; weston_surface_set_label_func(surface, black_surface_get_label); weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1); pixman_region32_fini(&surface->opaque); pixman_region32_init_rect(&surface->opaque, 0, 0, w, h); pixman_region32_fini(&surface->input); pixman_region32_init_rect(&surface->input, 0, 0, w, h); weston_surface_set_size(surface, w, h); weston_view_set_position(view, x, y); return view; } static void shell_ensure_fullscreen_black_view(struct shell_surface *shsurf) { struct weston_output *output = shsurf->fullscreen_output; assert(shsurf->state.fullscreen); if (!shsurf->fullscreen.black_view) shsurf->fullscreen.black_view = create_black_surface(shsurf->surface->compositor, shsurf->surface, output->x, output->y, output->width, output->height); weston_view_geometry_dirty(shsurf->fullscreen.black_view); weston_layer_entry_remove(&shsurf->fullscreen.black_view->layer_link); weston_layer_entry_insert(&shsurf->view->layer_link, &shsurf->fullscreen.black_view->layer_link); weston_view_geometry_dirty(shsurf->fullscreen.black_view); weston_surface_damage(shsurf->surface); shsurf->state.lowered = false; } /* Create black surface and append it to the associated fullscreen surface. * Handle size dismatch and positioning according to the method. */ static void shell_configure_fullscreen(struct shell_surface *shsurf) { struct weston_output *output = shsurf->fullscreen_output; struct weston_surface *surface = shsurf->surface; struct weston_matrix *matrix; float scale, output_aspect, surface_aspect, x, y; int32_t surf_x, surf_y, surf_width, surf_height; if (shsurf->fullscreen.type != WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER) restore_output_mode(output); /* Reverse the effect of lower_fullscreen_layer() */ weston_layer_entry_remove(&shsurf->view->layer_link); weston_layer_entry_insert(&shsurf->shell->fullscreen_layer.view_list, &shsurf->view->layer_link); shell_ensure_fullscreen_black_view(shsurf); surface_subsurfaces_boundingbox(shsurf->surface, &surf_x, &surf_y, &surf_width, &surf_height); switch (shsurf->fullscreen.type) { case WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT: if (surface->buffer_ref.buffer) center_on_output(shsurf->view, shsurf->fullscreen_output); break; case WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE: /* 1:1 mapping between surface and output dimensions */ if (output->width == surf_width && output->height == surf_height) { weston_view_set_position(shsurf->view, output->x - surf_x, output->y - surf_y); break; } matrix = &shsurf->fullscreen.transform.matrix; weston_matrix_init(matrix); output_aspect = (float) output->width / (float) output->height; /* XXX: Use surf_width and surf_height here? */ surface_aspect = (float) surface->width / (float) surface->height; if (output_aspect < surface_aspect) scale = (float) output->width / (float) surf_width; else scale = (float) output->height / (float) surf_height; weston_matrix_scale(matrix, scale, scale, 1); wl_list_remove(&shsurf->fullscreen.transform.link); wl_list_insert(&shsurf->view->geometry.transformation_list, &shsurf->fullscreen.transform.link); x = output->x + (output->width - surf_width * scale) / 2 - surf_x; y = output->y + (output->height - surf_height * scale) / 2 - surf_y; weston_view_set_position(shsurf->view, x, y); break; case WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER: if (shell_surface_is_top_fullscreen(shsurf)) { struct weston_mode mode = {0, surf_width * surface->buffer_viewport.buffer.scale, surf_height * surface->buffer_viewport.buffer.scale, shsurf->fullscreen.framerate}; if (weston_output_mode_switch_to_temporary(output, &mode, surface->buffer_viewport.buffer.scale) == 0) { weston_view_set_position(shsurf->view, output->x - surf_x, output->y - surf_y); shsurf->fullscreen.black_view->surface->width = output->width; shsurf->fullscreen.black_view->surface->height = output->height; weston_view_set_position(shsurf->fullscreen.black_view, output->x - surf_x, output->y - surf_y); break; } else { weston_log("shell: Can't switch to temporary mode.\n"); restore_output_mode(output); center_on_output(shsurf->view, output); } } break; case WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL: center_on_output(shsurf->view, output); break; default: break; } } static void shell_map_fullscreen(struct shell_surface *shsurf) { shell_configure_fullscreen(shsurf); } static void set_xwayland(struct shell_surface *shsurf, int x, int y, uint32_t flags) { /* XXX: using the same fields for transient type */ surface_clear_next_states(shsurf); shsurf->transient.x = x; shsurf->transient.y = y; shsurf->transient.flags = flags; shell_surface_set_parent(shsurf, NULL); set_type(shsurf, SHELL_SURFACE_XWAYLAND); shsurf->state_changed = true; } static void shell_interface_set_fullscreen(struct shell_surface *shsurf, uint32_t method, uint32_t framerate, struct weston_output *output) { surface_clear_next_states(shsurf); shsurf->next_state.fullscreen = true; shsurf->state_changed = true; set_fullscreen(shsurf, method, framerate, output); } static struct weston_output * get_focused_output(struct weston_compositor *compositor) { struct weston_seat *seat; struct weston_output *output = NULL; wl_list_for_each(seat, &compositor->seat_list, link) { struct weston_touch *touch = weston_seat_get_touch(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); /* Priority has touch focus, then pointer and * then keyboard focus. We should probably have * three for loops and check frist for touch, * then for pointer, etc. but unless somebody has some * objections, I think this is sufficient. */ if (touch && touch->focus) output = touch->focus->output; else if (pointer && pointer->focus) output = pointer->focus->output; else if (keyboard && keyboard->focus) output = keyboard->focus->output; if (output) break; } return output; } static void shell_interface_set_maximized(struct shell_surface *shsurf) { struct weston_output *output; surface_clear_next_states(shsurf); shsurf->next_state.maximized = true; shsurf->state_changed = true; shsurf->type = SHELL_SURFACE_TOPLEVEL; if (!weston_surface_is_mapped(shsurf->surface)) output = get_focused_output(shsurf->surface->compositor); else output = shsurf->surface->output; shell_surface_set_output(shsurf, output); send_configure_for_surface(shsurf); } static int shell_interface_move(struct shell_surface *shsurf, struct weston_pointer *pointer) { return surface_move(shsurf, pointer, true); } static int shell_interface_resize(struct shell_surface *shsurf, struct weston_pointer *pointer, uint32_t edges) { return surface_resize(shsurf, pointer, edges); } static const struct weston_pointer_grab_interface popup_grab_interface; static void destroy_shell_seat(struct wl_listener *listener, void *data) { struct shell_seat *shseat = container_of(listener, struct shell_seat, seat_destroy_listener); struct shell_surface *shsurf, *next; if (shseat->popup_grab.grab.interface == &popup_grab_interface) { weston_pointer_end_grab(shseat->popup_grab.grab.pointer); shseat->popup_grab.client = NULL; wl_list_for_each_safe(shsurf, next, &shseat->popup_grab.surfaces_list, popup.grab_link) { shsurf->popup.shseat = NULL; wl_list_init(&shsurf->popup.grab_link); } } wl_list_remove(&shseat->seat_destroy_listener.link); free(shseat); } static void shell_seat_caps_changed(struct wl_listener *listener, void *data) { struct weston_keyboard *keyboard; struct weston_pointer *pointer; struct shell_seat *seat; seat = container_of(listener, struct shell_seat, caps_changed_listener); keyboard = weston_seat_get_keyboard(seat->seat); pointer = weston_seat_get_pointer(seat->seat); if (keyboard && wl_list_empty(&seat->keyboard_focus_listener.link)) { wl_signal_add(&keyboard->focus_signal, &seat->keyboard_focus_listener); } else if (!keyboard) { wl_list_remove(&seat->keyboard_focus_listener.link); wl_list_init(&seat->keyboard_focus_listener.link); } if (pointer && wl_list_empty(&seat->pointer_focus_listener.link)) { wl_signal_add(&pointer->focus_signal, &seat->pointer_focus_listener); } else if (!pointer) { wl_list_remove(&seat->pointer_focus_listener.link); wl_list_init(&seat->pointer_focus_listener.link); } } static struct shell_seat * create_shell_seat(struct weston_seat *seat) { struct shell_seat *shseat; shseat = calloc(1, sizeof *shseat); if (!shseat) { weston_log("no memory to allocate shell seat\n"); return NULL; } shseat->seat = seat; wl_list_init(&shseat->popup_grab.surfaces_list); shseat->seat_destroy_listener.notify = destroy_shell_seat; wl_signal_add(&seat->destroy_signal, &shseat->seat_destroy_listener); shseat->keyboard_focus_listener.notify = handle_keyboard_focus; wl_list_init(&shseat->keyboard_focus_listener.link); shseat->pointer_focus_listener.notify = handle_pointer_focus; wl_list_init(&shseat->pointer_focus_listener.link); shseat->caps_changed_listener.notify = shell_seat_caps_changed; wl_signal_add(&seat->updated_caps_signal, &shseat->caps_changed_listener); shell_seat_caps_changed(&shseat->caps_changed_listener, NULL); return shseat; } static struct shell_seat * get_shell_seat(struct weston_seat *seat) { struct wl_listener *listener; listener = wl_signal_get(&seat->destroy_signal, destroy_shell_seat); assert(listener != NULL); return container_of(listener, struct shell_seat, seat_destroy_listener); } static void popup_grab_focus(struct weston_pointer_grab *grab) { struct weston_pointer *pointer = grab->pointer; struct weston_view *view; struct shell_seat *shseat = container_of(grab, struct shell_seat, popup_grab.grab); struct wl_client *client = shseat->popup_grab.client; wl_fixed_t sx, sy; view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (view && view->surface->resource && wl_resource_get_client(view->surface->resource) == client) { weston_pointer_set_focus(pointer, view, sx, sy); } else { weston_pointer_clear_focus(pointer); } } static void popup_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct weston_pointer *pointer = grab->pointer; struct wl_resource *resource; wl_fixed_t sx, sy; if (pointer->focus) { weston_view_from_global_fixed(pointer->focus, x, y, &pointer->sx, &pointer->sy); } weston_pointer_move(pointer, x, y); wl_resource_for_each(resource, &pointer->focus_resource_list) { weston_view_from_global_fixed(pointer->focus, pointer->x, pointer->y, &sx, &sy); wl_pointer_send_motion(resource, time, sx, sy); } } static void popup_grab_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct wl_resource *resource; struct shell_seat *shseat = container_of(grab, struct shell_seat, popup_grab.grab); struct wl_display *display = shseat->seat->compositor->wl_display; enum wl_pointer_button_state state = state_w; uint32_t serial; struct wl_list *resource_list; resource_list = &grab->pointer->focus_resource_list; if (!wl_list_empty(resource_list)) { serial = wl_display_get_serial(display); wl_resource_for_each(resource, resource_list) { wl_pointer_send_button(resource, serial, time, button, state); } } else if (state == WL_POINTER_BUTTON_STATE_RELEASED && (shseat->popup_grab.initial_up || time - grab->pointer->grab_time > 500)) { popup_grab_end(grab->pointer); } if (state == WL_POINTER_BUTTON_STATE_RELEASED) shseat->popup_grab.initial_up = 1; } static void popup_grab_cancel(struct weston_pointer_grab *grab) { popup_grab_end(grab->pointer); } static const struct weston_pointer_grab_interface popup_grab_interface = { popup_grab_focus, popup_grab_motion, popup_grab_button, popup_grab_cancel, }; static void touch_popup_grab_down(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct wl_resource *resource; struct shell_seat *shseat = container_of(grab, struct shell_seat, popup_grab.touch_grab); struct wl_display *display = shseat->seat->compositor->wl_display; uint32_t serial; struct wl_list *resource_list; wl_fixed_t sx, sy; weston_view_from_global_fixed(grab->touch->focus, x, y, &sx, &sy); resource_list = &grab->touch->focus_resource_list; if (!wl_list_empty(resource_list)) { serial = wl_display_get_serial(display); wl_resource_for_each(resource, resource_list) { wl_touch_send_down(resource, serial, time, grab->touch->focus->surface->resource, touch_id, sx, sy); } } } static void touch_popup_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id) { struct wl_resource *resource; struct shell_seat *shseat = container_of(grab, struct shell_seat, popup_grab.touch_grab); struct wl_display *display = shseat->seat->compositor->wl_display; uint32_t serial; struct wl_list *resource_list; resource_list = &grab->touch->focus_resource_list; if (!wl_list_empty(resource_list)) { serial = wl_display_get_serial(display); wl_resource_for_each(resource, resource_list) { wl_touch_send_up(resource, serial, time, touch_id); } } } static void touch_popup_grab_motion(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct wl_resource *resource; struct wl_list *resource_list; wl_fixed_t sx, sy; weston_view_from_global_fixed(grab->touch->focus, x, y, &sx, &sy); resource_list = &grab->touch->focus_resource_list; if (!wl_list_empty(resource_list)) { wl_resource_for_each(resource, resource_list) { wl_touch_send_motion(resource, time, touch_id, sx, sy); } } } static void touch_popup_grab_frame(struct weston_touch_grab *grab) { } static void touch_popup_grab_cancel(struct weston_touch_grab *grab) { touch_popup_grab_end(grab->touch); } static const struct weston_touch_grab_interface touch_popup_grab_interface = { touch_popup_grab_down, touch_popup_grab_up, touch_popup_grab_motion, touch_popup_grab_frame, touch_popup_grab_cancel, }; static void shell_surface_send_popup_done(struct shell_surface *shsurf) { if (shell_surface_is_wl_shell_surface(shsurf)) wl_shell_surface_send_popup_done(shsurf->resource); else if (shell_surface_is_xdg_popup(shsurf)) xdg_popup_send_popup_done(shsurf->resource); } static void popup_grab_end(struct weston_pointer *pointer) { struct weston_pointer_grab *grab = pointer->grab; struct shell_seat *shseat = container_of(grab, struct shell_seat, popup_grab.grab); struct shell_surface *shsurf; struct shell_surface *next; if (pointer->grab->interface == &popup_grab_interface) { weston_pointer_end_grab(grab->pointer); shseat->popup_grab.client = NULL; shseat->popup_grab.grab.interface = NULL; assert(!wl_list_empty(&shseat->popup_grab.surfaces_list)); /* Send the popup_done event to all the popups open */ wl_list_for_each_safe(shsurf, next, &shseat->popup_grab.surfaces_list, popup.grab_link) { shell_surface_send_popup_done(shsurf); shsurf->popup.shseat = NULL; wl_list_init(&shsurf->popup.grab_link); } wl_list_init(&shseat->popup_grab.surfaces_list); } } static void touch_popup_grab_end(struct weston_touch *touch) { struct weston_touch_grab *grab = touch->grab; struct shell_seat *shseat = container_of(grab, struct shell_seat, popup_grab.touch_grab); struct shell_surface *shsurf; struct shell_surface *next; if (touch->grab->interface == &touch_popup_grab_interface) { weston_touch_end_grab(grab->touch); shseat->popup_grab.client = NULL; shseat->popup_grab.touch_grab.interface = NULL; assert(!wl_list_empty(&shseat->popup_grab.surfaces_list)); /* Send the popup_done event to all the popups open */ wl_list_for_each_safe(shsurf, next, &shseat->popup_grab.surfaces_list, popup.grab_link) { shell_surface_send_popup_done(shsurf); shsurf->popup.shseat = NULL; wl_list_init(&shsurf->popup.grab_link); } wl_list_init(&shseat->popup_grab.surfaces_list); } } static struct shell_surface * get_top_popup(struct shell_seat *shseat) { struct shell_surface *shsurf; if (wl_list_empty(&shseat->popup_grab.surfaces_list)) { return NULL; } else { shsurf = container_of(shseat->popup_grab.surfaces_list.next, struct shell_surface, popup.grab_link); return shsurf; } } static int add_popup_grab(struct shell_surface *shsurf, struct shell_seat *shseat, int32_t type) { struct weston_seat *seat = shseat->seat; struct shell_surface *parent, *top_surface; struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_touch *touch = weston_seat_get_touch(seat); parent = get_shell_surface(shsurf->parent); top_surface = get_top_popup(shseat); if (shell_surface_is_xdg_popup(shsurf) && (!parent || (top_surface == NULL && !shell_surface_is_xdg_surface(parent)) || (top_surface != NULL && parent != top_surface))) { wl_resource_post_error(shsurf->owner_resource, XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP, "xdg_popup was not created on the " "topmost popup"); return -1; } if (wl_list_empty(&shseat->popup_grab.surfaces_list)) { shseat->popup_grab.type = type; shseat->popup_grab.client = wl_resource_get_client(shsurf->resource); if (type == POINTER) { shseat->popup_grab.grab.interface = &popup_grab_interface; /* We must make sure here that this popup was opened * after a mouse press, and not just by moving around * with other popups already open. */ if (pointer->button_count > 0) shseat->popup_grab.initial_up = 0; } else if (type == TOUCH) { shseat->popup_grab.touch_grab.interface = &touch_popup_grab_interface; } wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link); if (type == POINTER) { weston_pointer_start_grab(pointer, &shseat->popup_grab.grab); } else if (type == TOUCH) { weston_touch_start_grab(touch, &shseat->popup_grab.touch_grab); } } else { wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link); } return 0; } static void remove_popup_grab(struct shell_surface *shsurf) { struct shell_seat *shseat = shsurf->popup.shseat; if (shell_surface_is_xdg_popup(shsurf) && get_top_popup(shseat) != shsurf) { wl_resource_post_error(shsurf->owner_resource, XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP, "xdg_popup was destroyed while it was " "not the topmost popup."); return; } wl_list_remove(&shsurf->popup.grab_link); wl_list_init(&shsurf->popup.grab_link); if (wl_list_empty(&shseat->popup_grab.surfaces_list)) { if (shseat->popup_grab.type == POINTER) { weston_pointer_end_grab(shseat->popup_grab.grab.pointer); shseat->popup_grab.grab.interface = NULL; } else if (shseat->popup_grab.type == TOUCH) { weston_touch_end_grab(shseat->popup_grab.touch_grab.touch); shseat->popup_grab.touch_grab.interface = NULL; } } } static int shell_map_popup(struct shell_surface *shsurf) { struct shell_seat *shseat = shsurf->popup.shseat; struct weston_view *parent_view = get_default_view(shsurf->parent); struct weston_pointer *pointer = weston_seat_get_pointer(shseat->seat); struct weston_touch *touch = weston_seat_get_touch(shseat->seat); shsurf->surface->output = parent_view->output; shsurf->view->output = parent_view->output; weston_view_set_transform_parent(shsurf->view, parent_view); weston_view_set_position(shsurf->view, shsurf->popup.x, shsurf->popup.y); weston_view_update_transform(shsurf->view); if (pointer && pointer->grab_serial == shsurf->popup.serial) { if (add_popup_grab(shsurf, shseat, POINTER) != 0) return -1; } else if (touch && touch->grab_serial == shsurf->popup.serial) { if (add_popup_grab(shsurf, shseat, TOUCH) != 0) return -1; } else { shell_surface_send_popup_done(shsurf); shseat->popup_grab.client = NULL; } return 0; } static const struct wl_shell_surface_interface shell_surface_implementation = { shell_surface_pong, shell_surface_move, shell_surface_resize, shell_surface_set_toplevel, shell_surface_set_transient, shell_surface_set_fullscreen, shell_surface_set_popup, shell_surface_set_maximized, shell_surface_set_title, shell_surface_set_class }; static void destroy_shell_surface(struct shell_surface *shsurf) { struct shell_surface *child, *next; wl_signal_emit(&shsurf->destroy_signal, shsurf); if (!wl_list_empty(&shsurf->popup.grab_link)) { remove_popup_grab(shsurf); } if (shsurf->fullscreen.type == WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER && shell_surface_is_top_fullscreen(shsurf)) restore_output_mode (shsurf->fullscreen_output); if (shsurf->fullscreen.black_view) weston_surface_destroy(shsurf->fullscreen.black_view->surface); /* As destroy_resource() use wl_list_for_each_safe(), * we can always remove the listener. */ wl_list_remove(&shsurf->surface_destroy_listener.link); shsurf->surface->configure = NULL; weston_surface_set_label_func(shsurf->surface, NULL); free(shsurf->title); weston_view_destroy(shsurf->view); wl_list_remove(&shsurf->children_link); wl_list_for_each_safe(child, next, &shsurf->children_list, children_link) shell_surface_set_parent(child, NULL); wl_list_remove(&shsurf->link); free(shsurf); } static void shell_destroy_shell_surface(struct wl_resource *resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); if (!wl_list_empty(&shsurf->popup.grab_link)) remove_popup_grab(shsurf); wl_list_remove(wl_resource_get_link(shsurf->resource)); shsurf->resource = NULL; } static void shell_handle_surface_destroy(struct wl_listener *listener, void *data) { struct shell_surface *shsurf = container_of(listener, struct shell_surface, surface_destroy_listener); if (shsurf->resource) wl_resource_destroy(shsurf->resource); destroy_shell_surface(shsurf); } static void fade_out_done_idle_cb(void *data) { struct shell_surface *shsurf = data; weston_surface_destroy(shsurf->surface); } static void fade_out_done(struct weston_view_animation *animation, void *data) { struct shell_surface *shsurf = data; struct wl_event_loop *loop; loop = wl_display_get_event_loop( shsurf->surface->compositor->wl_display); if (!shsurf->destroying) { wl_event_loop_add_idle(loop, fade_out_done_idle_cb, shsurf); shsurf->destroying = true; } } static void handle_resource_destroy(struct wl_listener *listener, void *data) { struct shell_surface *shsurf = container_of(listener, struct shell_surface, resource_destroy_listener); if (!weston_surface_is_mapped(shsurf->surface)) return; shsurf->surface->ref_count++; pixman_region32_fini(&shsurf->surface->pending.input); pixman_region32_init(&shsurf->surface->pending.input); pixman_region32_fini(&shsurf->surface->input); pixman_region32_init(&shsurf->surface->input); if (shsurf->shell->win_close_animation_type == ANIMATION_FADE) { weston_fade_run(shsurf->view, 1.0, 0.0, 300.0, fade_out_done, shsurf); } else { weston_surface_destroy(shsurf->surface); } } static void shell_surface_configure(struct weston_surface *, int32_t, int32_t); struct shell_surface * get_shell_surface(struct weston_surface *surface) { if (surface->configure == shell_surface_configure) return surface->configure_private; else return NULL; } static struct shell_surface * create_common_surface(struct shell_client *owner, void *shell, struct weston_surface *surface, const struct weston_shell_client *client) { struct shell_surface *shsurf; assert(surface->configure == NULL); shsurf = calloc(1, sizeof *shsurf); if (!shsurf) { weston_log("no memory to allocate shell surface\n"); return NULL; } shsurf->view = weston_view_create(surface); if (!shsurf->view) { weston_log("no memory to allocate shell surface\n"); free(shsurf); return NULL; } surface->configure = shell_surface_configure; surface->configure_private = shsurf; weston_surface_set_label_func(surface, shell_surface_get_label); shsurf->resource_destroy_listener.notify = handle_resource_destroy; wl_resource_add_destroy_listener(surface->resource, &shsurf->resource_destroy_listener); shsurf->owner = owner; shsurf->shell = (struct desktop_shell *) shell; shsurf->unresponsive = 0; shsurf->saved_position_valid = false; shsurf->saved_size_valid = false; shsurf->saved_rotation_valid = false; shsurf->surface = surface; shsurf->fullscreen.type = WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT; shsurf->fullscreen.framerate = 0; shsurf->fullscreen.black_view = NULL; wl_list_init(&shsurf->fullscreen.transform.link); shsurf->output = get_default_output(shsurf->shell->compositor); wl_signal_init(&shsurf->destroy_signal); shsurf->surface_destroy_listener.notify = shell_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &shsurf->surface_destroy_listener); /* init link so its safe to always remove it in destroy_shell_surface */ wl_list_init(&shsurf->link); wl_list_init(&shsurf->popup.grab_link); /* empty when not in use */ wl_list_init(&shsurf->rotation.transform.link); weston_matrix_init(&shsurf->rotation.rotation); wl_list_init(&shsurf->workspace_transform.link); wl_list_init(&shsurf->children_link); wl_list_init(&shsurf->children_list); shsurf->parent = NULL; set_type(shsurf, SHELL_SURFACE_NONE); shsurf->client = client; return shsurf; } static struct shell_surface * create_shell_surface(void *shell, struct weston_surface *surface, const struct weston_shell_client *client) { return create_common_surface(NULL, shell, surface, client); } static struct weston_view * get_primary_view(void *shell, struct shell_surface *shsurf) { return shsurf->view; } static void shell_get_shell_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct shell_client *sc = wl_resource_get_user_data(resource); struct desktop_shell *shell = sc->shell; struct shell_surface *shsurf; if (weston_surface_set_role(surface, "wl_shell_surface", resource, WL_SHELL_ERROR_ROLE) < 0) return; shsurf = create_common_surface(sc, shell, surface, &shell_client); if (!shsurf) { wl_resource_post_no_memory(surface_resource); return; } shsurf->resource = wl_resource_create(client, &wl_shell_surface_interface, 1, id); wl_resource_set_implementation(shsurf->resource, &shell_surface_implementation, shsurf, shell_destroy_shell_surface); wl_list_init(wl_resource_get_link(shsurf->resource)); } static bool shell_surface_is_wl_shell_surface(struct shell_surface *shsurf) { /* A shell surface without a resource is created from xwayland * and is considered a wl_shell surface for now. */ return shsurf->resource == NULL || wl_resource_instance_of(shsurf->resource, &wl_shell_surface_interface, &shell_surface_implementation); } static const struct wl_shell_interface shell_implementation = { shell_get_shell_surface }; /**************************** * xdg-shell implementation */ static void xdg_surface_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void xdg_surface_set_parent(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct shell_surface *parent; if (parent_resource) { parent = wl_resource_get_user_data(parent_resource); shell_surface_set_parent(shsurf, parent->surface); } else { shell_surface_set_parent(shsurf, NULL); } } static void xdg_surface_set_app_id(struct wl_client *client, struct wl_resource *resource, const char *app_id) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); free(shsurf->class); shsurf->class = strdup(app_id); shsurf->surface->timeline.force_refresh = 1; } static void xdg_surface_show_window_menu(struct wl_client *client, struct wl_resource *surface_resource, struct wl_resource *seat_resource, uint32_t serial, int32_t x, int32_t y) { /* TODO */ } static void xdg_surface_set_title(struct wl_client *client, struct wl_resource *resource, const char *title) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); set_title(shsurf, title); } static void xdg_surface_move(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial) { common_surface_move(resource, seat_resource, serial); } static void xdg_surface_resize(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial, uint32_t edges) { common_surface_resize(resource, seat_resource, serial, edges); } static void xdg_surface_ack_configure(struct wl_client *client, struct wl_resource *resource, uint32_t serial) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); if (shsurf->state_requested) { shsurf->next_state = shsurf->requested_state; shsurf->state_changed = true; shsurf->state_requested = false; } } static void xdg_surface_set_window_geometry(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); set_window_geometry(shsurf, x, y, width, height); } static void xdg_surface_set_maximized(struct wl_client *client, struct wl_resource *resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_output *output; shsurf->state_requested = true; shsurf->requested_state.maximized = true; if (!weston_surface_is_mapped(shsurf->surface)) output = get_focused_output(shsurf->surface->compositor); else output = shsurf->surface->output; shell_surface_set_output(shsurf, output); send_configure_for_surface(shsurf); } static void xdg_surface_unset_maximized(struct wl_client *client, struct wl_resource *resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); shsurf->state_requested = true; shsurf->requested_state.maximized = false; send_configure_for_surface(shsurf); } static void xdg_surface_set_fullscreen(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct weston_output *output; shsurf->state_requested = true; shsurf->requested_state.fullscreen = true; if (output_resource) output = wl_resource_get_user_data(output_resource); else output = NULL; /* handle clients launching in fullscreen */ if (output == NULL && !weston_surface_is_mapped(shsurf->surface)) { /* Set the output to the one that has focus currently. */ assert(shsurf->surface); output = get_focused_output(shsurf->surface->compositor); } shell_surface_set_output(shsurf, output); shsurf->fullscreen_output = shsurf->output; send_configure_for_surface(shsurf); } static void xdg_surface_unset_fullscreen(struct wl_client *client, struct wl_resource *resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); shsurf->state_requested = true; shsurf->requested_state.fullscreen = false; send_configure_for_surface(shsurf); } static void xdg_surface_set_minimized(struct wl_client *client, struct wl_resource *resource) { struct shell_surface *shsurf = wl_resource_get_user_data(resource); if (shsurf->type != SHELL_SURFACE_TOPLEVEL) return; /* apply compositor's own minimization logic (hide) */ set_minimized(shsurf->surface); } static const struct xdg_surface_interface xdg_surface_implementation = { xdg_surface_destroy, xdg_surface_set_parent, xdg_surface_set_title, xdg_surface_set_app_id, xdg_surface_show_window_menu, xdg_surface_move, xdg_surface_resize, xdg_surface_ack_configure, xdg_surface_set_window_geometry, xdg_surface_set_maximized, xdg_surface_unset_maximized, xdg_surface_set_fullscreen, xdg_surface_unset_fullscreen, xdg_surface_set_minimized, }; static void xdg_send_configure(struct weston_surface *surface, int32_t width, int32_t height) { struct shell_surface *shsurf = get_shell_surface(surface); uint32_t *s; struct wl_array states; uint32_t serial; assert(shsurf); if (!shsurf->resource) return; wl_array_init(&states); if (shsurf->requested_state.fullscreen) { s = wl_array_add(&states, sizeof *s); *s = XDG_SURFACE_STATE_FULLSCREEN; } else if (shsurf->requested_state.maximized) { s = wl_array_add(&states, sizeof *s); *s = XDG_SURFACE_STATE_MAXIMIZED; } if (shsurf->resize_edges != 0) { s = wl_array_add(&states, sizeof *s); *s = XDG_SURFACE_STATE_RESIZING; } if (shsurf->focus_count > 0) { s = wl_array_add(&states, sizeof *s); *s = XDG_SURFACE_STATE_ACTIVATED; } serial = wl_display_next_serial(shsurf->surface->compositor->wl_display); xdg_surface_send_configure(shsurf->resource, width, height, &states, serial); wl_array_release(&states); } static const struct weston_shell_client xdg_client = { xdg_send_configure }; static void xdg_shell_destroy(struct wl_client *client, struct wl_resource *resource) { struct shell_client *sc = wl_resource_get_user_data(resource); struct wl_resource *shsurf_resource; struct shell_surface *shsurf; wl_resource_for_each(shsurf_resource, &sc->surface_list) { shsurf = wl_resource_get_user_data(shsurf_resource); if (shsurf->owner_resource == resource) { wl_resource_post_error( resource, XDG_SHELL_ERROR_DEFUNCT_SURFACES, "not all child surface objects destroyed"); return; } } wl_resource_destroy(resource); } static void xdg_use_unstable_version(struct wl_client *client, struct wl_resource *resource, int32_t version) { if (version > 1) { wl_resource_post_error(resource, 1, "xdg-shell:: version not implemented yet."); return; } } static struct shell_surface * create_xdg_surface(struct shell_client *owner, void *shell, struct weston_surface *surface, const struct weston_shell_client *client) { struct shell_surface *shsurf; shsurf = create_common_surface(owner, shell, surface, client); if (!shsurf) return NULL; set_type(shsurf, SHELL_SURFACE_TOPLEVEL); return shsurf; } static void xdg_get_xdg_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct shell_client *sc = wl_resource_get_user_data(resource); struct desktop_shell *shell = sc->shell; struct shell_surface *shsurf; shsurf = get_shell_surface(surface); if (shsurf && shell_surface_is_xdg_surface(shsurf)) { wl_resource_post_error(resource, XDG_SHELL_ERROR_ROLE, "This wl_surface is already an " "xdg_surface"); return; } if (weston_surface_set_role(surface, "xdg_surface", resource, XDG_SHELL_ERROR_ROLE) < 0) return; shsurf = create_xdg_surface(sc, shell, surface, &xdg_client); if (!shsurf) { wl_resource_post_no_memory(surface_resource); return; } shsurf->resource = wl_resource_create(client, &xdg_surface_interface, 1, id); wl_resource_set_implementation(shsurf->resource, &xdg_surface_implementation, shsurf, shell_destroy_shell_surface); shsurf->owner_resource = resource; wl_list_insert(&sc->surface_list, wl_resource_get_link(shsurf->resource)); } static bool shell_surface_is_xdg_surface(struct shell_surface *shsurf) { return shsurf->resource && wl_resource_instance_of(shsurf->resource, &xdg_surface_interface, &xdg_surface_implementation); } /* xdg-popup implementation */ static void xdg_popup_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct xdg_popup_interface xdg_popup_implementation = { xdg_popup_destroy, }; static void xdg_popup_send_configure(struct weston_surface *surface, int32_t width, int32_t height) { } static const struct weston_shell_client xdg_popup_client = { xdg_popup_send_configure }; static struct shell_surface * create_xdg_popup(struct shell_client *owner, void *shell, struct weston_surface *surface, const struct weston_shell_client *client, struct weston_surface *parent, struct shell_seat *seat, uint32_t serial, int32_t x, int32_t y) { struct shell_surface *shsurf; shsurf = create_common_surface(owner, shell, surface, client); if (!shsurf) return NULL; set_type(shsurf, SHELL_SURFACE_POPUP); shsurf->popup.shseat = seat; shsurf->popup.serial = serial; shsurf->popup.x = x; shsurf->popup.y = y; shell_surface_set_parent(shsurf, parent); return shsurf; } static void xdg_get_xdg_popup(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource, struct wl_resource *parent_resource, struct wl_resource *seat_resource, uint32_t serial, int32_t x, int32_t y) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct shell_client *sc = wl_resource_get_user_data(resource); struct desktop_shell *shell = sc->shell; struct shell_surface *shsurf; struct shell_surface *parent_shsurf; struct weston_surface *parent; struct shell_seat *seat; shsurf = get_shell_surface(surface); if (shsurf && shell_surface_is_xdg_popup(shsurf)) { wl_resource_post_error(resource, XDG_SHELL_ERROR_ROLE, "This wl_surface is already an " "xdg_popup"); return; } if (weston_surface_set_role(surface, "xdg_popup", resource, XDG_SHELL_ERROR_ROLE) < 0) return; if (!parent_resource) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "xdg_shell::get_xdg_popup requires a parent shell surface"); return; } parent = wl_resource_get_user_data(parent_resource); seat = get_shell_seat(wl_resource_get_user_data(seat_resource));; /* Verify that we are creating the top most popup when mapping, * as it's not until then we know whether it was mapped as most * top level or not. */ parent_shsurf = get_shell_surface(parent); if (!shell_surface_is_xdg_popup(parent_shsurf) && !shell_surface_is_xdg_surface(parent_shsurf)) { wl_resource_post_error(resource, XDG_SHELL_ERROR_INVALID_POPUP_PARENT, "xdg_popup parent was invalid"); return; } shsurf = create_xdg_popup(sc, shell, surface, &xdg_popup_client, parent, seat, serial, x, y); if (!shsurf) { wl_resource_post_no_memory(surface_resource); return; } shsurf->resource = wl_resource_create(client, &xdg_popup_interface, 1, id); wl_resource_set_implementation(shsurf->resource, &xdg_popup_implementation, shsurf, shell_destroy_shell_surface); shsurf->owner_resource = resource; wl_list_insert(&sc->surface_list, wl_resource_get_link(shsurf->resource)); } static void xdg_pong(struct wl_client *client, struct wl_resource *resource, uint32_t serial) { struct shell_client *sc = wl_resource_get_user_data(resource); shell_client_pong(sc, serial); } static bool shell_surface_is_xdg_popup(struct shell_surface *shsurf) { return wl_resource_instance_of(shsurf->resource, &xdg_popup_interface, &xdg_popup_implementation); } static const struct xdg_shell_interface xdg_implementation = { xdg_shell_destroy, xdg_use_unstable_version, xdg_get_xdg_surface, xdg_get_xdg_popup, xdg_pong }; static int xdg_shell_unversioned_dispatch(const void *implementation, void *_target, uint32_t opcode, const struct wl_message *message, union wl_argument *args) { struct wl_resource *resource = _target; struct shell_client *sc = wl_resource_get_user_data(resource); if (opcode != 1 /* XDG_SHELL_USE_UNSTABLE_VERSION */) { wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "must call use_unstable_version first"); return 0; } #define XDG_SERVER_VERSION 5 static_assert(XDG_SERVER_VERSION == XDG_SHELL_VERSION_CURRENT, "shell implementation doesn't match protocol version"); if (args[0].i != XDG_SERVER_VERSION) { wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "incompatible version, server is %d " "client wants %d", XDG_SERVER_VERSION, args[0].i); return 0; } wl_resource_set_implementation(resource, &xdg_implementation, sc, NULL); return 1; } /* end of xdg-shell implementation */ /***********************************/ static void shell_fade(struct desktop_shell *shell, enum fade_type type); static void configure_static_view(struct weston_view *ev, struct weston_layer *layer) { struct weston_view *v, *next; wl_list_for_each_safe(v, next, &layer->view_list.link, layer_link.link) { if (v->output == ev->output && v != ev) { weston_view_unmap(v); v->surface->configure = NULL; weston_surface_set_label_func(v->surface, NULL); } } weston_view_set_position(ev, ev->output->x, ev->output->y); if (wl_list_empty(&ev->layer_link.link)) { weston_layer_entry_insert(&layer->view_list, &ev->layer_link); weston_compositor_schedule_repaint(ev->surface->compositor); } } static int background_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "background for output %s", surface->output->name); } static void background_configure(struct weston_surface *es, int32_t sx, int32_t sy) { struct desktop_shell *shell = es->configure_private; struct weston_view *view; view = container_of(es->views.next, struct weston_view, surface_link); configure_static_view(view, &shell->background_layer); } static void desktop_shell_set_background(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource, struct wl_resource *surface_resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct weston_view *view, *next; if (surface->configure) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "surface role already assigned"); return; } wl_list_for_each_safe(view, next, &surface->views, surface_link) weston_view_destroy(view); view = weston_view_create(surface); surface->configure = background_configure; surface->configure_private = shell; weston_surface_set_label_func(surface, background_get_label); surface->output = wl_resource_get_user_data(output_resource); view->output = surface->output; desktop_shell_send_configure(resource, 0, surface_resource, surface->output->width, surface->output->height); } static int panel_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "panel for output %s", surface->output->name); } static void panel_configure(struct weston_surface *es, int32_t sx, int32_t sy) { struct desktop_shell *shell = es->configure_private; struct weston_view *view; view = container_of(es->views.next, struct weston_view, surface_link); configure_static_view(view, &shell->panel_layer); } static void desktop_shell_set_panel(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource, struct wl_resource *surface_resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct weston_view *view, *next; if (surface->configure) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "surface role already assigned"); return; } wl_list_for_each_safe(view, next, &surface->views, surface_link) weston_view_destroy(view); view = weston_view_create(surface); surface->configure = panel_configure; surface->configure_private = shell; weston_surface_set_label_func(surface, panel_get_label); surface->output = wl_resource_get_user_data(output_resource); view->output = surface->output; desktop_shell_send_configure(resource, 0, surface_resource, surface->output->width, surface->output->height); } static int lock_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "lock window"); } static void lock_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct desktop_shell *shell = surface->configure_private; struct weston_view *view; view = container_of(surface->views.next, struct weston_view, surface_link); if (surface->width == 0) return; center_on_output(view, get_default_output(shell->compositor)); if (!weston_surface_is_mapped(surface)) { weston_layer_entry_insert(&shell->lock_layer.view_list, &view->layer_link); weston_view_update_transform(view); shell_fade(shell, FADE_IN); } } static void handle_lock_surface_destroy(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, lock_surface_listener); weston_log("lock surface gone\n"); shell->lock_surface = NULL; } static void desktop_shell_set_lock_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(surface_resource); shell->prepare_event_sent = false; if (!shell->locked) return; shell->lock_surface = surface; shell->lock_surface_listener.notify = handle_lock_surface_destroy; wl_signal_add(&surface->destroy_signal, &shell->lock_surface_listener); weston_view_create(surface); surface->configure = lock_surface_configure; surface->configure_private = shell; weston_surface_set_label_func(surface, lock_surface_get_label); } static void resume_desktop(struct desktop_shell *shell) { struct workspace *ws = get_current_workspace(shell); wl_list_remove(&shell->lock_layer.link); if (shell->showing_input_panels) { wl_list_insert(&shell->compositor->cursor_layer.link, &shell->input_panel_layer.link); wl_list_insert(&shell->input_panel_layer.link, &shell->fullscreen_layer.link); } else { wl_list_insert(&shell->compositor->cursor_layer.link, &shell->fullscreen_layer.link); } wl_list_insert(&shell->fullscreen_layer.link, &shell->panel_layer.link); wl_list_insert(&shell->panel_layer.link, &ws->layer.link), restore_focus_state(shell, get_current_workspace(shell)); shell->locked = false; shell_fade(shell, FADE_IN); weston_compositor_damage_all(shell->compositor); } static void desktop_shell_unlock(struct wl_client *client, struct wl_resource *resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); shell->prepare_event_sent = false; if (shell->locked) resume_desktop(shell); } static void desktop_shell_set_grab_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); shell->grab_surface = wl_resource_get_user_data(surface_resource); weston_view_create(shell->grab_surface); } static void desktop_shell_desktop_ready(struct wl_client *client, struct wl_resource *resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); shell_fade_startup(shell); } static void desktop_shell_set_panel_position(struct wl_client *client, struct wl_resource *resource, uint32_t position) { struct desktop_shell *shell = wl_resource_get_user_data(resource); if (position != DESKTOP_SHELL_PANEL_POSITION_TOP && position != DESKTOP_SHELL_PANEL_POSITION_BOTTOM && position != DESKTOP_SHELL_PANEL_POSITION_LEFT && position != DESKTOP_SHELL_PANEL_POSITION_RIGHT) { wl_resource_post_error(resource, DESKTOP_SHELL_ERROR_INVALID_ARGUMENT, "bad position argument"); return; } shell->panel_position = position; } static const struct desktop_shell_interface desktop_shell_implementation = { desktop_shell_set_background, desktop_shell_set_panel, desktop_shell_set_lock_surface, desktop_shell_unlock, desktop_shell_set_grab_surface, desktop_shell_desktop_ready, desktop_shell_set_panel_position }; static enum shell_surface_type get_shell_surface_type(struct weston_surface *surface) { struct shell_surface *shsurf; shsurf = get_shell_surface(surface); if (!shsurf) return SHELL_SURFACE_NONE; return shsurf->type; } static void move_binding(struct weston_pointer *pointer, uint32_t time, uint32_t button, void *data) { struct weston_surface *focus; struct weston_surface *surface; struct shell_surface *shsurf; if (pointer->focus == NULL) return; focus = pointer->focus->surface; surface = weston_surface_get_main_surface(focus); if (surface == NULL) return; shsurf = get_shell_surface(surface); if (shsurf == NULL || shsurf->state.fullscreen || shsurf->state.maximized) return; surface_move(shsurf, pointer, false); } static void maximize_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t button, void *data) { struct weston_surface *focus = keyboard->focus; struct weston_surface *surface; struct shell_surface *shsurf; surface = weston_surface_get_main_surface(focus); if (surface == NULL) return; shsurf = get_shell_surface(surface); if (shsurf == NULL) return; if (!shell_surface_is_xdg_surface(shsurf)) return; shsurf->state_requested = true; shsurf->requested_state.maximized = !shsurf->state.maximized; send_configure_for_surface(shsurf); } static void fullscreen_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t button, void *data) { struct weston_surface *focus = keyboard->focus; struct weston_surface *surface; struct shell_surface *shsurf; surface = weston_surface_get_main_surface(focus); if (surface == NULL) return; shsurf = get_shell_surface(surface); if (shsurf == NULL) return; if (!shell_surface_is_xdg_surface(shsurf)) return; shsurf->state_requested = true; shsurf->requested_state.fullscreen = !shsurf->state.fullscreen; shsurf->fullscreen_output = shsurf->output; send_configure_for_surface(shsurf); } static void touch_move_binding(struct weston_touch *touch, uint32_t time, void *data) { struct weston_surface *focus; struct weston_surface *surface; struct shell_surface *shsurf; if (touch->focus == NULL) return; focus = touch->focus->surface; surface = weston_surface_get_main_surface(focus); if (surface == NULL) return; shsurf = get_shell_surface(surface); if (shsurf == NULL || shsurf->state.fullscreen || shsurf->state.maximized) return; surface_touch_move(shsurf, touch); } static void resize_binding(struct weston_pointer *pointer, uint32_t time, uint32_t button, void *data) { struct weston_surface *focus; struct weston_surface *surface; uint32_t edges = 0; int32_t x, y; struct shell_surface *shsurf; if (pointer->focus == NULL) return; focus = pointer->focus->surface; surface = weston_surface_get_main_surface(focus); if (surface == NULL) return; shsurf = get_shell_surface(surface); if (shsurf == NULL || shsurf->state.fullscreen || shsurf->state.maximized) return; weston_view_from_global(shsurf->view, wl_fixed_to_int(pointer->grab_x), wl_fixed_to_int(pointer->grab_y), &x, &y); if (x < shsurf->surface->width / 3) edges |= WL_SHELL_SURFACE_RESIZE_LEFT; else if (x < 2 * shsurf->surface->width / 3) edges |= 0; else edges |= WL_SHELL_SURFACE_RESIZE_RIGHT; if (y < shsurf->surface->height / 3) edges |= WL_SHELL_SURFACE_RESIZE_TOP; else if (y < 2 * shsurf->surface->height / 3) edges |= 0; else edges |= WL_SHELL_SURFACE_RESIZE_BOTTOM; surface_resize(shsurf, pointer, edges); } static void surface_opacity_binding(struct weston_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value, void *data) { float step = 0.005; struct shell_surface *shsurf; struct weston_surface *focus = pointer->focus->surface; struct weston_surface *surface; /* XXX: broken for windows containing sub-surfaces */ surface = weston_surface_get_main_surface(focus); if (surface == NULL) return; shsurf = get_shell_surface(surface); if (!shsurf) return; shsurf->view->alpha -= wl_fixed_to_double(value) * step; if (shsurf->view->alpha > 1.0) shsurf->view->alpha = 1.0; if (shsurf->view->alpha < step) shsurf->view->alpha = step; weston_view_geometry_dirty(shsurf->view); weston_surface_damage(surface); } static void do_zoom(struct weston_seat *seat, uint32_t time, uint32_t key, uint32_t axis, wl_fixed_t value) { struct weston_compositor *compositor = seat->compositor; struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_output *output; float increment; if (!pointer) { weston_log("Zoom hotkey pressed but seat '%s' contains no pointer.\n", seat->seat_name); return; } wl_list_for_each(output, &compositor->output_list, link) { if (pixman_region32_contains_point(&output->region, wl_fixed_to_double(pointer->x), wl_fixed_to_double(pointer->y), NULL)) { if (key == KEY_PAGEUP) increment = output->zoom.increment; else if (key == KEY_PAGEDOWN) increment = -output->zoom.increment; else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) /* For every pixel zoom 20th of a step */ increment = output->zoom.increment * -wl_fixed_to_double(value) / 20.0; else increment = 0; output->zoom.level += increment; if (output->zoom.level < 0.0) output->zoom.level = 0.0; else if (output->zoom.level > output->zoom.max_level) output->zoom.level = output->zoom.max_level; if (!output->zoom.active) { if (output->zoom.level <= 0.0) continue; weston_output_activate_zoom(output, seat); } output->zoom.spring_z.target = output->zoom.level; weston_output_update_zoom(output); } } } static void zoom_axis_binding(struct weston_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value, void *data) { do_zoom(pointer->seat, time, 0, axis, value); } static void zoom_key_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { do_zoom(keyboard->seat, time, key, 0, 0); } static void terminate_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; wl_display_terminate(compositor->wl_display); } static void rotate_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct rotate_grab *rotate = container_of(grab, struct rotate_grab, base.grab); struct weston_pointer *pointer = grab->pointer; struct shell_surface *shsurf = rotate->base.shsurf; float cx, cy, dx, dy, cposx, cposy, dposx, dposy, r; weston_pointer_move(pointer, x, y); if (!shsurf) return; cx = 0.5f * shsurf->surface->width; cy = 0.5f * shsurf->surface->height; dx = wl_fixed_to_double(pointer->x) - rotate->center.x; dy = wl_fixed_to_double(pointer->y) - rotate->center.y; r = sqrtf(dx * dx + dy * dy); wl_list_remove(&shsurf->rotation.transform.link); weston_view_geometry_dirty(shsurf->view); if (r > 20.0f) { struct weston_matrix *matrix = &shsurf->rotation.transform.matrix; weston_matrix_init(&rotate->rotation); weston_matrix_rotate_xy(&rotate->rotation, dx / r, dy / r); weston_matrix_init(matrix); weston_matrix_translate(matrix, -cx, -cy, 0.0f); weston_matrix_multiply(matrix, &shsurf->rotation.rotation); weston_matrix_multiply(matrix, &rotate->rotation); weston_matrix_translate(matrix, cx, cy, 0.0f); wl_list_insert( &shsurf->view->geometry.transformation_list, &shsurf->rotation.transform.link); } else { wl_list_init(&shsurf->rotation.transform.link); weston_matrix_init(&shsurf->rotation.rotation); weston_matrix_init(&rotate->rotation); } /* We need to adjust the position of the surface * in case it was resized in a rotated state before */ cposx = shsurf->view->geometry.x + cx; cposy = shsurf->view->geometry.y + cy; dposx = rotate->center.x - cposx; dposy = rotate->center.y - cposy; if (dposx != 0.0f || dposy != 0.0f) { weston_view_set_position(shsurf->view, shsurf->view->geometry.x + dposx, shsurf->view->geometry.y + dposy); } /* Repaint implies weston_view_update_transform(), which * lazily applies the damage due to rotation update. */ weston_compositor_schedule_repaint(shsurf->surface->compositor); } static void rotate_grab_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct rotate_grab *rotate = container_of(grab, struct rotate_grab, base.grab); struct weston_pointer *pointer = grab->pointer; struct shell_surface *shsurf = rotate->base.shsurf; enum wl_pointer_button_state state = state_w; if (pointer->button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { if (shsurf) weston_matrix_multiply(&shsurf->rotation.rotation, &rotate->rotation); shell_grab_end(&rotate->base); free(rotate); } } static void rotate_grab_cancel(struct weston_pointer_grab *grab) { struct rotate_grab *rotate = container_of(grab, struct rotate_grab, base.grab); shell_grab_end(&rotate->base); free(rotate); } static const struct weston_pointer_grab_interface rotate_grab_interface = { noop_grab_focus, rotate_grab_motion, rotate_grab_button, rotate_grab_cancel, }; static void surface_rotate(struct shell_surface *surface, struct weston_pointer *pointer) { struct rotate_grab *rotate; float dx, dy; float r; surface = find_toplevel_surface(surface); rotate = malloc(sizeof *rotate); if (!rotate) return; weston_view_to_global_float(surface->view, surface->surface->width * 0.5f, surface->surface->height * 0.5f, &rotate->center.x, &rotate->center.y); dx = wl_fixed_to_double(pointer->x) - rotate->center.x; dy = wl_fixed_to_double(pointer->y) - rotate->center.y; r = sqrtf(dx * dx + dy * dy); if (r > 20.0f) { struct weston_matrix inverse; weston_matrix_init(&inverse); weston_matrix_rotate_xy(&inverse, dx / r, -dy / r); weston_matrix_multiply(&surface->rotation.rotation, &inverse); weston_matrix_init(&rotate->rotation); weston_matrix_rotate_xy(&rotate->rotation, dx / r, dy / r); } else { weston_matrix_init(&surface->rotation.rotation); weston_matrix_init(&rotate->rotation); } shell_grab_start(&rotate->base, &rotate_grab_interface, surface, pointer, DESKTOP_SHELL_CURSOR_ARROW); } static void rotate_binding(struct weston_pointer *pointer, uint32_t time, uint32_t button, void *data) { struct weston_surface *focus; struct weston_surface *base_surface; struct shell_surface *surface; if (pointer->focus == NULL) return; focus = pointer->focus->surface; base_surface = weston_surface_get_main_surface(focus); if (base_surface == NULL) return; surface = get_shell_surface(base_surface); if (surface == NULL || surface->state.fullscreen || surface->state.maximized) return; surface_rotate(surface, pointer); } /* Move all fullscreen layers down to the current workspace and hide their * black views. The surfaces' state is set to both fullscreen and lowered, * and this is reversed when such a surface is re-configured, see * shell_configure_fullscreen() and shell_ensure_fullscreen_black_view(). * * lowering_output = NULL - Lower on all outputs, else only lower on the * specified output. * * This should be used when implementing shell-wide overlays, such as * the alt-tab switcher, which need to de-promote fullscreen layers. */ void lower_fullscreen_layer(struct desktop_shell *shell, struct weston_output *lowering_output) { struct workspace *ws; struct weston_view *view, *prev; ws = get_current_workspace(shell); wl_list_for_each_reverse_safe(view, prev, &shell->fullscreen_layer.view_list.link, layer_link.link) { struct shell_surface *shsurf = get_shell_surface(view->surface); if (!shsurf) continue; /* Only lower surfaces which have lowering_output as their fullscreen * output, unless a NULL output asks for lowering on all outputs. */ if (lowering_output && (shsurf->fullscreen_output != lowering_output)) continue; /* We can have a non-fullscreen popup for a fullscreen surface * in the fullscreen layer. */ if (shsurf->state.fullscreen) { /* Hide the black view */ weston_layer_entry_remove(&shsurf->fullscreen.black_view->layer_link); wl_list_init(&shsurf->fullscreen.black_view->layer_link.link); weston_view_damage_below(shsurf->fullscreen.black_view); } /* Lower the view to the workspace layer */ weston_layer_entry_remove(&view->layer_link); weston_layer_entry_insert(&ws->layer.view_list, &view->layer_link); weston_view_damage_below(view); weston_surface_damage(view->surface); shsurf->state.lowered = true; } } void activate(struct desktop_shell *shell, struct weston_surface *es, struct weston_seat *seat, bool configure) { struct weston_surface *main_surface; struct focus_state *state; struct workspace *ws; struct weston_surface *old_es; struct shell_surface *shsurf; main_surface = weston_surface_get_main_surface(es); shsurf = get_shell_surface(main_surface); assert(shsurf); /* Only demote fullscreen surfaces on the output of activated shsurf. * Leave fullscreen surfaces on unrelated outputs alone. */ lower_fullscreen_layer(shell, shsurf->output); weston_surface_activate(es, seat); state = ensure_focus_state(shell, seat); if (state == NULL) return; old_es = state->keyboard_focus; focus_state_set_focus(state, es); if (shsurf->state.fullscreen && configure) shell_configure_fullscreen(shsurf); else restore_output_mode(shsurf->output); /* Update the surface’s layer. This brings it to the top of the stacking * order as appropriate. */ shell_surface_update_layer(shsurf); if (shell->focus_animation_type != ANIMATION_NONE) { ws = get_current_workspace(shell); animate_focus_change(shell, ws, get_default_view(old_es), get_default_view(es)); } } /* no-op func for checking black surface */ static void black_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy) { } static bool is_black_surface (struct weston_surface *es, struct weston_surface **fs_surface) { if (es->configure == black_surface_configure) { if (fs_surface) *fs_surface = (struct weston_surface *)es->configure_private; return true; } return false; } static void activate_binding(struct weston_seat *seat, struct desktop_shell *shell, struct weston_surface *focus) { struct weston_surface *main_surface; if (!focus) return; if (is_black_surface(focus, &main_surface)) focus = main_surface; main_surface = weston_surface_get_main_surface(focus); if (get_shell_surface_type(main_surface) == SHELL_SURFACE_NONE) return; activate(shell, focus, seat, true); } static void click_to_activate_binding(struct weston_pointer *pointer, uint32_t time, uint32_t button, void *data) { if (pointer->grab != &pointer->default_grab) return; if (pointer->focus == NULL) return; activate_binding(pointer->seat, data, pointer->focus->surface); } static void touch_to_activate_binding(struct weston_touch *touch, uint32_t time, void *data) { if (touch->grab != &touch->default_grab) return; if (touch->focus == NULL) return; activate_binding(touch->seat, data, touch->focus->surface); } static void unfocus_all_seats(struct desktop_shell *shell) { struct weston_seat *seat, *next; wl_list_for_each_safe(seat, next, &shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard) continue; weston_keyboard_set_focus(keyboard, NULL); } } static void lock(struct desktop_shell *shell) { struct workspace *ws = get_current_workspace(shell); if (shell->locked) { weston_compositor_sleep(shell->compositor); return; } shell->locked = true; /* Hide all surfaces by removing the fullscreen, panel and * toplevel layers. This way nothing else can show or receive * input events while we are locked. */ wl_list_remove(&shell->panel_layer.link); wl_list_remove(&shell->fullscreen_layer.link); if (shell->showing_input_panels) wl_list_remove(&shell->input_panel_layer.link); wl_list_remove(&ws->layer.link); wl_list_insert(&shell->compositor->cursor_layer.link, &shell->lock_layer.link); weston_compositor_sleep(shell->compositor); /* Remove the keyboard focus on all seats. This will be * restored to the workspace's saved state via * restore_focus_state when the compositor is unlocked */ unfocus_all_seats(shell); /* TODO: disable bindings that should not work while locked. */ /* All this must be undone in resume_desktop(). */ } static void unlock(struct desktop_shell *shell) { if (!shell->locked || shell->lock_surface) { shell_fade(shell, FADE_IN); return; } /* If desktop-shell client has gone away, unlock immediately. */ if (!shell->child.desktop_shell) { resume_desktop(shell); return; } if (shell->prepare_event_sent) return; desktop_shell_send_prepare_lock_surface(shell->child.desktop_shell); shell->prepare_event_sent = true; } static void shell_fade_done(struct weston_view_animation *animation, void *data) { struct desktop_shell *shell = data; shell->fade.animation = NULL; switch (shell->fade.type) { case FADE_IN: weston_surface_destroy(shell->fade.view->surface); shell->fade.view = NULL; break; case FADE_OUT: lock(shell); break; default: break; } } static struct weston_view * shell_fade_create_surface(struct desktop_shell *shell) { struct weston_compositor *compositor = shell->compositor; struct weston_surface *surface; struct weston_view *view; surface = weston_surface_create(compositor); if (!surface) return NULL; view = weston_view_create(surface); if (!view) { weston_surface_destroy(surface); return NULL; } weston_surface_set_size(surface, 8192, 8192); weston_view_set_position(view, 0, 0); weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0); weston_layer_entry_insert(&compositor->fade_layer.view_list, &view->layer_link); pixman_region32_init(&surface->input); return view; } static void shell_fade(struct desktop_shell *shell, enum fade_type type) { float tint; switch (type) { case FADE_IN: tint = 0.0; break; case FADE_OUT: tint = 1.0; break; default: weston_log("shell: invalid fade type\n"); return; } shell->fade.type = type; if (shell->fade.view == NULL) { shell->fade.view = shell_fade_create_surface(shell); if (!shell->fade.view) return; shell->fade.view->alpha = 1.0 - tint; weston_view_update_transform(shell->fade.view); } if (shell->fade.view->output == NULL) { /* If the black view gets a NULL output, we lost the * last output and we'll just cancel the fade. This * happens when you close the last window under the * X11 or Wayland backends. */ shell->locked = false; weston_surface_destroy(shell->fade.view->surface); shell->fade.view = NULL; } else if (shell->fade.animation) { weston_fade_update(shell->fade.animation, tint); } else { shell->fade.animation = weston_fade_run(shell->fade.view, 1.0 - tint, tint, 300.0, shell_fade_done, shell); } } static void do_shell_fade_startup(void *data) { struct desktop_shell *shell = data; if (shell->startup_animation_type == ANIMATION_FADE) { shell_fade(shell, FADE_IN); } else { weston_log("desktop shell: " "unexpected fade-in animation type %d\n", shell->startup_animation_type); weston_surface_destroy(shell->fade.view->surface); shell->fade.view = NULL; } } static void shell_fade_startup(struct desktop_shell *shell) { struct wl_event_loop *loop; if (!shell->fade.startup_timer) return; wl_event_source_remove(shell->fade.startup_timer); shell->fade.startup_timer = NULL; loop = wl_display_get_event_loop(shell->compositor->wl_display); wl_event_loop_add_idle(loop, do_shell_fade_startup, shell); } static int fade_startup_timeout(void *data) { struct desktop_shell *shell = data; shell_fade_startup(shell); return 0; } static void shell_fade_init(struct desktop_shell *shell) { /* Make compositor output all black, and wait for the desktop-shell * client to signal it is ready, then fade in. The timer triggers a * fade-in, in case the desktop-shell client takes too long. */ struct wl_event_loop *loop; if (shell->fade.view != NULL) { weston_log("%s: warning: fade surface already exists\n", __func__); return; } if (shell->startup_animation_type == ANIMATION_NONE) return; shell->fade.view = shell_fade_create_surface(shell); if (!shell->fade.view) return; weston_view_update_transform(shell->fade.view); weston_surface_damage(shell->fade.view->surface); loop = wl_display_get_event_loop(shell->compositor->wl_display); shell->fade.startup_timer = wl_event_loop_add_timer(loop, fade_startup_timeout, shell); wl_event_source_timer_update(shell->fade.startup_timer, 15000); } static void idle_handler(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, idle_listener); struct weston_seat *seat; wl_list_for_each(seat, &shell->compositor->seat_list, link) { struct weston_touch *touch = weston_seat_get_touch(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (pointer) popup_grab_end(pointer); if (touch) touch_popup_grab_end(touch); } shell_fade(shell, FADE_OUT); /* lock() is called from shell_fade_done() */ } static void wake_handler(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, wake_listener); unlock(shell); } static void center_on_output(struct weston_view *view, struct weston_output *output) { int32_t surf_x, surf_y, width, height; float x, y; surface_subsurfaces_boundingbox(view->surface, &surf_x, &surf_y, &width, &height); x = output->x + (output->width - width) / 2 - surf_x / 2; y = output->y + (output->height - height) / 2 - surf_y / 2; weston_view_set_position(view, x, y); } static void weston_view_set_initial_position(struct weston_view *view, struct desktop_shell *shell) { struct weston_compositor *compositor = shell->compositor; int ix = 0, iy = 0; int32_t range_x, range_y; int32_t x, y; struct weston_output *output, *target_output = NULL; struct weston_seat *seat; pixman_rectangle32_t area; /* As a heuristic place the new window on the same output as the * pointer. Falling back to the output containing 0, 0. * * TODO: Do something clever for touch too? */ wl_list_for_each(seat, &compositor->seat_list, link) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (pointer) { ix = wl_fixed_to_int(pointer->x); iy = wl_fixed_to_int(pointer->y); break; } } wl_list_for_each(output, &compositor->output_list, link) { if (pixman_region32_contains_point(&output->region, ix, iy, NULL)) { target_output = output; break; } } if (!target_output) { weston_view_set_position(view, 10 + random() % 400, 10 + random() % 400); return; } /* Valid range within output where the surface will still be onscreen. * If this is negative it means that the surface is bigger than * output. */ get_output_work_area(shell, target_output, &area); x = area.x; y = area.y; range_x = area.width - view->surface->width; range_y = area.height - view->surface->height; if (range_x > 0) x += random() % range_x; if (range_y > 0) y += random() % range_y; weston_view_set_position(view, x, y); } static void set_maximized_position(struct desktop_shell *shell, struct shell_surface *shsurf) { int32_t surf_x, surf_y; pixman_rectangle32_t area; pixman_box32_t *e; get_output_work_area(shell, shsurf->output, &area); if (shsurf->has_set_geometry) { surf_x = shsurf->geometry.x; surf_y = shsurf->geometry.y; } else { surface_subsurfaces_boundingbox(shsurf->surface, &surf_x, &surf_y, NULL, NULL); } e = pixman_region32_extents(&shsurf->output->region); weston_view_set_position(shsurf->view, e->x1 + area.x - surf_x, e->y1 + area.y - surf_y); } static void map(struct desktop_shell *shell, struct shell_surface *shsurf, int32_t sx, int32_t sy) { struct weston_compositor *compositor = shell->compositor; struct weston_seat *seat; /* initial positioning, see also configure() */ switch (shsurf->type) { case SHELL_SURFACE_TOPLEVEL: if (shsurf->state.fullscreen) { center_on_output(shsurf->view, shsurf->fullscreen_output); shell_map_fullscreen(shsurf); } else if (shsurf->state.maximized) { set_maximized_position(shell, shsurf); } else if (!shsurf->state.relative) { weston_view_set_initial_position(shsurf->view, shell); } break; case SHELL_SURFACE_POPUP: if (shell_map_popup(shsurf) != 0) return; break; case SHELL_SURFACE_NONE: weston_view_set_position(shsurf->view, shsurf->view->geometry.x + sx, shsurf->view->geometry.y + sy); break; case SHELL_SURFACE_XWAYLAND: default: ; } /* Surface stacking order, see also activate(). */ shell_surface_update_layer(shsurf); if (shsurf->type != SHELL_SURFACE_NONE) { weston_view_update_transform(shsurf->view); if (shsurf->state.maximized) { shsurf->surface->output = shsurf->output; shsurf->view->output = shsurf->output; } } switch (shsurf->type) { /* XXX: xwayland's using the same fields for transient type */ case SHELL_SURFACE_XWAYLAND: if (shsurf->transient.flags == WL_SHELL_SURFACE_TRANSIENT_INACTIVE) break; case SHELL_SURFACE_TOPLEVEL: if (shsurf->state.relative && shsurf->transient.flags == WL_SHELL_SURFACE_TRANSIENT_INACTIVE) break; if (shell->locked) break; wl_list_for_each(seat, &compositor->seat_list, link) activate(shell, shsurf->surface, seat, true); break; case SHELL_SURFACE_POPUP: case SHELL_SURFACE_NONE: default: break; } if (shsurf->type == SHELL_SURFACE_TOPLEVEL && !shsurf->state.maximized && !shsurf->state.fullscreen) { switch (shell->win_animation_type) { case ANIMATION_FADE: weston_fade_run(shsurf->view, 0.0, 1.0, 300.0, NULL, NULL); break; case ANIMATION_ZOOM: weston_zoom_run(shsurf->view, 0.5, 1.0, NULL, NULL); break; case ANIMATION_NONE: default: break; } } } static void configure(struct desktop_shell *shell, struct weston_surface *surface, float x, float y) { struct shell_surface *shsurf; struct weston_view *view; shsurf = get_shell_surface(surface); assert(shsurf); if (shsurf->state.fullscreen) shell_configure_fullscreen(shsurf); else if (shsurf->state.maximized) { set_maximized_position(shell, shsurf); } else { weston_view_set_position(shsurf->view, x, y); } /* XXX: would a fullscreen surface need the same handling? */ if (surface->output) { wl_list_for_each(view, &surface->views, surface_link) weston_view_update_transform(view); if (shsurf->state.maximized) surface->output = shsurf->output; } } static void shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy) { struct shell_surface *shsurf = get_shell_surface(es); struct desktop_shell *shell; int type_changed = 0; assert(shsurf); shell = shsurf->shell; if (!weston_surface_is_mapped(es) && !wl_list_empty(&shsurf->popup.grab_link)) { remove_popup_grab(shsurf); } if (es->width == 0) return; if (shsurf->has_next_geometry) { shsurf->geometry = shsurf->next_geometry; shsurf->has_next_geometry = false; shsurf->has_set_geometry = true; } else if (!shsurf->has_set_geometry) { surface_subsurfaces_boundingbox(shsurf->surface, &shsurf->geometry.x, &shsurf->geometry.y, &shsurf->geometry.width, &shsurf->geometry.height); } if (shsurf->state_changed) { set_surface_type(shsurf); type_changed = 1; } if (!weston_surface_is_mapped(es)) { map(shell, shsurf, sx, sy); } else if (type_changed || sx != 0 || sy != 0 || shsurf->last_width != es->width || shsurf->last_height != es->height) { float from_x, from_y; float to_x, to_y; if (shsurf->resize_edges) { sx = 0; sy = 0; } if (shsurf->resize_edges & WL_SHELL_SURFACE_RESIZE_LEFT) sx = shsurf->last_width - es->width; if (shsurf->resize_edges & WL_SHELL_SURFACE_RESIZE_TOP) sy = shsurf->last_height - es->height; shsurf->last_width = es->width; shsurf->last_height = es->height; weston_view_to_global_float(shsurf->view, 0, 0, &from_x, &from_y); weston_view_to_global_float(shsurf->view, sx, sy, &to_x, &to_y); configure(shell, es, shsurf->view->geometry.x + to_x - from_x, shsurf->view->geometry.y + to_y - from_y); } } static bool check_desktop_shell_crash_too_early(struct desktop_shell *shell) { struct timespec now; if (clock_gettime(CLOCK_MONOTONIC, &now) < 0) return false; /* * If the shell helper client dies before the session has been * up for roughly 30 seconds, better just make Weston shut down, * because the user likely has no way to interact with the desktop * anyway. */ if (now.tv_sec - shell->startup_time.tv_sec < 30) { weston_log("Error: %s apparently cannot run at all.\n", shell->client); weston_log_continue(STAMP_SPACE "Quitting..."); wl_display_terminate(shell->compositor->wl_display); return true; } return false; } static void launch_desktop_shell_process(void *data); static void respawn_desktop_shell_process(struct desktop_shell *shell) { uint32_t time; /* if desktop-shell dies more than 5 times in 30 seconds, give up */ time = weston_compositor_get_time(); if (time - shell->child.deathstamp > 30000) { shell->child.deathstamp = time; shell->child.deathcount = 0; } shell->child.deathcount++; if (shell->child.deathcount > 5) { weston_log("%s disconnected, giving up.\n", shell->client); return; } weston_log("%s disconnected, respawning...\n", shell->client); launch_desktop_shell_process(shell); } static void desktop_shell_client_destroy(struct wl_listener *listener, void *data) { struct desktop_shell *shell; shell = container_of(listener, struct desktop_shell, child.client_destroy_listener); wl_list_remove(&shell->child.client_destroy_listener.link); shell->child.client = NULL; /* * unbind_desktop_shell() will reset shell->child.desktop_shell * before the respawned process has a chance to create a new * desktop_shell object, because we are being called from the * wl_client destructor which destroys all wl_resources before * returning. */ if (!check_desktop_shell_crash_too_early(shell)) respawn_desktop_shell_process(shell); shell_fade_startup(shell); } static void launch_desktop_shell_process(void *data) { struct desktop_shell *shell = data; shell->child.client = weston_client_start(shell->compositor, shell->client); if (!shell->child.client) { weston_log("not able to start %s\n", shell->client); return; } shell->child.client_destroy_listener.notify = desktop_shell_client_destroy; wl_client_add_destroy_listener(shell->child.client, &shell->child.client_destroy_listener); } static void handle_shell_client_destroy(struct wl_listener *listener, void *data) { struct shell_client *sc = container_of(listener, struct shell_client, destroy_listener); if (sc->ping_timer) wl_event_source_remove(sc->ping_timer); /* Since we're about to free shell_client, we remove it from the * head of the surface list so we don't use that freed list node * during surface clean up later on. */ wl_list_remove(&sc->surface_list); free(sc); } static struct shell_client * shell_client_create(struct wl_client *client, struct desktop_shell *shell, const struct wl_interface *interface, uint32_t id) { struct shell_client *sc; sc = zalloc(sizeof *sc); if (sc == NULL) { wl_client_post_no_memory(client); return NULL; } sc->resource = wl_resource_create(client, interface, 1, id); if (sc->resource == NULL) { free(sc); wl_client_post_no_memory(client); return NULL; } sc->client = client; sc->shell = shell; sc->destroy_listener.notify = handle_shell_client_destroy; wl_client_add_destroy_listener(client, &sc->destroy_listener); wl_list_init(&sc->surface_list); return sc; } static void bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct desktop_shell *shell = data; struct shell_client *sc; sc = shell_client_create(client, shell, &wl_shell_interface, id); if (sc) wl_resource_set_implementation(sc->resource, &shell_implementation, sc, NULL); } static void bind_xdg_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct desktop_shell *shell = data; struct shell_client *sc; sc = shell_client_create(client, shell, &xdg_shell_interface, id); if (sc) wl_resource_set_dispatcher(sc->resource, xdg_shell_unversioned_dispatch, NULL, sc, NULL); } static void unbind_desktop_shell(struct wl_resource *resource) { struct desktop_shell *shell = wl_resource_get_user_data(resource); if (shell->locked) resume_desktop(shell); shell->child.desktop_shell = NULL; shell->prepare_event_sent = false; } static void bind_desktop_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct desktop_shell *shell = data; struct wl_resource *resource; resource = wl_resource_create(client, &desktop_shell_interface, MIN(version, 3), id); if (client == shell->child.client) { wl_resource_set_implementation(resource, &desktop_shell_implementation, shell, unbind_desktop_shell); shell->child.desktop_shell = resource; if (version < 2) shell_fade_startup(shell); return; } wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "permission to bind desktop_shell denied"); } struct switcher { struct desktop_shell *shell; struct weston_surface *current; struct wl_listener listener; struct weston_keyboard_grab grab; struct wl_array minimized_array; }; static void switcher_next(struct switcher *switcher) { struct weston_view *view; struct weston_surface *first = NULL, *prev = NULL, *next = NULL; struct shell_surface *shsurf; struct workspace *ws = get_current_workspace(switcher->shell); /* temporary re-display minimized surfaces */ struct weston_view *tmp; struct weston_view **minimized; wl_list_for_each_safe(view, tmp, &switcher->shell->minimized_layer.view_list.link, layer_link.link) { weston_layer_entry_remove(&view->layer_link); weston_layer_entry_insert(&ws->layer.view_list, &view->layer_link); minimized = wl_array_add(&switcher->minimized_array, sizeof *minimized); *minimized = view; } wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) { shsurf = get_shell_surface(view->surface); if (shsurf && shsurf->type == SHELL_SURFACE_TOPLEVEL && shsurf->parent == NULL) { if (first == NULL) first = view->surface; if (prev == switcher->current) next = view->surface; prev = view->surface; view->alpha = 0.25; weston_view_geometry_dirty(view); weston_surface_damage(view->surface); } if (is_black_surface(view->surface, NULL)) { view->alpha = 0.25; weston_view_geometry_dirty(view); weston_surface_damage(view->surface); } } if (next == NULL) next = first; if (next == NULL) return; wl_list_remove(&switcher->listener.link); wl_signal_add(&next->destroy_signal, &switcher->listener); switcher->current = next; wl_list_for_each(view, &next->views, surface_link) view->alpha = 1.0; shsurf = get_shell_surface(switcher->current); if (shsurf && shsurf->state.fullscreen) shsurf->fullscreen.black_view->alpha = 1.0; } static void switcher_handle_surface_destroy(struct wl_listener *listener, void *data) { struct switcher *switcher = container_of(listener, struct switcher, listener); switcher_next(switcher); } static void switcher_destroy(struct switcher *switcher) { struct weston_view *view; struct weston_keyboard *keyboard = switcher->grab.keyboard; struct workspace *ws = get_current_workspace(switcher->shell); wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) { if (is_focus_view(view)) continue; view->alpha = 1.0; weston_surface_damage(view->surface); } if (switcher->current) activate(switcher->shell, switcher->current, keyboard->seat, true); wl_list_remove(&switcher->listener.link); weston_keyboard_end_grab(keyboard); if (keyboard->input_method_resource) keyboard->grab = &keyboard->input_method_grab; /* re-hide surfaces that were temporary shown during the switch */ struct weston_view **minimized; wl_array_for_each(minimized, &switcher->minimized_array) { /* with the exception of the current selected */ if ((*minimized)->surface != switcher->current) { weston_layer_entry_remove(&(*minimized)->layer_link); weston_layer_entry_insert(&switcher->shell->minimized_layer.view_list, &(*minimized)->layer_link); weston_view_damage_below(*minimized); } } wl_array_release(&switcher->minimized_array); free(switcher); } static void switcher_key(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state_w) { struct switcher *switcher = container_of(grab, struct switcher, grab); enum wl_keyboard_key_state state = state_w; if (key == KEY_TAB && state == WL_KEYBOARD_KEY_STATE_PRESSED) switcher_next(switcher); } static void switcher_modifier(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct switcher *switcher = container_of(grab, struct switcher, grab); struct weston_seat *seat = grab->keyboard->seat; if ((seat->modifier_state & switcher->shell->binding_modifier) == 0) switcher_destroy(switcher); } static void switcher_cancel(struct weston_keyboard_grab *grab) { struct switcher *switcher = container_of(grab, struct switcher, grab); switcher_destroy(switcher); } static const struct weston_keyboard_grab_interface switcher_grab = { switcher_key, switcher_modifier, switcher_cancel, }; static void switcher_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct desktop_shell *shell = data; struct switcher *switcher; switcher = malloc(sizeof *switcher); switcher->shell = shell; switcher->current = NULL; switcher->listener.notify = switcher_handle_surface_destroy; wl_list_init(&switcher->listener.link); wl_array_init(&switcher->minimized_array); restore_all_output_modes(shell->compositor); lower_fullscreen_layer(switcher->shell, NULL); switcher->grab.interface = &switcher_grab; weston_keyboard_start_grab(keyboard, &switcher->grab); weston_keyboard_set_focus(keyboard, NULL); switcher_next(switcher); } static void backlight_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; struct weston_output *output; long backlight_new = 0; /* TODO: we're limiting to simple use cases, where we assume just * control on the primary display. We'd have to extend later if we * ever get support for setting backlights on random desktop LCD * panels though */ output = get_default_output(compositor); if (!output) return; if (!output->set_backlight) return; if (key == KEY_F9 || key == KEY_BRIGHTNESSDOWN) backlight_new = output->backlight_current - 25; else if (key == KEY_F10 || key == KEY_BRIGHTNESSUP) backlight_new = output->backlight_current + 25; if (backlight_new < 5) backlight_new = 5; if (backlight_new > 255) backlight_new = 255; output->backlight_current = backlight_new; output->set_backlight(output, output->backlight_current); } static void force_kill_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_surface *focus_surface; struct wl_client *client; struct desktop_shell *shell = data; struct weston_compositor *compositor = shell->compositor; pid_t pid; focus_surface = keyboard->focus; if (!focus_surface) return; wl_signal_emit(&compositor->kill_signal, focus_surface); client = wl_resource_get_client(focus_surface->resource); wl_client_get_credentials(client, &pid, NULL, NULL); /* Skip clients that we launched ourselves (the credentials of * the socketpair is ours) */ if (pid == getpid()) return; kill(pid, SIGKILL); } static void workspace_up_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct desktop_shell *shell = data; unsigned int new_index = shell->workspaces.current; if (shell->locked) return; if (new_index != 0) new_index--; change_workspace(shell, new_index); } static void workspace_down_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct desktop_shell *shell = data; unsigned int new_index = shell->workspaces.current; if (shell->locked) return; if (new_index < shell->workspaces.num - 1) new_index++; change_workspace(shell, new_index); } static void workspace_f_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct desktop_shell *shell = data; unsigned int new_index; if (shell->locked) return; new_index = key - KEY_F1; if (new_index >= shell->workspaces.num) new_index = shell->workspaces.num - 1; change_workspace(shell, new_index); } static void workspace_move_surface_up_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct desktop_shell *shell = data; unsigned int new_index = shell->workspaces.current; if (shell->locked) return; if (new_index != 0) new_index--; take_surface_to_workspace_by_seat(shell, keyboard->seat, new_index); } static void workspace_move_surface_down_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct desktop_shell *shell = data; unsigned int new_index = shell->workspaces.current; if (shell->locked) return; if (new_index < shell->workspaces.num - 1) new_index++; take_surface_to_workspace_by_seat(shell, keyboard->seat, new_index); } static void shell_reposition_view_on_output_destroy(struct weston_view *view) { struct weston_output *output, *first_output; struct weston_compositor *ec = view->surface->compositor; struct shell_surface *shsurf; float x, y; int visible; x = view->geometry.x; y = view->geometry.y; /* At this point the destroyed output is not in the list anymore. * If the view is still visible somewhere, we leave where it is, * otherwise, move it to the first output. */ visible = 0; wl_list_for_each(output, &ec->output_list, link) { if (pixman_region32_contains_point(&output->region, x, y, NULL)) { visible = 1; break; } } if (!visible) { first_output = container_of(ec->output_list.next, struct weston_output, link); x = first_output->x + first_output->width / 4; y = first_output->y + first_output->height / 4; weston_view_set_position(view, x, y); } else { weston_view_geometry_dirty(view); } shsurf = get_shell_surface(view->surface); if (shsurf) { shsurf->saved_position_valid = false; shsurf->next_state.maximized = false; shsurf->next_state.fullscreen = false; shsurf->state_changed = true; } } void shell_for_each_layer(struct desktop_shell *shell, shell_for_each_layer_func_t func, void *data) { struct workspace **ws; func(shell, &shell->fullscreen_layer, data); func(shell, &shell->panel_layer, data); func(shell, &shell->background_layer, data); func(shell, &shell->lock_layer, data); func(shell, &shell->input_panel_layer, data); wl_array_for_each(ws, &shell->workspaces.array) func(shell, &(*ws)->layer, data); } static void shell_output_destroy_move_layer(struct desktop_shell *shell, struct weston_layer *layer, void *data) { struct weston_output *output = data; struct weston_view *view; wl_list_for_each(view, &layer->view_list.link, layer_link.link) { if (view->output != output) continue; shell_reposition_view_on_output_destroy(view); } } static void handle_output_destroy(struct wl_listener *listener, void *data) { struct shell_output *output_listener = container_of(listener, struct shell_output, destroy_listener); struct weston_output *output = output_listener->output; struct desktop_shell *shell = output_listener->shell; shell_for_each_layer(shell, shell_output_destroy_move_layer, output); wl_list_remove(&output_listener->destroy_listener.link); wl_list_remove(&output_listener->link); free(output_listener); } static void create_shell_output(struct desktop_shell *shell, struct weston_output *output) { struct shell_output *shell_output; shell_output = zalloc(sizeof *shell_output); if (shell_output == NULL) return; shell_output->output = output; shell_output->shell = shell; shell_output->destroy_listener.notify = handle_output_destroy; wl_signal_add(&output->destroy_signal, &shell_output->destroy_listener); wl_list_insert(shell->output_list.prev, &shell_output->link); } static void handle_output_create(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, output_create_listener); struct weston_output *output = (struct weston_output *)data; create_shell_output(shell, output); } static void handle_output_move_layer(struct desktop_shell *shell, struct weston_layer *layer, void *data) { struct weston_output *output = data; struct weston_view *view; float x, y; wl_list_for_each(view, &layer->view_list.link, layer_link.link) { if (view->output != output) continue; x = view->geometry.x + output->move_x; y = view->geometry.y + output->move_y; weston_view_set_position(view, x, y); } } static void handle_output_move(struct wl_listener *listener, void *data) { struct desktop_shell *shell; shell = container_of(listener, struct desktop_shell, output_move_listener); shell_for_each_layer(shell, handle_output_move_layer, data); } static void setup_output_destroy_handler(struct weston_compositor *ec, struct desktop_shell *shell) { struct weston_output *output; wl_list_init(&shell->output_list); wl_list_for_each(output, &ec->output_list, link) create_shell_output(shell, output); shell->output_create_listener.notify = handle_output_create; wl_signal_add(&ec->output_created_signal, &shell->output_create_listener); shell->output_move_listener.notify = handle_output_move; wl_signal_add(&ec->output_moved_signal, &shell->output_move_listener); } static void shell_destroy(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, destroy_listener); struct workspace **ws; struct shell_output *shell_output, *tmp; /* Force state to unlocked so we don't try to fade */ shell->locked = false; if (shell->child.client) { /* disable respawn */ wl_list_remove(&shell->child.client_destroy_listener.link); wl_client_destroy(shell->child.client); } wl_list_remove(&shell->idle_listener.link); wl_list_remove(&shell->wake_listener.link); text_backend_destroy(shell->text_backend); input_panel_destroy(shell); wl_list_for_each_safe(shell_output, tmp, &shell->output_list, link) { wl_list_remove(&shell_output->destroy_listener.link); wl_list_remove(&shell_output->link); free(shell_output); } wl_list_remove(&shell->output_create_listener.link); wl_list_remove(&shell->output_move_listener.link); wl_array_for_each(ws, &shell->workspaces.array) workspace_destroy(*ws); wl_array_release(&shell->workspaces.array); free(shell->client); free(shell); } static void shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell) { uint32_t mod; int i, num_workspace_bindings; /* fixed bindings */ weston_compositor_add_key_binding(ec, KEY_BACKSPACE, MODIFIER_CTRL | MODIFIER_ALT, terminate_binding, ec); weston_compositor_add_button_binding(ec, BTN_LEFT, 0, click_to_activate_binding, shell); weston_compositor_add_button_binding(ec, BTN_RIGHT, 0, click_to_activate_binding, shell); weston_compositor_add_touch_binding(ec, 0, touch_to_activate_binding, shell); weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL, MODIFIER_SUPER | MODIFIER_ALT, surface_opacity_binding, NULL); weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL, MODIFIER_SUPER, zoom_axis_binding, NULL); /* configurable bindings */ mod = shell->binding_modifier; weston_compositor_add_key_binding(ec, KEY_PAGEUP, mod, zoom_key_binding, NULL); weston_compositor_add_key_binding(ec, KEY_PAGEDOWN, mod, zoom_key_binding, NULL); weston_compositor_add_key_binding(ec, KEY_M, mod | MODIFIER_SHIFT, maximize_binding, NULL); weston_compositor_add_key_binding(ec, KEY_F, mod | MODIFIER_SHIFT, fullscreen_binding, NULL); weston_compositor_add_button_binding(ec, BTN_LEFT, mod, move_binding, shell); weston_compositor_add_touch_binding(ec, mod, touch_move_binding, shell); weston_compositor_add_button_binding(ec, BTN_RIGHT, mod, resize_binding, shell); weston_compositor_add_button_binding(ec, BTN_LEFT, mod | MODIFIER_SHIFT, resize_binding, shell); if (ec->capabilities & WESTON_CAP_ROTATION_ANY) weston_compositor_add_button_binding(ec, BTN_MIDDLE, mod, rotate_binding, NULL); weston_compositor_add_key_binding(ec, KEY_TAB, mod, switcher_binding, shell); weston_compositor_add_key_binding(ec, KEY_F9, mod, backlight_binding, ec); weston_compositor_add_key_binding(ec, KEY_BRIGHTNESSDOWN, 0, backlight_binding, ec); weston_compositor_add_key_binding(ec, KEY_F10, mod, backlight_binding, ec); weston_compositor_add_key_binding(ec, KEY_BRIGHTNESSUP, 0, backlight_binding, ec); weston_compositor_add_key_binding(ec, KEY_K, mod, force_kill_binding, shell); weston_compositor_add_key_binding(ec, KEY_UP, mod, workspace_up_binding, shell); weston_compositor_add_key_binding(ec, KEY_DOWN, mod, workspace_down_binding, shell); weston_compositor_add_key_binding(ec, KEY_UP, mod | MODIFIER_SHIFT, workspace_move_surface_up_binding, shell); weston_compositor_add_key_binding(ec, KEY_DOWN, mod | MODIFIER_SHIFT, workspace_move_surface_down_binding, shell); if (shell->exposay_modifier) weston_compositor_add_modifier_binding(ec, shell->exposay_modifier, exposay_binding, shell); /* Add bindings for mod+F[1-6] for workspace 1 to 6. */ if (shell->workspaces.num > 1) { num_workspace_bindings = shell->workspaces.num; if (num_workspace_bindings > 6) num_workspace_bindings = 6; for (i = 0; i < num_workspace_bindings; i++) weston_compositor_add_key_binding(ec, KEY_F1 + i, mod, workspace_f_binding, shell); } weston_install_debug_key_binding(ec, mod); } static void handle_seat_created(struct wl_listener *listener, void *data) { struct weston_seat *seat = data; create_shell_seat(seat); } WL_EXPORT int module_init(struct weston_compositor *ec, int *argc, char *argv[]) { struct weston_seat *seat; struct desktop_shell *shell; struct workspace **pws; unsigned int i; struct wl_event_loop *loop; shell = zalloc(sizeof *shell); if (shell == NULL) return -1; shell->compositor = ec; shell->destroy_listener.notify = shell_destroy; wl_signal_add(&ec->destroy_signal, &shell->destroy_listener); shell->idle_listener.notify = idle_handler; wl_signal_add(&ec->idle_signal, &shell->idle_listener); shell->wake_listener.notify = wake_handler; wl_signal_add(&ec->wake_signal, &shell->wake_listener); ec->shell_interface.shell = shell; ec->shell_interface.create_shell_surface = create_shell_surface; ec->shell_interface.get_primary_view = get_primary_view; ec->shell_interface.set_toplevel = set_toplevel; ec->shell_interface.set_transient = set_transient; ec->shell_interface.set_fullscreen = shell_interface_set_fullscreen; ec->shell_interface.set_xwayland = set_xwayland; ec->shell_interface.move = shell_interface_move; ec->shell_interface.resize = shell_interface_resize; ec->shell_interface.set_title = set_title; ec->shell_interface.set_window_geometry = set_window_geometry; ec->shell_interface.set_maximized = shell_interface_set_maximized; ec->shell_interface.set_pid = set_pid; weston_layer_init(&shell->fullscreen_layer, &ec->cursor_layer.link); weston_layer_init(&shell->panel_layer, &shell->fullscreen_layer.link); weston_layer_init(&shell->background_layer, &shell->panel_layer.link); weston_layer_init(&shell->lock_layer, NULL); weston_layer_init(&shell->input_panel_layer, NULL); wl_array_init(&shell->workspaces.array); wl_list_init(&shell->workspaces.client_list); if (input_panel_setup(shell) < 0) return -1; shell->text_backend = text_backend_init(ec); if (!shell->text_backend) return -1; shell_configuration(shell); shell->exposay.state_cur = EXPOSAY_LAYOUT_INACTIVE; shell->exposay.state_target = EXPOSAY_TARGET_CANCEL; for (i = 0; i < shell->workspaces.num; i++) { pws = wl_array_add(&shell->workspaces.array, sizeof *pws); if (pws == NULL) return -1; *pws = workspace_create(); if (*pws == NULL) return -1; } activate_workspace(shell, 0); weston_layer_init(&shell->minimized_layer, NULL); wl_list_init(&shell->workspaces.anim_sticky_list); wl_list_init(&shell->workspaces.animation.link); shell->workspaces.animation.frame = animate_workspace_change_frame; if (wl_global_create(ec->wl_display, &wl_shell_interface, 1, shell, bind_shell) == NULL) return -1; if (wl_global_create(ec->wl_display, &xdg_shell_interface, 1, shell, bind_xdg_shell) == NULL) return -1; if (wl_global_create(ec->wl_display, &desktop_shell_interface, 3, shell, bind_desktop_shell) == NULL) return -1; if (wl_global_create(ec->wl_display, &workspace_manager_interface, 1, shell, bind_workspace_manager) == NULL) return -1; shell->child.deathstamp = weston_compositor_get_time(); shell->panel_position = DESKTOP_SHELL_PANEL_POSITION_TOP; setup_output_destroy_handler(ec, shell); loop = wl_display_get_event_loop(ec->wl_display); wl_event_loop_add_idle(loop, launch_desktop_shell_process, shell); wl_list_for_each(seat, &ec->seat_list, link) handle_seat_created(NULL, seat); shell->seat_create_listener.notify = handle_seat_created; wl_signal_add(&ec->seat_created_signal, &shell->seat_create_listener); screenshooter_create(ec); shell_add_bindings(ec, shell); shell_fade_init(shell); clock_gettime(CLOCK_MONOTONIC, &shell->startup_time); return 0; } weston-1.9.0/shared/0000775000175000017500000000000012600133270011303 500000000000000weston-1.9.0/shared/helpers.h0000664000175000017500000000540412575610240013051 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_HELPERS_H #define WESTON_HELPERS_H #ifdef __cplusplus extern "C" { #endif /** * @file * Simple misc helper macros. */ /** * Compile-time computation of number of items in a hardcoded array. * * @param a the array being measured. * @return the number of items hardcoded into the array. */ #ifndef ARRAY_LENGTH #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) #endif /** * Returns the smaller of two values. * * @param x the first item to compare. * @param y the second item to compare. * @return the value that evaluates to lesser than the other. */ #ifndef MIN #define MIN(x,y) (((x) < (y)) ? (x) : (y)) #endif /** * Returns a pointer the the containing struct of a given member item. * * To demonstrate, the following example retrieves a pointer to * `example_container` given only its `destroy_listener` member: * * @code * struct example_container { * struct wl_listener destroy_listener; * // other members... * }; * * void example_container_destroy(struct wl_listener *listener, void *data) * { * struct example_container *ctr; * * ctr = wl_container_of(listener, ctr, destroy_listener); * // destroy ctr... * } * @endcode * * @param ptr A valid pointer to the contained item. * * @param type A pointer to the type of content that the list item * stores. Type does not need be a valid pointer; a null or * an uninitialised pointer will suffice. * * @param member The named location of ptr within the sample type. * * @return The container for the specified pointer. */ #ifndef container_of #define container_of(ptr, type, member) ({ \ const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) #endif #ifdef __cplusplus } #endif #endif /* WESTON_HELPERS_H */ weston-1.9.0/shared/timespec-util.h0000664000175000017500000000411612552056467014204 00000000000000/* * Copyright © 2014 - 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef TIMESPEC_UTIL_H #define TIMESPEC_UTIL_H #include #include #define NSEC_PER_SEC 1000000000 /* Subtract timespecs * * \param r[out] result: a - b * \param a[in] operand * \param b[in] operand */ static inline void timespec_sub(struct timespec *r, const struct timespec *a, const struct timespec *b) { r->tv_sec = a->tv_sec - b->tv_sec; r->tv_nsec = a->tv_nsec - b->tv_nsec; if (r->tv_nsec < 0) { r->tv_sec--; r->tv_nsec += NSEC_PER_SEC; } } /* Convert timespec to nanoseconds * * \param a timespec * \return nanoseconds */ static inline int64_t timespec_to_nsec(const struct timespec *a) { return (int64_t)a->tv_sec * NSEC_PER_SEC + a->tv_nsec; } /* Convert milli-Hertz to nanoseconds * * \param mhz frequency in mHz, not zero * \return period in nanoseconds */ static inline int64_t millihz_to_nsec(uint32_t mhz) { assert(mhz > 0); return 1000000000000LL / mhz; } #endif /* TIMESPEC_UTIL_H */ weston-1.9.0/shared/file-util.c0000664000175000017500000000632512537627702013310 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "file-util.h" static int current_time_str(char *str, size_t len, const char *fmt) { time_t t; struct tm *t_local; int ret; t = time(NULL); t_local = localtime(&t); if (!t_local) { errno = ETIME; return -1; } ret = strftime(str, len, fmt, t_local); if (ret == 0) { errno = ETIME; return -1; } return ret; } static int create_file_excl(const char *fname) { return open(fname, O_RDWR | O_CLOEXEC | O_CREAT | O_EXCL, 00666); } /** Create a unique file with date and time in the name * * \param path_prefix Path and file name prefix. * \param suffix File name suffix. * \param name_out[out] Buffer for the resulting file name. * \param name_len Number of bytes usable in name_out. * \return stdio FILE pointer, or NULL on failure. * * Create and open a new file with the name concatenated from * path_prefix, date and time, and suffix. If a file with this name * already exists, an counter number is added to the end of the * date and time sub-string. The counter is increased until a free file * name is found. * * Once creating the file succeeds, the name of the file is in name_out. * On failure, the contents of name_out are undefined and errno is set. */ FILE * file_create_dated(const char *path_prefix, const char *suffix, char *name_out, size_t name_len) { char timestr[128]; int ret; int fd; int cnt = 0; if (current_time_str(timestr, sizeof(timestr), "%F_%H-%M-%S") < 0) return NULL; ret = snprintf(name_out, name_len, "%s%s%s", path_prefix, timestr, suffix); if (ret < 0 || (size_t)ret >= name_len) { errno = ENOBUFS; return NULL; } fd = create_file_excl(name_out); while (fd == -1 && errno == EEXIST) { cnt++; ret = snprintf(name_out, name_len, "%s%s-%d%s", path_prefix, timestr, cnt, suffix); if (ret < 0 || (size_t)ret >= name_len) { errno = ENOBUFS; return NULL; } fd = create_file_excl(name_out); } if (fd == -1) return NULL; return fdopen(fd, "w"); } weston-1.9.0/shared/matrix.h0000664000175000017500000000472512537627702012731 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_MATRIX_H #define WESTON_MATRIX_H #ifdef __cplusplus extern "C" { #endif enum weston_matrix_transform_type { WESTON_MATRIX_TRANSFORM_TRANSLATE = (1 << 0), WESTON_MATRIX_TRANSFORM_SCALE = (1 << 1), WESTON_MATRIX_TRANSFORM_ROTATE = (1 << 2), WESTON_MATRIX_TRANSFORM_OTHER = (1 << 3), }; struct weston_matrix { float d[16]; unsigned int type; }; struct weston_vector { float f[4]; }; void weston_matrix_init(struct weston_matrix *matrix); void weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n); void weston_matrix_scale(struct weston_matrix *matrix, float x, float y, float z); void weston_matrix_translate(struct weston_matrix *matrix, float x, float y, float z); void weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin); void weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v); int weston_matrix_invert(struct weston_matrix *inverse, const struct weston_matrix *matrix); #ifdef UNIT_TEST # define MATRIX_TEST_EXPORT WL_EXPORT int matrix_invert(double *A, unsigned *p, const struct weston_matrix *matrix); void inverse_transform(const double *LU, const unsigned *p, float *v); #else # define MATRIX_TEST_EXPORT static #endif #ifdef __cplusplus } #endif #endif /* WESTON_MATRIX_H */ weston-1.9.0/shared/config-parser.c0000664000175000017500000002316612537664716014165 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "config-parser.h" #include "helpers.h" struct weston_config_entry { char *key; char *value; struct wl_list link; }; struct weston_config_section { char *name; struct wl_list entry_list; struct wl_list link; }; struct weston_config { struct wl_list section_list; char path[PATH_MAX]; }; static int open_config_file(struct weston_config *c, const char *name) { const char *config_dir = getenv("XDG_CONFIG_HOME"); const char *home_dir = getenv("HOME"); const char *config_dirs = getenv("XDG_CONFIG_DIRS"); const char *p, *next; int fd; if (name[0] == '/') { snprintf(c->path, sizeof c->path, "%s", name); return open(name, O_RDONLY | O_CLOEXEC); } /* Precedence is given to config files in the home directory, * and then to directories listed in XDG_CONFIG_DIRS and * finally to the current working directory. */ /* $XDG_CONFIG_HOME */ if (config_dir) { snprintf(c->path, sizeof c->path, "%s/%s", config_dir, name); fd = open(c->path, O_RDONLY | O_CLOEXEC); if (fd >= 0) return fd; } /* $HOME/.config */ if (home_dir) { snprintf(c->path, sizeof c->path, "%s/.config/%s", home_dir, name); fd = open(c->path, O_RDONLY | O_CLOEXEC); if (fd >= 0) return fd; } /* For each $XDG_CONFIG_DIRS: weston/ */ if (!config_dirs) config_dirs = "/etc/xdg"; /* See XDG base dir spec. */ for (p = config_dirs; *p != '\0'; p = next) { next = strchrnul(p, ':'); snprintf(c->path, sizeof c->path, "%.*s/weston/%s", (int)(next - p), p, name); fd = open(c->path, O_RDONLY | O_CLOEXEC); if (fd >= 0) return fd; if (*next == ':') next++; } /* Current working directory. */ snprintf(c->path, sizeof c->path, "./%s", name); return open(c->path, O_RDONLY | O_CLOEXEC); } static struct weston_config_entry * config_section_get_entry(struct weston_config_section *section, const char *key) { struct weston_config_entry *e; if (section == NULL) return NULL; wl_list_for_each(e, §ion->entry_list, link) if (strcmp(e->key, key) == 0) return e; return NULL; } WL_EXPORT struct weston_config_section * weston_config_get_section(struct weston_config *config, const char *section, const char *key, const char *value) { struct weston_config_section *s; struct weston_config_entry *e; if (config == NULL) return NULL; wl_list_for_each(s, &config->section_list, link) { if (strcmp(s->name, section) != 0) continue; if (key == NULL) return s; e = config_section_get_entry(s, key); if (e && strcmp(e->value, value) == 0) return s; } return NULL; } WL_EXPORT int weston_config_section_get_int(struct weston_config_section *section, const char *key, int32_t *value, int32_t default_value) { struct weston_config_entry *entry; char *end; entry = config_section_get_entry(section, key); if (entry == NULL) { *value = default_value; errno = ENOENT; return -1; } *value = strtol(entry->value, &end, 0); if (*end != '\0') { *value = default_value; errno = EINVAL; return -1; } return 0; } WL_EXPORT int weston_config_section_get_uint(struct weston_config_section *section, const char *key, uint32_t *value, uint32_t default_value) { struct weston_config_entry *entry; char *end; entry = config_section_get_entry(section, key); if (entry == NULL) { *value = default_value; errno = ENOENT; return -1; } *value = strtoul(entry->value, &end, 0); if (*end != '\0') { *value = default_value; errno = EINVAL; return -1; } return 0; } WL_EXPORT int weston_config_section_get_double(struct weston_config_section *section, const char *key, double *value, double default_value) { struct weston_config_entry *entry; char *end; entry = config_section_get_entry(section, key); if (entry == NULL) { *value = default_value; errno = ENOENT; return -1; } *value = strtod(entry->value, &end); if (*end != '\0') { *value = default_value; errno = EINVAL; return -1; } return 0; } WL_EXPORT int weston_config_section_get_string(struct weston_config_section *section, const char *key, char **value, const char *default_value) { struct weston_config_entry *entry; entry = config_section_get_entry(section, key); if (entry == NULL) { if (default_value) *value = strdup(default_value); else *value = NULL; errno = ENOENT; return -1; } *value = strdup(entry->value); return 0; } WL_EXPORT int weston_config_section_get_bool(struct weston_config_section *section, const char *key, int *value, int default_value) { struct weston_config_entry *entry; entry = config_section_get_entry(section, key); if (entry == NULL) { *value = default_value; errno = ENOENT; return -1; } if (strcmp(entry->value, "false") == 0) *value = 0; else if (strcmp(entry->value, "true") == 0) *value = 1; else { *value = default_value; errno = EINVAL; return -1; } return 0; } WL_EXPORT const char * weston_config_get_libexec_dir(void) { const char *path = getenv("WESTON_BUILD_DIR"); if (path) return path; return LIBEXECDIR; } const char * weston_config_get_name_from_env(void) { const char *name; name = getenv(WESTON_CONFIG_FILE_ENV_VAR); if (name) return name; return "weston.ini"; } static struct weston_config_section * config_add_section(struct weston_config *config, const char *name) { struct weston_config_section *section; section = malloc(sizeof *section); section->name = strdup(name); wl_list_init(§ion->entry_list); wl_list_insert(config->section_list.prev, §ion->link); return section; } static struct weston_config_entry * section_add_entry(struct weston_config_section *section, const char *key, const char *value) { struct weston_config_entry *entry; entry = malloc(sizeof *entry); entry->key = strdup(key); entry->value = strdup(value); wl_list_insert(section->entry_list.prev, &entry->link); return entry; } struct weston_config * weston_config_parse(const char *name) { FILE *fp; char line[512], *p; struct stat filestat; struct weston_config *config; struct weston_config_section *section = NULL; int i, fd; config = malloc(sizeof *config); if (config == NULL) return NULL; wl_list_init(&config->section_list); fd = open_config_file(config, name); if (fd == -1) { free(config); return NULL; } if (fstat(fd, &filestat) < 0 || !S_ISREG(filestat.st_mode)) { close(fd); free(config); return NULL; } fp = fdopen(fd, "r"); if (fp == NULL) { free(config); return NULL; } while (fgets(line, sizeof line, fp)) { switch (line[0]) { case '#': case '\n': continue; case '[': p = strchr(&line[1], ']'); if (!p || p[1] != '\n') { fprintf(stderr, "malformed " "section header: %s\n", line); fclose(fp); weston_config_destroy(config); return NULL; } p[0] = '\0'; section = config_add_section(config, &line[1]); continue; default: p = strchr(line, '='); if (!p || p == line || !section) { fprintf(stderr, "malformed " "config line: %s\n", line); fclose(fp); weston_config_destroy(config); return NULL; } p[0] = '\0'; p++; while (isspace(*p)) p++; i = strlen(p); while (i > 0 && isspace(p[i - 1])) { p[i - 1] = '\0'; i--; } section_add_entry(section, line, p); continue; } } fclose(fp); return config; } const char * weston_config_get_full_path(struct weston_config *config) { return config == NULL ? NULL : config->path; } int weston_config_next_section(struct weston_config *config, struct weston_config_section **section, const char **name) { if (config == NULL) return 0; if (*section == NULL) *section = container_of(config->section_list.next, struct weston_config_section, link); else *section = container_of((*section)->link.next, struct weston_config_section, link); if (&(*section)->link == &config->section_list) return 0; *name = (*section)->name; return 1; } void weston_config_destroy(struct weston_config *config) { struct weston_config_section *s, *next_s; struct weston_config_entry *e, *next_e; if (config == NULL) return; wl_list_for_each_safe(s, next_s, &config->section_list, link) { wl_list_for_each_safe(e, next_e, &s->entry_list, link) { free(e->key); free(e->value); free(e); } free(s->name); free(s); } free(config); } weston-1.9.0/shared/os-compatibility.h0000664000175000017500000000321312552064071014673 00000000000000/* * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef OS_COMPATIBILITY_H #define OS_COMPATIBILITY_H #include "config.h" #include #ifdef HAVE_EXECINFO_H #include #else static inline int backtrace(void **buffer, int size) { return 0; } #endif int os_fd_set_cloexec(int fd); int os_socketpair_cloexec(int domain, int type, int protocol, int *sv); int os_epoll_create_cloexec(void); int os_create_anonymous_file(off_t size); #ifndef HAVE_STRCHRNUL char * strchrnul(const char *s, int c); #endif #endif /* OS_COMPATIBILITY_H */ weston-1.9.0/shared/platform.h0000664000175000017500000000716212537627702013247 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_PLATFORM_H #define WESTON_PLATFORM_H #include #ifdef ENABLE_EGL #include #include #endif #ifndef EGL_PLATFORM_WAYLAND_KHR #define EGL_PLATFORM_WAYLAND_KHR 0x31D8 #endif #ifdef __cplusplus extern "C" { #endif #ifdef ENABLE_EGL #ifndef EGL_EXT_platform_base typedef EGLDisplay (*PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); typedef EGLSurface (*PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); #endif static inline void * weston_platform_get_egl_proc_address(const char *address) { const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); if (extensions && (strstr(extensions, "EGL_EXT_platform_wayland") || strstr(extensions, "EGL_KHR_platform_wayland"))) { return (void *) eglGetProcAddress(address); } return NULL; } static inline EGLDisplay weston_platform_get_egl_display(EGLenum platform, void *native_display, const EGLint *attrib_list) { static PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL; if (!get_platform_display) { get_platform_display = weston_platform_get_egl_proc_address( "eglGetPlatformDisplayEXT"); } if (get_platform_display) return get_platform_display(platform, native_display, attrib_list); return eglGetDisplay((EGLNativeDisplayType) native_display); } static inline EGLSurface weston_platform_create_egl_surface(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list) { static PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window = NULL; if (!create_platform_window) { create_platform_window = weston_platform_get_egl_proc_address( "eglCreatePlatformWindowSurfaceEXT"); } if (create_platform_window) return create_platform_window(dpy, config, native_window, attrib_list); return eglCreateWindowSurface(dpy, config, (EGLNativeWindowType) native_window, attrib_list); } #else /* ENABLE_EGL */ static inline void * weston_platform_get_egl_display(void *platform, void *native_display, const int *attrib_list) { return NULL; } static inline void * weston_platform_create_egl_surface(void *dpy, void *config, void *native_window, const int *attrib_list) { return NULL; } #endif /* ENABLE_EGL */ #ifdef __cplusplus } #endif #endif /* WESTON_PLATFORM_H */ weston-1.9.0/shared/file-util.h0000664000175000017500000000265012537627702013312 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_FILE_UTIL_H #define WESTON_FILE_UTIL_H #ifdef __cplusplus extern "C" { #endif #include FILE * file_create_dated(const char *path_prefix, const char *suffix, char *name_out, size_t name_len); #ifdef __cplusplus } #endif #endif /* WESTON_FILE_UTIL_H */ weston-1.9.0/shared/image-loader.c0000664000175000017500000002267412537664701013751 00000000000000/* * Copyright © 2008-2012 Kristian Høgsberg * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "shared/helpers.h" #include "image-loader.h" #ifdef HAVE_WEBP #include #endif static int stride_for_width(int width) { return width * 4; } static void swizzle_row(JSAMPLE *row, JDIMENSION width) { JSAMPLE *s; uint32_t *d; s = row + (width - 1) * 3; d = (uint32_t *) (row + (width - 1) * 4); while (s >= row) { *d = 0xff000000 | (s[0] << 16) | (s[1] << 8) | (s[2] << 0); s -= 3; d--; } } static void error_exit(j_common_ptr cinfo) { longjmp(cinfo->client_data, 1); } static void pixman_image_destroy_func(pixman_image_t *image, void *data) { free(data); } static pixman_image_t * load_jpeg(FILE *fp) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; pixman_image_t *pixman_image = NULL; unsigned int i; int stride, first; JSAMPLE *data, *rows[4]; jmp_buf env; cinfo.err = jpeg_std_error(&jerr); jerr.error_exit = error_exit; cinfo.client_data = env; if (setjmp(env)) return NULL; jpeg_create_decompress(&cinfo); jpeg_stdio_src(&cinfo, fp); jpeg_read_header(&cinfo, TRUE); cinfo.out_color_space = JCS_RGB; jpeg_start_decompress(&cinfo); stride = cinfo.output_width * 4; data = malloc(stride * cinfo.output_height); if (data == NULL) { fprintf(stderr, "couldn't allocate image data\n"); return NULL; } while (cinfo.output_scanline < cinfo.output_height) { first = cinfo.output_scanline; for (i = 0; i < ARRAY_LENGTH(rows); i++) rows[i] = data + (first + i) * stride; jpeg_read_scanlines(&cinfo, rows, ARRAY_LENGTH(rows)); for (i = 0; first + i < cinfo.output_scanline; i++) swizzle_row(rows[i], cinfo.output_width); } jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); pixman_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, cinfo.output_width, cinfo.output_height, (uint32_t *) data, stride); pixman_image_set_destroy_function(pixman_image, pixman_image_destroy_func, data); return pixman_image; } static inline int multiply_alpha(int alpha, int color) { int temp = (alpha * color) + 0x80; return ((temp + (temp >> 8)) >> 8); } static void premultiply_data(png_structp png, png_row_infop row_info, png_bytep data) { unsigned int i; png_bytep p; for (i = 0, p = data; i < row_info->rowbytes; i += 4, p += 4) { png_byte alpha = p[3]; uint32_t w; if (alpha == 0) { w = 0; } else { png_byte red = p[0]; png_byte green = p[1]; png_byte blue = p[2]; if (alpha != 0xff) { red = multiply_alpha(alpha, red); green = multiply_alpha(alpha, green); blue = multiply_alpha(alpha, blue); } w = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0); } * (uint32_t *) p = w; } } static void read_func(png_structp png, png_bytep data, png_size_t size) { FILE *fp = png_get_io_ptr(png); if (fread(data, 1, size, fp) != size) png_error(png, NULL); } static void png_error_callback(png_structp png, png_const_charp error_msg) { longjmp (png_jmpbuf (png), 1); } static pixman_image_t * load_png(FILE *fp) { png_struct *png; png_info *info; png_byte *data = NULL; png_byte **row_pointers = NULL; png_uint_32 width, height; int depth, color_type, interlace, stride; unsigned int i; pixman_image_t *pixman_image = NULL; png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, png_error_callback, NULL); if (!png) return NULL; info = png_create_info_struct(png); if (!info) { png_destroy_read_struct(&png, &info, NULL); return NULL; } if (setjmp(png_jmpbuf(png))) { if (data) free(data); if (row_pointers) free(row_pointers); png_destroy_read_struct(&png, &info, NULL); return NULL; } png_set_read_fn(png, fp, read_func); png_read_info(png, info); png_get_IHDR(png, info, &width, &height, &depth, &color_type, &interlace, NULL, NULL); if (color_type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); if (color_type == PNG_COLOR_TYPE_GRAY) png_set_expand_gray_1_2_4_to_8(png); if (png_get_valid(png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png); if (depth == 16) png_set_strip_16(png); if (depth < 8) png_set_packing(png); if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(png); if (interlace != PNG_INTERLACE_NONE) png_set_interlace_handling(png); png_set_filler(png, 0xff, PNG_FILLER_AFTER); png_set_read_user_transform_fn(png, premultiply_data); png_read_update_info(png, info); png_get_IHDR(png, info, &width, &height, &depth, &color_type, &interlace, NULL, NULL); stride = stride_for_width(width); data = malloc(stride * height); if (!data) { png_destroy_read_struct(&png, &info, NULL); return NULL; } row_pointers = malloc(height * sizeof row_pointers[0]); if (row_pointers == NULL) { free(data); png_destroy_read_struct(&png, &info, NULL); return NULL; } for (i = 0; i < height; i++) row_pointers[i] = &data[i * stride]; png_read_image(png, row_pointers); png_read_end(png, info); free(row_pointers); png_destroy_read_struct(&png, &info, NULL); pixman_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, width, height, (uint32_t *) data, stride); pixman_image_set_destroy_function(pixman_image, pixman_image_destroy_func, data); return pixman_image; } #ifdef HAVE_WEBP static pixman_image_t * load_webp(FILE *fp) { WebPDecoderConfig config; uint8_t buffer[16 * 1024]; int len; VP8StatusCode status; WebPIDecoder *idec; if (!WebPInitDecoderConfig(&config)) { fprintf(stderr, "Library version mismatch!\n"); return NULL; } /* webp decoding api doesn't seem to specify a min size that's usable for GetFeatures, but 256 works... */ len = fread(buffer, 1, 256, fp); status = WebPGetFeatures(buffer, len, &config.input); if (status != VP8_STATUS_OK) { fprintf(stderr, "failed to parse webp header\n"); WebPFreeDecBuffer(&config.output); return NULL; } config.output.colorspace = MODE_BGRA; config.output.u.RGBA.stride = stride_for_width(config.input.width); config.output.u.RGBA.size = config.output.u.RGBA.stride * config.input.height; config.output.u.RGBA.rgba = malloc(config.output.u.RGBA.stride * config.input.height); config.output.is_external_memory = 1; if (!config.output.u.RGBA.rgba) { WebPFreeDecBuffer(&config.output); return NULL; } rewind(fp); idec = WebPINewDecoder(&config.output); if (!idec) { WebPFreeDecBuffer(&config.output); return NULL; } while (!feof(fp)) { len = fread(buffer, 1, sizeof buffer, fp); status = WebPIAppend(idec, buffer, len); if (status != VP8_STATUS_OK) { fprintf(stderr, "webp decode status %d\n", status); WebPIDelete(idec); WebPFreeDecBuffer(&config.output); return NULL; } } WebPIDelete(idec); WebPFreeDecBuffer(&config.output); return pixman_image_create_bits(PIXMAN_a8r8g8b8, config.input.width, config.input.height, (uint32_t *) config.output.u.RGBA.rgba, config.output.u.RGBA.stride); } #endif struct image_loader { unsigned char header[4]; int header_size; pixman_image_t *(*load)(FILE *fp); }; static const struct image_loader loaders[] = { { { 0x89, 'P', 'N', 'G' }, 4, load_png }, { { 0xff, 0xd8 }, 2, load_jpeg }, #ifdef HAVE_WEBP { { 'R', 'I', 'F', 'F' }, 4, load_webp } #endif }; pixman_image_t * load_image(const char *filename) { pixman_image_t *image; unsigned char header[4]; FILE *fp; unsigned int i; if (!filename || !*filename) return NULL; fp = fopen(filename, "rb"); if (!fp) { fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return NULL; } if (fread(header, sizeof header, 1, fp) != 1) { fclose(fp); fprintf(stderr, "%s: unable to read file header\n", filename); return NULL; } rewind(fp); for (i = 0; i < ARRAY_LENGTH(loaders); i++) { if (memcmp(header, loaders[i].header, loaders[i].header_size) == 0) { image = loaders[i].load(fp); break; } } fclose(fp); if (i == ARRAY_LENGTH(loaders)) { fprintf(stderr, "%s: unrecognized file header " "0x%02x 0x%02x 0x%02x 0x%02x\n", filename, header[0], header[1], header[2], header[3]); image = NULL; } else if (!image) { /* load probably printed something, but just in case */ fprintf(stderr, "%s: error reading image\n", filename); } return image; } weston-1.9.0/shared/zalloc.h0000664000175000017500000000257012537627702012705 00000000000000/* * Copyright © 2013 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_ZALLOC_H #define WESTON_ZALLOC_H #ifdef __cplusplus extern "C" { #endif #include static inline void * zalloc(size_t size) { return calloc(1, size); } #ifdef __cplusplus } #endif #endif /* WESTON_ZALLOC_H */ weston-1.9.0/shared/cairo-util.c0000664000175000017500000003627012537664701013470 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "cairo-util.h" #include "shared/helpers.h" #include "image-loader.h" #include "config-parser.h" void surface_flush_device(cairo_surface_t *surface) { cairo_device_t *device; device = cairo_surface_get_device(surface); if (device) cairo_device_flush(device); } static int blur_surface(cairo_surface_t *surface, int margin) { int32_t width, height, stride, x, y, z, w; uint8_t *src, *dst; uint32_t *s, *d, a, p; int i, j, k, size, half; uint32_t kernel[71]; double f; size = ARRAY_LENGTH(kernel); width = cairo_image_surface_get_width(surface); height = cairo_image_surface_get_height(surface); stride = cairo_image_surface_get_stride(surface); src = cairo_image_surface_get_data(surface); dst = malloc(height * stride); if (dst == NULL) return -1; half = size / 2; a = 0; for (i = 0; i < size; i++) { f = (i - half); kernel[i] = exp(- f * f / ARRAY_LENGTH(kernel)) * 10000; a += kernel[i]; } for (i = 0; i < height; i++) { s = (uint32_t *) (src + i * stride); d = (uint32_t *) (dst + i * stride); for (j = 0; j < width; j++) { if (margin < j && j < width - margin) { d[j] = s[j]; continue; } x = 0; y = 0; z = 0; w = 0; for (k = 0; k < size; k++) { if (j - half + k < 0 || j - half + k >= width) continue; p = s[j - half + k]; x += (p >> 24) * kernel[k]; y += ((p >> 16) & 0xff) * kernel[k]; z += ((p >> 8) & 0xff) * kernel[k]; w += (p & 0xff) * kernel[k]; } d[j] = (x / a << 24) | (y / a << 16) | (z / a << 8) | w / a; } } for (i = 0; i < height; i++) { s = (uint32_t *) (dst + i * stride); d = (uint32_t *) (src + i * stride); for (j = 0; j < width; j++) { if (margin <= i && i < height - margin) { d[j] = s[j]; continue; } x = 0; y = 0; z = 0; w = 0; for (k = 0; k < size; k++) { if (i - half + k < 0 || i - half + k >= height) continue; s = (uint32_t *) (dst + (i - half + k) * stride); p = s[j]; x += (p >> 24) * kernel[k]; y += ((p >> 16) & 0xff) * kernel[k]; z += ((p >> 8) & 0xff) * kernel[k]; w += (p & 0xff) * kernel[k]; } d[j] = (x / a << 24) | (y / a << 16) | (z / a << 8) | w / a; } } free(dst); cairo_surface_mark_dirty(surface); return 0; } void render_shadow(cairo_t *cr, cairo_surface_t *surface, int x, int y, int width, int height, int margin, int top_margin) { cairo_pattern_t *pattern; cairo_matrix_t matrix; int i, fx, fy, shadow_height, shadow_width; cairo_set_source_rgba(cr, 0, 0, 0, 0.45); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); pattern = cairo_pattern_create_for_surface (surface); cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST); for (i = 0; i < 4; i++) { /* when fy is set, then we are working with lower corners, * when fx is set, then we are working with right corners * * 00 ------- 01 * | | * | | * 10 ------- 11 */ fx = i & 1; fy = i >> 1; cairo_matrix_init_translate(&matrix, -x + fx * (128 - width), -y + fy * (128 - height)); cairo_pattern_set_matrix(pattern, &matrix); shadow_width = margin; shadow_height = fy ? margin : top_margin; /* if the shadows together are greater than the surface, we need * to fix it - set the shadow size to the half of * the size of surface. Also handle the case when the size is * not divisible by 2. In that case we need one part of the * shadow to be one pixel greater. !fy or !fx, respectively, * will do the work. */ if (height < 2 * shadow_height) shadow_height = (height + !fy) / 2; if (width < 2 * shadow_width) shadow_width = (width + !fx) / 2; cairo_reset_clip(cr); cairo_rectangle(cr, x + fx * (width - shadow_width), y + fy * (height - shadow_height), shadow_width, shadow_height); cairo_clip (cr); cairo_mask(cr, pattern); } shadow_width = width - 2 * margin; shadow_height = top_margin; if (height < 2 * shadow_height) shadow_height = height / 2; if (shadow_width > 0 && shadow_height) { /* Top stretch */ cairo_matrix_init_translate(&matrix, 60, 0); cairo_matrix_scale(&matrix, 8.0 / width, 1); cairo_matrix_translate(&matrix, -x - width / 2, -y); cairo_pattern_set_matrix(pattern, &matrix); cairo_rectangle(cr, x + margin, y, shadow_width, shadow_height); cairo_reset_clip(cr); cairo_rectangle(cr, x + margin, y, shadow_width, shadow_height); cairo_clip (cr); cairo_mask(cr, pattern); /* Bottom stretch */ cairo_matrix_translate(&matrix, 0, -height + 128); cairo_pattern_set_matrix(pattern, &matrix); cairo_reset_clip(cr); cairo_rectangle(cr, x + margin, y + height - margin, shadow_width, margin); cairo_clip (cr); cairo_mask(cr, pattern); } shadow_width = margin; if (width < 2 * shadow_width) shadow_width = width / 2; shadow_height = height - margin - top_margin; /* if height is smaller than sum of margins, * then the shadow is already done by the corners */ if (shadow_height > 0 && shadow_width) { /* Left stretch */ cairo_matrix_init_translate(&matrix, 0, 60); cairo_matrix_scale(&matrix, 1, 8.0 / height); cairo_matrix_translate(&matrix, -x, -y - height / 2); cairo_pattern_set_matrix(pattern, &matrix); cairo_reset_clip(cr); cairo_rectangle(cr, x, y + top_margin, shadow_width, shadow_height); cairo_clip (cr); cairo_mask(cr, pattern); /* Right stretch */ cairo_matrix_translate(&matrix, -width + 128, 0); cairo_pattern_set_matrix(pattern, &matrix); cairo_rectangle(cr, x + width - shadow_width, y + top_margin, shadow_width, shadow_height); cairo_reset_clip(cr); cairo_clip (cr); cairo_mask(cr, pattern); } cairo_pattern_destroy(pattern); cairo_reset_clip(cr); } void tile_source(cairo_t *cr, cairo_surface_t *surface, int x, int y, int width, int height, int margin, int top_margin) { cairo_pattern_t *pattern; cairo_matrix_t matrix; int i, fx, fy, vmargin; cairo_set_operator(cr, CAIRO_OPERATOR_OVER); pattern = cairo_pattern_create_for_surface (surface); cairo_pattern_set_filter(pattern, CAIRO_FILTER_NEAREST); cairo_set_source(cr, pattern); cairo_pattern_destroy(pattern); for (i = 0; i < 4; i++) { fx = i & 1; fy = i >> 1; cairo_matrix_init_translate(&matrix, -x + fx * (128 - width), -y + fy * (128 - height)); cairo_pattern_set_matrix(pattern, &matrix); if (fy) vmargin = margin; else vmargin = top_margin; cairo_rectangle(cr, x + fx * (width - margin), y + fy * (height - vmargin), margin, vmargin); cairo_fill(cr); } /* Top stretch */ cairo_matrix_init_translate(&matrix, 60, 0); cairo_matrix_scale(&matrix, 8.0 / (width - 2 * margin), 1); cairo_matrix_translate(&matrix, -x - width / 2, -y); cairo_pattern_set_matrix(pattern, &matrix); cairo_rectangle(cr, x + margin, y, width - 2 * margin, top_margin); cairo_fill(cr); /* Bottom stretch */ cairo_matrix_translate(&matrix, 0, -height + 128); cairo_pattern_set_matrix(pattern, &matrix); cairo_rectangle(cr, x + margin, y + height - margin, width - 2 * margin, margin); cairo_fill(cr); /* Left stretch */ cairo_matrix_init_translate(&matrix, 0, 60); cairo_matrix_scale(&matrix, 1, 8.0 / (height - margin - top_margin)); cairo_matrix_translate(&matrix, -x, -y - height / 2); cairo_pattern_set_matrix(pattern, &matrix); cairo_rectangle(cr, x, y + top_margin, margin, height - margin - top_margin); cairo_fill(cr); /* Right stretch */ cairo_matrix_translate(&matrix, -width + 128, 0); cairo_pattern_set_matrix(pattern, &matrix); cairo_rectangle(cr, x + width - margin, y + top_margin, margin, height - margin - top_margin); cairo_fill(cr); } void rounded_rect(cairo_t *cr, int x0, int y0, int x1, int y1, int radius) { cairo_move_to(cr, x0, y0 + radius); cairo_arc(cr, x0 + radius, y0 + radius, radius, M_PI, 3 * M_PI / 2); cairo_line_to(cr, x1 - radius, y0); cairo_arc(cr, x1 - radius, y0 + radius, radius, 3 * M_PI / 2, 2 * M_PI); cairo_line_to(cr, x1, y1 - radius); cairo_arc(cr, x1 - radius, y1 - radius, radius, 0, M_PI / 2); cairo_line_to(cr, x0 + radius, y1); cairo_arc(cr, x0 + radius, y1 - radius, radius, M_PI / 2, M_PI); cairo_close_path(cr); } cairo_surface_t * load_cairo_surface(const char *filename) { pixman_image_t *image; int width, height, stride; void *data; image = load_image(filename); if (image == NULL) { return NULL; } data = pixman_image_get_data(image); width = pixman_image_get_width(image); height = pixman_image_get_height(image); stride = pixman_image_get_stride(image); return cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, width, height, stride); } void theme_set_background_source(struct theme *t, cairo_t *cr, uint32_t flags) { cairo_pattern_t *pattern; if (flags & THEME_FRAME_ACTIVE) { pattern = cairo_pattern_create_linear(16, 16, 16, 112); cairo_pattern_add_color_stop_rgb(pattern, 0.0, 1.0, 1.0, 1.0); cairo_pattern_add_color_stop_rgb(pattern, 0.2, 0.8, 0.8, 0.8); cairo_set_source(cr, pattern); cairo_pattern_destroy(pattern); } else { cairo_set_source_rgba(cr, 0.75, 0.75, 0.75, 1); } } struct theme * theme_create(void) { struct theme *t; cairo_t *cr; t = malloc(sizeof *t); if (t == NULL) return NULL; t->margin = 32; t->width = 6; t->titlebar_height = 27; t->frame_radius = 3; t->shadow = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 128, 128); cr = cairo_create(t->shadow); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_set_source_rgba(cr, 0, 0, 0, 1); rounded_rect(cr, 32, 32, 96, 96, t->frame_radius); cairo_fill(cr); if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) goto err_shadow; cairo_destroy(cr); if (blur_surface(t->shadow, 64) == -1) goto err_shadow; t->active_frame = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 128, 128); cr = cairo_create(t->active_frame); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); theme_set_background_source(t, cr, THEME_FRAME_ACTIVE); rounded_rect(cr, 0, 0, 128, 128, t->frame_radius); cairo_fill(cr); if (cairo_status(cr) != CAIRO_STATUS_SUCCESS) goto err_active_frame; cairo_destroy(cr); t->inactive_frame = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 128, 128); cr = cairo_create(t->inactive_frame); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); theme_set_background_source(t, cr, 0); rounded_rect(cr, 0, 0, 128, 128, t->frame_radius); cairo_fill(cr); if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) goto err_inactive_frame; cairo_destroy(cr); return t; err_inactive_frame: cairo_surface_destroy(t->inactive_frame); err_active_frame: cairo_surface_destroy(t->active_frame); err_shadow: cairo_surface_destroy(t->shadow); free(t); return NULL; } void theme_destroy(struct theme *t) { cairo_surface_destroy(t->active_frame); cairo_surface_destroy(t->inactive_frame); cairo_surface_destroy(t->shadow); free(t); } void theme_render_frame(struct theme *t, cairo_t *cr, int width, int height, const char *title, struct wl_list *buttons, uint32_t flags) { cairo_text_extents_t extents; cairo_font_extents_t font_extents; cairo_surface_t *source; int x, y, margin, top_margin; cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0); cairo_paint(cr); if (flags & THEME_FRAME_MAXIMIZED) margin = 0; else { render_shadow(cr, t->shadow, 2, 2, width + 8, height + 8, 64, 64); margin = t->margin; } if (flags & THEME_FRAME_ACTIVE) source = t->active_frame; else source = t->inactive_frame; if (title || !wl_list_empty(buttons)) top_margin = t->titlebar_height; else top_margin = t->width; tile_source(cr, source, margin, margin, width - margin * 2, height - margin * 2, t->width, top_margin); if (title || !wl_list_empty(buttons)) { cairo_rectangle (cr, margin + t->width, margin, width - (margin + t->width) * 2, t->titlebar_height - t->width); cairo_clip(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr, 14); cairo_text_extents(cr, title, &extents); cairo_font_extents (cr, &font_extents); x = (width - extents.width) / 2; y = margin + (t->titlebar_height - font_extents.ascent - font_extents.descent) / 2 + font_extents.ascent; if (flags & THEME_FRAME_ACTIVE) { cairo_move_to(cr, x + 1, y + 1); cairo_set_source_rgb(cr, 1, 1, 1); cairo_show_text(cr, title); cairo_move_to(cr, x, y); cairo_set_source_rgb(cr, 0, 0, 0); cairo_show_text(cr, title); } else { cairo_move_to(cr, x, y); cairo_set_source_rgb(cr, 0.4, 0.4, 0.4); cairo_show_text(cr, title); } } } enum theme_location theme_get_location(struct theme *t, int x, int y, int width, int height, int flags) { int vlocation, hlocation, location; int margin, top_margin, grip_size; if (flags & THEME_FRAME_MAXIMIZED) { margin = 0; grip_size = 0; } else { margin = t->margin; grip_size = 8; } if (flags & THEME_FRAME_NO_TITLE) top_margin = t->width; else top_margin = t->titlebar_height; if (x < margin) hlocation = THEME_LOCATION_EXTERIOR; else if (x < margin + grip_size) hlocation = THEME_LOCATION_RESIZING_LEFT; else if (x < width - margin - grip_size) hlocation = THEME_LOCATION_INTERIOR; else if (x < width - margin) hlocation = THEME_LOCATION_RESIZING_RIGHT; else hlocation = THEME_LOCATION_EXTERIOR; if (y < margin) vlocation = THEME_LOCATION_EXTERIOR; else if (y < margin + grip_size) vlocation = THEME_LOCATION_RESIZING_TOP; else if (y < height - margin - grip_size) vlocation = THEME_LOCATION_INTERIOR; else if (y < height - margin) vlocation = THEME_LOCATION_RESIZING_BOTTOM; else vlocation = THEME_LOCATION_EXTERIOR; location = vlocation | hlocation; if (location & THEME_LOCATION_EXTERIOR) location = THEME_LOCATION_EXTERIOR; if (location == THEME_LOCATION_INTERIOR && y < margin + top_margin) location = THEME_LOCATION_TITLEBAR; else if (location == THEME_LOCATION_INTERIOR) location = THEME_LOCATION_CLIENT_AREA; return location; } weston-1.9.0/shared/config-parser.h0000664000175000017500000000670112537627702014160 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef CONFIGPARSER_H #define CONFIGPARSER_H #ifdef __cplusplus extern "C" { #endif #define WESTON_CONFIG_FILE_ENV_VAR "WESTON_CONFIG_FILE" enum config_key_type { CONFIG_KEY_INTEGER, /* typeof data = int */ CONFIG_KEY_UNSIGNED_INTEGER, /* typeof data = unsigned int */ CONFIG_KEY_STRING, /* typeof data = char* */ CONFIG_KEY_BOOLEAN /* typeof data = int */ }; struct config_key { const char *name; enum config_key_type type; void *data; }; struct config_section { const char *name; const struct config_key *keys; int num_keys; void (*done)(void *data); }; enum weston_option_type { WESTON_OPTION_INTEGER, WESTON_OPTION_UNSIGNED_INTEGER, WESTON_OPTION_STRING, WESTON_OPTION_BOOLEAN }; struct weston_option { enum weston_option_type type; const char *name; int short_name; void *data; }; int parse_options(const struct weston_option *options, int count, int *argc, char *argv[]); struct weston_config_section; struct weston_config; struct weston_config_section * weston_config_get_section(struct weston_config *config, const char *section, const char *key, const char *value); int weston_config_section_get_int(struct weston_config_section *section, const char *key, int32_t *value, int32_t default_value); int weston_config_section_get_uint(struct weston_config_section *section, const char *key, uint32_t *value, uint32_t default_value); int weston_config_section_get_double(struct weston_config_section *section, const char *key, double *value, double default_value); int weston_config_section_get_string(struct weston_config_section *section, const char *key, char **value, const char *default_value); int weston_config_section_get_bool(struct weston_config_section *section, const char *key, int *value, int default_value); const char * weston_config_get_libexec_dir(void); const char * weston_config_get_name_from_env(void); struct weston_config * weston_config_parse(const char *name); const char * weston_config_get_full_path(struct weston_config *config); void weston_config_destroy(struct weston_config *config); int weston_config_next_section(struct weston_config *config, struct weston_config_section **section, const char **name); #ifdef __cplusplus } #endif #endif /* CONFIGPARSER_H */ weston-1.9.0/shared/matrix.c0000664000175000017500000001442512537627702012722 00000000000000/* * Copyright © 2011 Intel Corporation * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #ifdef IN_WESTON #include #else #define WL_EXPORT #endif #include "matrix.h" /* * Matrices are stored in column-major order, that is the array indices are: * 0 4 8 12 * 1 5 9 13 * 2 6 10 14 * 3 7 11 15 */ WL_EXPORT void weston_matrix_init(struct weston_matrix *matrix) { static const struct weston_matrix identity = { .d = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }, .type = 0, }; memcpy(matrix, &identity, sizeof identity); } /* m <- n * m, that is, m is multiplied on the LEFT. */ WL_EXPORT void weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n) { struct weston_matrix tmp; const float *row, *column; div_t d; int i, j; for (i = 0; i < 16; i++) { tmp.d[i] = 0; d = div(i, 4); row = m->d + d.quot * 4; column = n->d + d.rem; for (j = 0; j < 4; j++) tmp.d[i] += row[j] * column[j * 4]; } tmp.type = m->type | n->type; memcpy(m, &tmp, sizeof tmp); } WL_EXPORT void weston_matrix_translate(struct weston_matrix *matrix, float x, float y, float z) { struct weston_matrix translate = { .d = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1 }, .type = WESTON_MATRIX_TRANSFORM_TRANSLATE, }; weston_matrix_multiply(matrix, &translate); } WL_EXPORT void weston_matrix_scale(struct weston_matrix *matrix, float x, float y,float z) { struct weston_matrix scale = { .d = { x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1 }, .type = WESTON_MATRIX_TRANSFORM_SCALE, }; weston_matrix_multiply(matrix, &scale); } WL_EXPORT void weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin) { struct weston_matrix translate = { .d = { cos, sin, 0, 0, -sin, cos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }, .type = WESTON_MATRIX_TRANSFORM_ROTATE, }; weston_matrix_multiply(matrix, &translate); } /* v <- m * v */ WL_EXPORT void weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v) { int i, j; struct weston_vector t; for (i = 0; i < 4; i++) { t.f[i] = 0; for (j = 0; j < 4; j++) t.f[i] += v->f[j] * matrix->d[i + j * 4]; } *v = t; } static inline void swap_rows(double *a, double *b) { unsigned k; double tmp; for (k = 0; k < 13; k += 4) { tmp = a[k]; a[k] = b[k]; b[k] = tmp; } } static inline void swap_unsigned(unsigned *a, unsigned *b) { unsigned tmp; tmp = *a; *a = *b; *b = tmp; } static inline unsigned find_pivot(double *column, unsigned k) { unsigned p = k; for (++k; k < 4; ++k) if (fabs(column[p]) < fabs(column[k])) p = k; return p; } /* * reference: Gene H. Golub and Charles F. van Loan. Matrix computations. * 3rd ed. The Johns Hopkins University Press. 1996. * LU decomposition, forward and back substitution: Chapter 3. */ MATRIX_TEST_EXPORT inline int matrix_invert(double *A, unsigned *p, const struct weston_matrix *matrix) { unsigned i, j, k; unsigned pivot; double pv; for (i = 0; i < 4; ++i) p[i] = i; for (i = 16; i--; ) A[i] = matrix->d[i]; /* LU decomposition with partial pivoting */ for (k = 0; k < 4; ++k) { pivot = find_pivot(&A[k * 4], k); if (pivot != k) { swap_unsigned(&p[k], &p[pivot]); swap_rows(&A[k], &A[pivot]); } pv = A[k * 4 + k]; if (fabs(pv) < 1e-9) return -1; /* zero pivot, not invertible */ for (i = k + 1; i < 4; ++i) { A[i + k * 4] /= pv; for (j = k + 1; j < 4; ++j) A[i + j * 4] -= A[i + k * 4] * A[k + j * 4]; } } return 0; } MATRIX_TEST_EXPORT inline void inverse_transform(const double *LU, const unsigned *p, float *v) { /* Solve A * x = v, when we have P * A = L * U. * P * A * x = P * v => L * U * x = P * v * Let U * x = b, then L * b = P * v. */ double b[4]; unsigned j; /* Forward substitution, column version, solves L * b = P * v */ /* The diagonal of L is all ones, and not explicitly stored. */ b[0] = v[p[0]]; b[1] = (double)v[p[1]] - b[0] * LU[1 + 0 * 4]; b[2] = (double)v[p[2]] - b[0] * LU[2 + 0 * 4]; b[3] = (double)v[p[3]] - b[0] * LU[3 + 0 * 4]; b[2] -= b[1] * LU[2 + 1 * 4]; b[3] -= b[1] * LU[3 + 1 * 4]; b[3] -= b[2] * LU[3 + 2 * 4]; /* backward substitution, column version, solves U * y = b */ #if 1 /* hand-unrolled, 25% faster for whole function */ b[3] /= LU[3 + 3 * 4]; b[0] -= b[3] * LU[0 + 3 * 4]; b[1] -= b[3] * LU[1 + 3 * 4]; b[2] -= b[3] * LU[2 + 3 * 4]; b[2] /= LU[2 + 2 * 4]; b[0] -= b[2] * LU[0 + 2 * 4]; b[1] -= b[2] * LU[1 + 2 * 4]; b[1] /= LU[1 + 1 * 4]; b[0] -= b[1] * LU[0 + 1 * 4]; b[0] /= LU[0 + 0 * 4]; #else for (j = 3; j > 0; --j) { unsigned k; b[j] /= LU[j + j * 4]; for (k = 0; k < j; ++k) b[k] -= b[j] * LU[k + j * 4]; } b[0] /= LU[0 + 0 * 4]; #endif /* the result */ for (j = 0; j < 4; ++j) v[j] = b[j]; } WL_EXPORT int weston_matrix_invert(struct weston_matrix *inverse, const struct weston_matrix *matrix) { double LU[16]; /* column-major */ unsigned perm[4]; /* permutation */ unsigned c; if (matrix_invert(LU, perm, matrix) < 0) return -1; weston_matrix_init(inverse); for (c = 0; c < 4; ++c) inverse_transform(LU, perm, &inverse->d[c * 4]); inverse->type = matrix->type; return 0; } weston-1.9.0/shared/image-loader.h0000664000175000017500000000241412537627702013744 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _IMAGE_LOADER_H #define _IMAGE_LOADER_H #include pixman_image_t * load_image(const char *filename); #endif weston-1.9.0/shared/cairo-util.h0000664000175000017500000001410312537627702013464 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _CAIRO_UTIL_H #define _CAIRO_UTIL_H #include #include #include void surface_flush_device(cairo_surface_t *surface); void render_shadow(cairo_t *cr, cairo_surface_t *surface, int x, int y, int width, int height, int margin, int top_margin); void tile_source(cairo_t *cr, cairo_surface_t *surface, int x, int y, int width, int height, int margin, int top_margin); void rounded_rect(cairo_t *cr, int x0, int y0, int x1, int y1, int radius); cairo_surface_t * load_cairo_surface(const char *filename); struct theme { cairo_surface_t *active_frame; cairo_surface_t *inactive_frame; cairo_surface_t *shadow; int frame_radius; int margin; int width; int titlebar_height; }; struct theme * theme_create(void); void theme_destroy(struct theme *t); enum { THEME_FRAME_ACTIVE = 1, THEME_FRAME_MAXIMIZED = 2, THEME_FRAME_NO_TITLE = 4 }; void theme_set_background_source(struct theme *t, cairo_t *cr, uint32_t flags); void theme_render_frame(struct theme *t, cairo_t *cr, int width, int height, const char *title, struct wl_list *buttons, uint32_t flags); enum theme_location { THEME_LOCATION_INTERIOR = 0, THEME_LOCATION_RESIZING_TOP = 1, THEME_LOCATION_RESIZING_BOTTOM = 2, THEME_LOCATION_RESIZING_LEFT = 4, THEME_LOCATION_RESIZING_TOP_LEFT = 5, THEME_LOCATION_RESIZING_BOTTOM_LEFT = 6, THEME_LOCATION_RESIZING_RIGHT = 8, THEME_LOCATION_RESIZING_TOP_RIGHT = 9, THEME_LOCATION_RESIZING_BOTTOM_RIGHT = 10, THEME_LOCATION_RESIZING_MASK = 15, THEME_LOCATION_EXTERIOR = 16, THEME_LOCATION_TITLEBAR = 17, THEME_LOCATION_CLIENT_AREA = 18, }; enum theme_location theme_get_location(struct theme *t, int x, int y, int width, int height, int flags); struct frame; enum frame_status { FRAME_STATUS_NONE = 0, FRAME_STATUS_REPAINT = 0x1, FRAME_STATUS_MINIMIZE = 0x2, FRAME_STATUS_MAXIMIZE = 0x4, FRAME_STATUS_CLOSE = 0x8, FRAME_STATUS_MENU = 0x10, FRAME_STATUS_RESIZE = 0x20, FRAME_STATUS_MOVE = 0x40, FRAME_STATUS_ALL = 0x7f }; enum frame_flag { FRAME_FLAG_ACTIVE = 0x1, FRAME_FLAG_MAXIMIZED = 0x2 }; enum { FRAME_BUTTON_NONE = 0, FRAME_BUTTON_CLOSE = 0x1, FRAME_BUTTON_MAXIMIZE = 0x2, FRAME_BUTTON_MINIMIZE = 0x4, FRAME_BUTTON_ALL = 0x7 }; enum frame_button_state { FRAME_BUTTON_RELEASED = 0, FRAME_BUTTON_PRESSED = 1 }; struct frame * frame_create(struct theme *t, int32_t width, int32_t height, uint32_t buttons, const char *title); void frame_destroy(struct frame *frame); /* May set FRAME_STATUS_REPAINT */ int frame_set_title(struct frame *frame, const char *title); /* May set FRAME_STATUS_REPAINT */ void frame_set_flag(struct frame *frame, enum frame_flag flag); /* May set FRAME_STATUS_REPAINT */ void frame_unset_flag(struct frame *frame, enum frame_flag flag); /* May set FRAME_STATUS_REPAINT */ void frame_resize(struct frame *frame, int32_t width, int32_t height); /* May set FRAME_STATUS_REPAINT */ void frame_resize_inside(struct frame *frame, int32_t width, int32_t height); int32_t frame_width(struct frame *frame); int32_t frame_height(struct frame *frame); void frame_interior(struct frame *frame, int32_t *x, int32_t *y, int32_t *width, int32_t *height); void frame_input_rect(struct frame *frame, int32_t *x, int32_t *y, int32_t *width, int32_t *height); void frame_opaque_rect(struct frame *frame, int32_t *x, int32_t *y, int32_t *width, int32_t *height); int frame_get_shadow_margin(struct frame *frame); uint32_t frame_status(struct frame *frame); void frame_status_clear(struct frame *frame, enum frame_status status); /* May set FRAME_STATUS_REPAINT */ enum theme_location frame_pointer_enter(struct frame *frame, void *pointer, int x, int y); /* May set FRAME_STATUS_REPAINT */ enum theme_location frame_pointer_motion(struct frame *frame, void *pointer, int x, int y); /* May set FRAME_STATUS_REPAINT */ void frame_pointer_leave(struct frame *frame, void *pointer); /* Call to indicate that a button has been pressed/released. The return * value for a button release will be the same as for the corresponding * press. This allows you to more easily track grabs. If you want the * actual location, simply keep the location from the last * frame_pointer_motion call. * * May set: * FRAME_STATUS_MINIMIZE * FRAME_STATUS_MAXIMIZE * FRAME_STATUS_CLOSE * FRAME_STATUS_MENU * FRAME_STATUS_RESIZE * FRAME_STATUS_MOVE */ enum theme_location frame_pointer_button(struct frame *frame, void *pointer, uint32_t button, enum frame_button_state state); void frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y); void frame_touch_up(struct frame *frame, void *data, int32_t id); enum theme_location frame_double_click(struct frame *frame, void *pointer, uint32_t button, enum frame_button_state state); void frame_double_touch_down(struct frame *frame, void *data, int32_t id, int x, int y); void frame_double_touch_up(struct frame *frame, void *data, int32_t id); void frame_repaint(struct frame *frame, cairo_t *cr); #endif weston-1.9.0/shared/frame.c0000664000175000017500000005277412537627702012521 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2012-2013 Collabora, Ltd. * Copyright © 2013 Jason Ekstrand * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include "cairo-util.h" enum frame_button_flags { FRAME_BUTTON_ALIGN_RIGHT = 0x1, FRAME_BUTTON_DECORATED = 0x2, FRAME_BUTTON_CLICK_DOWN = 0x4, }; struct frame_button { struct frame *frame; struct wl_list link; /* buttons_list */ cairo_surface_t *icon; enum frame_button_flags flags; int hover_count; int press_count; struct { int x, y; int width, height; } allocation; enum frame_status status_effect; }; struct frame_pointer_button { struct wl_list link; uint32_t button; enum theme_location press_location; struct frame_button *frame_button; }; struct frame_pointer { struct wl_list link; void *data; int x, y; struct frame_button *hover_button; struct wl_list down_buttons; }; struct frame_touch { struct wl_list link; void *data; int x, y; struct frame_button *button; }; struct frame { int32_t width, height; char *title; uint32_t flags; struct theme *theme; struct { int32_t x, y; int32_t width, height; } interior; int shadow_margin; int opaque_margin; int geometry_dirty; uint32_t status; struct wl_list buttons; struct wl_list pointers; struct wl_list touches; }; static struct frame_button * frame_button_create(struct frame *frame, const char *icon, enum frame_status status_effect, enum frame_button_flags flags) { struct frame_button *button; button = calloc(1, sizeof *button); if (!button) return NULL; button->icon = cairo_image_surface_create_from_png(icon); if (!button->icon) { free(button); return NULL; } button->frame = frame; button->flags = flags; button->status_effect = status_effect; wl_list_insert(frame->buttons.prev, &button->link); return button; } static void frame_button_destroy(struct frame_button *button) { cairo_surface_destroy(button->icon); free(button); } static void frame_button_enter(struct frame_button *button) { if (!button->hover_count) button->frame->status |= FRAME_STATUS_REPAINT; button->hover_count++; } static void frame_button_leave(struct frame_button *button, struct frame_pointer *pointer) { button->hover_count--; if (!button->hover_count) button->frame->status |= FRAME_STATUS_REPAINT; } static void frame_button_press(struct frame_button *button) { if (!button->press_count) button->frame->status |= FRAME_STATUS_REPAINT; button->press_count++; if (button->flags & FRAME_BUTTON_CLICK_DOWN) button->frame->status |= button->status_effect; } static void frame_button_release(struct frame_button *button) { button->press_count--; if (button->press_count) return; button->frame->status |= FRAME_STATUS_REPAINT; if (!(button->flags & FRAME_BUTTON_CLICK_DOWN)) button->frame->status |= button->status_effect; } static void frame_button_cancel(struct frame_button *button) { button->press_count--; if (!button->press_count) button->frame->status |= FRAME_STATUS_REPAINT; } static void frame_button_repaint(struct frame_button *button, cairo_t *cr) { int x, y; if (!button->allocation.width) return; if (!button->allocation.height) return; x = button->allocation.x; y = button->allocation.y; cairo_save(cr); if (button->flags & FRAME_BUTTON_DECORATED) { cairo_set_line_width(cr, 1); cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); cairo_rectangle(cr, x, y, 25, 16); cairo_stroke_preserve(cr); if (button->press_count) { cairo_set_source_rgb(cr, 0.7, 0.7, 0.7); } else if (button->hover_count) { cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); } else { cairo_set_source_rgb(cr, 0.88, 0.88, 0.88); } cairo_fill (cr); x += 4; } cairo_set_source_surface(cr, button->icon, x, y); cairo_paint(cr); cairo_restore(cr); } static struct frame_pointer * frame_pointer_get(struct frame *frame, void *data) { struct frame_pointer *pointer; wl_list_for_each(pointer, &frame->pointers, link) if (pointer->data == data) return pointer; pointer = calloc(1, sizeof *pointer); if (!pointer) return NULL; pointer->data = data; wl_list_init(&pointer->down_buttons); wl_list_insert(&frame->pointers, &pointer->link); return pointer; } static void frame_pointer_destroy(struct frame_pointer *pointer) { wl_list_remove(&pointer->link); free(pointer); } static struct frame_touch * frame_touch_get(struct frame *frame, void *data) { struct frame_touch *touch; wl_list_for_each(touch, &frame->touches, link) if (touch->data == data) return touch; touch = calloc(1, sizeof *touch); if (!touch) return NULL; touch->data = data; wl_list_insert(&frame->touches, &touch->link); return touch; } static void frame_touch_destroy(struct frame_touch *touch) { wl_list_remove(&touch->link); free(touch); } void frame_destroy(struct frame *frame) { struct frame_button *button, *next; struct frame_touch *touch, *next_touch; struct frame_pointer *pointer, *next_pointer; wl_list_for_each_safe(button, next, &frame->buttons, link) frame_button_destroy(button); wl_list_for_each_safe(touch, next_touch, &frame->touches, link) frame_touch_destroy(touch); wl_list_for_each_safe(pointer, next_pointer, &frame->pointers, link) frame_pointer_destroy(pointer); free(frame->title); free(frame); } struct frame * frame_create(struct theme *t, int32_t width, int32_t height, uint32_t buttons, const char *title) { struct frame *frame; struct frame_button *button; frame = calloc(1, sizeof *frame); if (!frame) return NULL; frame->width = width; frame->height = height; frame->flags = 0; frame->theme = t; frame->status = FRAME_STATUS_REPAINT; frame->geometry_dirty = 1; wl_list_init(&frame->buttons); wl_list_init(&frame->pointers); wl_list_init(&frame->touches); if (title) { frame->title = strdup(title); if (!frame->title) goto free_frame; } if (title) { button = frame_button_create(frame, DATADIR "/weston/icon_window.png", FRAME_STATUS_MENU, FRAME_BUTTON_CLICK_DOWN); if (!button) goto free_frame; } if (buttons & FRAME_BUTTON_CLOSE) { button = frame_button_create(frame, DATADIR "/weston/sign_close.png", FRAME_STATUS_CLOSE, FRAME_BUTTON_ALIGN_RIGHT | FRAME_BUTTON_DECORATED); if (!button) goto free_frame; } if (buttons & FRAME_BUTTON_MAXIMIZE) { button = frame_button_create(frame, DATADIR "/weston/sign_maximize.png", FRAME_STATUS_MAXIMIZE, FRAME_BUTTON_ALIGN_RIGHT | FRAME_BUTTON_DECORATED); if (!button) goto free_frame; } if (buttons & FRAME_BUTTON_MINIMIZE) { button = frame_button_create(frame, DATADIR "/weston/sign_minimize.png", FRAME_STATUS_MINIMIZE, FRAME_BUTTON_ALIGN_RIGHT | FRAME_BUTTON_DECORATED); if (!button) goto free_frame; } return frame; free_frame: frame_destroy(frame); return NULL; } int frame_set_title(struct frame *frame, const char *title) { char *dup = NULL; if (title) { dup = strdup(title); if (!dup) return -1; } free(frame->title); frame->title = dup; frame->geometry_dirty = 1; frame->status |= FRAME_STATUS_REPAINT; return 0; } void frame_set_flag(struct frame *frame, enum frame_flag flag) { if (flag & FRAME_FLAG_MAXIMIZED && !(frame->flags & FRAME_FLAG_MAXIMIZED)) frame->geometry_dirty = 1; frame->flags |= flag; frame->status |= FRAME_STATUS_REPAINT; } void frame_unset_flag(struct frame *frame, enum frame_flag flag) { if (flag & FRAME_FLAG_MAXIMIZED && frame->flags & FRAME_FLAG_MAXIMIZED) frame->geometry_dirty = 1; frame->flags &= ~flag; frame->status |= FRAME_STATUS_REPAINT; } void frame_resize(struct frame *frame, int32_t width, int32_t height) { frame->width = width; frame->height = height; frame->geometry_dirty = 1; frame->status |= FRAME_STATUS_REPAINT; } void frame_resize_inside(struct frame *frame, int32_t width, int32_t height) { struct theme *t = frame->theme; int decoration_width, decoration_height, titlebar_height; if (frame->title || !wl_list_empty(&frame->buttons)) titlebar_height = t->titlebar_height; else titlebar_height = t->width; if (frame->flags & FRAME_FLAG_MAXIMIZED) { decoration_width = t->width * 2; decoration_height = t->width + titlebar_height; } else { decoration_width = (t->width + t->margin) * 2; decoration_height = t->width + titlebar_height + t->margin * 2; } frame_resize(frame, width + decoration_width, height + decoration_height); } int32_t frame_width(struct frame *frame) { return frame->width; } int32_t frame_height(struct frame *frame) { return frame->height; } static void frame_refresh_geometry(struct frame *frame) { struct frame_button *button; struct theme *t = frame->theme; int x_l, x_r, y, w, h, titlebar_height; int32_t decoration_width, decoration_height; if (!frame->geometry_dirty) return; if (frame->title || !wl_list_empty(&frame->buttons)) titlebar_height = t->titlebar_height; else titlebar_height = t->width; if (frame->flags & FRAME_FLAG_MAXIMIZED) { decoration_width = t->width * 2; decoration_height = t->width + titlebar_height; frame->interior.x = t->width; frame->interior.y = titlebar_height; frame->interior.width = frame->width - decoration_width; frame->interior.height = frame->height - decoration_height; frame->opaque_margin = 0; frame->shadow_margin = 0; } else { decoration_width = (t->width + t->margin) * 2; decoration_height = t->width + titlebar_height + t->margin * 2; frame->interior.x = t->width + t->margin; frame->interior.y = titlebar_height + t->margin; frame->interior.width = frame->width - decoration_width; frame->interior.height = frame->height - decoration_height; frame->opaque_margin = t->margin + t->frame_radius; frame->shadow_margin = t->margin; } x_r = frame->width - t->width - frame->shadow_margin; x_l = t->width + frame->shadow_margin; y = t->width + frame->shadow_margin; wl_list_for_each(button, &frame->buttons, link) { const int button_padding = 4; w = cairo_image_surface_get_width(button->icon); h = cairo_image_surface_get_height(button->icon); if (button->flags & FRAME_BUTTON_DECORATED) w += 10; if (button->flags & FRAME_BUTTON_ALIGN_RIGHT) { x_r -= w; button->allocation.x = x_r; button->allocation.y = y; button->allocation.width = w + 1; button->allocation.height = h + 1; x_r -= button_padding; } else { button->allocation.x = x_l; button->allocation.y = y; button->allocation.width = w + 1; button->allocation.height = h + 1; x_l += w; x_l += button_padding; } } frame->geometry_dirty = 0; } void frame_interior(struct frame *frame, int32_t *x, int32_t *y, int32_t *width, int32_t *height) { frame_refresh_geometry(frame); if (x) *x = frame->interior.x; if (y) *y = frame->interior.y; if (width) *width = frame->interior.width; if (height) *height = frame->interior.height; } void frame_input_rect(struct frame *frame, int32_t *x, int32_t *y, int32_t *width, int32_t *height) { frame_refresh_geometry(frame); if (x) *x = frame->shadow_margin; if (y) *y = frame->shadow_margin; if (width) *width = frame->width - frame->shadow_margin * 2; if (height) *height = frame->height - frame->shadow_margin * 2; } void frame_opaque_rect(struct frame *frame, int32_t *x, int32_t *y, int32_t *width, int32_t *height) { frame_refresh_geometry(frame); if (x) *x = frame->opaque_margin; if (y) *y = frame->opaque_margin; if (width) *width = frame->width - frame->opaque_margin * 2; if (height) *height = frame->height - frame->opaque_margin * 2; } int frame_get_shadow_margin(struct frame *frame) { frame_refresh_geometry(frame); return frame->shadow_margin; } uint32_t frame_status(struct frame *frame) { return frame->status; } void frame_status_clear(struct frame *frame, enum frame_status status) { frame->status &= ~status; } static struct frame_button * frame_find_button(struct frame *frame, int x, int y) { struct frame_button *button; int rel_x, rel_y; wl_list_for_each(button, &frame->buttons, link) { rel_x = x - button->allocation.x; rel_y = y - button->allocation.y; if (0 <= rel_x && rel_x < button->allocation.width && 0 <= rel_y && rel_y < button->allocation.height) return button; } return NULL; } enum theme_location frame_pointer_enter(struct frame *frame, void *data, int x, int y) { return frame_pointer_motion(frame, data, x, y); } enum theme_location frame_pointer_motion(struct frame *frame, void *data, int x, int y) { struct frame_pointer *pointer = frame_pointer_get(frame, data); struct frame_button *button = frame_find_button(frame, x, y); enum theme_location location; location = theme_get_location(frame->theme, x, y, frame->width, frame->height, frame->flags & FRAME_FLAG_MAXIMIZED ? THEME_FRAME_MAXIMIZED : 0); if (!pointer) return location; pointer->x = x; pointer->y = y; if (pointer->hover_button == button) return location; if (pointer->hover_button) frame_button_leave(pointer->hover_button, pointer); pointer->hover_button = button; if (pointer->hover_button) frame_button_enter(pointer->hover_button); return location; } static void frame_pointer_button_destroy(struct frame_pointer_button *button) { wl_list_remove(&button->link); free(button); } static void frame_pointer_button_press(struct frame *frame, struct frame_pointer *pointer, struct frame_pointer_button *button) { if (button->button == BTN_RIGHT) { if (button->press_location == THEME_LOCATION_TITLEBAR) frame->status |= FRAME_STATUS_MENU; frame_pointer_button_destroy(button); } else if (button->button == BTN_LEFT) { if (pointer->hover_button) { frame_button_press(pointer->hover_button); } else { switch (button->press_location) { case THEME_LOCATION_TITLEBAR: frame->status |= FRAME_STATUS_MOVE; frame_pointer_button_destroy(button); break; case THEME_LOCATION_RESIZING_TOP: case THEME_LOCATION_RESIZING_BOTTOM: case THEME_LOCATION_RESIZING_LEFT: case THEME_LOCATION_RESIZING_RIGHT: case THEME_LOCATION_RESIZING_TOP_LEFT: case THEME_LOCATION_RESIZING_TOP_RIGHT: case THEME_LOCATION_RESIZING_BOTTOM_LEFT: case THEME_LOCATION_RESIZING_BOTTOM_RIGHT: frame->status |= FRAME_STATUS_RESIZE; frame_pointer_button_destroy(button); break; default: break; } } } } static void frame_pointer_button_release(struct frame *frame, struct frame_pointer *pointer, struct frame_pointer_button *button) { if (button->button == BTN_LEFT && button->frame_button) { if (button->frame_button == pointer->hover_button) frame_button_release(button->frame_button); else frame_button_cancel(button->frame_button); } } static void frame_pointer_button_cancel(struct frame *frame, struct frame_pointer *pointer, struct frame_pointer_button *button) { if (button->frame_button) frame_button_cancel(button->frame_button); } void frame_pointer_leave(struct frame *frame, void *data) { struct frame_pointer *pointer = frame_pointer_get(frame, data); struct frame_pointer_button *button, *next; if (!pointer) return; if (pointer->hover_button) frame_button_leave(pointer->hover_button, pointer); wl_list_for_each_safe(button, next, &pointer->down_buttons, link) { frame_pointer_button_cancel(frame, pointer, button); frame_pointer_button_destroy(button); } frame_pointer_destroy(pointer); } enum theme_location frame_pointer_button(struct frame *frame, void *data, uint32_t btn, enum frame_button_state state) { struct frame_pointer *pointer = frame_pointer_get(frame, data); struct frame_pointer_button *button; enum theme_location location = THEME_LOCATION_EXTERIOR; if (!pointer) return location; location = theme_get_location(frame->theme, pointer->x, pointer->y, frame->width, frame->height, frame->flags & FRAME_FLAG_MAXIMIZED ? THEME_FRAME_MAXIMIZED : 0); if (state == FRAME_BUTTON_PRESSED) { button = malloc(sizeof *button); if (!button) return location; button->button = btn; button->press_location = location; button->frame_button = pointer->hover_button; wl_list_insert(&pointer->down_buttons, &button->link); frame_pointer_button_press(frame, pointer, button); } else if (state == FRAME_BUTTON_RELEASED) { button = NULL; wl_list_for_each(button, &pointer->down_buttons, link) if (button->button == btn) break; /* Make sure we didn't hit the end */ if (&button->link == &pointer->down_buttons) return location; location = button->press_location; frame_pointer_button_release(frame, pointer, button); frame_pointer_button_destroy(button); } return location; } void frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y) { struct frame_touch *touch = frame_touch_get(frame, data); struct frame_button *button = frame_find_button(frame, x, y); enum theme_location location; if (id > 0) return; if (touch && button) { touch->button = button; frame_button_press(touch->button); return; } location = theme_get_location(frame->theme, x, y, frame->width, frame->height, frame->flags & FRAME_FLAG_MAXIMIZED ? THEME_FRAME_MAXIMIZED : 0); switch (location) { case THEME_LOCATION_TITLEBAR: frame->status |= FRAME_STATUS_MOVE; break; case THEME_LOCATION_RESIZING_TOP: case THEME_LOCATION_RESIZING_BOTTOM: case THEME_LOCATION_RESIZING_LEFT: case THEME_LOCATION_RESIZING_RIGHT: case THEME_LOCATION_RESIZING_TOP_LEFT: case THEME_LOCATION_RESIZING_TOP_RIGHT: case THEME_LOCATION_RESIZING_BOTTOM_LEFT: case THEME_LOCATION_RESIZING_BOTTOM_RIGHT: frame->status |= FRAME_STATUS_RESIZE; break; default: break; } } void frame_touch_up(struct frame *frame, void *data, int32_t id) { struct frame_touch *touch = frame_touch_get(frame, data); if (id > 0) return; if (touch && touch->button) { frame_button_release(touch->button); frame_touch_destroy(touch); } } enum theme_location frame_double_click(struct frame *frame, void *data, uint32_t btn, enum frame_button_state state) { struct frame_pointer *pointer = frame_pointer_get(frame, data); struct frame_button *button; enum theme_location location = THEME_LOCATION_EXTERIOR; location = theme_get_location(frame->theme, pointer->x, pointer->y, frame->width, frame->height, frame->flags & FRAME_FLAG_MAXIMIZED ? THEME_FRAME_MAXIMIZED : 0); button = frame_find_button(frame, pointer->x, pointer->y); if (location != THEME_LOCATION_TITLEBAR || btn != BTN_LEFT) return location; if (state == FRAME_BUTTON_PRESSED) { if (button) frame_button_press(button); else frame->status |= FRAME_STATUS_MAXIMIZE; } else if (state == FRAME_BUTTON_RELEASED) { if (button) frame_button_release(button); } return location; } void frame_double_touch_down(struct frame *frame, void *data, int32_t id, int x, int y) { struct frame_touch *touch = frame_touch_get(frame, data); struct frame_button *button = frame_find_button(frame, x, y); enum theme_location location; if (touch && button) { touch->button = button; frame_button_press(touch->button); return; } location = theme_get_location(frame->theme, x, y, frame->width, frame->height, frame->flags & FRAME_FLAG_MAXIMIZED ? THEME_FRAME_MAXIMIZED : 0); switch (location) { case THEME_LOCATION_TITLEBAR: frame->status |= FRAME_STATUS_MAXIMIZE; break; case THEME_LOCATION_RESIZING_TOP: case THEME_LOCATION_RESIZING_BOTTOM: case THEME_LOCATION_RESIZING_LEFT: case THEME_LOCATION_RESIZING_RIGHT: case THEME_LOCATION_RESIZING_TOP_LEFT: case THEME_LOCATION_RESIZING_TOP_RIGHT: case THEME_LOCATION_RESIZING_BOTTOM_LEFT: case THEME_LOCATION_RESIZING_BOTTOM_RIGHT: frame->status |= FRAME_STATUS_RESIZE; break; default: break; } } void frame_double_touch_up(struct frame *frame, void *data, int32_t id) { struct frame_touch *touch = frame_touch_get(frame, data); if (touch && touch->button) { frame_button_release(touch->button); frame_touch_destroy(touch); } } void frame_repaint(struct frame *frame, cairo_t *cr) { struct frame_button *button; uint32_t flags = 0; frame_refresh_geometry(frame); if (frame->flags & FRAME_FLAG_MAXIMIZED) flags |= THEME_FRAME_MAXIMIZED; if (frame->flags & FRAME_FLAG_ACTIVE) flags |= THEME_FRAME_ACTIVE; cairo_save(cr); theme_render_frame(frame->theme, cr, frame->width, frame->height, frame->title, &frame->buttons, flags); cairo_restore(cr); wl_list_for_each(button, &frame->buttons, link) frame_button_repaint(button, cr); frame_status_clear(frame, FRAME_STATUS_REPAINT); } weston-1.9.0/shared/option-parser.c0000664000175000017500000000601612537627702014215 00000000000000/* * Copyright © 2012 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "config-parser.h" static int handle_option(const struct weston_option *option, char *value) { char* p; switch (option->type) { case WESTON_OPTION_INTEGER: * (int32_t *) option->data = strtol(value, &p, 0); return *value && !*p; case WESTON_OPTION_UNSIGNED_INTEGER: * (uint32_t *) option->data = strtoul(value, &p, 0); return *value && !*p; case WESTON_OPTION_STRING: * (char **) option->data = strdup(value); return 1; default: assert(0); } } static int long_option(const struct weston_option *options, int count, char *arg) { int k, len; for (k = 0; k < count; k++) { if (!options[k].name) continue; len = strlen(options[k].name); if (strncmp(options[k].name, arg + 2, len) != 0) continue; if (options[k].type == WESTON_OPTION_BOOLEAN) { if (!arg[len + 2]) { * (int32_t *) options[k].data = 1; return 1; } } else if (arg[len+2] == '=') { return handle_option(options + k, arg + len + 3); } } return 0; } static int short_option(const struct weston_option *options, int count, char *arg) { int k; if (!arg[1]) return 0; for (k = 0; k < count; k++) { if (options[k].short_name != arg[1]) continue; if (options[k].type == WESTON_OPTION_BOOLEAN) { if (!arg[2]) { * (int32_t *) options[k].data = 1; return 1; } } else { return handle_option(options + k, arg + 2); } } return 0; } int parse_options(const struct weston_option *options, int count, int *argc, char *argv[]) { int i, j; for (i = 1, j = 1; i < *argc; i++) { if (argv[i][0] == '-') { if (argv[i][1] == '-') { if (long_option(options, count, argv[i])) continue; } else if (short_option(options, count, argv[i])) continue; } argv[j++] = argv[i]; } argv[j] = NULL; *argc = j; return j; } weston-1.9.0/shared/os-compatibility.c0000664000175000017500000001042212552064071014666 00000000000000/* * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "os-compatibility.h" int os_fd_set_cloexec(int fd) { long flags; if (fd == -1) return -1; flags = fcntl(fd, F_GETFD); if (flags == -1) return -1; if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) return -1; return 0; } static int set_cloexec_or_close(int fd) { if (os_fd_set_cloexec(fd) != 0) { close(fd); return -1; } return fd; } int os_socketpair_cloexec(int domain, int type, int protocol, int *sv) { int ret; #ifdef SOCK_CLOEXEC ret = socketpair(domain, type | SOCK_CLOEXEC, protocol, sv); if (ret == 0 || errno != EINVAL) return ret; #endif ret = socketpair(domain, type, protocol, sv); if (ret < 0) return ret; sv[0] = set_cloexec_or_close(sv[0]); sv[1] = set_cloexec_or_close(sv[1]); if (sv[0] != -1 && sv[1] != -1) return 0; close(sv[0]); close(sv[1]); return -1; } int os_epoll_create_cloexec(void) { int fd; #ifdef EPOLL_CLOEXEC fd = epoll_create1(EPOLL_CLOEXEC); if (fd >= 0) return fd; if (errno != EINVAL) return -1; #endif fd = epoll_create(1); return set_cloexec_or_close(fd); } static int create_tmpfile_cloexec(char *tmpname) { int fd; #ifdef HAVE_MKOSTEMP fd = mkostemp(tmpname, O_CLOEXEC); if (fd >= 0) unlink(tmpname); #else fd = mkstemp(tmpname); if (fd >= 0) { fd = set_cloexec_or_close(fd); unlink(tmpname); } #endif return fd; } /* * Create a new, unique, anonymous file of the given size, and * return the file descriptor for it. The file descriptor is set * CLOEXEC. The file is immediately suitable for mmap()'ing * the given size at offset zero. * * The file should not have a permanent backing store like a disk, * but may have if XDG_RUNTIME_DIR is not properly implemented in OS. * * The file name is deleted from the file system. * * The file is suitable for buffer sharing between processes by * transmitting the file descriptor over Unix sockets using the * SCM_RIGHTS methods. * * If the C library implements posix_fallocate(), it is used to * guarantee that disk space is available for the file at the * given size. If disk space is insufficent, errno is set to ENOSPC. * If posix_fallocate() is not supported, program may receive * SIGBUS on accessing mmap()'ed file contents instead. */ int os_create_anonymous_file(off_t size) { static const char template[] = "/weston-shared-XXXXXX"; const char *path; char *name; int fd; int ret; path = getenv("XDG_RUNTIME_DIR"); if (!path) { errno = ENOENT; return -1; } name = malloc(strlen(path) + sizeof(template)); if (!name) return -1; strcpy(name, path); strcat(name, template); fd = create_tmpfile_cloexec(name); free(name); if (fd < 0) return -1; #ifdef HAVE_POSIX_FALLOCATE ret = posix_fallocate(fd, 0, size); if (ret != 0) { close(fd); errno = ret; return -1; } #else ret = ftruncate(fd, size); if (ret < 0) { close(fd); return -1; } #endif return fd; } #ifndef HAVE_STRCHRNUL char * strchrnul(const char *s, int c) { while (*s && *s != c) s++; return (char *)s; } #endif weston-1.9.0/Makefile.in0000664000175000017500000226250712600133000012027 00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = weston$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ $(am__EXEEXT_11) $(am__EXEEXT_12) noinst_PROGRAMS = spring-tool$(EXEEXT) $(am__EXEEXT_15) \ $(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_20) \ $(am__EXEEXT_22) matrix-test$(EXEEXT) $(am__EXEEXT_23) \ $(am__EXEEXT_24) zuctest$(EXEEXT) libexec_PROGRAMS = $(am__EXEEXT_13) $(am__EXEEXT_14) @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@am__append_1 = \ @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@ src/dbus.h \ @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@ src/dbus.c \ @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@ src/logind-util.h \ @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@ src/logind-util.c @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@am__append_2 = $(SYSTEMD_LOGIN_CFLAGS) $(DBUS_CFLAGS) @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@am__append_3 = $(SYSTEMD_LOGIN_LIBS) $(DBUS_LIBS) @BUILD_WESTON_LAUNCH_TRUE@am__append_4 = weston-launch @ENABLE_EGL_TRUE@am__append_5 = gl-renderer.la @ENABLE_X11_COMPOSITOR_TRUE@am__append_6 = x11-backend.la @ENABLE_DRM_COMPOSITOR_TRUE@am__append_7 = drm-backend.la @ENABLE_DRM_COMPOSITOR_TRUE@@ENABLE_VAAPI_RECORDER_TRUE@am__append_8 = src/vaapi-recorder.c src/vaapi-recorder.h @ENABLE_DRM_COMPOSITOR_TRUE@@ENABLE_VAAPI_RECORDER_TRUE@am__append_9 = $(LIBVA_LIBS) @ENABLE_DRM_COMPOSITOR_TRUE@@ENABLE_VAAPI_RECORDER_TRUE@am__append_10 = $(LIBVA_CFLAGS) @ENABLE_WAYLAND_COMPOSITOR_TRUE@am__append_11 = wayland-backend.la @ENABLE_RPI_COMPOSITOR_TRUE@@INSTALL_RPI_COMPOSITOR_TRUE@am__append_12 = rpi-backend.la @ENABLE_RPI_COMPOSITOR_TRUE@@INSTALL_RPI_COMPOSITOR_FALSE@am__append_13 = rpi-backend.la @ENABLE_EGL_TRUE@@ENABLE_RPI_COMPOSITOR_TRUE@am__append_14 = $(EGL_LIBS) @ENABLE_EGL_TRUE@@ENABLE_RPI_COMPOSITOR_TRUE@am__append_15 = $(EGL_CFLAGS) @ENABLE_HEADLESS_COMPOSITOR_TRUE@am__append_16 = headless-backend.la @ENABLE_FBDEV_COMPOSITOR_TRUE@am__append_17 = fbdev-backend.la @ENABLE_RDP_COMPOSITOR_TRUE@am__append_18 = rdp-backend.la @HAVE_LCMS_TRUE@am__append_19 = cms-static.la @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@am__append_20 = cms-colord.la @BUILD_CLIENTS_TRUE@am__append_21 = weston-terminal weston-info @BUILD_CLIENTS_TRUE@am__append_22 = \ @BUILD_CLIENTS_TRUE@ weston-desktop-shell \ @BUILD_CLIENTS_TRUE@ weston-screenshooter \ @BUILD_CLIENTS_TRUE@ weston-keyboard \ @BUILD_CLIENTS_TRUE@ weston-simple-im @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@am__append_23 = \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ weston-ivi-shell-user-interface @BUILD_CLIENTS_TRUE@@INSTALL_DEMO_CLIENTS_TRUE@am__append_24 = $(demo_clients) @BUILD_CLIENTS_TRUE@@INSTALL_DEMO_CLIENTS_FALSE@am__append_25 = $(demo_clients) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am__append_26 = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-simple-shm \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-simple-damage \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-simple-touch \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-presentation-shm \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-multi-resource @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@am__append_27 = weston-simple-egl @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@am__append_28 = weston-simple-dmabuf @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@am__append_29 = protocol/linux-dmabuf-client-protocol.h @BUILD_CLIENTS_TRUE@am__append_30 = libtoytoolkit.la @BUILD_CLIENTS_TRUE@am__append_31 = $(nodist_libtoytoolkit_la_SOURCES) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@am__append_32 = weston-nested weston-nested-client @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@am__append_33 = weston-subsurfaces @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@am__append_34 = weston-editor @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@am__append_35 = weston-gears @ENABLE_IVI_SHELL_TRUE@am__append_36 = \ @ENABLE_IVI_SHELL_TRUE@ data/background.png \ @ENABLE_IVI_SHELL_TRUE@ data/tiling.png \ @ENABLE_IVI_SHELL_TRUE@ data/fullscreen.png \ @ENABLE_IVI_SHELL_TRUE@ data/panel.png \ @ENABLE_IVI_SHELL_TRUE@ data/random.png \ @ENABLE_IVI_SHELL_TRUE@ data/sidebyside.png \ @ENABLE_IVI_SHELL_TRUE@ data/home.png \ @ENABLE_IVI_SHELL_TRUE@ data/icon_ivi_clickdot.png \ @ENABLE_IVI_SHELL_TRUE@ data/icon_ivi_flower.png \ @ENABLE_IVI_SHELL_TRUE@ data/icon_ivi_simple-egl.png \ @ENABLE_IVI_SHELL_TRUE@ data/icon_ivi_simple-shm.png \ @ENABLE_IVI_SHELL_TRUE@ data/icon_ivi_smoke.png @BUILD_WCAP_TOOLS_TRUE@am__append_37 = wcap-decode @ENABLE_DESKTOP_SHELL_TRUE@am__append_38 = desktop-shell.la @ENABLE_DESKTOP_SHELL_TRUE@am__append_39 = $(nodist_desktop_shell_la_SOURCES) @ENABLE_FULLSCREEN_SHELL_TRUE@am__append_40 = fullscreen-shell.la @ENABLE_FULLSCREEN_SHELL_TRUE@am__append_41 = $(nodist_fullscreen_shell_la_SOURCES) @ENABLE_IVI_SHELL_TRUE@am__append_42 = \ @ENABLE_IVI_SHELL_TRUE@ $(ivi_shell) \ @ENABLE_IVI_SHELL_TRUE@ $(hmi_controller) @ENABLE_IVI_SHELL_TRUE@am__append_43 = $(nodist_ivi_shell_la_SOURCES) \ @ENABLE_IVI_SHELL_TRUE@ $(nodist_hmi_controller_la_SOURCES) @ENABLE_SCREEN_SHARING_TRUE@am__append_44 = screen-share.la @ENABLE_XWAYLAND_TRUE@am__append_45 = xwayland.la @ENABLE_JUNIT_XML_TRUE@am__append_46 = \ @ENABLE_JUNIT_XML_TRUE@ $(LIBXML2_CFLAGS) @ENABLE_JUNIT_XML_TRUE@am__append_47 = \ @ENABLE_JUNIT_XML_TRUE@ $(LIBXML2_LIBS) TESTS = $(am__EXEEXT_16) $(am__EXEEXT_17) $(module_tests) \ $(am__EXEEXT_20) $(am__EXEEXT_22) @ENABLE_EGL_TRUE@am__append_48 = $(EGL_TESTS_CFLAGS) @ENABLE_EGL_TRUE@am__append_49 = $(EGL_TESTS_LIBS) @ENABLE_EGL_TRUE@am__append_50 = buffer-count.weston @ENABLE_XWAYLAND_TEST_TRUE@am__append_51 = xwayland-test.weston @ENABLE_IVI_SHELL_TRUE@am__append_52 = \ @ENABLE_IVI_SHELL_TRUE@ ivi-layout-internal-test.la \ @ENABLE_IVI_SHELL_TRUE@ ivi-layout-test.la @ENABLE_IVI_SHELL_TRUE@am__append_53 = \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell-app.weston @ENABLE_IVI_SHELL_TRUE@am__append_54 = ivi-layout.ivi @BUILD_SETBACKLIGHT_TRUE@am__append_55 = setbacklight @ENABLE_DRM_COMPOSITOR_TRUE@am__append_56 = weston-drm.7 subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in \ $(top_srcdir)/doc/doxygen/tools.doxygen.in \ $(top_srcdir)/doc/doxygen/tooldev.doxygen.in \ $(top_srcdir)/src/version.h.in $(top_srcdir)/src/weston.pc.in \ $(top_srcdir)/build-aux/depcomp $(dist_wayland_session_DATA) \ $(am__dist_westondata_DATA_DIST) $(westoninclude_HEADERS) \ $(top_srcdir)/build-aux/test-driver COPYING README \ build-aux/compile build-aux/config.guess build-aux/config.sub \ build-aux/depcomp build-aux/install-sh build-aux/missing \ build-aux/ltmain.sh $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = doc/doxygen/tools.doxygen \ doc/doxygen/tooldev.doxygen src/version.h src/weston.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(wayland_sessiondir)" "$(DESTDIR)$(westondatadir)" \ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(westonincludedir)" LTLIBRARIES = $(module_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@cms_colord_la_DEPENDENCIES = \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ $(am__DEPENDENCIES_1) am__cms_colord_la_SOURCES_DIST = src/cms-colord.c src/cms-helper.c \ src/cms-helper.h shared/helpers.h am__dirstamp = $(am__leading_dot)dirstamp @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@am_cms_colord_la_OBJECTS = src/cms_colord_la-cms-colord.lo \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ src/cms_colord_la-cms-helper.lo cms_colord_la_OBJECTS = $(am_cms_colord_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cms_colord_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cms_colord_la_CFLAGS) \ $(CFLAGS) $(cms_colord_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@am_cms_colord_la_rpath = -rpath \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ $(moduledir) @HAVE_LCMS_TRUE@cms_static_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_LCMS_TRUE@ $(am__DEPENDENCIES_1) libshared.la am__cms_static_la_SOURCES_DIST = src/cms-static.c src/cms-helper.c \ src/cms-helper.h shared/helpers.h @HAVE_LCMS_TRUE@am_cms_static_la_OBJECTS = \ @HAVE_LCMS_TRUE@ src/cms_static_la-cms-static.lo \ @HAVE_LCMS_TRUE@ src/cms_static_la-cms-helper.lo cms_static_la_OBJECTS = $(am_cms_static_la_OBJECTS) cms_static_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(cms_static_la_CFLAGS) \ $(CFLAGS) $(cms_static_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_LCMS_TRUE@am_cms_static_la_rpath = -rpath $(moduledir) @ENABLE_DESKTOP_SHELL_TRUE@desktop_shell_la_DEPENDENCIES = \ @ENABLE_DESKTOP_SHELL_TRUE@ $(am__DEPENDENCIES_1) libshared.la am__desktop_shell_la_SOURCES_DIST = desktop-shell/shell.h \ desktop-shell/shell.c desktop-shell/exposay.c \ desktop-shell/input-panel.c shared/helpers.h @ENABLE_DESKTOP_SHELL_TRUE@am_desktop_shell_la_OBJECTS = desktop-shell/desktop_shell_la-shell.lo \ @ENABLE_DESKTOP_SHELL_TRUE@ desktop-shell/desktop_shell_la-exposay.lo \ @ENABLE_DESKTOP_SHELL_TRUE@ desktop-shell/desktop_shell_la-input-panel.lo @ENABLE_DESKTOP_SHELL_TRUE@nodist_desktop_shell_la_OBJECTS = protocol/desktop_shell_la-desktop-shell-protocol.lo \ @ENABLE_DESKTOP_SHELL_TRUE@ protocol/desktop_shell_la-xdg-shell-protocol.lo desktop_shell_la_OBJECTS = $(am_desktop_shell_la_OBJECTS) \ $(nodist_desktop_shell_la_OBJECTS) desktop_shell_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(desktop_shell_la_CFLAGS) $(CFLAGS) \ $(desktop_shell_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_DESKTOP_SHELL_TRUE@am_desktop_shell_la_rpath = -rpath \ @ENABLE_DESKTOP_SHELL_TRUE@ $(moduledir) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @ENABLE_DRM_COMPOSITOR_TRUE@@ENABLE_VAAPI_RECORDER_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) @ENABLE_DRM_COMPOSITOR_TRUE@drm_backend_la_DEPENDENCIES = \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_2) libshared.la \ @ENABLE_DRM_COMPOSITOR_TRUE@ libsession-helper.la \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_3) am__drm_backend_la_SOURCES_DIST = src/compositor-drm.c \ src/libinput-seat.c src/libinput-seat.h src/libinput-device.c \ src/libinput-device.h shared/helpers.h shared/timespec-util.h \ src/libbacklight.c src/libbacklight.h src/vaapi-recorder.c \ src/vaapi-recorder.h am__objects_1 = src/drm_backend_la-libinput-seat.lo \ src/drm_backend_la-libinput-device.lo @ENABLE_DRM_COMPOSITOR_TRUE@@ENABLE_VAAPI_RECORDER_TRUE@am__objects_2 = src/drm_backend_la-vaapi-recorder.lo @ENABLE_DRM_COMPOSITOR_TRUE@am_drm_backend_la_OBJECTS = src/drm_backend_la-compositor-drm.lo \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__objects_1) \ @ENABLE_DRM_COMPOSITOR_TRUE@ src/drm_backend_la-libbacklight.lo \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__objects_2) drm_backend_la_OBJECTS = $(am_drm_backend_la_OBJECTS) drm_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(drm_backend_la_CFLAGS) $(CFLAGS) $(drm_backend_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_DRM_COMPOSITOR_TRUE@am_drm_backend_la_rpath = -rpath \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(moduledir) @ENABLE_FBDEV_COMPOSITOR_TRUE@fbdev_backend_la_DEPENDENCIES = \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_2) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ libsession-helper.la \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ libshared.la am__fbdev_backend_la_SOURCES_DIST = src/compositor-fbdev.c \ shared/helpers.h src/libinput-seat.c src/libinput-seat.h \ src/libinput-device.c src/libinput-device.h am__objects_3 = src/fbdev_backend_la-libinput-seat.lo \ src/fbdev_backend_la-libinput-device.lo @ENABLE_FBDEV_COMPOSITOR_TRUE@am_fbdev_backend_la_OBJECTS = src/fbdev_backend_la-compositor-fbdev.lo \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(am__objects_3) fbdev_backend_la_OBJECTS = $(am_fbdev_backend_la_OBJECTS) fbdev_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(fbdev_backend_la_CFLAGS) $(CFLAGS) \ $(fbdev_backend_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_FBDEV_COMPOSITOR_TRUE@am_fbdev_backend_la_rpath = -rpath \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(moduledir) @ENABLE_FULLSCREEN_SHELL_TRUE@fullscreen_shell_la_DEPENDENCIES = \ @ENABLE_FULLSCREEN_SHELL_TRUE@ $(am__DEPENDENCIES_1) am__fullscreen_shell_la_SOURCES_DIST = \ fullscreen-shell/fullscreen-shell.c shared/helpers.h @ENABLE_FULLSCREEN_SHELL_TRUE@am_fullscreen_shell_la_OBJECTS = fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo @ENABLE_FULLSCREEN_SHELL_TRUE@nodist_fullscreen_shell_la_OBJECTS = protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo fullscreen_shell_la_OBJECTS = $(am_fullscreen_shell_la_OBJECTS) \ $(nodist_fullscreen_shell_la_OBJECTS) fullscreen_shell_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(fullscreen_shell_la_CFLAGS) $(CFLAGS) \ $(fullscreen_shell_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_FULLSCREEN_SHELL_TRUE@am_fullscreen_shell_la_rpath = -rpath \ @ENABLE_FULLSCREEN_SHELL_TRUE@ $(moduledir) @ENABLE_EGL_TRUE@gl_renderer_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @ENABLE_EGL_TRUE@ $(am__DEPENDENCIES_1) am__gl_renderer_la_SOURCES_DIST = src/gl-renderer.h src/gl-renderer.c \ src/vertex-clipping.c src/vertex-clipping.h shared/helpers.h @ENABLE_EGL_TRUE@am_gl_renderer_la_OBJECTS = \ @ENABLE_EGL_TRUE@ src/gl_renderer_la-gl-renderer.lo \ @ENABLE_EGL_TRUE@ src/gl_renderer_la-vertex-clipping.lo gl_renderer_la_OBJECTS = $(am_gl_renderer_la_OBJECTS) gl_renderer_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(gl_renderer_la_CFLAGS) $(CFLAGS) $(gl_renderer_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_EGL_TRUE@am_gl_renderer_la_rpath = -rpath $(moduledir) @ENABLE_HEADLESS_COMPOSITOR_TRUE@headless_backend_la_DEPENDENCIES = \ @ENABLE_HEADLESS_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_HEADLESS_COMPOSITOR_TRUE@ libshared.la am__headless_backend_la_SOURCES_DIST = src/compositor-headless.c \ shared/helpers.h @ENABLE_HEADLESS_COMPOSITOR_TRUE@am_headless_backend_la_OBJECTS = src/headless_backend_la-compositor-headless.lo headless_backend_la_OBJECTS = $(am_headless_backend_la_OBJECTS) headless_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(headless_backend_la_CFLAGS) $(CFLAGS) \ $(headless_backend_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_HEADLESS_COMPOSITOR_TRUE@am_headless_backend_la_rpath = \ @ENABLE_HEADLESS_COMPOSITOR_TRUE@ -rpath $(moduledir) @ENABLE_IVI_SHELL_TRUE@hmi_controller_la_DEPENDENCIES = \ @ENABLE_IVI_SHELL_TRUE@ $(am__DEPENDENCIES_1) libshared.la am__hmi_controller_la_SOURCES_DIST = ivi-shell/ivi-layout-export.h \ ivi-shell/hmi-controller.c shared/helpers.h @ENABLE_IVI_SHELL_TRUE@am_hmi_controller_la_OBJECTS = ivi-shell/hmi_controller_la-hmi-controller.lo @ENABLE_IVI_SHELL_TRUE@nodist_hmi_controller_la_OBJECTS = protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo hmi_controller_la_OBJECTS = $(am_hmi_controller_la_OBJECTS) \ $(nodist_hmi_controller_la_OBJECTS) hmi_controller_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(hmi_controller_la_CFLAGS) $(CFLAGS) \ $(hmi_controller_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_IVI_SHELL_TRUE@am_hmi_controller_la_rpath = -rpath \ @ENABLE_IVI_SHELL_TRUE@ $(moduledir) @ENABLE_IVI_SHELL_TRUE@ivi_layout_internal_test_la_DEPENDENCIES = \ @ENABLE_IVI_SHELL_TRUE@ $(am__DEPENDENCIES_1) am__ivi_layout_internal_test_la_SOURCES_DIST = \ tests/ivi_layout-internal-test.c @ENABLE_IVI_SHELL_TRUE@am_ivi_layout_internal_test_la_OBJECTS = tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo ivi_layout_internal_test_la_OBJECTS = \ $(am_ivi_layout_internal_test_la_OBJECTS) ivi_layout_internal_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(ivi_layout_internal_test_la_CFLAGS) $(CFLAGS) \ $(ivi_layout_internal_test_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_IVI_SHELL_TRUE@am_ivi_layout_internal_test_la_rpath = @ENABLE_IVI_SHELL_TRUE@ivi_layout_test_la_DEPENDENCIES = \ @ENABLE_IVI_SHELL_TRUE@ $(am__DEPENDENCIES_1) am__ivi_layout_test_la_SOURCES_DIST = tests/ivi_layout-test-plugin.c \ tests/ivi-test.h shared/helpers.h @ENABLE_IVI_SHELL_TRUE@am_ivi_layout_test_la_OBJECTS = tests/ivi_layout_test_la-ivi_layout-test-plugin.lo @ENABLE_IVI_SHELL_TRUE@nodist_ivi_layout_test_la_OBJECTS = protocol/ivi_layout_test_la-weston-test-protocol.lo ivi_layout_test_la_OBJECTS = $(am_ivi_layout_test_la_OBJECTS) \ $(nodist_ivi_layout_test_la_OBJECTS) ivi_layout_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(ivi_layout_test_la_CFLAGS) $(CFLAGS) \ $(ivi_layout_test_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_IVI_SHELL_TRUE@am_ivi_layout_test_la_rpath = @ENABLE_IVI_SHELL_TRUE@ivi_shell_la_DEPENDENCIES = \ @ENABLE_IVI_SHELL_TRUE@ $(am__DEPENDENCIES_1) libshared.la am__ivi_shell_la_SOURCES_DIST = ivi-shell/ivi-layout-export.h \ ivi-shell/ivi-layout-private.h ivi-shell/ivi-layout.c \ ivi-shell/ivi-layout-transition.c ivi-shell/ivi-shell.h \ ivi-shell/ivi-shell.c ivi-shell/input-panel-ivi.c \ shared/helpers.h @ENABLE_IVI_SHELL_TRUE@am_ivi_shell_la_OBJECTS = \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi_shell_la-ivi-layout.lo \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi_shell_la-ivi-layout-transition.lo \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi_shell_la-ivi-shell.lo \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi_shell_la-input-panel-ivi.lo @ENABLE_IVI_SHELL_TRUE@nodist_ivi_shell_la_OBJECTS = protocol/ivi_shell_la-ivi-application-protocol.lo ivi_shell_la_OBJECTS = $(am_ivi_shell_la_OBJECTS) \ $(nodist_ivi_shell_la_OBJECTS) ivi_shell_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(ivi_shell_la_CFLAGS) \ $(CFLAGS) $(ivi_shell_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_IVI_SHELL_TRUE@am_ivi_shell_la_rpath = -rpath $(moduledir) @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) \ @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@ $(am__DEPENDENCIES_1) libsession_helper_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_4) am__libsession_helper_la_SOURCES_DIST = src/weston-launch.h \ src/launcher-util.c src/launcher-util.h src/dbus.h src/dbus.c \ src/logind-util.h src/logind-util.c @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@am__objects_4 = src/libsession_helper_la-dbus.lo \ @ENABLE_DBUS_TRUE@@HAVE_SYSTEMD_LOGIN_TRUE@ src/libsession_helper_la-logind-util.lo am_libsession_helper_la_OBJECTS = \ src/libsession_helper_la-launcher-util.lo $(am__objects_4) libsession_helper_la_OBJECTS = $(am_libsession_helper_la_OBJECTS) libsession_helper_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libsession_helper_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ libshared_cairo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_5 = shared/libshared_cairo_la-config-parser.lo \ shared/libshared_cairo_la-option-parser.lo \ shared/libshared_cairo_la-file-util.lo \ shared/libshared_cairo_la-os-compatibility.lo am_libshared_cairo_la_OBJECTS = $(am__objects_5) \ shared/libshared_cairo_la-image-loader.lo \ shared/libshared_cairo_la-cairo-util.lo \ shared/libshared_cairo_la-frame.lo libshared_cairo_la_OBJECTS = $(am_libshared_cairo_la_OBJECTS) libshared_cairo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libshared_cairo_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ libshared_la_LIBADD = am_libshared_la_OBJECTS = shared/libshared_la-config-parser.lo \ shared/libshared_la-option-parser.lo \ shared/libshared_la-file-util.lo \ shared/libshared_la-os-compatibility.lo libshared_la_OBJECTS = $(am_libshared_la_OBJECTS) libshared_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libshared_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ libtest_client_la_DEPENDENCIES = $(am__DEPENDENCIES_1) libshared.la \ libtest-runner.la am_libtest_client_la_OBJECTS = \ tests/libtest_client_la-weston-test-client-helper.lo nodist_libtest_client_la_OBJECTS = \ protocol/libtest_client_la-weston-test-protocol.lo libtest_client_la_OBJECTS = $(am_libtest_client_la_OBJECTS) \ $(nodist_libtest_client_la_OBJECTS) libtest_client_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libtest_client_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ libtest_runner_la_LIBADD = am_libtest_runner_la_OBJECTS = \ tests/libtest_runner_la-weston-test-runner.lo libtest_runner_la_OBJECTS = $(am_libtest_runner_la_OBJECTS) libtest_runner_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libtest_runner_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ @BUILD_CLIENTS_TRUE@libtoytoolkit_la_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@ $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@ $(am__DEPENDENCIES_1) libshared-cairo.la am__libtoytoolkit_la_SOURCES_DIST = clients/window.c clients/window.h \ shared/helpers.h @BUILD_CLIENTS_TRUE@am_libtoytoolkit_la_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/libtoytoolkit_la-window.lo @BUILD_CLIENTS_TRUE@nodist_libtoytoolkit_la_OBJECTS = protocol/libtoytoolkit_la-text-cursor-position-protocol.lo \ @BUILD_CLIENTS_TRUE@ protocol/libtoytoolkit_la-scaler-protocol.lo \ @BUILD_CLIENTS_TRUE@ protocol/libtoytoolkit_la-workspaces-protocol.lo \ @BUILD_CLIENTS_TRUE@ protocol/libtoytoolkit_la-presentation_timing-protocol.lo \ @BUILD_CLIENTS_TRUE@ protocol/libtoytoolkit_la-xdg-shell-protocol.lo \ @BUILD_CLIENTS_TRUE@ protocol/libtoytoolkit_la-ivi-application-protocol.lo libtoytoolkit_la_OBJECTS = $(am_libtoytoolkit_la_OBJECTS) \ $(nodist_libtoytoolkit_la_OBJECTS) libtoytoolkit_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libtoytoolkit_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ @BUILD_CLIENTS_TRUE@am_libtoytoolkit_la_rpath = @ENABLE_JUNIT_XML_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) libzunitc_la_DEPENDENCIES = libshared.la $(am__DEPENDENCIES_5) am_libzunitc_la_OBJECTS = \ tools/zunitc/src/libzunitc_la-zuc_base_logger.lo \ tools/zunitc/src/libzunitc_la-zuc_collector.lo \ tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo \ tools/zunitc/src/libzunitc_la-zunitc_impl.lo libzunitc_la_OBJECTS = $(am_libzunitc_la_OBJECTS) libzunitc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libzunitc_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ libzunitcmain_la_DEPENDENCIES = libzunitc.la libshared.la am_libzunitcmain_la_OBJECTS = \ tools/zunitc/src/libzunitcmain_la-main.lo libzunitcmain_la_OBJECTS = $(am_libzunitcmain_la_OBJECTS) libzunitcmain_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(libzunitcmain_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ @ENABLE_RDP_COMPOSITOR_TRUE@rdp_backend_la_DEPENDENCIES = \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) libshared.la am__rdp_backend_la_SOURCES_DIST = src/compositor-rdp.c \ shared/helpers.h @ENABLE_RDP_COMPOSITOR_TRUE@am_rdp_backend_la_OBJECTS = src/rdp_backend_la-compositor-rdp.lo rdp_backend_la_OBJECTS = $(am_rdp_backend_la_OBJECTS) rdp_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(rdp_backend_la_CFLAGS) $(CFLAGS) $(rdp_backend_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_RDP_COMPOSITOR_TRUE@am_rdp_backend_la_rpath = -rpath \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(moduledir) @ENABLE_EGL_TRUE@@ENABLE_RPI_COMPOSITOR_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1) @ENABLE_RPI_COMPOSITOR_TRUE@rpi_backend_la_DEPENDENCIES = \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_2) \ @ENABLE_RPI_COMPOSITOR_TRUE@ libsession-helper.la libshared.la \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_6) am__rpi_backend_la_SOURCES_DIST = src/compositor-rpi.c \ src/rpi-renderer.c src/rpi-renderer.h src/rpi-bcm-stubs.h \ shared/helpers.h src/libinput-seat.c src/libinput-seat.h \ src/libinput-device.c src/libinput-device.h am__objects_6 = src/rpi_backend_la-libinput-seat.lo \ src/rpi_backend_la-libinput-device.lo @ENABLE_RPI_COMPOSITOR_TRUE@am_rpi_backend_la_OBJECTS = src/rpi_backend_la-compositor-rpi.lo \ @ENABLE_RPI_COMPOSITOR_TRUE@ src/rpi_backend_la-rpi-renderer.lo \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__objects_6) rpi_backend_la_OBJECTS = $(am_rpi_backend_la_OBJECTS) rpi_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(rpi_backend_la_CFLAGS) $(CFLAGS) $(rpi_backend_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_RPI_COMPOSITOR_TRUE@@INSTALL_RPI_COMPOSITOR_FALSE@am_rpi_backend_la_rpath = @ENABLE_RPI_COMPOSITOR_TRUE@@INSTALL_RPI_COMPOSITOR_TRUE@am_rpi_backend_la_rpath = -rpath \ @ENABLE_RPI_COMPOSITOR_TRUE@@INSTALL_RPI_COMPOSITOR_TRUE@ $(moduledir) @ENABLE_SCREEN_SHARING_TRUE@screen_share_la_DEPENDENCIES = \ @ENABLE_SCREEN_SHARING_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_SCREEN_SHARING_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_SCREEN_SHARING_TRUE@ libshared-cairo.la am__screen_share_la_SOURCES_DIST = src/screen-share.c shared/helpers.h @ENABLE_SCREEN_SHARING_TRUE@am_screen_share_la_OBJECTS = src/screen_share_la-screen-share.lo @ENABLE_SCREEN_SHARING_TRUE@nodist_screen_share_la_OBJECTS = protocol/screen_share_la-fullscreen-shell-protocol.lo screen_share_la_OBJECTS = $(am_screen_share_la_OBJECTS) \ $(nodist_screen_share_la_OBJECTS) screen_share_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(screen_share_la_CFLAGS) $(CFLAGS) $(screen_share_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_SCREEN_SHARING_TRUE@am_screen_share_la_rpath = -rpath \ @ENABLE_SCREEN_SHARING_TRUE@ $(moduledir) surface_global_test_la_LIBADD = am_surface_global_test_la_OBJECTS = \ tests/surface_global_test_la-surface-global-test.lo surface_global_test_la_OBJECTS = $(am_surface_global_test_la_OBJECTS) surface_global_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(surface_global_test_la_CFLAGS) $(CFLAGS) \ $(surface_global_test_la_LDFLAGS) $(LDFLAGS) -o $@ surface_screenshot_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ libshared.la am_surface_screenshot_la_OBJECTS = \ tests/surface_screenshot_la-surface-screenshot.lo surface_screenshot_la_OBJECTS = $(am_surface_screenshot_la_OBJECTS) surface_screenshot_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(surface_screenshot_la_CFLAGS) $(CFLAGS) \ $(surface_screenshot_la_LDFLAGS) $(LDFLAGS) -o $@ surface_test_la_LIBADD = am_surface_test_la_OBJECTS = tests/surface_test_la-surface-test.lo surface_test_la_OBJECTS = $(am_surface_test_la_OBJECTS) surface_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(surface_test_la_CFLAGS) $(CFLAGS) $(surface_test_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_WAYLAND_COMPOSITOR_TRUE@wayland_backend_la_DEPENDENCIES = \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ libshared-cairo.la am__wayland_backend_la_SOURCES_DIST = src/compositor-wayland.c \ shared/helpers.h @ENABLE_WAYLAND_COMPOSITOR_TRUE@am_wayland_backend_la_OBJECTS = src/wayland_backend_la-compositor-wayland.lo @ENABLE_WAYLAND_COMPOSITOR_TRUE@nodist_wayland_backend_la_OBJECTS = protocol/wayland_backend_la-fullscreen-shell-protocol.lo wayland_backend_la_OBJECTS = $(am_wayland_backend_la_OBJECTS) \ $(nodist_wayland_backend_la_OBJECTS) wayland_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(wayland_backend_la_CFLAGS) $(CFLAGS) \ $(wayland_backend_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_WAYLAND_COMPOSITOR_TRUE@am_wayland_backend_la_rpath = -rpath \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(moduledir) weston_test_la_DEPENDENCIES = $(am__DEPENDENCIES_1) libshared.la am_weston_test_la_OBJECTS = tests/weston_test_la-weston-test.lo nodist_weston_test_la_OBJECTS = \ protocol/weston_test_la-weston-test-protocol.lo weston_test_la_OBJECTS = $(am_weston_test_la_OBJECTS) \ $(nodist_weston_test_la_OBJECTS) weston_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_test_la_CFLAGS) $(CFLAGS) $(weston_test_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_X11_COMPOSITOR_TRUE@x11_backend_la_DEPENDENCIES = \ @ENABLE_X11_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_X11_COMPOSITOR_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_X11_COMPOSITOR_TRUE@ libshared-cairo.la am__x11_backend_la_SOURCES_DIST = src/compositor-x11.c \ shared/helpers.h @ENABLE_X11_COMPOSITOR_TRUE@am_x11_backend_la_OBJECTS = src/x11_backend_la-compositor-x11.lo x11_backend_la_OBJECTS = $(am_x11_backend_la_OBJECTS) x11_backend_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(x11_backend_la_CFLAGS) $(CFLAGS) $(x11_backend_la_LDFLAGS) \ $(LDFLAGS) -o $@ @ENABLE_X11_COMPOSITOR_TRUE@am_x11_backend_la_rpath = -rpath \ @ENABLE_X11_COMPOSITOR_TRUE@ $(moduledir) @ENABLE_XWAYLAND_TRUE@xwayland_la_DEPENDENCIES = \ @ENABLE_XWAYLAND_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_XWAYLAND_TRUE@ $(top_builddir)/libshared-cairo.la am__xwayland_la_SOURCES_DIST = xwayland/xwayland.h \ xwayland/window-manager.c xwayland/selection.c xwayland/dnd.c \ xwayland/launcher.c xwayland/hash.c xwayland/hash.h \ shared/helpers.h @ENABLE_XWAYLAND_TRUE@am_xwayland_la_OBJECTS = \ @ENABLE_XWAYLAND_TRUE@ xwayland/xwayland_la-window-manager.lo \ @ENABLE_XWAYLAND_TRUE@ xwayland/xwayland_la-selection.lo \ @ENABLE_XWAYLAND_TRUE@ xwayland/xwayland_la-dnd.lo \ @ENABLE_XWAYLAND_TRUE@ xwayland/xwayland_la-launcher.lo \ @ENABLE_XWAYLAND_TRUE@ xwayland/xwayland_la-hash.lo xwayland_la_OBJECTS = $(am_xwayland_la_OBJECTS) xwayland_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(xwayland_la_CFLAGS) \ $(CFLAGS) $(xwayland_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_XWAYLAND_TRUE@am_xwayland_la_rpath = -rpath $(moduledir) @BUILD_WESTON_LAUNCH_TRUE@am__EXEEXT_1 = weston-launch$(EXEEXT) @BUILD_CLIENTS_TRUE@am__EXEEXT_2 = weston-terminal$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-info$(EXEEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am__EXEEXT_3 = weston-simple-shm$(EXEEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-simple-damage$(EXEEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-simple-touch$(EXEEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-presentation-shm$(EXEEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ weston-multi-resource$(EXEEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@am__EXEEXT_4 = weston-simple-egl$(EXEEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@am__EXEEXT_5 = weston-simple-dmabuf$(EXEEXT) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@am__EXEEXT_6 = weston-nested$(EXEEXT) \ @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@ weston-nested-client$(EXEEXT) @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@am__EXEEXT_7 = weston-subsurfaces$(EXEEXT) @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@am__EXEEXT_8 = \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ weston-editor$(EXEEXT) @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@am__EXEEXT_9 = weston-gears$(EXEEXT) @BUILD_CLIENTS_TRUE@am__EXEEXT_10 = weston-flower$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-image$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-cliptest$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-dnd$(EXEEXT) weston-smoke$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-resizor$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-eventdemo$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-clickdot$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-transformed$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-fullscreen$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-stacking$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-calibrator$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-scaler$(EXEEXT) $(am__EXEEXT_3) \ @BUILD_CLIENTS_TRUE@ $(am__EXEEXT_4) $(am__EXEEXT_5) \ @BUILD_CLIENTS_TRUE@ $(am__EXEEXT_6) $(am__EXEEXT_7) \ @BUILD_CLIENTS_TRUE@ $(am__EXEEXT_8) $(am__EXEEXT_9) @BUILD_CLIENTS_TRUE@@INSTALL_DEMO_CLIENTS_TRUE@am__EXEEXT_11 = $(am__EXEEXT_10) @BUILD_WCAP_TOOLS_TRUE@am__EXEEXT_12 = wcap-decode$(EXEEXT) @BUILD_CLIENTS_TRUE@am__EXEEXT_13 = weston-desktop-shell$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-screenshooter$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-keyboard$(EXEEXT) \ @BUILD_CLIENTS_TRUE@ weston-simple-im$(EXEEXT) @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@am__EXEEXT_14 = weston-ivi-shell-user-interface$(EXEEXT) @BUILD_CLIENTS_TRUE@@INSTALL_DEMO_CLIENTS_FALSE@am__EXEEXT_15 = $(am__EXEEXT_10) am__EXEEXT_16 = internal-screenshot.weston$(EXEEXT) am__EXEEXT_17 = config-parser.test$(EXEEXT) vertex-clip.test$(EXEEXT) \ zuctest$(EXEEXT) @ENABLE_EGL_TRUE@am__EXEEXT_18 = buffer-count.weston$(EXEEXT) @ENABLE_XWAYLAND_TEST_TRUE@am__EXEEXT_19 = \ @ENABLE_XWAYLAND_TEST_TRUE@ xwayland-test.weston$(EXEEXT) am__EXEEXT_20 = bad_buffer.weston$(EXEEXT) keyboard.weston$(EXEEXT) \ event.weston$(EXEEXT) button.weston$(EXEEXT) \ text.weston$(EXEEXT) presentation.weston$(EXEEXT) \ roles.weston$(EXEEXT) subsurface.weston$(EXEEXT) \ devices.weston$(EXEEXT) $(am__EXEEXT_18) $(am__EXEEXT_19) @ENABLE_IVI_SHELL_TRUE@am__EXEEXT_21 = ivi-shell-app.weston$(EXEEXT) am__EXEEXT_22 = $(am__EXEEXT_21) @ENABLE_IVI_SHELL_TRUE@am__EXEEXT_23 = ivi-layout.ivi$(EXEEXT) @BUILD_SETBACKLIGHT_TRUE@am__EXEEXT_24 = setbacklight$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS) am_bad_buffer_weston_OBJECTS = \ tests/bad_buffer_weston-bad-buffer-test.$(OBJEXT) bad_buffer_weston_OBJECTS = $(am_bad_buffer_weston_OBJECTS) bad_buffer_weston_DEPENDENCIES = libtest-client.la bad_buffer_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(bad_buffer_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__buffer_count_weston_SOURCES_DIST = tests/buffer-count-test.c @ENABLE_EGL_TRUE@am_buffer_count_weston_OBJECTS = tests/buffer_count_weston-buffer-count-test.$(OBJEXT) buffer_count_weston_OBJECTS = $(am_buffer_count_weston_OBJECTS) @ENABLE_EGL_TRUE@buffer_count_weston_DEPENDENCIES = libtest-client.la \ @ENABLE_EGL_TRUE@ $(am__DEPENDENCIES_1) buffer_count_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(buffer_count_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_button_weston_OBJECTS = tests/button_weston-button-test.$(OBJEXT) button_weston_OBJECTS = $(am_button_weston_OBJECTS) button_weston_DEPENDENCIES = libtest-client.la button_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(button_weston_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_config_parser_test_OBJECTS = \ tests/config_parser_test-config-parser-test.$(OBJEXT) config_parser_test_OBJECTS = $(am_config_parser_test_OBJECTS) config_parser_test_DEPENDENCIES = libshared.la $(am__DEPENDENCIES_1) \ libzunitc.la libzunitcmain.la config_parser_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(config_parser_test_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_devices_weston_OBJECTS = \ tests/devices_weston-devices-test.$(OBJEXT) devices_weston_OBJECTS = $(am_devices_weston_OBJECTS) devices_weston_DEPENDENCIES = libtest-client.la devices_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(devices_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am_event_weston_OBJECTS = tests/event_weston-event-test.$(OBJEXT) event_weston_OBJECTS = $(am_event_weston_OBJECTS) event_weston_DEPENDENCIES = libtest-client.la event_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(event_weston_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_internal_screenshot_weston_OBJECTS = tests/internal_screenshot_weston-internal-screenshot-test.$(OBJEXT) internal_screenshot_weston_OBJECTS = \ $(am_internal_screenshot_weston_OBJECTS) internal_screenshot_weston_DEPENDENCIES = libtest-client.la \ $(am__DEPENDENCIES_1) internal_screenshot_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(internal_screenshot_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__ivi_layout_ivi_SOURCES_DIST = tests/ivi_layout-test.c \ tests/ivi-test.h shared/helpers.h @ENABLE_IVI_SHELL_TRUE@am_ivi_layout_ivi_OBJECTS = tests/ivi_layout_ivi-ivi_layout-test.$(OBJEXT) @ENABLE_IVI_SHELL_TRUE@nodist_ivi_layout_ivi_OBJECTS = protocol/ivi_layout_ivi-ivi-application-protocol.$(OBJEXT) ivi_layout_ivi_OBJECTS = $(am_ivi_layout_ivi_OBJECTS) \ $(nodist_ivi_layout_ivi_OBJECTS) @ENABLE_IVI_SHELL_TRUE@ivi_layout_ivi_DEPENDENCIES = \ @ENABLE_IVI_SHELL_TRUE@ libtest-client.la ivi_layout_ivi_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(ivi_layout_ivi_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am__ivi_shell_app_weston_SOURCES_DIST = tests/ivi-shell-app-test.c @ENABLE_IVI_SHELL_TRUE@am_ivi_shell_app_weston_OBJECTS = tests/ivi_shell_app_weston-ivi-shell-app-test.$(OBJEXT) @ENABLE_IVI_SHELL_TRUE@nodist_ivi_shell_app_weston_OBJECTS = protocol/ivi_shell_app_weston-ivi-application-protocol.$(OBJEXT) ivi_shell_app_weston_OBJECTS = $(am_ivi_shell_app_weston_OBJECTS) \ $(nodist_ivi_shell_app_weston_OBJECTS) @ENABLE_IVI_SHELL_TRUE@ivi_shell_app_weston_DEPENDENCIES = \ @ENABLE_IVI_SHELL_TRUE@ libtest-client.la ivi_shell_app_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_keyboard_weston_OBJECTS = \ tests/keyboard_weston-keyboard-test.$(OBJEXT) keyboard_weston_OBJECTS = $(am_keyboard_weston_OBJECTS) keyboard_weston_DEPENDENCIES = libtest-client.la keyboard_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(keyboard_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_matrix_test_OBJECTS = tests/matrix_test-matrix-test.$(OBJEXT) \ shared/matrix_test-matrix.$(OBJEXT) matrix_test_OBJECTS = $(am_matrix_test_OBJECTS) matrix_test_DEPENDENCIES = am_presentation_weston_OBJECTS = \ tests/presentation_weston-presentation-test.$(OBJEXT) nodist_presentation_weston_OBJECTS = protocol/presentation_weston-presentation_timing-protocol.$(OBJEXT) presentation_weston_OBJECTS = $(am_presentation_weston_OBJECTS) \ $(nodist_presentation_weston_OBJECTS) presentation_weston_DEPENDENCIES = libtest-client.la presentation_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(presentation_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_roles_weston_OBJECTS = tests/roles_weston-roles-test.$(OBJEXT) roles_weston_OBJECTS = $(am_roles_weston_OBJECTS) roles_weston_DEPENDENCIES = libtest-client.la roles_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(roles_weston_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__setbacklight_SOURCES_DIST = tests/setbacklight.c \ src/libbacklight.c src/libbacklight.h @BUILD_SETBACKLIGHT_TRUE@am_setbacklight_OBJECTS = tests/setbacklight-setbacklight.$(OBJEXT) \ @BUILD_SETBACKLIGHT_TRUE@ src/setbacklight-libbacklight.$(OBJEXT) setbacklight_OBJECTS = $(am_setbacklight_OBJECTS) @BUILD_SETBACKLIGHT_TRUE@setbacklight_DEPENDENCIES = \ @BUILD_SETBACKLIGHT_TRUE@ $(am__DEPENDENCIES_1) setbacklight_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(setbacklight_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_spring_tool_OBJECTS = src/spring_tool-spring-tool.$(OBJEXT) \ src/spring_tool-animation.$(OBJEXT) \ shared/spring_tool-matrix.$(OBJEXT) spring_tool_OBJECTS = $(am_spring_tool_OBJECTS) spring_tool_DEPENDENCIES = $(am__DEPENDENCIES_1) spring_tool_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(spring_tool_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_subsurface_weston_OBJECTS = \ tests/subsurface_weston-subsurface-test.$(OBJEXT) subsurface_weston_OBJECTS = $(am_subsurface_weston_OBJECTS) subsurface_weston_DEPENDENCIES = libtest-client.la subsurface_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(subsurface_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am_text_weston_OBJECTS = tests/text_weston-text-test.$(OBJEXT) nodist_text_weston_OBJECTS = \ protocol/text_weston-text-protocol.$(OBJEXT) text_weston_OBJECTS = $(am_text_weston_OBJECTS) \ $(nodist_text_weston_OBJECTS) text_weston_DEPENDENCIES = libtest-client.la text_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(text_weston_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_vertex_clip_test_OBJECTS = tests/vertex-clip-test.$(OBJEXT) \ src/vertex-clipping.$(OBJEXT) vertex_clip_test_OBJECTS = $(am_vertex_clip_test_OBJECTS) vertex_clip_test_DEPENDENCIES = libtest-runner.la am__wcap_decode_SOURCES_DIST = wcap/main.c wcap/wcap-decode.c \ wcap/wcap-decode.h @BUILD_WCAP_TOOLS_TRUE@am_wcap_decode_OBJECTS = \ @BUILD_WCAP_TOOLS_TRUE@ wcap/wcap_decode-main.$(OBJEXT) \ @BUILD_WCAP_TOOLS_TRUE@ wcap/wcap_decode-wcap-decode.$(OBJEXT) wcap_decode_OBJECTS = $(am_wcap_decode_OBJECTS) @BUILD_WCAP_TOOLS_TRUE@wcap_decode_DEPENDENCIES = \ @BUILD_WCAP_TOOLS_TRUE@ $(am__DEPENDENCIES_1) wcap_decode_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(wcap_decode_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_weston_OBJECTS = src/weston-log.$(OBJEXT) \ src/weston-compositor.$(OBJEXT) src/weston-input.$(OBJEXT) \ src/weston-data-device.$(OBJEXT) \ src/weston-screenshooter.$(OBJEXT) \ src/weston-clipboard.$(OBJEXT) src/weston-zoom.$(OBJEXT) \ src/weston-text-backend.$(OBJEXT) \ src/weston-bindings.$(OBJEXT) src/weston-animation.$(OBJEXT) \ src/weston-noop-renderer.$(OBJEXT) \ src/weston-pixman-renderer.$(OBJEXT) \ src/weston-timeline.$(OBJEXT) src/weston-main.$(OBJEXT) \ src/weston-linux-dmabuf.$(OBJEXT) \ shared/weston-matrix.$(OBJEXT) nodist_weston_OBJECTS = \ protocol/weston-screenshooter-protocol.$(OBJEXT) \ protocol/weston-text-cursor-position-protocol.$(OBJEXT) \ protocol/weston-text-protocol.$(OBJEXT) \ protocol/weston-input-method-protocol.$(OBJEXT) \ protocol/weston-workspaces-protocol.$(OBJEXT) \ protocol/weston-presentation_timing-protocol.$(OBJEXT) \ protocol/weston-scaler-protocol.$(OBJEXT) \ protocol/weston-linux-dmabuf-protocol.$(OBJEXT) weston_OBJECTS = $(am_weston_OBJECTS) $(nodist_weston_OBJECTS) weston_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) libshared.la weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_CFLAGS) $(CFLAGS) \ $(weston_LDFLAGS) $(LDFLAGS) -o $@ am__weston_calibrator_SOURCES_DIST = clients/calibrator.c \ shared/helpers.h shared/matrix.c shared/matrix.h @BUILD_CLIENTS_TRUE@am_weston_calibrator_OBJECTS = clients/weston_calibrator-calibrator.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@ shared/weston_calibrator-matrix.$(OBJEXT) weston_calibrator_OBJECTS = $(am_weston_calibrator_OBJECTS) @BUILD_CLIENTS_TRUE@weston_calibrator_DEPENDENCIES = libtoytoolkit.la weston_calibrator_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_calibrator_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_clickdot_SOURCES_DIST = clients/clickdot.c shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_clickdot_OBJECTS = clients/weston_clickdot-clickdot.$(OBJEXT) weston_clickdot_OBJECTS = $(am_weston_clickdot_OBJECTS) @BUILD_CLIENTS_TRUE@weston_clickdot_DEPENDENCIES = libtoytoolkit.la weston_clickdot_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_clickdot_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_cliptest_SOURCES_DIST = clients/cliptest.c \ src/vertex-clipping.c src/vertex-clipping.h @BUILD_CLIENTS_TRUE@am_weston_cliptest_OBJECTS = clients/weston_cliptest-cliptest.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@ src/weston_cliptest-vertex-clipping.$(OBJEXT) weston_cliptest_OBJECTS = $(am_weston_cliptest_OBJECTS) @BUILD_CLIENTS_TRUE@weston_cliptest_DEPENDENCIES = libtoytoolkit.la weston_cliptest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_cliptest_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_desktop_shell_SOURCES_DIST = clients/desktop-shell.c \ shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_desktop_shell_OBJECTS = clients/weston_desktop_shell-desktop-shell.$(OBJEXT) @BUILD_CLIENTS_TRUE@nodist_weston_desktop_shell_OBJECTS = protocol/weston_desktop_shell-desktop-shell-protocol.$(OBJEXT) weston_desktop_shell_OBJECTS = $(am_weston_desktop_shell_OBJECTS) \ $(nodist_weston_desktop_shell_OBJECTS) @BUILD_CLIENTS_TRUE@weston_desktop_shell_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@ libtoytoolkit.la weston_desktop_shell_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_desktop_shell_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_dnd_SOURCES_DIST = clients/dnd.c shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_dnd_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_dnd-dnd.$(OBJEXT) weston_dnd_OBJECTS = $(am_weston_dnd_OBJECTS) @BUILD_CLIENTS_TRUE@weston_dnd_DEPENDENCIES = libtoytoolkit.la weston_dnd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_dnd_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_editor_SOURCES_DIST = clients/editor.c shared/helpers.h @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@am_weston_editor_OBJECTS = clients/weston_editor-editor.$(OBJEXT) @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@nodist_weston_editor_OBJECTS = protocol/weston_editor-text-protocol.$(OBJEXT) weston_editor_OBJECTS = $(am_weston_editor_OBJECTS) \ $(nodist_weston_editor_OBJECTS) @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@weston_editor_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ libtoytoolkit.la \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ $(am__DEPENDENCIES_1) weston_editor_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_editor_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_eventdemo_SOURCES_DIST = clients/eventdemo.c \ shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_eventdemo_OBJECTS = clients/weston_eventdemo-eventdemo.$(OBJEXT) weston_eventdemo_OBJECTS = $(am_weston_eventdemo_OBJECTS) @BUILD_CLIENTS_TRUE@weston_eventdemo_DEPENDENCIES = libtoytoolkit.la weston_eventdemo_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_eventdemo_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_flower_SOURCES_DIST = clients/flower.c @BUILD_CLIENTS_TRUE@am_weston_flower_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_flower-flower.$(OBJEXT) weston_flower_OBJECTS = $(am_weston_flower_OBJECTS) @BUILD_CLIENTS_TRUE@weston_flower_DEPENDENCIES = libtoytoolkit.la weston_flower_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_flower_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_fullscreen_SOURCES_DIST = clients/fullscreen.c @BUILD_CLIENTS_TRUE@am_weston_fullscreen_OBJECTS = clients/weston_fullscreen-fullscreen.$(OBJEXT) @BUILD_CLIENTS_TRUE@nodist_weston_fullscreen_OBJECTS = protocol/weston_fullscreen-fullscreen-shell-protocol.$(OBJEXT) weston_fullscreen_OBJECTS = $(am_weston_fullscreen_OBJECTS) \ $(nodist_weston_fullscreen_OBJECTS) @BUILD_CLIENTS_TRUE@weston_fullscreen_DEPENDENCIES = libtoytoolkit.la weston_fullscreen_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_fullscreen_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_gears_SOURCES_DIST = clients/gears.c @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@am_weston_gears_OBJECTS = clients/weston_gears-gears.$(OBJEXT) weston_gears_OBJECTS = $(am_weston_gears_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@weston_gears_DEPENDENCIES = libtoytoolkit.la weston_gears_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_gears_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_image_SOURCES_DIST = clients/image.c @BUILD_CLIENTS_TRUE@am_weston_image_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_image-image.$(OBJEXT) weston_image_OBJECTS = $(am_weston_image_OBJECTS) @BUILD_CLIENTS_TRUE@weston_image_DEPENDENCIES = libtoytoolkit.la weston_image_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_image_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_info_SOURCES_DIST = clients/weston-info.c shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_info_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_info-weston-info.$(OBJEXT) @BUILD_CLIENTS_TRUE@nodist_weston_info_OBJECTS = protocol/weston_info-presentation_timing-protocol.$(OBJEXT) weston_info_OBJECTS = $(am_weston_info_OBJECTS) \ $(nodist_weston_info_OBJECTS) @BUILD_CLIENTS_TRUE@weston_info_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@ libshared.la weston_info_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_info_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_ivi_shell_user_interface_SOURCES_DIST = \ clients/ivi-shell-user-interface.c shared/helpers.h @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@am_weston_ivi_shell_user_interface_OBJECTS = clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.$(OBJEXT) @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@nodist_weston_ivi_shell_user_interface_OBJECTS = protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ protocol/weston_ivi_shell_user_interface-ivi-application-protocol.$(OBJEXT) weston_ivi_shell_user_interface_OBJECTS = \ $(am_weston_ivi_shell_user_interface_OBJECTS) \ $(nodist_weston_ivi_shell_user_interface_OBJECTS) @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@weston_ivi_shell_user_interface_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ libtoytoolkit.la weston_ivi_shell_user_interface_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_keyboard_SOURCES_DIST = clients/keyboard.c @BUILD_CLIENTS_TRUE@am_weston_keyboard_OBJECTS = clients/weston_keyboard-keyboard.$(OBJEXT) @BUILD_CLIENTS_TRUE@nodist_weston_keyboard_OBJECTS = protocol/weston_keyboard-desktop-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@ protocol/weston_keyboard-input-method-protocol.$(OBJEXT) weston_keyboard_OBJECTS = $(am_weston_keyboard_OBJECTS) \ $(nodist_weston_keyboard_OBJECTS) @BUILD_CLIENTS_TRUE@weston_keyboard_DEPENDENCIES = libtoytoolkit.la weston_keyboard_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_keyboard_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_launch_SOURCES_DIST = src/weston-launch.c \ src/weston-launch.h @BUILD_WESTON_LAUNCH_TRUE@am_weston_launch_OBJECTS = src/weston_launch-weston-launch.$(OBJEXT) weston_launch_OBJECTS = $(am_weston_launch_OBJECTS) @BUILD_WESTON_LAUNCH_TRUE@weston_launch_DEPENDENCIES = \ @BUILD_WESTON_LAUNCH_TRUE@ $(am__DEPENDENCIES_1) \ @BUILD_WESTON_LAUNCH_TRUE@ $(am__DEPENDENCIES_1) \ @BUILD_WESTON_LAUNCH_TRUE@ $(am__DEPENDENCIES_1) weston_launch_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_launch_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_multi_resource_SOURCES_DIST = clients/multi-resource.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am_weston_multi_resource_OBJECTS = clients/weston_multi_resource-multi-resource.$(OBJEXT) weston_multi_resource_OBJECTS = $(am_weston_multi_resource_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_multi_resource_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ libshared.la weston_multi_resource_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_multi_resource_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_nested_SOURCES_DIST = clients/nested.c shared/helpers.h @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@am_weston_nested_OBJECTS = clients/weston_nested-nested.$(OBJEXT) weston_nested_OBJECTS = $(am_weston_nested_OBJECTS) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@ libtoytoolkit.la \ @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@ $(am__DEPENDENCIES_1) weston_nested_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_nested_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_nested_client_SOURCES_DIST = clients/nested-client.c @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@am_weston_nested_client_OBJECTS = clients/weston_nested_client-nested-client.$(OBJEXT) weston_nested_client_OBJECTS = $(am_weston_nested_client_OBJECTS) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_client_DEPENDENCIES = $(am__DEPENDENCIES_1) weston_nested_client_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_nested_client_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_presentation_shm_SOURCES_DIST = clients/presentation-shm.c \ shared/helpers.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am_weston_presentation_shm_OBJECTS = clients/weston_presentation_shm-presentation-shm.$(OBJEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@nodist_weston_presentation_shm_OBJECTS = protocol/weston_presentation_shm-presentation_timing-protocol.$(OBJEXT) weston_presentation_shm_OBJECTS = \ $(am_weston_presentation_shm_OBJECTS) \ $(nodist_weston_presentation_shm_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_presentation_shm_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ libshared.la weston_presentation_shm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_presentation_shm_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_resizor_SOURCES_DIST = clients/resizor.c @BUILD_CLIENTS_TRUE@am_weston_resizor_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_resizor-resizor.$(OBJEXT) weston_resizor_OBJECTS = $(am_weston_resizor_OBJECTS) @BUILD_CLIENTS_TRUE@weston_resizor_DEPENDENCIES = libtoytoolkit.la weston_resizor_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_resizor_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o \ $@ am__weston_scaler_SOURCES_DIST = clients/scaler.c @BUILD_CLIENTS_TRUE@am_weston_scaler_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_scaler-scaler.$(OBJEXT) weston_scaler_OBJECTS = $(am_weston_scaler_OBJECTS) @BUILD_CLIENTS_TRUE@weston_scaler_DEPENDENCIES = libtoytoolkit.la weston_scaler_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_scaler_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_screenshooter_SOURCES_DIST = clients/screenshot.c @BUILD_CLIENTS_TRUE@am_weston_screenshooter_OBJECTS = clients/weston_screenshooter-screenshot.$(OBJEXT) @BUILD_CLIENTS_TRUE@nodist_weston_screenshooter_OBJECTS = protocol/weston_screenshooter-screenshooter-protocol.$(OBJEXT) weston_screenshooter_OBJECTS = $(am_weston_screenshooter_OBJECTS) \ $(nodist_weston_screenshooter_OBJECTS) @BUILD_CLIENTS_TRUE@weston_screenshooter_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@ $(am__DEPENDENCIES_1) libshared.la weston_screenshooter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_screenshooter_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_simple_damage_SOURCES_DIST = clients/simple-damage.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am_weston_simple_damage_OBJECTS = clients/weston_simple_damage-simple-damage.$(OBJEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@nodist_weston_simple_damage_OBJECTS = protocol/weston_simple_damage-scaler-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/weston_simple_damage-xdg-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/weston_simple_damage-fullscreen-shell-protocol.$(OBJEXT) weston_simple_damage_OBJECTS = $(am_weston_simple_damage_OBJECTS) \ $(nodist_weston_simple_damage_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_damage_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ libshared.la weston_simple_damage_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_simple_damage_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_simple_dmabuf_SOURCES_DIST = clients/simple-dmabuf.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@am_weston_simple_dmabuf_OBJECTS = clients/weston_simple_dmabuf-simple-dmabuf.$(OBJEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@nodist_weston_simple_dmabuf_OBJECTS = protocol/weston_simple_dmabuf-xdg-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/weston_simple_dmabuf-fullscreen-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/weston_simple_dmabuf-linux-dmabuf-protocol.$(OBJEXT) weston_simple_dmabuf_OBJECTS = $(am_weston_simple_dmabuf_OBJECTS) \ $(nodist_weston_simple_dmabuf_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@weston_simple_dmabuf_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ libshared.la weston_simple_dmabuf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_simple_egl_SOURCES_DIST = clients/simple-egl.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@am_weston_simple_egl_OBJECTS = clients/weston_simple_egl-simple-egl.$(OBJEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@nodist_weston_simple_egl_OBJECTS = protocol/weston_simple_egl-xdg-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@ protocol/weston_simple_egl-ivi-application-protocol.$(OBJEXT) weston_simple_egl_OBJECTS = $(am_weston_simple_egl_OBJECTS) \ $(nodist_weston_simple_egl_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@weston_simple_egl_DEPENDENCIES = $(am__DEPENDENCIES_1) weston_simple_egl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_simple_egl_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_simple_im_SOURCES_DIST = clients/weston-simple-im.c @BUILD_CLIENTS_TRUE@am_weston_simple_im_OBJECTS = clients/weston_simple_im-weston-simple-im.$(OBJEXT) @BUILD_CLIENTS_TRUE@nodist_weston_simple_im_OBJECTS = protocol/weston_simple_im-input-method-protocol.$(OBJEXT) weston_simple_im_OBJECTS = $(am_weston_simple_im_OBJECTS) \ $(nodist_weston_simple_im_OBJECTS) @BUILD_CLIENTS_TRUE@weston_simple_im_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@ $(am__DEPENDENCIES_1) weston_simple_im_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_simple_im_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_simple_shm_SOURCES_DIST = clients/simple-shm.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am_weston_simple_shm_OBJECTS = clients/weston_simple_shm-simple-shm.$(OBJEXT) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@nodist_weston_simple_shm_OBJECTS = protocol/weston_simple_shm-xdg-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/weston_simple_shm-fullscreen-shell-protocol.$(OBJEXT) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/weston_simple_shm-ivi-application-protocol.$(OBJEXT) weston_simple_shm_OBJECTS = $(am_weston_simple_shm_OBJECTS) \ $(nodist_weston_simple_shm_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_shm_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ libshared.la weston_simple_shm_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_simple_shm_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_simple_touch_SOURCES_DIST = clients/simple-touch.c \ shared/helpers.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@am_weston_simple_touch_OBJECTS = clients/weston_simple_touch-simple-touch.$(OBJEXT) weston_simple_touch_OBJECTS = $(am_weston_simple_touch_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_touch_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ libshared.la weston_simple_touch_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_simple_touch_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_smoke_SOURCES_DIST = clients/smoke.c @BUILD_CLIENTS_TRUE@am_weston_smoke_OBJECTS = \ @BUILD_CLIENTS_TRUE@ clients/weston_smoke-smoke.$(OBJEXT) weston_smoke_OBJECTS = $(am_weston_smoke_OBJECTS) @BUILD_CLIENTS_TRUE@weston_smoke_DEPENDENCIES = libtoytoolkit.la weston_smoke_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(weston_smoke_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__weston_stacking_SOURCES_DIST = clients/stacking.c shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_stacking_OBJECTS = clients/weston_stacking-stacking.$(OBJEXT) weston_stacking_OBJECTS = $(am_weston_stacking_OBJECTS) @BUILD_CLIENTS_TRUE@weston_stacking_DEPENDENCIES = libtoytoolkit.la weston_stacking_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_stacking_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_subsurfaces_SOURCES_DIST = clients/subsurfaces.c \ shared/helpers.h @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@am_weston_subsurfaces_OBJECTS = clients/weston_subsurfaces-subsurfaces.$(OBJEXT) weston_subsurfaces_OBJECTS = $(am_weston_subsurfaces_OBJECTS) @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@weston_subsurfaces_DEPENDENCIES = libtoytoolkit.la \ @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@ $(am__DEPENDENCIES_1) weston_subsurfaces_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_subsurfaces_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__weston_terminal_SOURCES_DIST = clients/terminal.c shared/helpers.h @BUILD_CLIENTS_TRUE@am_weston_terminal_OBJECTS = clients/weston_terminal-terminal.$(OBJEXT) weston_terminal_OBJECTS = $(am_weston_terminal_OBJECTS) @BUILD_CLIENTS_TRUE@weston_terminal_DEPENDENCIES = libtoytoolkit.la weston_terminal_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_terminal_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ am__weston_transformed_SOURCES_DIST = clients/transformed.c @BUILD_CLIENTS_TRUE@am_weston_transformed_OBJECTS = clients/weston_transformed-transformed.$(OBJEXT) weston_transformed_OBJECTS = $(am_weston_transformed_OBJECTS) @BUILD_CLIENTS_TRUE@weston_transformed_DEPENDENCIES = \ @BUILD_CLIENTS_TRUE@ libtoytoolkit.la weston_transformed_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(weston_transformed_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__xwayland_test_weston_SOURCES_DIST = tests/xwayland-test.c @ENABLE_XWAYLAND_TEST_TRUE@am_xwayland_test_weston_OBJECTS = tests/xwayland_test_weston-xwayland-test.$(OBJEXT) xwayland_test_weston_OBJECTS = $(am_xwayland_test_weston_OBJECTS) @ENABLE_XWAYLAND_TEST_TRUE@xwayland_test_weston_DEPENDENCIES = \ @ENABLE_XWAYLAND_TEST_TRUE@ libtest-client.la \ @ENABLE_XWAYLAND_TEST_TRUE@ $(am__DEPENDENCIES_1) xwayland_test_weston_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(xwayland_test_weston_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_zuctest_OBJECTS = \ tools/zunitc/test/zuctest-fixtures_test.$(OBJEXT) \ tools/zunitc/test/zuctest-zunitc_test.$(OBJEXT) zuctest_OBJECTS = $(am_zuctest_OBJECTS) zuctest_DEPENDENCIES = libzunitc.la libzunitcmain.la zuctest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(zuctest_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cms_colord_la_SOURCES) $(cms_static_la_SOURCES) \ $(desktop_shell_la_SOURCES) $(nodist_desktop_shell_la_SOURCES) \ $(drm_backend_la_SOURCES) $(fbdev_backend_la_SOURCES) \ $(fullscreen_shell_la_SOURCES) \ $(nodist_fullscreen_shell_la_SOURCES) \ $(gl_renderer_la_SOURCES) $(headless_backend_la_SOURCES) \ $(hmi_controller_la_SOURCES) \ $(nodist_hmi_controller_la_SOURCES) \ $(ivi_layout_internal_test_la_SOURCES) \ $(ivi_layout_test_la_SOURCES) \ $(nodist_ivi_layout_test_la_SOURCES) $(ivi_shell_la_SOURCES) \ $(nodist_ivi_shell_la_SOURCES) $(libsession_helper_la_SOURCES) \ $(libshared_cairo_la_SOURCES) $(libshared_la_SOURCES) \ $(libtest_client_la_SOURCES) \ $(nodist_libtest_client_la_SOURCES) \ $(libtest_runner_la_SOURCES) $(libtoytoolkit_la_SOURCES) \ $(nodist_libtoytoolkit_la_SOURCES) $(libzunitc_la_SOURCES) \ $(libzunitcmain_la_SOURCES) $(rdp_backend_la_SOURCES) \ $(rpi_backend_la_SOURCES) $(screen_share_la_SOURCES) \ $(nodist_screen_share_la_SOURCES) \ $(surface_global_test_la_SOURCES) \ $(surface_screenshot_la_SOURCES) $(surface_test_la_SOURCES) \ $(wayland_backend_la_SOURCES) \ $(nodist_wayland_backend_la_SOURCES) $(weston_test_la_SOURCES) \ $(nodist_weston_test_la_SOURCES) $(x11_backend_la_SOURCES) \ $(xwayland_la_SOURCES) $(bad_buffer_weston_SOURCES) \ $(buffer_count_weston_SOURCES) $(button_weston_SOURCES) \ $(config_parser_test_SOURCES) $(devices_weston_SOURCES) \ $(event_weston_SOURCES) $(internal_screenshot_weston_SOURCES) \ $(ivi_layout_ivi_SOURCES) $(nodist_ivi_layout_ivi_SOURCES) \ $(ivi_shell_app_weston_SOURCES) \ $(nodist_ivi_shell_app_weston_SOURCES) \ $(keyboard_weston_SOURCES) $(matrix_test_SOURCES) \ $(presentation_weston_SOURCES) \ $(nodist_presentation_weston_SOURCES) $(roles_weston_SOURCES) \ $(setbacklight_SOURCES) $(spring_tool_SOURCES) \ $(subsurface_weston_SOURCES) $(text_weston_SOURCES) \ $(nodist_text_weston_SOURCES) $(vertex_clip_test_SOURCES) \ $(wcap_decode_SOURCES) $(weston_SOURCES) \ $(nodist_weston_SOURCES) $(weston_calibrator_SOURCES) \ $(weston_clickdot_SOURCES) $(weston_cliptest_SOURCES) \ $(weston_desktop_shell_SOURCES) \ $(nodist_weston_desktop_shell_SOURCES) $(weston_dnd_SOURCES) \ $(weston_editor_SOURCES) $(nodist_weston_editor_SOURCES) \ $(weston_eventdemo_SOURCES) $(weston_flower_SOURCES) \ $(weston_fullscreen_SOURCES) \ $(nodist_weston_fullscreen_SOURCES) $(weston_gears_SOURCES) \ $(weston_image_SOURCES) $(weston_info_SOURCES) \ $(nodist_weston_info_SOURCES) \ $(weston_ivi_shell_user_interface_SOURCES) \ $(nodist_weston_ivi_shell_user_interface_SOURCES) \ $(weston_keyboard_SOURCES) $(nodist_weston_keyboard_SOURCES) \ $(weston_launch_SOURCES) $(weston_multi_resource_SOURCES) \ $(weston_nested_SOURCES) $(weston_nested_client_SOURCES) \ $(weston_presentation_shm_SOURCES) \ $(nodist_weston_presentation_shm_SOURCES) \ $(weston_resizor_SOURCES) $(weston_scaler_SOURCES) \ $(weston_screenshooter_SOURCES) \ $(nodist_weston_screenshooter_SOURCES) \ $(weston_simple_damage_SOURCES) \ $(nodist_weston_simple_damage_SOURCES) \ $(weston_simple_dmabuf_SOURCES) \ $(nodist_weston_simple_dmabuf_SOURCES) \ $(weston_simple_egl_SOURCES) \ $(nodist_weston_simple_egl_SOURCES) \ $(weston_simple_im_SOURCES) $(nodist_weston_simple_im_SOURCES) \ $(weston_simple_shm_SOURCES) \ $(nodist_weston_simple_shm_SOURCES) \ $(weston_simple_touch_SOURCES) $(weston_smoke_SOURCES) \ $(weston_stacking_SOURCES) $(weston_subsurfaces_SOURCES) \ $(weston_terminal_SOURCES) $(weston_transformed_SOURCES) \ $(xwayland_test_weston_SOURCES) $(zuctest_SOURCES) DIST_SOURCES = $(am__cms_colord_la_SOURCES_DIST) \ $(am__cms_static_la_SOURCES_DIST) \ $(am__desktop_shell_la_SOURCES_DIST) \ $(am__drm_backend_la_SOURCES_DIST) \ $(am__fbdev_backend_la_SOURCES_DIST) \ $(am__fullscreen_shell_la_SOURCES_DIST) \ $(am__gl_renderer_la_SOURCES_DIST) \ $(am__headless_backend_la_SOURCES_DIST) \ $(am__hmi_controller_la_SOURCES_DIST) \ $(am__ivi_layout_internal_test_la_SOURCES_DIST) \ $(am__ivi_layout_test_la_SOURCES_DIST) \ $(am__ivi_shell_la_SOURCES_DIST) \ $(am__libsession_helper_la_SOURCES_DIST) \ $(libshared_cairo_la_SOURCES) $(libshared_la_SOURCES) \ $(libtest_client_la_SOURCES) $(libtest_runner_la_SOURCES) \ $(am__libtoytoolkit_la_SOURCES_DIST) $(libzunitc_la_SOURCES) \ $(libzunitcmain_la_SOURCES) $(am__rdp_backend_la_SOURCES_DIST) \ $(am__rpi_backend_la_SOURCES_DIST) \ $(am__screen_share_la_SOURCES_DIST) \ $(surface_global_test_la_SOURCES) \ $(surface_screenshot_la_SOURCES) $(surface_test_la_SOURCES) \ $(am__wayland_backend_la_SOURCES_DIST) \ $(weston_test_la_SOURCES) $(am__x11_backend_la_SOURCES_DIST) \ $(am__xwayland_la_SOURCES_DIST) $(bad_buffer_weston_SOURCES) \ $(am__buffer_count_weston_SOURCES_DIST) \ $(button_weston_SOURCES) $(config_parser_test_SOURCES) \ $(devices_weston_SOURCES) $(event_weston_SOURCES) \ $(internal_screenshot_weston_SOURCES) \ $(am__ivi_layout_ivi_SOURCES_DIST) \ $(am__ivi_shell_app_weston_SOURCES_DIST) \ $(keyboard_weston_SOURCES) $(matrix_test_SOURCES) \ $(presentation_weston_SOURCES) $(roles_weston_SOURCES) \ $(am__setbacklight_SOURCES_DIST) $(spring_tool_SOURCES) \ $(subsurface_weston_SOURCES) $(text_weston_SOURCES) \ $(vertex_clip_test_SOURCES) $(am__wcap_decode_SOURCES_DIST) \ $(weston_SOURCES) $(am__weston_calibrator_SOURCES_DIST) \ $(am__weston_clickdot_SOURCES_DIST) \ $(am__weston_cliptest_SOURCES_DIST) \ $(am__weston_desktop_shell_SOURCES_DIST) \ $(am__weston_dnd_SOURCES_DIST) \ $(am__weston_editor_SOURCES_DIST) \ $(am__weston_eventdemo_SOURCES_DIST) \ $(am__weston_flower_SOURCES_DIST) \ $(am__weston_fullscreen_SOURCES_DIST) \ $(am__weston_gears_SOURCES_DIST) \ $(am__weston_image_SOURCES_DIST) \ $(am__weston_info_SOURCES_DIST) \ $(am__weston_ivi_shell_user_interface_SOURCES_DIST) \ $(am__weston_keyboard_SOURCES_DIST) \ $(am__weston_launch_SOURCES_DIST) \ $(am__weston_multi_resource_SOURCES_DIST) \ $(am__weston_nested_SOURCES_DIST) \ $(am__weston_nested_client_SOURCES_DIST) \ $(am__weston_presentation_shm_SOURCES_DIST) \ $(am__weston_resizor_SOURCES_DIST) \ $(am__weston_scaler_SOURCES_DIST) \ $(am__weston_screenshooter_SOURCES_DIST) \ $(am__weston_simple_damage_SOURCES_DIST) \ $(am__weston_simple_dmabuf_SOURCES_DIST) \ $(am__weston_simple_egl_SOURCES_DIST) \ $(am__weston_simple_im_SOURCES_DIST) \ $(am__weston_simple_shm_SOURCES_DIST) \ $(am__weston_simple_touch_SOURCES_DIST) \ $(am__weston_smoke_SOURCES_DIST) \ $(am__weston_stacking_SOURCES_DIST) \ $(am__weston_subsurfaces_SOURCES_DIST) \ $(am__weston_terminal_SOURCES_DIST) \ $(am__weston_transformed_SOURCES_DIST) \ $(am__xwayland_test_weston_SOURCES_DIST) $(zuctest_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 man7dir = $(mandir)/man7 NROFF = nroff MANS = $(man_MANS) am__dist_westondata_DATA_DIST = data/wayland.svg data/wayland.png \ data/pattern.png data/terminal.png data/border.png \ data/icon_window.png data/sign_close.png \ data/sign_maximize.png data/sign_minimize.png \ data/background.png data/tiling.png data/fullscreen.png \ data/panel.png data/random.png data/sidebyside.png \ data/home.png data/icon_ivi_clickdot.png \ data/icon_ivi_flower.png data/icon_ivi_simple-egl.png \ data/icon_ivi_simple-shm.png data/icon_ivi_smoke.png DATA = $(dist_wayland_session_DATA) $(dist_westondata_DATA) \ $(pkgconfig_DATA) HEADERS = $(westoninclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope check recheck am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) am__test_logs3 = $(am__test_logs2:.la.log=.log) LA_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LA_LOG_COMPILE = $(LA_LOG_COMPILER) $(AM_LA_LOG_FLAGS) $(LA_LOG_FLAGS) TEST_LOGS = $(am__test_logs3:.weston.log=.log) WESTON_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver WESTON_LOG_COMPILE = $(WESTON_LOG_COMPILER) $(AM_WESTON_LOG_FLAGS) \ $(WESTON_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) GZIP_ENV = --best DIST_ARCHIVES = $(distdir).tar.xz DIST_TARGETS = dist-xz distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CAIRO_CFLAGS = @CAIRO_CFLAGS@ CAIRO_EGL_CFLAGS = @CAIRO_EGL_CFLAGS@ CAIRO_EGL_LIBS = @CAIRO_EGL_LIBS@ CAIRO_LIBS = @CAIRO_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLIENT_CFLAGS = @CLIENT_CFLAGS@ CLIENT_LIBS = @CLIENT_LIBS@ COLORD_CFLAGS = @COLORD_CFLAGS@ COLORD_LIBS = @COLORD_LIBS@ COMPOSITOR_CFLAGS = @COMPOSITOR_CFLAGS@ COMPOSITOR_LIBS = @COMPOSITOR_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOPEN_LIBS = @DLOPEN_LIBS@ DOXYGEN = @DOXYGEN@ DRM_COMPOSITOR_CFLAGS = @DRM_COMPOSITOR_CFLAGS@ DRM_COMPOSITOR_GBM_CFLAGS = @DRM_COMPOSITOR_GBM_CFLAGS@ DRM_COMPOSITOR_GBM_LIBS = @DRM_COMPOSITOR_GBM_LIBS@ DRM_COMPOSITOR_LIBS = @DRM_COMPOSITOR_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGL_CFLAGS = @EGL_CFLAGS@ EGL_LIBS = @EGL_LIBS@ EGL_TESTS_CFLAGS = @EGL_TESTS_CFLAGS@ EGL_TESTS_LIBS = @EGL_TESTS_LIBS@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FBDEV_COMPOSITOR_CFLAGS = @FBDEV_COMPOSITOR_CFLAGS@ FBDEV_COMPOSITOR_LIBS = @FBDEV_COMPOSITOR_LIBS@ FGREP = @FGREP@ GCC_CFLAGS = @GCC_CFLAGS@ GL_RENDERER_CFLAGS = @GL_RENDERER_CFLAGS@ GL_RENDERER_LIBS = @GL_RENDERER_LIBS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JPEG_LIBS = @JPEG_LIBS@ LCMS_CFLAGS = @LCMS_CFLAGS@ LCMS_LIBS = @LCMS_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ LIBDRM_LIBS = @LIBDRM_LIBS@ LIBINPUT_BACKEND_CFLAGS = @LIBINPUT_BACKEND_CFLAGS@ LIBINPUT_BACKEND_LIBS = @LIBINPUT_BACKEND_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIBVA_CFLAGS = @LIBVA_CFLAGS@ LIBVA_LIBS = @LIBVA_LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_LIBS = @PAM_LIBS@ PANGO_CFLAGS = @PANGO_CFLAGS@ PANGO_LIBS = @PANGO_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ RANLIB = @RANLIB@ RDP_COMPOSITOR_CFLAGS = @RDP_COMPOSITOR_CFLAGS@ RDP_COMPOSITOR_LIBS = @RDP_COMPOSITOR_LIBS@ RPI_BCM_HOST_CFLAGS = @RPI_BCM_HOST_CFLAGS@ RPI_BCM_HOST_LIBS = @RPI_BCM_HOST_LIBS@ RPI_COMPOSITOR_CFLAGS = @RPI_COMPOSITOR_CFLAGS@ RPI_COMPOSITOR_LIBS = @RPI_COMPOSITOR_LIBS@ SCREEN_SHARE_CFLAGS = @SCREEN_SHARE_CFLAGS@ SCREEN_SHARE_LIBS = @SCREEN_SHARE_LIBS@ SED = @SED@ SERVER_CFLAGS = @SERVER_CFLAGS@ SERVER_LIBS = @SERVER_LIBS@ SETBACKLIGHT_CFLAGS = @SETBACKLIGHT_CFLAGS@ SETBACKLIGHT_LIBS = @SETBACKLIGHT_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMPLE_CLIENT_CFLAGS = @SIMPLE_CLIENT_CFLAGS@ SIMPLE_CLIENT_LIBS = @SIMPLE_CLIENT_LIBS@ SIMPLE_DMABUF_CLIENT_CFLAGS = @SIMPLE_DMABUF_CLIENT_CFLAGS@ SIMPLE_DMABUF_CLIENT_LIBS = @SIMPLE_DMABUF_CLIENT_LIBS@ SIMPLE_EGL_CLIENT_CFLAGS = @SIMPLE_EGL_CLIENT_CFLAGS@ SIMPLE_EGL_CLIENT_LIBS = @SIMPLE_EGL_CLIENT_LIBS@ STRIP = @STRIP@ SYSTEMD_LOGIN_209_CFLAGS = @SYSTEMD_LOGIN_209_CFLAGS@ SYSTEMD_LOGIN_209_LIBS = @SYSTEMD_LOGIN_209_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ TEST_CLIENT_CFLAGS = @TEST_CLIENT_CFLAGS@ TEST_CLIENT_LIBS = @TEST_CLIENT_LIBS@ VERSION = @VERSION@ WAYLAND_COMPOSITOR_CFLAGS = @WAYLAND_COMPOSITOR_CFLAGS@ WAYLAND_COMPOSITOR_LIBS = @WAYLAND_COMPOSITOR_LIBS@ WAYLAND_SCANNER_CFLAGS = @WAYLAND_SCANNER_CFLAGS@ WAYLAND_SCANNER_LIBS = @WAYLAND_SCANNER_LIBS@ WCAP_CFLAGS = @WCAP_CFLAGS@ WCAP_LIBS = @WCAP_LIBS@ WEBP_CFLAGS = @WEBP_CFLAGS@ WEBP_LIBS = @WEBP_LIBS@ WESTON_INFO_CFLAGS = @WESTON_INFO_CFLAGS@ WESTON_INFO_LIBS = @WESTON_INFO_LIBS@ WESTON_NATIVE_BACKEND = @WESTON_NATIVE_BACKEND@ WESTON_SHELL_CLIENT = @WESTON_SHELL_CLIENT@ WESTON_VERSION = @WESTON_VERSION@ WESTON_VERSION_MAJOR = @WESTON_VERSION_MAJOR@ WESTON_VERSION_MICRO = @WESTON_VERSION_MICRO@ WESTON_VERSION_MINOR = @WESTON_VERSION_MINOR@ X11_COMPOSITOR_CFLAGS = @X11_COMPOSITOR_CFLAGS@ X11_COMPOSITOR_LIBS = @X11_COMPOSITOR_LIBS@ X11_COMPOSITOR_XKB_CFLAGS = @X11_COMPOSITOR_XKB_CFLAGS@ X11_COMPOSITOR_XKB_LIBS = @X11_COMPOSITOR_XKB_LIBS@ XCB_CFLAGS = @XCB_CFLAGS@ XCB_LIBS = @XCB_LIBS@ XSERVER_PATH = @XSERVER_PATH@ XWAYLAND_CFLAGS = @XWAYLAND_CFLAGS@ XWAYLAND_LIBS = @XWAYLAND_LIBS@ XWAYLAND_TEST_CFLAGS = @XWAYLAND_TEST_CFLAGS@ XWAYLAND_TEST_LIBS = @XWAYLAND_TEST_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ wayland_scanner = @wayland_scanner@ ACLOCAL_AMFLAGS = -I m4 moduledir = $(libdir)/weston module_LTLIBRARIES = $(am__append_5) $(am__append_6) $(am__append_7) \ $(am__append_11) $(am__append_12) $(am__append_16) \ $(am__append_17) $(am__append_18) $(am__append_19) \ $(am__append_20) $(am__append_38) $(am__append_40) \ $(am__append_42) $(am__append_44) $(am__append_45) # # Shared utilities # # # manual test modules in tests subdirectory # noinst_LTLIBRARIES = libsession-helper.la $(am__append_13) \ $(am__append_30) libshared.la libshared-cairo.la libzunitc.la \ libzunitcmain.la weston-test.la $(module_tests) \ libtest-runner.la libtest-client.la surface-screenshot.la BUILT_SOURCES = $(nodist_weston_SOURCES) $(am__append_29) \ $(am__append_31) protocol/screenshooter-protocol.c \ protocol/screenshooter-client-protocol.h \ protocol/text-cursor-position-client-protocol.h \ protocol/text-cursor-position-protocol.c \ protocol/text-protocol.c protocol/text-client-protocol.h \ protocol/input-method-protocol.c \ protocol/input-method-client-protocol.h \ protocol/desktop-shell-client-protocol.h \ protocol/desktop-shell-protocol.c \ protocol/scaler-client-protocol.h protocol/scaler-protocol.c \ protocol/workspaces-client-protocol.h \ protocol/workspaces-protocol.c \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/ivi-hmi-controller-protocol.c \ protocol/ivi-hmi-controller-client-protocol.h \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h $(am__append_39) \ $(am__append_41) $(am__append_43) \ protocol/weston-test-protocol.c \ protocol/weston-test-server-protocol.h \ protocol/weston-test-client-protocol.h \ protocol/text-protocol.c protocol/text-client-protocol.h AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in \ tests/weston-tests-env tests/internal-screenshot.ini \ tests/reference/internal-screenshot-bad-00.png \ tests/reference/internal-screenshot-good-00.png \ protocol/desktop-shell.xml protocol/screenshooter.xml \ protocol/text.xml protocol/input-method.xml \ protocol/workspaces.xml protocol/text-cursor-position.xml \ protocol/weston-test.xml protocol/xdg-shell.xml \ protocol/fullscreen-shell.xml protocol/presentation_timing.xml \ protocol/scaler.xml protocol/ivi-application.xml \ protocol/ivi-hmi-controller.xml protocol/linux-dmabuf.xml \ man/weston.man man/weston-drm.man man/weston.ini.man AM_CFLAGS = $(GCC_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -I$(top_builddir)/clients \ -I$(top_builddir)/tests \ -I$(top_srcdir)/shared \ -I$(top_builddir)/protocol \ -DDATADIR='"$(datadir)"' \ -DMODULEDIR='"$(moduledir)"' \ -DLIBEXECDIR='"$(libexecdir)"' \ -DBINDIR='"$(bindir)"' CLEANFILES = weston.ini ivi-shell/weston.ini tests/weston-ivi.ini \ internal-screenshot-00.png $(BUILT_SOURCES) $(man_MANS) weston_LDFLAGS = -export-dynamic weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS) weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \ $(DLOPEN_LIBS) -lm libshared.la weston_SOURCES = \ src/git-version.h \ src/log.c \ src/compositor.c \ src/compositor.h \ src/input.c \ src/data-device.c \ src/screenshooter.c \ src/clipboard.c \ src/zoom.c \ src/text-backend.c \ src/bindings.c \ src/animation.c \ src/noop-renderer.c \ src/pixman-renderer.c \ src/pixman-renderer.h \ src/timeline.c \ src/timeline.h \ src/timeline-object.h \ src/main.c \ src/linux-dmabuf.c \ src/linux-dmabuf.h \ shared/helpers.h \ shared/matrix.c \ shared/matrix.h \ shared/timespec-util.h \ shared/zalloc.h \ shared/platform.h \ src/weston-egl-ext.h nodist_weston_SOURCES = \ protocol/screenshooter-protocol.c \ protocol/screenshooter-server-protocol.h \ protocol/text-cursor-position-protocol.c \ protocol/text-cursor-position-server-protocol.h \ protocol/text-protocol.c \ protocol/text-server-protocol.h \ protocol/input-method-protocol.c \ protocol/input-method-server-protocol.h \ protocol/workspaces-protocol.c \ protocol/workspaces-server-protocol.h \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-server-protocol.h \ protocol/scaler-protocol.c \ protocol/scaler-server-protocol.h \ protocol/linux-dmabuf-protocol.c \ protocol/linux-dmabuf-server-protocol.h libsession_helper_la_SOURCES = src/weston-launch.h src/launcher-util.c \ src/launcher-util.h $(am__append_1) libsession_helper_la_CFLAGS = $(AM_CFLAGS) $(LIBDRM_CFLAGS) \ $(PIXMAN_CFLAGS) $(COMPOSITOR_CFLAGS) $(am__append_2) libsession_helper_la_LIBADD = $(LIBDRM_LIBS) $(am__append_3) @BUILD_WESTON_LAUNCH_TRUE@weston_launch_SOURCES = src/weston-launch.c src/weston-launch.h @BUILD_WESTON_LAUNCH_TRUE@weston_launch_CPPFLAGS = -DBINDIR='"$(bindir)"' @BUILD_WESTON_LAUNCH_TRUE@weston_launch_CFLAGS = \ @BUILD_WESTON_LAUNCH_TRUE@ $(AM_CFLAGS) \ @BUILD_WESTON_LAUNCH_TRUE@ $(PAM_CFLAGS) \ @BUILD_WESTON_LAUNCH_TRUE@ $(SYSTEMD_LOGIN_CFLAGS) \ @BUILD_WESTON_LAUNCH_TRUE@ $(LIBDRM_CFLAGS) @BUILD_WESTON_LAUNCH_TRUE@weston_launch_LDADD = $(PAM_LIBS) $(SYSTEMD_LOGIN_LIBS) $(LIBDRM_LIBS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = src/weston.pc wayland_sessiondir = $(datadir)/wayland-sessions dist_wayland_session_DATA = src/weston.desktop westonincludedir = $(includedir)/weston westoninclude_HEADERS = \ src/version.h \ src/compositor.h \ src/timeline-object.h \ shared/matrix.h \ shared/config-parser.h \ shared/zalloc.h \ shared/platform.h @ENABLE_EGL_TRUE@gl_renderer_la_LDFLAGS = -module -avoid-version @ENABLE_EGL_TRUE@gl_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS) @ENABLE_EGL_TRUE@gl_renderer_la_CFLAGS = \ @ENABLE_EGL_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_EGL_TRUE@ $(EGL_CFLAGS) \ @ENABLE_EGL_TRUE@ $(GL_RENDERER_CFLAGS) \ @ENABLE_EGL_TRUE@ $(AM_CFLAGS) @ENABLE_EGL_TRUE@gl_renderer_la_SOURCES = \ @ENABLE_EGL_TRUE@ src/gl-renderer.h \ @ENABLE_EGL_TRUE@ src/gl-renderer.c \ @ENABLE_EGL_TRUE@ src/vertex-clipping.c \ @ENABLE_EGL_TRUE@ src/vertex-clipping.h \ @ENABLE_EGL_TRUE@ shared/helpers.h @ENABLE_X11_COMPOSITOR_TRUE@x11_backend_la_LDFLAGS = -module -avoid-version @ENABLE_X11_COMPOSITOR_TRUE@x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \ @ENABLE_X11_COMPOSITOR_TRUE@ libshared-cairo.la @ENABLE_X11_COMPOSITOR_TRUE@x11_backend_la_CFLAGS = \ @ENABLE_X11_COMPOSITOR_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_X11_COMPOSITOR_TRUE@ $(EGL_CFLAGS) \ @ENABLE_X11_COMPOSITOR_TRUE@ $(PIXMAN_CFLAGS) \ @ENABLE_X11_COMPOSITOR_TRUE@ $(CAIRO_CFLAGS) \ @ENABLE_X11_COMPOSITOR_TRUE@ $(X11_COMPOSITOR_CFLAGS) \ @ENABLE_X11_COMPOSITOR_TRUE@ $(AM_CFLAGS) @ENABLE_X11_COMPOSITOR_TRUE@x11_backend_la_SOURCES = \ @ENABLE_X11_COMPOSITOR_TRUE@ src/compositor-x11.c \ @ENABLE_X11_COMPOSITOR_TRUE@ shared/helpers.h INPUT_BACKEND_LIBS = $(LIBINPUT_BACKEND_LIBS) INPUT_BACKEND_SOURCES = \ src/libinput-seat.c \ src/libinput-seat.h \ src/libinput-device.c \ src/libinput-device.h \ shared/helpers.h @ENABLE_DRM_COMPOSITOR_TRUE@drm_backend_la_LDFLAGS = -module -avoid-version @ENABLE_DRM_COMPOSITOR_TRUE@drm_backend_la_LIBADD = \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(COMPOSITOR_LIBS) \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(DRM_COMPOSITOR_LIBS) \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(INPUT_BACKEND_LIBS) libshared.la \ @ENABLE_DRM_COMPOSITOR_TRUE@ -lrt libsession-helper.la \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(am__append_9) @ENABLE_DRM_COMPOSITOR_TRUE@drm_backend_la_CFLAGS = \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(COMPOSITOR_CFLAGS) $(EGL_CFLAGS) \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(DRM_COMPOSITOR_CFLAGS) \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(AM_CFLAGS) $(am__append_10) @ENABLE_DRM_COMPOSITOR_TRUE@drm_backend_la_SOURCES = \ @ENABLE_DRM_COMPOSITOR_TRUE@ src/compositor-drm.c \ @ENABLE_DRM_COMPOSITOR_TRUE@ $(INPUT_BACKEND_SOURCES) \ @ENABLE_DRM_COMPOSITOR_TRUE@ shared/helpers.h \ @ENABLE_DRM_COMPOSITOR_TRUE@ shared/timespec-util.h \ @ENABLE_DRM_COMPOSITOR_TRUE@ src/libbacklight.c \ @ENABLE_DRM_COMPOSITOR_TRUE@ src/libbacklight.h $(am__append_8) @ENABLE_WAYLAND_COMPOSITOR_TRUE@wayland_backend_la_LDFLAGS = -module -avoid-version @ENABLE_WAYLAND_COMPOSITOR_TRUE@wayland_backend_la_LIBADD = \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(COMPOSITOR_LIBS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(WAYLAND_COMPOSITOR_LIBS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ libshared-cairo.la @ENABLE_WAYLAND_COMPOSITOR_TRUE@wayland_backend_la_CFLAGS = \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(EGL_CFLAGS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(PIXMAN_CFLAGS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(CAIRO_CFLAGS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(WAYLAND_COMPOSITOR_CFLAGS) \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ $(AM_CFLAGS) @ENABLE_WAYLAND_COMPOSITOR_TRUE@wayland_backend_la_SOURCES = \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ src/compositor-wayland.c \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ shared/helpers.h @ENABLE_WAYLAND_COMPOSITOR_TRUE@nodist_wayland_backend_la_SOURCES = \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ protocol/fullscreen-shell-protocol.c \ @ENABLE_WAYLAND_COMPOSITOR_TRUE@ protocol/fullscreen-shell-client-protocol.h @ENABLE_RPI_COMPOSITOR_TRUE@rpi_backend_la_LDFLAGS = -module -avoid-version @ENABLE_RPI_COMPOSITOR_TRUE@rpi_backend_la_LIBADD = \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(COMPOSITOR_LIBS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(RPI_COMPOSITOR_LIBS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(RPI_BCM_HOST_LIBS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(INPUT_BACKEND_LIBS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ libsession-helper.la libshared.la \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__append_14) @ENABLE_RPI_COMPOSITOR_TRUE@rpi_backend_la_CFLAGS = $(AM_CFLAGS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(RPI_COMPOSITOR_CFLAGS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(RPI_BCM_HOST_CFLAGS) \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(am__append_15) @ENABLE_RPI_COMPOSITOR_TRUE@rpi_backend_la_SOURCES = \ @ENABLE_RPI_COMPOSITOR_TRUE@ src/compositor-rpi.c \ @ENABLE_RPI_COMPOSITOR_TRUE@ src/rpi-renderer.c \ @ENABLE_RPI_COMPOSITOR_TRUE@ src/rpi-renderer.h \ @ENABLE_RPI_COMPOSITOR_TRUE@ src/rpi-bcm-stubs.h \ @ENABLE_RPI_COMPOSITOR_TRUE@ shared/helpers.h \ @ENABLE_RPI_COMPOSITOR_TRUE@ $(INPUT_BACKEND_SOURCES) @ENABLE_HEADLESS_COMPOSITOR_TRUE@headless_backend_la_LDFLAGS = -module -avoid-version @ENABLE_HEADLESS_COMPOSITOR_TRUE@headless_backend_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la @ENABLE_HEADLESS_COMPOSITOR_TRUE@headless_backend_la_CFLAGS = $(COMPOSITOR_CFLAGS) $(AM_CFLAGS) @ENABLE_HEADLESS_COMPOSITOR_TRUE@headless_backend_la_SOURCES = \ @ENABLE_HEADLESS_COMPOSITOR_TRUE@ src/compositor-headless.c \ @ENABLE_HEADLESS_COMPOSITOR_TRUE@ shared/helpers.h @ENABLE_FBDEV_COMPOSITOR_TRUE@fbdev_backend_la_LDFLAGS = -module -avoid-version @ENABLE_FBDEV_COMPOSITOR_TRUE@fbdev_backend_la_LIBADD = \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(COMPOSITOR_LIBS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(FBDEV_COMPOSITOR_LIBS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(INPUT_BACKEND_LIBS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ libsession-helper.la \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ libshared.la @ENABLE_FBDEV_COMPOSITOR_TRUE@fbdev_backend_la_CFLAGS = \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(EGL_CFLAGS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(FBDEV_COMPOSITOR_CFLAGS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(PIXMAN_CFLAGS) \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(AM_CFLAGS) @ENABLE_FBDEV_COMPOSITOR_TRUE@fbdev_backend_la_SOURCES = \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ src/compositor-fbdev.c \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ shared/helpers.h \ @ENABLE_FBDEV_COMPOSITOR_TRUE@ $(INPUT_BACKEND_SOURCES) @ENABLE_RDP_COMPOSITOR_TRUE@rdp_backend_la_LDFLAGS = -module -avoid-version @ENABLE_RDP_COMPOSITOR_TRUE@rdp_backend_la_LIBADD = $(COMPOSITOR_LIBS) \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(RDP_COMPOSITOR_LIBS) \ @ENABLE_RDP_COMPOSITOR_TRUE@ libshared.la @ENABLE_RDP_COMPOSITOR_TRUE@rdp_backend_la_CFLAGS = \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(RDP_COMPOSITOR_CFLAGS) \ @ENABLE_RDP_COMPOSITOR_TRUE@ $(AM_CFLAGS) @ENABLE_RDP_COMPOSITOR_TRUE@rdp_backend_la_SOURCES = \ @ENABLE_RDP_COMPOSITOR_TRUE@ src/compositor-rdp.c \ @ENABLE_RDP_COMPOSITOR_TRUE@ shared/helpers.h @HAVE_LCMS_TRUE@cms_static_la_LDFLAGS = -module -avoid-version @HAVE_LCMS_TRUE@cms_static_la_LIBADD = $(COMPOSITOR_LIBS) $(LCMS_LIBS) libshared.la @HAVE_LCMS_TRUE@cms_static_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LCMS_CFLAGS) @HAVE_LCMS_TRUE@cms_static_la_SOURCES = \ @HAVE_LCMS_TRUE@ src/cms-static.c \ @HAVE_LCMS_TRUE@ src/cms-helper.c \ @HAVE_LCMS_TRUE@ src/cms-helper.h \ @HAVE_LCMS_TRUE@ shared/helpers.h @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@cms_colord_la_LDFLAGS = -module -avoid-version @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@cms_colord_la_LIBADD = $(COMPOSITOR_LIBS) $(COLORD_LIBS) @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@cms_colord_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(COLORD_CFLAGS) @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@cms_colord_la_SOURCES = \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ src/cms-colord.c \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ src/cms-helper.c \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ src/cms-helper.h \ @ENABLE_COLORD_TRUE@@HAVE_LCMS_TRUE@ shared/helpers.h spring_tool_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm spring_tool_SOURCES = \ src/spring-tool.c \ src/animation.c \ shared/matrix.c \ shared/matrix.h \ src/compositor.h @BUILD_CLIENTS_TRUE@demo_clients = weston-flower weston-image \ @BUILD_CLIENTS_TRUE@ weston-cliptest weston-dnd weston-smoke \ @BUILD_CLIENTS_TRUE@ weston-resizor weston-eventdemo \ @BUILD_CLIENTS_TRUE@ weston-clickdot weston-transformed \ @BUILD_CLIENTS_TRUE@ weston-fullscreen weston-stacking \ @BUILD_CLIENTS_TRUE@ weston-calibrator weston-scaler \ @BUILD_CLIENTS_TRUE@ $(am__append_26) $(am__append_27) \ @BUILD_CLIENTS_TRUE@ $(am__append_28) $(am__append_32) \ @BUILD_CLIENTS_TRUE@ $(am__append_33) $(am__append_34) \ @BUILD_CLIENTS_TRUE@ $(am__append_35) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_shm_SOURCES = clients/simple-shm.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@nodist_weston_simple_shm_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/xdg-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/xdg-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/fullscreen-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/fullscreen-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/ivi-application-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/ivi-application-client-protocol.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_damage_SOURCES = clients/simple-damage.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@nodist_weston_simple_damage_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/scaler-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/scaler-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/xdg-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/xdg-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/fullscreen-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/fullscreen-shell-client-protocol.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_touch_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ clients/simple-touch.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_touch_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_simple_touch_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_presentation_shm_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ clients/presentation-shm.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@nodist_weston_presentation_shm_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/presentation_timing-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@ protocol/presentation_timing-client-protocol.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_presentation_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_presentation_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lm @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_multi_resource_SOURCES = clients/multi-resource.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_multi_resource_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_CLIENTS_TRUE@weston_multi_resource_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lrt -lm @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@weston_simple_egl_SOURCES = clients/simple-egl.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@nodist_weston_simple_egl_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@ protocol/xdg-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@ protocol/xdg-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@ protocol/ivi-application-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@ protocol/ivi-application-client-protocol.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_EGL_CLIENTS_TRUE@weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@nodist_weston_simple_dmabuf_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/xdg-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/xdg-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/fullscreen-shell-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/fullscreen-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/linux-dmabuf-protocol.c \ @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@ protocol/linux-dmabuf-client-protocol.h @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE@weston_simple_dmabuf_LDADD = $(SIMPLE_DMABUF_CLIENT_LIBS) libshared.la @BUILD_CLIENTS_TRUE@libtoytoolkit_la_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/window.c \ @BUILD_CLIENTS_TRUE@ clients/window.h \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@nodist_libtoytoolkit_la_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/text-cursor-position-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/text-cursor-position-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/scaler-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/scaler-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/workspaces-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/workspaces-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/presentation_timing-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/presentation_timing-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/xdg-shell-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/xdg-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/ivi-application-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/ivi-application-client-protocol.h @BUILD_CLIENTS_TRUE@libtoytoolkit_la_LIBADD = \ @BUILD_CLIENTS_TRUE@ $(CLIENT_LIBS) \ @BUILD_CLIENTS_TRUE@ $(CAIRO_EGL_LIBS) \ @BUILD_CLIENTS_TRUE@ libshared-cairo.la -lrt -lm @BUILD_CLIENTS_TRUE@libtoytoolkit_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_EGL_CFLAGS) @BUILD_CLIENTS_TRUE@weston_flower_SOURCES = clients/flower.c @BUILD_CLIENTS_TRUE@weston_flower_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_flower_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_screenshooter_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/screenshot.c @BUILD_CLIENTS_TRUE@nodist_weston_screenshooter_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/screenshooter-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/screenshooter-client-protocol.h @BUILD_CLIENTS_TRUE@weston_screenshooter_LDADD = $(CLIENT_LIBS) libshared.la @BUILD_CLIENTS_TRUE@weston_screenshooter_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_terminal_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/terminal.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@weston_terminal_LDADD = libtoytoolkit.la -lutil @BUILD_CLIENTS_TRUE@weston_terminal_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_image_SOURCES = clients/image.c @BUILD_CLIENTS_TRUE@weston_image_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_image_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_cliptest_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/cliptest.c \ @BUILD_CLIENTS_TRUE@ src/vertex-clipping.c \ @BUILD_CLIENTS_TRUE@ src/vertex-clipping.h @BUILD_CLIENTS_TRUE@weston_cliptest_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_cliptest_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_dnd_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/dnd.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@weston_dnd_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_dnd_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_smoke_SOURCES = clients/smoke.c @BUILD_CLIENTS_TRUE@weston_smoke_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_smoke_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_resizor_SOURCES = clients/resizor.c @BUILD_CLIENTS_TRUE@weston_resizor_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_resizor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_scaler_SOURCES = clients/scaler.c @BUILD_CLIENTS_TRUE@weston_scaler_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_scaler_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_SOURCES = \ @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@ clients/nested.c \ @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_LDADD = libtoytoolkit.la $(SERVER_LIBS) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_client_SOURCES = clients/nested-client.c @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_client_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm @BUILD_CLIENTS_TRUE@@HAVE_CAIRO_GLESV2_TRUE@weston_nested_client_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_eventdemo_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/eventdemo.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@weston_eventdemo_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_eventdemo_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_clickdot_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/clickdot.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@weston_clickdot_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_clickdot_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_transformed_SOURCES = clients/transformed.c @BUILD_CLIENTS_TRUE@weston_transformed_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_fullscreen_SOURCES = clients/fullscreen.c @BUILD_CLIENTS_TRUE@nodist_weston_fullscreen_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/fullscreen-shell-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/fullscreen-shell-client-protocol.h @BUILD_CLIENTS_TRUE@weston_fullscreen_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_stacking_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/stacking.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@weston_stacking_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_stacking_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_calibrator_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/calibrator.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h \ @BUILD_CLIENTS_TRUE@ shared/matrix.c \ @BUILD_CLIENTS_TRUE@ shared/matrix.h @BUILD_CLIENTS_TRUE@weston_calibrator_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_calibrator_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@weston_subsurfaces_SOURCES = \ @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@ clients/subsurfaces.c \ @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@weston_subsurfaces_CFLAGS = \ @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@ $(AM_CFLAGS) \ @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@ $(SIMPLE_EGL_CLIENT_CFLAGS) \ @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@ $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_SUBSURFACES_CLIENT_TRUE@weston_subsurfaces_LDADD = libtoytoolkit.la $(SIMPLE_EGL_CLIENT_LIBS) -lm @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@weston_editor_SOURCES = \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ clients/editor.c \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@nodist_weston_editor_SOURCES = \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ protocol/text-protocol.c \ @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@ protocol/text-client-protocol.h @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@weston_editor_LDADD = libtoytoolkit.la $(PANGO_LIBS) @BUILD_CLIENTS_TRUE@@HAVE_PANGO_TRUE@weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS) @BUILD_CLIENTS_TRUE@weston_keyboard_SOURCES = clients/keyboard.c @BUILD_CLIENTS_TRUE@nodist_weston_keyboard_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/desktop-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/desktop-shell-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/input-method-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/input-method-client-protocol.h @BUILD_CLIENTS_TRUE@weston_keyboard_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_simple_im_SOURCES = clients/weston-simple-im.c @BUILD_CLIENTS_TRUE@nodist_weston_simple_im_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/input-method-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/input-method-client-protocol.h @BUILD_CLIENTS_TRUE@weston_simple_im_LDADD = $(CLIENT_LIBS) @BUILD_CLIENTS_TRUE@weston_simple_im_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_info_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/weston-info.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@nodist_weston_info_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/presentation_timing-protocol.c \ @BUILD_CLIENTS_TRUE@ protocol/presentation_timing-client-protocol.h @BUILD_CLIENTS_TRUE@weston_info_LDADD = $(WESTON_INFO_LIBS) libshared.la @BUILD_CLIENTS_TRUE@weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@weston_desktop_shell_SOURCES = \ @BUILD_CLIENTS_TRUE@ clients/desktop-shell.c \ @BUILD_CLIENTS_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@nodist_weston_desktop_shell_SOURCES = \ @BUILD_CLIENTS_TRUE@ protocol/desktop-shell-client-protocol.h \ @BUILD_CLIENTS_TRUE@ protocol/desktop-shell-protocol.c @BUILD_CLIENTS_TRUE@weston_desktop_shell_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@weston_desktop_shell_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@weston_ivi_shell_user_interface_SOURCES = \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ clients/ivi-shell-user-interface.c \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ shared/helpers.h @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@nodist_weston_ivi_shell_user_interface_SOURCES = \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ protocol/ivi-hmi-controller-client-protocol.h \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ protocol/ivi-hmi-controller-protocol.c \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-client-protocol.h \ @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-protocol.c @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@weston_ivi_shell_user_interface_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@@ENABLE_IVI_SHELL_TRUE@weston_ivi_shell_user_interface_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@weston_gears_SOURCES = clients/gears.c @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@weston_gears_LDADD = libtoytoolkit.la @BUILD_CLIENTS_TRUE@@BUILD_FULL_GL_CLIENTS_TRUE@weston_gears_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) westondatadir = $(datadir)/weston dist_westondata_DATA = data/wayland.svg data/wayland.png \ data/pattern.png data/terminal.png data/border.png \ data/icon_window.png data/sign_close.png \ data/sign_maximize.png data/sign_minimize.png $(am__append_36) @BUILD_WCAP_TOOLS_TRUE@wcap_decode_SOURCES = \ @BUILD_WCAP_TOOLS_TRUE@ wcap/main.c \ @BUILD_WCAP_TOOLS_TRUE@ wcap/wcap-decode.c \ @BUILD_WCAP_TOOLS_TRUE@ wcap/wcap-decode.h @BUILD_WCAP_TOOLS_TRUE@wcap_decode_CFLAGS = $(AM_CFLAGS) $(WCAP_CFLAGS) @BUILD_WCAP_TOOLS_TRUE@wcap_decode_LDADD = $(WCAP_LIBS) @ENABLE_DESKTOP_SHELL_TRUE@desktop_shell_la_CPPFLAGS = \ @ENABLE_DESKTOP_SHELL_TRUE@ -I$(top_builddir)/protocol \ @ENABLE_DESKTOP_SHELL_TRUE@ -I$(top_srcdir)/shared \ @ENABLE_DESKTOP_SHELL_TRUE@ -I$(top_srcdir)/src \ @ENABLE_DESKTOP_SHELL_TRUE@ -I$(top_builddir)/src \ @ENABLE_DESKTOP_SHELL_TRUE@ -I$(top_builddir)/desktop-shell \ @ENABLE_DESKTOP_SHELL_TRUE@ -DDATADIR='"$(datadir)"' \ @ENABLE_DESKTOP_SHELL_TRUE@ -DMODULEDIR='"$(moduledir)"' \ @ENABLE_DESKTOP_SHELL_TRUE@ -DLIBEXECDIR='"$(libexecdir)"' \ @ENABLE_DESKTOP_SHELL_TRUE@ -DIN_WESTON @ENABLE_DESKTOP_SHELL_TRUE@desktop_shell_la_LDFLAGS = -module -avoid-version @ENABLE_DESKTOP_SHELL_TRUE@desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la @ENABLE_DESKTOP_SHELL_TRUE@desktop_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) @ENABLE_DESKTOP_SHELL_TRUE@desktop_shell_la_SOURCES = \ @ENABLE_DESKTOP_SHELL_TRUE@ desktop-shell/shell.h \ @ENABLE_DESKTOP_SHELL_TRUE@ desktop-shell/shell.c \ @ENABLE_DESKTOP_SHELL_TRUE@ desktop-shell/exposay.c \ @ENABLE_DESKTOP_SHELL_TRUE@ desktop-shell/input-panel.c \ @ENABLE_DESKTOP_SHELL_TRUE@ shared/helpers.h @ENABLE_DESKTOP_SHELL_TRUE@nodist_desktop_shell_la_SOURCES = \ @ENABLE_DESKTOP_SHELL_TRUE@ protocol/desktop-shell-protocol.c \ @ENABLE_DESKTOP_SHELL_TRUE@ protocol/desktop-shell-server-protocol.h \ @ENABLE_DESKTOP_SHELL_TRUE@ protocol/xdg-shell-protocol.c \ @ENABLE_DESKTOP_SHELL_TRUE@ protocol/xdg-shell-server-protocol.h @ENABLE_FULLSCREEN_SHELL_TRUE@fullscreen_shell_la_CPPFLAGS = \ @ENABLE_FULLSCREEN_SHELL_TRUE@ -I$(top_builddir)/protocol \ @ENABLE_FULLSCREEN_SHELL_TRUE@ -I$(top_srcdir)/shared \ @ENABLE_FULLSCREEN_SHELL_TRUE@ -I$(top_srcdir)/src \ @ENABLE_FULLSCREEN_SHELL_TRUE@ -I$(top_builddir)/src \ @ENABLE_FULLSCREEN_SHELL_TRUE@ -DIN_WESTON @ENABLE_FULLSCREEN_SHELL_TRUE@fullscreen_shell_la_LDFLAGS = -module -avoid-version @ENABLE_FULLSCREEN_SHELL_TRUE@fullscreen_shell_la_LIBADD = $(COMPOSITOR_LIBS) @ENABLE_FULLSCREEN_SHELL_TRUE@fullscreen_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) @ENABLE_FULLSCREEN_SHELL_TRUE@fullscreen_shell_la_SOURCES = \ @ENABLE_FULLSCREEN_SHELL_TRUE@ fullscreen-shell/fullscreen-shell.c \ @ENABLE_FULLSCREEN_SHELL_TRUE@ shared/helpers.h @ENABLE_FULLSCREEN_SHELL_TRUE@nodist_fullscreen_shell_la_SOURCES = \ @ENABLE_FULLSCREEN_SHELL_TRUE@ protocol/fullscreen-shell-protocol.c \ @ENABLE_FULLSCREEN_SHELL_TRUE@ protocol/fullscreen-shell-server-protocol.h @ENABLE_IVI_SHELL_TRUE@ivi_shell = ivi-shell.la @ENABLE_IVI_SHELL_TRUE@ivi_shell_la_LDFLAGS = -module -avoid-version @ENABLE_IVI_SHELL_TRUE@ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la @ENABLE_IVI_SHELL_TRUE@ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) @ENABLE_IVI_SHELL_TRUE@ivi_shell_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-layout-export.h \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-layout-private.h \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-layout.c \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-layout-transition.c \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-shell.h \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-shell.c \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/input-panel-ivi.c \ @ENABLE_IVI_SHELL_TRUE@ shared/helpers.h @ENABLE_IVI_SHELL_TRUE@nodist_ivi_shell_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-protocol.c \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-server-protocol.h @ENABLE_IVI_SHELL_TRUE@hmi_controller = hmi-controller.la @ENABLE_IVI_SHELL_TRUE@hmi_controller_la_LDFLAGS = -module -avoid-version @ENABLE_IVI_SHELL_TRUE@hmi_controller_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la @ENABLE_IVI_SHELL_TRUE@hmi_controller_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) @ENABLE_IVI_SHELL_TRUE@hmi_controller_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/ivi-layout-export.h \ @ENABLE_IVI_SHELL_TRUE@ ivi-shell/hmi-controller.c \ @ENABLE_IVI_SHELL_TRUE@ shared/helpers.h @ENABLE_IVI_SHELL_TRUE@nodist_hmi_controller_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-hmi-controller-protocol.c \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-hmi-controller-server-protocol.h @ENABLE_SCREEN_SHARING_TRUE@screen_share_la_CPPFLAGS = $(AM_CPPFLAGS) -DBINDIR='"$(bindir)"' @ENABLE_SCREEN_SHARING_TRUE@screen_share_la_LDFLAGS = -module -avoid-version @ENABLE_SCREEN_SHARING_TRUE@screen_share_la_LIBADD = \ @ENABLE_SCREEN_SHARING_TRUE@ $(COMPOSITOR_LIBS) \ @ENABLE_SCREEN_SHARING_TRUE@ $(SCREEN_SHARE_LIBS) \ @ENABLE_SCREEN_SHARING_TRUE@ libshared-cairo.la @ENABLE_SCREEN_SHARING_TRUE@screen_share_la_CFLAGS = \ @ENABLE_SCREEN_SHARING_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_SCREEN_SHARING_TRUE@ $(SCREEN_SHARE_CFLAGS) \ @ENABLE_SCREEN_SHARING_TRUE@ $(AM_CFLAGS) @ENABLE_SCREEN_SHARING_TRUE@screen_share_la_SOURCES = \ @ENABLE_SCREEN_SHARING_TRUE@ src/screen-share.c \ @ENABLE_SCREEN_SHARING_TRUE@ shared/helpers.h @ENABLE_SCREEN_SHARING_TRUE@nodist_screen_share_la_SOURCES = \ @ENABLE_SCREEN_SHARING_TRUE@ protocol/fullscreen-shell-protocol.c \ @ENABLE_SCREEN_SHARING_TRUE@ protocol/fullscreen-shell-client-protocol.h @ENABLE_XWAYLAND_TRUE@xwayland_la_CPPFLAGS = \ @ENABLE_XWAYLAND_TRUE@ -I$(top_builddir)/protocol \ @ENABLE_XWAYLAND_TRUE@ -I$(top_srcdir)/shared \ @ENABLE_XWAYLAND_TRUE@ -I$(top_srcdir)/src \ @ENABLE_XWAYLAND_TRUE@ -I$(top_builddir)/src \ @ENABLE_XWAYLAND_TRUE@ -I$(top_builddir)/xwayland \ @ENABLE_XWAYLAND_TRUE@ -DDATADIR='"$(datadir)"' \ @ENABLE_XWAYLAND_TRUE@ -DMODULEDIR='"$(moduledir)"' \ @ENABLE_XWAYLAND_TRUE@ -DLIBEXECDIR='"$(libexecdir)"' \ @ENABLE_XWAYLAND_TRUE@ -DXSERVER_PATH='"@XSERVER_PATH@"' @ENABLE_XWAYLAND_TRUE@xwayland_la_LDFLAGS = -module -avoid-version @ENABLE_XWAYLAND_TRUE@xwayland_la_LIBADD = \ @ENABLE_XWAYLAND_TRUE@ $(XWAYLAND_LIBS) \ @ENABLE_XWAYLAND_TRUE@ $(top_builddir)/libshared-cairo.la @ENABLE_XWAYLAND_TRUE@xwayland_la_CFLAGS = \ @ENABLE_XWAYLAND_TRUE@ $(AM_CFLAGS) \ @ENABLE_XWAYLAND_TRUE@ $(COMPOSITOR_CFLAGS) \ @ENABLE_XWAYLAND_TRUE@ $(PIXMAN_CFLAGS) \ @ENABLE_XWAYLAND_TRUE@ $(CAIRO_CFLAGS) @ENABLE_XWAYLAND_TRUE@xwayland_la_SOURCES = \ @ENABLE_XWAYLAND_TRUE@ xwayland/xwayland.h \ @ENABLE_XWAYLAND_TRUE@ xwayland/window-manager.c \ @ENABLE_XWAYLAND_TRUE@ xwayland/selection.c \ @ENABLE_XWAYLAND_TRUE@ xwayland/dnd.c \ @ENABLE_XWAYLAND_TRUE@ xwayland/launcher.c \ @ENABLE_XWAYLAND_TRUE@ xwayland/hash.c \ @ENABLE_XWAYLAND_TRUE@ xwayland/hash.h \ @ENABLE_XWAYLAND_TRUE@ shared/helpers.h libshared_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) libshared_la_SOURCES = \ shared/config-parser.c \ shared/option-parser.c \ shared/config-parser.h \ shared/file-util.c \ shared/file-util.h \ shared/helpers.h \ shared/os-compatibility.c \ shared/os-compatibility.h libshared_cairo_la_CFLAGS = \ -DDATADIR='"$(datadir)"' \ $(AM_CFLAGS) \ $(COMPOSITOR_CFLAGS) \ $(PIXMAN_CFLAGS) \ $(CAIRO_CFLAGS) \ $(PNG_CFLAGS) \ $(WEBP_CFLAGS) libshared_cairo_la_LIBADD = \ $(PIXMAN_LIBS) \ $(CAIRO_LIBS) \ $(PNG_LIBS) \ $(WEBP_LIBS) \ $(JPEG_LIBS) libshared_cairo_la_SOURCES = \ $(libshared_la_SOURCES) \ shared/helpers.h \ shared/image-loader.c \ shared/image-loader.h \ shared/cairo-util.c \ shared/frame.c \ shared/cairo-util.h libzunitc_la_SOURCES = \ tools/zunitc/inc/zunitc/zunitc.h \ tools/zunitc/inc/zunitc/zunitc_impl.h \ tools/zunitc/src/zuc_base_logger.c \ tools/zunitc/src/zuc_base_logger.h \ tools/zunitc/src/zuc_collector.c \ tools/zunitc/src/zuc_collector.h \ tools/zunitc/src/zuc_context.h \ tools/zunitc/src/zuc_event.h \ tools/zunitc/src/zuc_event_listener.h \ tools/zunitc/src/zuc_junit_reporter.c \ tools/zunitc/src/zuc_junit_reporter.h \ tools/zunitc/src/zuc_types.h \ tools/zunitc/src/zunitc_impl.c \ shared/helpers.h libzunitc_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/tools/zunitc/inc \ $(am__append_46) libzunitc_la_LIBADD = libshared.la $(am__append_47) libzunitcmain_la_SOURCES = \ tools/zunitc/src/main.c libzunitcmain_la_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc libzunitcmain_la_LIBADD = \ libzunitc.la \ libshared.la internal_tests = \ internal-screenshot.weston shared_tests = \ config-parser.test \ vertex-clip.test \ zuctest module_tests = surface-test.la surface-global-test.la $(am__append_52) weston_tests = bad_buffer.weston keyboard.weston event.weston \ button.weston text.weston presentation.weston roles.weston \ subsurface.weston devices.weston $(am__append_50) \ $(am__append_51) ivi_tests = $(am__append_53) AM_TESTS_ENVIRONMENT = \ abs_builddir='$(abs_builddir)'; export abs_builddir; \ abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir; TEST_EXTENSIONS = .la .weston LA_LOG_COMPILER = $(srcdir)/tests/weston-tests-env WESTON_LOG_COMPILER = $(srcdir)/tests/weston-tests-env test_module_ldflags = \ -module -avoid-version -rpath $(libdir) $(COMPOSITOR_LIBS) surface_global_test_la_SOURCES = tests/surface-global-test.c surface_global_test_la_LDFLAGS = $(test_module_ldflags) surface_global_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) surface_test_la_SOURCES = tests/surface-test.c surface_test_la_LDFLAGS = $(test_module_ldflags) surface_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) weston_test_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la weston_test_la_LDFLAGS = $(test_module_ldflags) $(am__append_49) weston_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) \ $(am__append_48) weston_test_la_SOURCES = \ tests/weston-test.c \ shared/helpers.h nodist_weston_test_la_SOURCES = \ protocol/weston-test-protocol.c \ protocol/weston-test-server-protocol.h libtest_runner_la_SOURCES = \ tests/weston-test-runner.c \ tests/weston-test-runner.h libtest_runner_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) config_parser_test_SOURCES = tests/config-parser-test.c config_parser_test_LDADD = \ libshared.la \ $(COMPOSITOR_LIBS) \ libzunitc.la \ libzunitcmain.la config_parser_test_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc vertex_clip_test_SOURCES = \ tests/vertex-clip-test.c \ shared/helpers.h \ src/vertex-clipping.c \ src/vertex-clipping.h vertex_clip_test_LDADD = libtest-runner.la -lm -lrt libtest_client_la_SOURCES = \ tests/weston-test-client-helper.c \ tests/weston-test-client-helper.h nodist_libtest_client_la_SOURCES = \ protocol/weston-test-protocol.c \ protocol/weston-test-client-protocol.h libtest_client_la_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) libtest_client_la_LIBADD = $(TEST_CLIENT_LIBS) libshared.la libtest-runner.la # # Internal tests - tests functionality of the testsuite itself # internal_screenshot_weston_SOURCES = tests/internal-screenshot-test.c internal_screenshot_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) $(CAIRO_CFLAGS) internal_screenshot_weston_LDADD = libtest-client.la $(CAIRO_LIBS) # # Weston Tests # bad_buffer_weston_SOURCES = tests/bad-buffer-test.c bad_buffer_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) bad_buffer_weston_LDADD = libtest-client.la keyboard_weston_SOURCES = tests/keyboard-test.c keyboard_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) keyboard_weston_LDADD = libtest-client.la event_weston_SOURCES = tests/event-test.c event_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) event_weston_LDADD = libtest-client.la button_weston_SOURCES = tests/button-test.c button_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) button_weston_LDADD = libtest-client.la devices_weston_SOURCES = tests/devices-test.c devices_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) devices_weston_LDADD = libtest-client.la text_weston_SOURCES = tests/text-test.c nodist_text_weston_SOURCES = \ protocol/text-protocol.c \ protocol/text-client-protocol.h text_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) text_weston_LDADD = libtest-client.la subsurface_weston_SOURCES = tests/subsurface-test.c subsurface_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) subsurface_weston_LDADD = libtest-client.la presentation_weston_SOURCES = \ tests/presentation-test.c \ shared/helpers.h nodist_presentation_weston_SOURCES = \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-client-protocol.h presentation_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) presentation_weston_LDADD = libtest-client.la roles_weston_SOURCES = tests/roles-test.c roles_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) roles_weston_LDADD = libtest-client.la @ENABLE_EGL_TRUE@buffer_count_weston_SOURCES = tests/buffer-count-test.c @ENABLE_EGL_TRUE@buffer_count_weston_CFLAGS = $(AM_CFLAGS) $(EGL_TESTS_CFLAGS) @ENABLE_EGL_TRUE@buffer_count_weston_LDADD = libtest-client.la $(EGL_TESTS_LIBS) @ENABLE_XWAYLAND_TEST_TRUE@xwayland_test_weston_SOURCES = tests/xwayland-test.c @ENABLE_XWAYLAND_TEST_TRUE@xwayland_test_weston_CFLAGS = $(AM_CFLAGS) $(XWAYLAND_TEST_CFLAGS) @ENABLE_XWAYLAND_TEST_TRUE@xwayland_test_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS) matrix_test_SOURCES = \ tests/matrix-test.c \ shared/matrix.c \ shared/matrix.h matrix_test_CPPFLAGS = -DUNIT_TEST matrix_test_LDADD = -lm -lrt @ENABLE_IVI_SHELL_TRUE@ivi_layout_internal_test_la_LIBADD = $(COMPOSITOR_LIBS) @ENABLE_IVI_SHELL_TRUE@ivi_layout_internal_test_la_LDFLAGS = $(test_module_ldflags) @ENABLE_IVI_SHELL_TRUE@ivi_layout_internal_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) @ENABLE_IVI_SHELL_TRUE@ivi_layout_internal_test_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ tests/ivi_layout-internal-test.c @ENABLE_IVI_SHELL_TRUE@ivi_layout_test_la_LIBADD = $(COMPOSITOR_LIBS) @ENABLE_IVI_SHELL_TRUE@ivi_layout_test_la_LDFLAGS = $(test_module_ldflags) @ENABLE_IVI_SHELL_TRUE@ivi_layout_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) @ENABLE_IVI_SHELL_TRUE@ivi_layout_test_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ tests/ivi_layout-test-plugin.c \ @ENABLE_IVI_SHELL_TRUE@ tests/ivi-test.h \ @ENABLE_IVI_SHELL_TRUE@ shared/helpers.h @ENABLE_IVI_SHELL_TRUE@nodist_ivi_layout_test_la_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ protocol/weston-test-protocol.c \ @ENABLE_IVI_SHELL_TRUE@ protocol/weston-test-server-protocol.h @ENABLE_IVI_SHELL_TRUE@ivi_shell_app_weston_SOURCES = tests/ivi-shell-app-test.c @ENABLE_IVI_SHELL_TRUE@nodist_ivi_shell_app_weston_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-protocol.c \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-client-protocol.h @ENABLE_IVI_SHELL_TRUE@ivi_shell_app_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) @ENABLE_IVI_SHELL_TRUE@ivi_shell_app_weston_LDADD = libtest-client.la @ENABLE_IVI_SHELL_TRUE@ivi_layout_ivi_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ tests/ivi_layout-test.c \ @ENABLE_IVI_SHELL_TRUE@ tests/ivi-test.h \ @ENABLE_IVI_SHELL_TRUE@ shared/helpers.h @ENABLE_IVI_SHELL_TRUE@nodist_ivi_layout_ivi_SOURCES = \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-protocol.c \ @ENABLE_IVI_SHELL_TRUE@ protocol/ivi-application-client-protocol.h @ENABLE_IVI_SHELL_TRUE@ivi_layout_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) @ENABLE_IVI_SHELL_TRUE@ivi_layout_ivi_LDADD = libtest-client.la @BUILD_SETBACKLIGHT_TRUE@setbacklight_SOURCES = \ @BUILD_SETBACKLIGHT_TRUE@ tests/setbacklight.c \ @BUILD_SETBACKLIGHT_TRUE@ src/libbacklight.c \ @BUILD_SETBACKLIGHT_TRUE@ src/libbacklight.h @BUILD_SETBACKLIGHT_TRUE@setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS) @BUILD_SETBACKLIGHT_TRUE@setbacklight_LDADD = $(SETBACKLIGHT_LIBS) zuctest_LDADD = \ libzunitc.la \ libzunitcmain.la zuctest_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc zuctest_SOURCES = \ tools/zunitc/test/fixtures_test.c \ tools/zunitc/test/zunitc_test.c surface_screenshot_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la surface_screenshot_la_LDFLAGS = $(test_module_ldflags) surface_screenshot_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) surface_screenshot_la_SOURCES = tests/surface-screenshot.c # # Documentation # man_MANS = weston.1 weston.ini.5 $(am__append_56) MAN_SUBSTS = \ -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \ -e 's|__weston_modules_dir__|$(pkglibdir)|g' \ -e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g' \ -e 's|__version__|$(PACKAGE_VERSION)|g' SUFFIXES = .1 .5 .7 .man @ENABLE_DEVDOCS_TRUE@DOXYGEN_INDICES = docs/developer/html/index.html docs/tools/html/index.html DOCDIRS = \ docs/developer \ docs/tools all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .1 .5 .7 .man .c .la .la$(EXEEXT) .lo .log .o .obj .trs .weston .weston$(EXEEXT) am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 doc/doxygen/tools.doxygen: $(top_builddir)/config.status $(top_srcdir)/doc/doxygen/tools.doxygen.in cd $(top_builddir) && $(SHELL) ./config.status $@ doc/doxygen/tooldev.doxygen: $(top_builddir)/config.status $(top_srcdir)/doc/doxygen/tooldev.doxygen.in cd $(top_builddir) && $(SHELL) ./config.status $@ src/version.h: $(top_builddir)/config.status $(top_srcdir)/src/version.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ src/weston.pc: $(top_builddir)/config.status $(top_srcdir)/src/weston.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) src/cms_colord_la-cms-colord.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/cms_colord_la-cms-helper.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) cms-colord.la: $(cms_colord_la_OBJECTS) $(cms_colord_la_DEPENDENCIES) $(EXTRA_cms_colord_la_DEPENDENCIES) $(AM_V_CCLD)$(cms_colord_la_LINK) $(am_cms_colord_la_rpath) $(cms_colord_la_OBJECTS) $(cms_colord_la_LIBADD) $(LIBS) src/cms_static_la-cms-static.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/cms_static_la-cms-helper.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) cms-static.la: $(cms_static_la_OBJECTS) $(cms_static_la_DEPENDENCIES) $(EXTRA_cms_static_la_DEPENDENCIES) $(AM_V_CCLD)$(cms_static_la_LINK) $(am_cms_static_la_rpath) $(cms_static_la_OBJECTS) $(cms_static_la_LIBADD) $(LIBS) desktop-shell/$(am__dirstamp): @$(MKDIR_P) desktop-shell @: > desktop-shell/$(am__dirstamp) desktop-shell/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) desktop-shell/$(DEPDIR) @: > desktop-shell/$(DEPDIR)/$(am__dirstamp) desktop-shell/desktop_shell_la-shell.lo: \ desktop-shell/$(am__dirstamp) \ desktop-shell/$(DEPDIR)/$(am__dirstamp) desktop-shell/desktop_shell_la-exposay.lo: \ desktop-shell/$(am__dirstamp) \ desktop-shell/$(DEPDIR)/$(am__dirstamp) desktop-shell/desktop_shell_la-input-panel.lo: \ desktop-shell/$(am__dirstamp) \ desktop-shell/$(DEPDIR)/$(am__dirstamp) protocol/$(am__dirstamp): @$(MKDIR_P) protocol @: > protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) protocol/$(DEPDIR) @: > protocol/$(DEPDIR)/$(am__dirstamp) protocol/desktop_shell_la-desktop-shell-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/desktop_shell_la-xdg-shell-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) desktop-shell.la: $(desktop_shell_la_OBJECTS) $(desktop_shell_la_DEPENDENCIES) $(EXTRA_desktop_shell_la_DEPENDENCIES) $(AM_V_CCLD)$(desktop_shell_la_LINK) $(am_desktop_shell_la_rpath) $(desktop_shell_la_OBJECTS) $(desktop_shell_la_LIBADD) $(LIBS) src/drm_backend_la-compositor-drm.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/drm_backend_la-libinput-seat.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/drm_backend_la-libinput-device.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/drm_backend_la-libbacklight.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/drm_backend_la-vaapi-recorder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) drm-backend.la: $(drm_backend_la_OBJECTS) $(drm_backend_la_DEPENDENCIES) $(EXTRA_drm_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(drm_backend_la_LINK) $(am_drm_backend_la_rpath) $(drm_backend_la_OBJECTS) $(drm_backend_la_LIBADD) $(LIBS) src/fbdev_backend_la-compositor-fbdev.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/fbdev_backend_la-libinput-seat.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/fbdev_backend_la-libinput-device.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) fbdev-backend.la: $(fbdev_backend_la_OBJECTS) $(fbdev_backend_la_DEPENDENCIES) $(EXTRA_fbdev_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(fbdev_backend_la_LINK) $(am_fbdev_backend_la_rpath) $(fbdev_backend_la_OBJECTS) $(fbdev_backend_la_LIBADD) $(LIBS) fullscreen-shell/$(am__dirstamp): @$(MKDIR_P) fullscreen-shell @: > fullscreen-shell/$(am__dirstamp) fullscreen-shell/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) fullscreen-shell/$(DEPDIR) @: > fullscreen-shell/$(DEPDIR)/$(am__dirstamp) fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo: \ fullscreen-shell/$(am__dirstamp) \ fullscreen-shell/$(DEPDIR)/$(am__dirstamp) protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) fullscreen-shell.la: $(fullscreen_shell_la_OBJECTS) $(fullscreen_shell_la_DEPENDENCIES) $(EXTRA_fullscreen_shell_la_DEPENDENCIES) $(AM_V_CCLD)$(fullscreen_shell_la_LINK) $(am_fullscreen_shell_la_rpath) $(fullscreen_shell_la_OBJECTS) $(fullscreen_shell_la_LIBADD) $(LIBS) src/gl_renderer_la-gl-renderer.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/gl_renderer_la-vertex-clipping.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) gl-renderer.la: $(gl_renderer_la_OBJECTS) $(gl_renderer_la_DEPENDENCIES) $(EXTRA_gl_renderer_la_DEPENDENCIES) $(AM_V_CCLD)$(gl_renderer_la_LINK) $(am_gl_renderer_la_rpath) $(gl_renderer_la_OBJECTS) $(gl_renderer_la_LIBADD) $(LIBS) src/headless_backend_la-compositor-headless.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) headless-backend.la: $(headless_backend_la_OBJECTS) $(headless_backend_la_DEPENDENCIES) $(EXTRA_headless_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(headless_backend_la_LINK) $(am_headless_backend_la_rpath) $(headless_backend_la_OBJECTS) $(headless_backend_la_LIBADD) $(LIBS) ivi-shell/$(am__dirstamp): @$(MKDIR_P) ivi-shell @: > ivi-shell/$(am__dirstamp) ivi-shell/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ivi-shell/$(DEPDIR) @: > ivi-shell/$(DEPDIR)/$(am__dirstamp) ivi-shell/hmi_controller_la-hmi-controller.lo: \ ivi-shell/$(am__dirstamp) ivi-shell/$(DEPDIR)/$(am__dirstamp) protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) hmi-controller.la: $(hmi_controller_la_OBJECTS) $(hmi_controller_la_DEPENDENCIES) $(EXTRA_hmi_controller_la_DEPENDENCIES) $(AM_V_CCLD)$(hmi_controller_la_LINK) $(am_hmi_controller_la_rpath) $(hmi_controller_la_OBJECTS) $(hmi_controller_la_LIBADD) $(LIBS) tests/$(am__dirstamp): @$(MKDIR_P) tests @: > tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tests/$(DEPDIR) @: > tests/$(DEPDIR)/$(am__dirstamp) tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo: \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) ivi-layout-internal-test.la: $(ivi_layout_internal_test_la_OBJECTS) $(ivi_layout_internal_test_la_DEPENDENCIES) $(EXTRA_ivi_layout_internal_test_la_DEPENDENCIES) $(AM_V_CCLD)$(ivi_layout_internal_test_la_LINK) $(am_ivi_layout_internal_test_la_rpath) $(ivi_layout_internal_test_la_OBJECTS) $(ivi_layout_internal_test_la_LIBADD) $(LIBS) tests/ivi_layout_test_la-ivi_layout-test-plugin.lo: \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) protocol/ivi_layout_test_la-weston-test-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) ivi-layout-test.la: $(ivi_layout_test_la_OBJECTS) $(ivi_layout_test_la_DEPENDENCIES) $(EXTRA_ivi_layout_test_la_DEPENDENCIES) $(AM_V_CCLD)$(ivi_layout_test_la_LINK) $(am_ivi_layout_test_la_rpath) $(ivi_layout_test_la_OBJECTS) $(ivi_layout_test_la_LIBADD) $(LIBS) ivi-shell/ivi_shell_la-ivi-layout.lo: ivi-shell/$(am__dirstamp) \ ivi-shell/$(DEPDIR)/$(am__dirstamp) ivi-shell/ivi_shell_la-ivi-layout-transition.lo: \ ivi-shell/$(am__dirstamp) ivi-shell/$(DEPDIR)/$(am__dirstamp) ivi-shell/ivi_shell_la-ivi-shell.lo: ivi-shell/$(am__dirstamp) \ ivi-shell/$(DEPDIR)/$(am__dirstamp) ivi-shell/ivi_shell_la-input-panel-ivi.lo: ivi-shell/$(am__dirstamp) \ ivi-shell/$(DEPDIR)/$(am__dirstamp) protocol/ivi_shell_la-ivi-application-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) ivi-shell.la: $(ivi_shell_la_OBJECTS) $(ivi_shell_la_DEPENDENCIES) $(EXTRA_ivi_shell_la_DEPENDENCIES) $(AM_V_CCLD)$(ivi_shell_la_LINK) $(am_ivi_shell_la_rpath) $(ivi_shell_la_OBJECTS) $(ivi_shell_la_LIBADD) $(LIBS) src/libsession_helper_la-launcher-util.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/libsession_helper_la-dbus.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/libsession_helper_la-logind-util.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) libsession-helper.la: $(libsession_helper_la_OBJECTS) $(libsession_helper_la_DEPENDENCIES) $(EXTRA_libsession_helper_la_DEPENDENCIES) $(AM_V_CCLD)$(libsession_helper_la_LINK) $(libsession_helper_la_OBJECTS) $(libsession_helper_la_LIBADD) $(LIBS) shared/$(am__dirstamp): @$(MKDIR_P) shared @: > shared/$(am__dirstamp) shared/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) shared/$(DEPDIR) @: > shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-config-parser.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-option-parser.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-file-util.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-os-compatibility.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-image-loader.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-cairo-util.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_cairo_la-frame.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) libshared-cairo.la: $(libshared_cairo_la_OBJECTS) $(libshared_cairo_la_DEPENDENCIES) $(EXTRA_libshared_cairo_la_DEPENDENCIES) $(AM_V_CCLD)$(libshared_cairo_la_LINK) $(libshared_cairo_la_OBJECTS) $(libshared_cairo_la_LIBADD) $(LIBS) shared/libshared_la-config-parser.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_la-option-parser.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_la-file-util.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) shared/libshared_la-os-compatibility.lo: shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) libshared.la: $(libshared_la_OBJECTS) $(libshared_la_DEPENDENCIES) $(EXTRA_libshared_la_DEPENDENCIES) $(AM_V_CCLD)$(libshared_la_LINK) $(libshared_la_OBJECTS) $(libshared_la_LIBADD) $(LIBS) tests/libtest_client_la-weston-test-client-helper.lo: \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) protocol/libtest_client_la-weston-test-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) libtest-client.la: $(libtest_client_la_OBJECTS) $(libtest_client_la_DEPENDENCIES) $(EXTRA_libtest_client_la_DEPENDENCIES) $(AM_V_CCLD)$(libtest_client_la_LINK) $(libtest_client_la_OBJECTS) $(libtest_client_la_LIBADD) $(LIBS) tests/libtest_runner_la-weston-test-runner.lo: tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) libtest-runner.la: $(libtest_runner_la_OBJECTS) $(libtest_runner_la_DEPENDENCIES) $(EXTRA_libtest_runner_la_DEPENDENCIES) $(AM_V_CCLD)$(libtest_runner_la_LINK) $(libtest_runner_la_OBJECTS) $(libtest_runner_la_LIBADD) $(LIBS) clients/$(am__dirstamp): @$(MKDIR_P) clients @: > clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) clients/$(DEPDIR) @: > clients/$(DEPDIR)/$(am__dirstamp) clients/libtoytoolkit_la-window.lo: clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) protocol/libtoytoolkit_la-text-cursor-position-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/libtoytoolkit_la-scaler-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/libtoytoolkit_la-workspaces-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/libtoytoolkit_la-presentation_timing-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/libtoytoolkit_la-xdg-shell-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/libtoytoolkit_la-ivi-application-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) libtoytoolkit.la: $(libtoytoolkit_la_OBJECTS) $(libtoytoolkit_la_DEPENDENCIES) $(EXTRA_libtoytoolkit_la_DEPENDENCIES) $(AM_V_CCLD)$(libtoytoolkit_la_LINK) $(am_libtoytoolkit_la_rpath) $(libtoytoolkit_la_OBJECTS) $(libtoytoolkit_la_LIBADD) $(LIBS) tools/zunitc/src/$(am__dirstamp): @$(MKDIR_P) tools/zunitc/src @: > tools/zunitc/src/$(am__dirstamp) tools/zunitc/src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tools/zunitc/src/$(DEPDIR) @: > tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) tools/zunitc/src/libzunitc_la-zuc_base_logger.lo: \ tools/zunitc/src/$(am__dirstamp) \ tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) tools/zunitc/src/libzunitc_la-zuc_collector.lo: \ tools/zunitc/src/$(am__dirstamp) \ tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo: \ tools/zunitc/src/$(am__dirstamp) \ tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) tools/zunitc/src/libzunitc_la-zunitc_impl.lo: \ tools/zunitc/src/$(am__dirstamp) \ tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) libzunitc.la: $(libzunitc_la_OBJECTS) $(libzunitc_la_DEPENDENCIES) $(EXTRA_libzunitc_la_DEPENDENCIES) $(AM_V_CCLD)$(libzunitc_la_LINK) $(libzunitc_la_OBJECTS) $(libzunitc_la_LIBADD) $(LIBS) tools/zunitc/src/libzunitcmain_la-main.lo: \ tools/zunitc/src/$(am__dirstamp) \ tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) libzunitcmain.la: $(libzunitcmain_la_OBJECTS) $(libzunitcmain_la_DEPENDENCIES) $(EXTRA_libzunitcmain_la_DEPENDENCIES) $(AM_V_CCLD)$(libzunitcmain_la_LINK) $(libzunitcmain_la_OBJECTS) $(libzunitcmain_la_LIBADD) $(LIBS) src/rdp_backend_la-compositor-rdp.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) rdp-backend.la: $(rdp_backend_la_OBJECTS) $(rdp_backend_la_DEPENDENCIES) $(EXTRA_rdp_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(rdp_backend_la_LINK) $(am_rdp_backend_la_rpath) $(rdp_backend_la_OBJECTS) $(rdp_backend_la_LIBADD) $(LIBS) src/rpi_backend_la-compositor-rpi.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/rpi_backend_la-rpi-renderer.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/rpi_backend_la-libinput-seat.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/rpi_backend_la-libinput-device.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) rpi-backend.la: $(rpi_backend_la_OBJECTS) $(rpi_backend_la_DEPENDENCIES) $(EXTRA_rpi_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(rpi_backend_la_LINK) $(am_rpi_backend_la_rpath) $(rpi_backend_la_OBJECTS) $(rpi_backend_la_LIBADD) $(LIBS) src/screen_share_la-screen-share.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) protocol/screen_share_la-fullscreen-shell-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) screen-share.la: $(screen_share_la_OBJECTS) $(screen_share_la_DEPENDENCIES) $(EXTRA_screen_share_la_DEPENDENCIES) $(AM_V_CCLD)$(screen_share_la_LINK) $(am_screen_share_la_rpath) $(screen_share_la_OBJECTS) $(screen_share_la_LIBADD) $(LIBS) tests/surface_global_test_la-surface-global-test.lo: \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) surface-global-test.la: $(surface_global_test_la_OBJECTS) $(surface_global_test_la_DEPENDENCIES) $(EXTRA_surface_global_test_la_DEPENDENCIES) $(AM_V_CCLD)$(surface_global_test_la_LINK) $(surface_global_test_la_OBJECTS) $(surface_global_test_la_LIBADD) $(LIBS) tests/surface_screenshot_la-surface-screenshot.lo: \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) surface-screenshot.la: $(surface_screenshot_la_OBJECTS) $(surface_screenshot_la_DEPENDENCIES) $(EXTRA_surface_screenshot_la_DEPENDENCIES) $(AM_V_CCLD)$(surface_screenshot_la_LINK) $(surface_screenshot_la_OBJECTS) $(surface_screenshot_la_LIBADD) $(LIBS) tests/surface_test_la-surface-test.lo: tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) surface-test.la: $(surface_test_la_OBJECTS) $(surface_test_la_DEPENDENCIES) $(EXTRA_surface_test_la_DEPENDENCIES) $(AM_V_CCLD)$(surface_test_la_LINK) $(surface_test_la_OBJECTS) $(surface_test_la_LIBADD) $(LIBS) src/wayland_backend_la-compositor-wayland.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) protocol/wayland_backend_la-fullscreen-shell-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) wayland-backend.la: $(wayland_backend_la_OBJECTS) $(wayland_backend_la_DEPENDENCIES) $(EXTRA_wayland_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(wayland_backend_la_LINK) $(am_wayland_backend_la_rpath) $(wayland_backend_la_OBJECTS) $(wayland_backend_la_LIBADD) $(LIBS) tests/weston_test_la-weston-test.lo: tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) protocol/weston_test_la-weston-test-protocol.lo: \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-test.la: $(weston_test_la_OBJECTS) $(weston_test_la_DEPENDENCIES) $(EXTRA_weston_test_la_DEPENDENCIES) $(AM_V_CCLD)$(weston_test_la_LINK) $(weston_test_la_OBJECTS) $(weston_test_la_LIBADD) $(LIBS) src/x11_backend_la-compositor-x11.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) x11-backend.la: $(x11_backend_la_OBJECTS) $(x11_backend_la_DEPENDENCIES) $(EXTRA_x11_backend_la_DEPENDENCIES) $(AM_V_CCLD)$(x11_backend_la_LINK) $(am_x11_backend_la_rpath) $(x11_backend_la_OBJECTS) $(x11_backend_la_LIBADD) $(LIBS) xwayland/$(am__dirstamp): @$(MKDIR_P) xwayland @: > xwayland/$(am__dirstamp) xwayland/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) xwayland/$(DEPDIR) @: > xwayland/$(DEPDIR)/$(am__dirstamp) xwayland/xwayland_la-window-manager.lo: xwayland/$(am__dirstamp) \ xwayland/$(DEPDIR)/$(am__dirstamp) xwayland/xwayland_la-selection.lo: xwayland/$(am__dirstamp) \ xwayland/$(DEPDIR)/$(am__dirstamp) xwayland/xwayland_la-dnd.lo: xwayland/$(am__dirstamp) \ xwayland/$(DEPDIR)/$(am__dirstamp) xwayland/xwayland_la-launcher.lo: xwayland/$(am__dirstamp) \ xwayland/$(DEPDIR)/$(am__dirstamp) xwayland/xwayland_la-hash.lo: xwayland/$(am__dirstamp) \ xwayland/$(DEPDIR)/$(am__dirstamp) xwayland.la: $(xwayland_la_OBJECTS) $(xwayland_la_DEPENDENCIES) $(EXTRA_xwayland_la_DEPENDENCIES) $(AM_V_CCLD)$(xwayland_la_LINK) $(am_xwayland_la_rpath) $(xwayland_la_OBJECTS) $(xwayland_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list tests/bad_buffer_weston-bad-buffer-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) bad_buffer.weston$(EXEEXT): $(bad_buffer_weston_OBJECTS) $(bad_buffer_weston_DEPENDENCIES) $(EXTRA_bad_buffer_weston_DEPENDENCIES) @rm -f bad_buffer.weston$(EXEEXT) $(AM_V_CCLD)$(bad_buffer_weston_LINK) $(bad_buffer_weston_OBJECTS) $(bad_buffer_weston_LDADD) $(LIBS) tests/buffer_count_weston-buffer-count-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) buffer-count.weston$(EXEEXT): $(buffer_count_weston_OBJECTS) $(buffer_count_weston_DEPENDENCIES) $(EXTRA_buffer_count_weston_DEPENDENCIES) @rm -f buffer-count.weston$(EXEEXT) $(AM_V_CCLD)$(buffer_count_weston_LINK) $(buffer_count_weston_OBJECTS) $(buffer_count_weston_LDADD) $(LIBS) tests/button_weston-button-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) button.weston$(EXEEXT): $(button_weston_OBJECTS) $(button_weston_DEPENDENCIES) $(EXTRA_button_weston_DEPENDENCIES) @rm -f button.weston$(EXEEXT) $(AM_V_CCLD)$(button_weston_LINK) $(button_weston_OBJECTS) $(button_weston_LDADD) $(LIBS) tests/config_parser_test-config-parser-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) config-parser.test$(EXEEXT): $(config_parser_test_OBJECTS) $(config_parser_test_DEPENDENCIES) $(EXTRA_config_parser_test_DEPENDENCIES) @rm -f config-parser.test$(EXEEXT) $(AM_V_CCLD)$(config_parser_test_LINK) $(config_parser_test_OBJECTS) $(config_parser_test_LDADD) $(LIBS) tests/devices_weston-devices-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) devices.weston$(EXEEXT): $(devices_weston_OBJECTS) $(devices_weston_DEPENDENCIES) $(EXTRA_devices_weston_DEPENDENCIES) @rm -f devices.weston$(EXEEXT) $(AM_V_CCLD)$(devices_weston_LINK) $(devices_weston_OBJECTS) $(devices_weston_LDADD) $(LIBS) tests/event_weston-event-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) event.weston$(EXEEXT): $(event_weston_OBJECTS) $(event_weston_DEPENDENCIES) $(EXTRA_event_weston_DEPENDENCIES) @rm -f event.weston$(EXEEXT) $(AM_V_CCLD)$(event_weston_LINK) $(event_weston_OBJECTS) $(event_weston_LDADD) $(LIBS) tests/internal_screenshot_weston-internal-screenshot-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) internal-screenshot.weston$(EXEEXT): $(internal_screenshot_weston_OBJECTS) $(internal_screenshot_weston_DEPENDENCIES) $(EXTRA_internal_screenshot_weston_DEPENDENCIES) @rm -f internal-screenshot.weston$(EXEEXT) $(AM_V_CCLD)$(internal_screenshot_weston_LINK) $(internal_screenshot_weston_OBJECTS) $(internal_screenshot_weston_LDADD) $(LIBS) tests/ivi_layout_ivi-ivi_layout-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) protocol/ivi_layout_ivi-ivi-application-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) ivi-layout.ivi$(EXEEXT): $(ivi_layout_ivi_OBJECTS) $(ivi_layout_ivi_DEPENDENCIES) $(EXTRA_ivi_layout_ivi_DEPENDENCIES) @rm -f ivi-layout.ivi$(EXEEXT) $(AM_V_CCLD)$(ivi_layout_ivi_LINK) $(ivi_layout_ivi_OBJECTS) $(ivi_layout_ivi_LDADD) $(LIBS) tests/ivi_shell_app_weston-ivi-shell-app-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) protocol/ivi_shell_app_weston-ivi-application-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) ivi-shell-app.weston$(EXEEXT): $(ivi_shell_app_weston_OBJECTS) $(ivi_shell_app_weston_DEPENDENCIES) $(EXTRA_ivi_shell_app_weston_DEPENDENCIES) @rm -f ivi-shell-app.weston$(EXEEXT) $(AM_V_CCLD)$(ivi_shell_app_weston_LINK) $(ivi_shell_app_weston_OBJECTS) $(ivi_shell_app_weston_LDADD) $(LIBS) tests/keyboard_weston-keyboard-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) keyboard.weston$(EXEEXT): $(keyboard_weston_OBJECTS) $(keyboard_weston_DEPENDENCIES) $(EXTRA_keyboard_weston_DEPENDENCIES) @rm -f keyboard.weston$(EXEEXT) $(AM_V_CCLD)$(keyboard_weston_LINK) $(keyboard_weston_OBJECTS) $(keyboard_weston_LDADD) $(LIBS) tests/matrix_test-matrix-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) shared/matrix_test-matrix.$(OBJEXT): shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) matrix-test$(EXEEXT): $(matrix_test_OBJECTS) $(matrix_test_DEPENDENCIES) $(EXTRA_matrix_test_DEPENDENCIES) @rm -f matrix-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(matrix_test_OBJECTS) $(matrix_test_LDADD) $(LIBS) tests/presentation_weston-presentation-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) protocol/presentation_weston-presentation_timing-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) presentation.weston$(EXEEXT): $(presentation_weston_OBJECTS) $(presentation_weston_DEPENDENCIES) $(EXTRA_presentation_weston_DEPENDENCIES) @rm -f presentation.weston$(EXEEXT) $(AM_V_CCLD)$(presentation_weston_LINK) $(presentation_weston_OBJECTS) $(presentation_weston_LDADD) $(LIBS) tests/roles_weston-roles-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) roles.weston$(EXEEXT): $(roles_weston_OBJECTS) $(roles_weston_DEPENDENCIES) $(EXTRA_roles_weston_DEPENDENCIES) @rm -f roles.weston$(EXEEXT) $(AM_V_CCLD)$(roles_weston_LINK) $(roles_weston_OBJECTS) $(roles_weston_LDADD) $(LIBS) tests/setbacklight-setbacklight.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) src/setbacklight-libbacklight.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) setbacklight$(EXEEXT): $(setbacklight_OBJECTS) $(setbacklight_DEPENDENCIES) $(EXTRA_setbacklight_DEPENDENCIES) @rm -f setbacklight$(EXEEXT) $(AM_V_CCLD)$(setbacklight_LINK) $(setbacklight_OBJECTS) $(setbacklight_LDADD) $(LIBS) src/spring_tool-spring-tool.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/spring_tool-animation.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) shared/spring_tool-matrix.$(OBJEXT): shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) spring-tool$(EXEEXT): $(spring_tool_OBJECTS) $(spring_tool_DEPENDENCIES) $(EXTRA_spring_tool_DEPENDENCIES) @rm -f spring-tool$(EXEEXT) $(AM_V_CCLD)$(spring_tool_LINK) $(spring_tool_OBJECTS) $(spring_tool_LDADD) $(LIBS) tests/subsurface_weston-subsurface-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) subsurface.weston$(EXEEXT): $(subsurface_weston_OBJECTS) $(subsurface_weston_DEPENDENCIES) $(EXTRA_subsurface_weston_DEPENDENCIES) @rm -f subsurface.weston$(EXEEXT) $(AM_V_CCLD)$(subsurface_weston_LINK) $(subsurface_weston_OBJECTS) $(subsurface_weston_LDADD) $(LIBS) tests/text_weston-text-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) protocol/text_weston-text-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) text.weston$(EXEEXT): $(text_weston_OBJECTS) $(text_weston_DEPENDENCIES) $(EXTRA_text_weston_DEPENDENCIES) @rm -f text.weston$(EXEEXT) $(AM_V_CCLD)$(text_weston_LINK) $(text_weston_OBJECTS) $(text_weston_LDADD) $(LIBS) tests/vertex-clip-test.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) src/vertex-clipping.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) vertex-clip.test$(EXEEXT): $(vertex_clip_test_OBJECTS) $(vertex_clip_test_DEPENDENCIES) $(EXTRA_vertex_clip_test_DEPENDENCIES) @rm -f vertex-clip.test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vertex_clip_test_OBJECTS) $(vertex_clip_test_LDADD) $(LIBS) wcap/$(am__dirstamp): @$(MKDIR_P) wcap @: > wcap/$(am__dirstamp) wcap/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) wcap/$(DEPDIR) @: > wcap/$(DEPDIR)/$(am__dirstamp) wcap/wcap_decode-main.$(OBJEXT): wcap/$(am__dirstamp) \ wcap/$(DEPDIR)/$(am__dirstamp) wcap/wcap_decode-wcap-decode.$(OBJEXT): wcap/$(am__dirstamp) \ wcap/$(DEPDIR)/$(am__dirstamp) wcap-decode$(EXEEXT): $(wcap_decode_OBJECTS) $(wcap_decode_DEPENDENCIES) $(EXTRA_wcap_decode_DEPENDENCIES) @rm -f wcap-decode$(EXEEXT) $(AM_V_CCLD)$(wcap_decode_LINK) $(wcap_decode_OBJECTS) $(wcap_decode_LDADD) $(LIBS) src/weston-log.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-compositor.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-input.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-data-device.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-screenshooter.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-clipboard.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-zoom.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-text-backend.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-bindings.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-animation.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-noop-renderer.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-pixman-renderer.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-timeline.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-main.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/weston-linux-dmabuf.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) shared/weston-matrix.$(OBJEXT): shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) protocol/weston-screenshooter-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-text-cursor-position-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-text-protocol.$(OBJEXT): protocol/$(am__dirstamp) \ protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-input-method-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-workspaces-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-presentation_timing-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-scaler-protocol.$(OBJEXT): protocol/$(am__dirstamp) \ protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston-linux-dmabuf-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston$(EXEEXT): $(weston_OBJECTS) $(weston_DEPENDENCIES) $(EXTRA_weston_DEPENDENCIES) @rm -f weston$(EXEEXT) $(AM_V_CCLD)$(weston_LINK) $(weston_OBJECTS) $(weston_LDADD) $(LIBS) clients/weston_calibrator-calibrator.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) shared/weston_calibrator-matrix.$(OBJEXT): shared/$(am__dirstamp) \ shared/$(DEPDIR)/$(am__dirstamp) weston-calibrator$(EXEEXT): $(weston_calibrator_OBJECTS) $(weston_calibrator_DEPENDENCIES) $(EXTRA_weston_calibrator_DEPENDENCIES) @rm -f weston-calibrator$(EXEEXT) $(AM_V_CCLD)$(weston_calibrator_LINK) $(weston_calibrator_OBJECTS) $(weston_calibrator_LDADD) $(LIBS) clients/weston_clickdot-clickdot.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-clickdot$(EXEEXT): $(weston_clickdot_OBJECTS) $(weston_clickdot_DEPENDENCIES) $(EXTRA_weston_clickdot_DEPENDENCIES) @rm -f weston-clickdot$(EXEEXT) $(AM_V_CCLD)$(weston_clickdot_LINK) $(weston_clickdot_OBJECTS) $(weston_clickdot_LDADD) $(LIBS) clients/weston_cliptest-cliptest.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) src/weston_cliptest-vertex-clipping.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) weston-cliptest$(EXEEXT): $(weston_cliptest_OBJECTS) $(weston_cliptest_DEPENDENCIES) $(EXTRA_weston_cliptest_DEPENDENCIES) @rm -f weston-cliptest$(EXEEXT) $(AM_V_CCLD)$(weston_cliptest_LINK) $(weston_cliptest_OBJECTS) $(weston_cliptest_LDADD) $(LIBS) clients/weston_desktop_shell-desktop-shell.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_desktop_shell-desktop-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-desktop-shell$(EXEEXT): $(weston_desktop_shell_OBJECTS) $(weston_desktop_shell_DEPENDENCIES) $(EXTRA_weston_desktop_shell_DEPENDENCIES) @rm -f weston-desktop-shell$(EXEEXT) $(AM_V_CCLD)$(weston_desktop_shell_LINK) $(weston_desktop_shell_OBJECTS) $(weston_desktop_shell_LDADD) $(LIBS) clients/weston_dnd-dnd.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-dnd$(EXEEXT): $(weston_dnd_OBJECTS) $(weston_dnd_DEPENDENCIES) $(EXTRA_weston_dnd_DEPENDENCIES) @rm -f weston-dnd$(EXEEXT) $(AM_V_CCLD)$(weston_dnd_LINK) $(weston_dnd_OBJECTS) $(weston_dnd_LDADD) $(LIBS) clients/weston_editor-editor.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_editor-text-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-editor$(EXEEXT): $(weston_editor_OBJECTS) $(weston_editor_DEPENDENCIES) $(EXTRA_weston_editor_DEPENDENCIES) @rm -f weston-editor$(EXEEXT) $(AM_V_CCLD)$(weston_editor_LINK) $(weston_editor_OBJECTS) $(weston_editor_LDADD) $(LIBS) clients/weston_eventdemo-eventdemo.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-eventdemo$(EXEEXT): $(weston_eventdemo_OBJECTS) $(weston_eventdemo_DEPENDENCIES) $(EXTRA_weston_eventdemo_DEPENDENCIES) @rm -f weston-eventdemo$(EXEEXT) $(AM_V_CCLD)$(weston_eventdemo_LINK) $(weston_eventdemo_OBJECTS) $(weston_eventdemo_LDADD) $(LIBS) clients/weston_flower-flower.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-flower$(EXEEXT): $(weston_flower_OBJECTS) $(weston_flower_DEPENDENCIES) $(EXTRA_weston_flower_DEPENDENCIES) @rm -f weston-flower$(EXEEXT) $(AM_V_CCLD)$(weston_flower_LINK) $(weston_flower_OBJECTS) $(weston_flower_LDADD) $(LIBS) clients/weston_fullscreen-fullscreen.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_fullscreen-fullscreen-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-fullscreen$(EXEEXT): $(weston_fullscreen_OBJECTS) $(weston_fullscreen_DEPENDENCIES) $(EXTRA_weston_fullscreen_DEPENDENCIES) @rm -f weston-fullscreen$(EXEEXT) $(AM_V_CCLD)$(weston_fullscreen_LINK) $(weston_fullscreen_OBJECTS) $(weston_fullscreen_LDADD) $(LIBS) clients/weston_gears-gears.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-gears$(EXEEXT): $(weston_gears_OBJECTS) $(weston_gears_DEPENDENCIES) $(EXTRA_weston_gears_DEPENDENCIES) @rm -f weston-gears$(EXEEXT) $(AM_V_CCLD)$(weston_gears_LINK) $(weston_gears_OBJECTS) $(weston_gears_LDADD) $(LIBS) clients/weston_image-image.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-image$(EXEEXT): $(weston_image_OBJECTS) $(weston_image_DEPENDENCIES) $(EXTRA_weston_image_DEPENDENCIES) @rm -f weston-image$(EXEEXT) $(AM_V_CCLD)$(weston_image_LINK) $(weston_image_OBJECTS) $(weston_image_LDADD) $(LIBS) clients/weston_info-weston-info.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_info-presentation_timing-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-info$(EXEEXT): $(weston_info_OBJECTS) $(weston_info_DEPENDENCIES) $(EXTRA_weston_info_DEPENDENCIES) @rm -f weston-info$(EXEEXT) $(AM_V_CCLD)$(weston_info_LINK) $(weston_info_OBJECTS) $(weston_info_LDADD) $(LIBS) clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_ivi_shell_user_interface-ivi-application-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-ivi-shell-user-interface$(EXEEXT): $(weston_ivi_shell_user_interface_OBJECTS) $(weston_ivi_shell_user_interface_DEPENDENCIES) $(EXTRA_weston_ivi_shell_user_interface_DEPENDENCIES) @rm -f weston-ivi-shell-user-interface$(EXEEXT) $(AM_V_CCLD)$(weston_ivi_shell_user_interface_LINK) $(weston_ivi_shell_user_interface_OBJECTS) $(weston_ivi_shell_user_interface_LDADD) $(LIBS) clients/weston_keyboard-keyboard.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_keyboard-desktop-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_keyboard-input-method-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-keyboard$(EXEEXT): $(weston_keyboard_OBJECTS) $(weston_keyboard_DEPENDENCIES) $(EXTRA_weston_keyboard_DEPENDENCIES) @rm -f weston-keyboard$(EXEEXT) $(AM_V_CCLD)$(weston_keyboard_LINK) $(weston_keyboard_OBJECTS) $(weston_keyboard_LDADD) $(LIBS) src/weston_launch-weston-launch.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) weston-launch$(EXEEXT): $(weston_launch_OBJECTS) $(weston_launch_DEPENDENCIES) $(EXTRA_weston_launch_DEPENDENCIES) @rm -f weston-launch$(EXEEXT) $(AM_V_CCLD)$(weston_launch_LINK) $(weston_launch_OBJECTS) $(weston_launch_LDADD) $(LIBS) clients/weston_multi_resource-multi-resource.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) weston-multi-resource$(EXEEXT): $(weston_multi_resource_OBJECTS) $(weston_multi_resource_DEPENDENCIES) $(EXTRA_weston_multi_resource_DEPENDENCIES) @rm -f weston-multi-resource$(EXEEXT) $(AM_V_CCLD)$(weston_multi_resource_LINK) $(weston_multi_resource_OBJECTS) $(weston_multi_resource_LDADD) $(LIBS) clients/weston_nested-nested.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-nested$(EXEEXT): $(weston_nested_OBJECTS) $(weston_nested_DEPENDENCIES) $(EXTRA_weston_nested_DEPENDENCIES) @rm -f weston-nested$(EXEEXT) $(AM_V_CCLD)$(weston_nested_LINK) $(weston_nested_OBJECTS) $(weston_nested_LDADD) $(LIBS) clients/weston_nested_client-nested-client.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) weston-nested-client$(EXEEXT): $(weston_nested_client_OBJECTS) $(weston_nested_client_DEPENDENCIES) $(EXTRA_weston_nested_client_DEPENDENCIES) @rm -f weston-nested-client$(EXEEXT) $(AM_V_CCLD)$(weston_nested_client_LINK) $(weston_nested_client_OBJECTS) $(weston_nested_client_LDADD) $(LIBS) clients/weston_presentation_shm-presentation-shm.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_presentation_shm-presentation_timing-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-presentation-shm$(EXEEXT): $(weston_presentation_shm_OBJECTS) $(weston_presentation_shm_DEPENDENCIES) $(EXTRA_weston_presentation_shm_DEPENDENCIES) @rm -f weston-presentation-shm$(EXEEXT) $(AM_V_CCLD)$(weston_presentation_shm_LINK) $(weston_presentation_shm_OBJECTS) $(weston_presentation_shm_LDADD) $(LIBS) clients/weston_resizor-resizor.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-resizor$(EXEEXT): $(weston_resizor_OBJECTS) $(weston_resizor_DEPENDENCIES) $(EXTRA_weston_resizor_DEPENDENCIES) @rm -f weston-resizor$(EXEEXT) $(AM_V_CCLD)$(weston_resizor_LINK) $(weston_resizor_OBJECTS) $(weston_resizor_LDADD) $(LIBS) clients/weston_scaler-scaler.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-scaler$(EXEEXT): $(weston_scaler_OBJECTS) $(weston_scaler_DEPENDENCIES) $(EXTRA_weston_scaler_DEPENDENCIES) @rm -f weston-scaler$(EXEEXT) $(AM_V_CCLD)$(weston_scaler_LINK) $(weston_scaler_OBJECTS) $(weston_scaler_LDADD) $(LIBS) clients/weston_screenshooter-screenshot.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_screenshooter-screenshooter-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-screenshooter$(EXEEXT): $(weston_screenshooter_OBJECTS) $(weston_screenshooter_DEPENDENCIES) $(EXTRA_weston_screenshooter_DEPENDENCIES) @rm -f weston-screenshooter$(EXEEXT) $(AM_V_CCLD)$(weston_screenshooter_LINK) $(weston_screenshooter_OBJECTS) $(weston_screenshooter_LDADD) $(LIBS) clients/weston_simple_damage-simple-damage.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_damage-scaler-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_damage-xdg-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_damage-fullscreen-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-simple-damage$(EXEEXT): $(weston_simple_damage_OBJECTS) $(weston_simple_damage_DEPENDENCIES) $(EXTRA_weston_simple_damage_DEPENDENCIES) @rm -f weston-simple-damage$(EXEEXT) $(AM_V_CCLD)$(weston_simple_damage_LINK) $(weston_simple_damage_OBJECTS) $(weston_simple_damage_LDADD) $(LIBS) clients/weston_simple_dmabuf-simple-dmabuf.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_dmabuf-xdg-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_dmabuf-fullscreen-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_dmabuf-linux-dmabuf-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-simple-dmabuf$(EXEEXT): $(weston_simple_dmabuf_OBJECTS) $(weston_simple_dmabuf_DEPENDENCIES) $(EXTRA_weston_simple_dmabuf_DEPENDENCIES) @rm -f weston-simple-dmabuf$(EXEEXT) $(AM_V_CCLD)$(weston_simple_dmabuf_LINK) $(weston_simple_dmabuf_OBJECTS) $(weston_simple_dmabuf_LDADD) $(LIBS) clients/weston_simple_egl-simple-egl.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_egl-xdg-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_egl-ivi-application-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-simple-egl$(EXEEXT): $(weston_simple_egl_OBJECTS) $(weston_simple_egl_DEPENDENCIES) $(EXTRA_weston_simple_egl_DEPENDENCIES) @rm -f weston-simple-egl$(EXEEXT) $(AM_V_CCLD)$(weston_simple_egl_LINK) $(weston_simple_egl_OBJECTS) $(weston_simple_egl_LDADD) $(LIBS) clients/weston_simple_im-weston-simple-im.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_im-input-method-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-simple-im$(EXEEXT): $(weston_simple_im_OBJECTS) $(weston_simple_im_DEPENDENCIES) $(EXTRA_weston_simple_im_DEPENDENCIES) @rm -f weston-simple-im$(EXEEXT) $(AM_V_CCLD)$(weston_simple_im_LINK) $(weston_simple_im_OBJECTS) $(weston_simple_im_LDADD) $(LIBS) clients/weston_simple_shm-simple-shm.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_shm-xdg-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_shm-fullscreen-shell-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) protocol/weston_simple_shm-ivi-application-protocol.$(OBJEXT): \ protocol/$(am__dirstamp) protocol/$(DEPDIR)/$(am__dirstamp) weston-simple-shm$(EXEEXT): $(weston_simple_shm_OBJECTS) $(weston_simple_shm_DEPENDENCIES) $(EXTRA_weston_simple_shm_DEPENDENCIES) @rm -f weston-simple-shm$(EXEEXT) $(AM_V_CCLD)$(weston_simple_shm_LINK) $(weston_simple_shm_OBJECTS) $(weston_simple_shm_LDADD) $(LIBS) clients/weston_simple_touch-simple-touch.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) weston-simple-touch$(EXEEXT): $(weston_simple_touch_OBJECTS) $(weston_simple_touch_DEPENDENCIES) $(EXTRA_weston_simple_touch_DEPENDENCIES) @rm -f weston-simple-touch$(EXEEXT) $(AM_V_CCLD)$(weston_simple_touch_LINK) $(weston_simple_touch_OBJECTS) $(weston_simple_touch_LDADD) $(LIBS) clients/weston_smoke-smoke.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-smoke$(EXEEXT): $(weston_smoke_OBJECTS) $(weston_smoke_DEPENDENCIES) $(EXTRA_weston_smoke_DEPENDENCIES) @rm -f weston-smoke$(EXEEXT) $(AM_V_CCLD)$(weston_smoke_LINK) $(weston_smoke_OBJECTS) $(weston_smoke_LDADD) $(LIBS) clients/weston_stacking-stacking.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-stacking$(EXEEXT): $(weston_stacking_OBJECTS) $(weston_stacking_DEPENDENCIES) $(EXTRA_weston_stacking_DEPENDENCIES) @rm -f weston-stacking$(EXEEXT) $(AM_V_CCLD)$(weston_stacking_LINK) $(weston_stacking_OBJECTS) $(weston_stacking_LDADD) $(LIBS) clients/weston_subsurfaces-subsurfaces.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) weston-subsurfaces$(EXEEXT): $(weston_subsurfaces_OBJECTS) $(weston_subsurfaces_DEPENDENCIES) $(EXTRA_weston_subsurfaces_DEPENDENCIES) @rm -f weston-subsurfaces$(EXEEXT) $(AM_V_CCLD)$(weston_subsurfaces_LINK) $(weston_subsurfaces_OBJECTS) $(weston_subsurfaces_LDADD) $(LIBS) clients/weston_terminal-terminal.$(OBJEXT): clients/$(am__dirstamp) \ clients/$(DEPDIR)/$(am__dirstamp) weston-terminal$(EXEEXT): $(weston_terminal_OBJECTS) $(weston_terminal_DEPENDENCIES) $(EXTRA_weston_terminal_DEPENDENCIES) @rm -f weston-terminal$(EXEEXT) $(AM_V_CCLD)$(weston_terminal_LINK) $(weston_terminal_OBJECTS) $(weston_terminal_LDADD) $(LIBS) clients/weston_transformed-transformed.$(OBJEXT): \ clients/$(am__dirstamp) clients/$(DEPDIR)/$(am__dirstamp) weston-transformed$(EXEEXT): $(weston_transformed_OBJECTS) $(weston_transformed_DEPENDENCIES) $(EXTRA_weston_transformed_DEPENDENCIES) @rm -f weston-transformed$(EXEEXT) $(AM_V_CCLD)$(weston_transformed_LINK) $(weston_transformed_OBJECTS) $(weston_transformed_LDADD) $(LIBS) tests/xwayland_test_weston-xwayland-test.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) xwayland-test.weston$(EXEEXT): $(xwayland_test_weston_OBJECTS) $(xwayland_test_weston_DEPENDENCIES) $(EXTRA_xwayland_test_weston_DEPENDENCIES) @rm -f xwayland-test.weston$(EXEEXT) $(AM_V_CCLD)$(xwayland_test_weston_LINK) $(xwayland_test_weston_OBJECTS) $(xwayland_test_weston_LDADD) $(LIBS) tools/zunitc/test/$(am__dirstamp): @$(MKDIR_P) tools/zunitc/test @: > tools/zunitc/test/$(am__dirstamp) tools/zunitc/test/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tools/zunitc/test/$(DEPDIR) @: > tools/zunitc/test/$(DEPDIR)/$(am__dirstamp) tools/zunitc/test/zuctest-fixtures_test.$(OBJEXT): \ tools/zunitc/test/$(am__dirstamp) \ tools/zunitc/test/$(DEPDIR)/$(am__dirstamp) tools/zunitc/test/zuctest-zunitc_test.$(OBJEXT): \ tools/zunitc/test/$(am__dirstamp) \ tools/zunitc/test/$(DEPDIR)/$(am__dirstamp) zuctest$(EXEEXT): $(zuctest_OBJECTS) $(zuctest_DEPENDENCIES) $(EXTRA_zuctest_DEPENDENCIES) @rm -f zuctest$(EXEEXT) $(AM_V_CCLD)$(zuctest_LINK) $(zuctest_OBJECTS) $(zuctest_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f clients/*.$(OBJEXT) -rm -f clients/*.lo -rm -f desktop-shell/*.$(OBJEXT) -rm -f desktop-shell/*.lo -rm -f fullscreen-shell/*.$(OBJEXT) -rm -f fullscreen-shell/*.lo -rm -f ivi-shell/*.$(OBJEXT) -rm -f ivi-shell/*.lo -rm -f protocol/*.$(OBJEXT) -rm -f protocol/*.lo -rm -f shared/*.$(OBJEXT) -rm -f shared/*.lo -rm -f src/*.$(OBJEXT) -rm -f src/*.lo -rm -f tests/*.$(OBJEXT) -rm -f tests/*.lo -rm -f tools/zunitc/src/*.$(OBJEXT) -rm -f tools/zunitc/src/*.lo -rm -f tools/zunitc/test/*.$(OBJEXT) -rm -f wcap/*.$(OBJEXT) -rm -f xwayland/*.$(OBJEXT) -rm -f xwayland/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/libtoytoolkit_la-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_calibrator-calibrator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_clickdot-clickdot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_cliptest-cliptest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_dnd-dnd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_editor-editor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_eventdemo-eventdemo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_flower-flower.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_fullscreen-fullscreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_gears-gears.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_image-image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_info-weston-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_keyboard-keyboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_multi_resource-multi-resource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_nested-nested.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_nested_client-nested-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_resizor-resizor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_scaler-scaler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_screenshooter-screenshot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_simple_damage-simple-damage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_simple_egl-simple-egl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_simple_shm-simple-shm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_simple_touch-simple-touch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_smoke-smoke.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_stacking-stacking.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_terminal-terminal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@clients/$(DEPDIR)/weston_transformed-transformed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@desktop-shell/$(DEPDIR)/desktop_shell_la-exposay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@desktop-shell/$(DEPDIR)/desktop_shell_la-input-panel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@desktop-shell/$(DEPDIR)/desktop_shell_la-shell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@fullscreen-shell/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ivi-shell/$(DEPDIR)/hmi_controller_la-hmi-controller.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ivi-shell/$(DEPDIR)/ivi_shell_la-input-panel-ivi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout-transition.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-shell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/desktop_shell_la-desktop-shell-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/desktop_shell_la-xdg-shell-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/hmi_controller_la-ivi-hmi-controller-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/ivi_layout_test_la-weston-test-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/ivi_shell_la-ivi-application-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtest_client_la-weston-test-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtoytoolkit_la-ivi-application-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtoytoolkit_la-presentation_timing-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtoytoolkit_la-scaler-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtoytoolkit_la-text-cursor-position-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtoytoolkit_la-workspaces-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/libtoytoolkit_la-xdg-shell-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/screen_share_la-fullscreen-shell-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/text_weston-text-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/wayland_backend_la-fullscreen-shell-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-input-method-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-presentation_timing-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-scaler-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-screenshooter-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-text-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston-workspaces-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_editor-text-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@protocol/$(DEPDIR)/weston_test_la-weston-test-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-cairo-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-config-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-file-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-frame.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-image-loader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-option-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_cairo_la-os-compatibility.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_la-config-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_la-file-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_la-option-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/libshared_la-os-compatibility.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/matrix_test-matrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/spring_tool-matrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/weston-matrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@shared/$(DEPDIR)/weston_calibrator-matrix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/cms_colord_la-cms-colord.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/cms_colord_la-cms-helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/cms_static_la-cms-helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/cms_static_la-cms-static.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/drm_backend_la-compositor-drm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/drm_backend_la-libbacklight.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/drm_backend_la-libinput-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/drm_backend_la-libinput-seat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/drm_backend_la-vaapi-recorder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fbdev_backend_la-compositor-fbdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fbdev_backend_la-libinput-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fbdev_backend_la-libinput-seat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gl_renderer_la-gl-renderer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/gl_renderer_la-vertex-clipping.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/headless_backend_la-compositor-headless.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libsession_helper_la-dbus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libsession_helper_la-launcher-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libsession_helper_la-logind-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rdp_backend_la-compositor-rdp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rpi_backend_la-compositor-rpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rpi_backend_la-libinput-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rpi_backend_la-libinput-seat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rpi_backend_la-rpi-renderer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/screen_share_la-screen-share.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/setbacklight-libbacklight.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/spring_tool-animation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/spring_tool-spring-tool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vertex-clipping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/wayland_backend_la-compositor-wayland.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-animation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-bindings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-clipboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-compositor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-data-device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-linux-dmabuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-noop-renderer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-pixman-renderer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-screenshooter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-text-backend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-timeline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston-zoom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston_cliptest-vertex-clipping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/weston_launch-weston-launch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/x11_backend_la-compositor-x11.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/button_weston-button-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/config_parser_test-config-parser-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/devices_weston-devices-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/event_weston-event-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/ivi_layout_internal_test_la-ivi_layout-internal-test.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/ivi_layout_test_la-ivi_layout-test-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/keyboard_weston-keyboard-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/libtest_client_la-weston-test-client-helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/libtest_runner_la-weston-test-runner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/matrix_test-matrix-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/presentation_weston-presentation-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/roles_weston-roles-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/setbacklight-setbacklight.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/subsurface_weston-subsurface-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/surface_global_test_la-surface-global-test.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/surface_screenshot_la-surface-screenshot.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/surface_test_la-surface-test.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/text_weston-text-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/vertex-clip-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/weston_test_la-weston-test.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_base_logger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_collector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_junit_reporter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/src/$(DEPDIR)/libzunitc_la-zunitc_impl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/src/$(DEPDIR)/libzunitcmain_la-main.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@wcap/$(DEPDIR)/wcap_decode-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@wcap/$(DEPDIR)/wcap_decode-wcap-decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xwayland/$(DEPDIR)/xwayland_la-dnd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xwayland/$(DEPDIR)/xwayland_la-hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xwayland/$(DEPDIR)/xwayland_la-launcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xwayland/$(DEPDIR)/xwayland_la-selection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@xwayland/$(DEPDIR)/xwayland_la-window-manager.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< src/cms_colord_la-cms-colord.lo: src/cms-colord.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_colord_la_CFLAGS) $(CFLAGS) -MT src/cms_colord_la-cms-colord.lo -MD -MP -MF src/$(DEPDIR)/cms_colord_la-cms-colord.Tpo -c -o src/cms_colord_la-cms-colord.lo `test -f 'src/cms-colord.c' || echo '$(srcdir)/'`src/cms-colord.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/cms_colord_la-cms-colord.Tpo src/$(DEPDIR)/cms_colord_la-cms-colord.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/cms-colord.c' object='src/cms_colord_la-cms-colord.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_colord_la_CFLAGS) $(CFLAGS) -c -o src/cms_colord_la-cms-colord.lo `test -f 'src/cms-colord.c' || echo '$(srcdir)/'`src/cms-colord.c src/cms_colord_la-cms-helper.lo: src/cms-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_colord_la_CFLAGS) $(CFLAGS) -MT src/cms_colord_la-cms-helper.lo -MD -MP -MF src/$(DEPDIR)/cms_colord_la-cms-helper.Tpo -c -o src/cms_colord_la-cms-helper.lo `test -f 'src/cms-helper.c' || echo '$(srcdir)/'`src/cms-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/cms_colord_la-cms-helper.Tpo src/$(DEPDIR)/cms_colord_la-cms-helper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/cms-helper.c' object='src/cms_colord_la-cms-helper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_colord_la_CFLAGS) $(CFLAGS) -c -o src/cms_colord_la-cms-helper.lo `test -f 'src/cms-helper.c' || echo '$(srcdir)/'`src/cms-helper.c src/cms_static_la-cms-static.lo: src/cms-static.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_static_la_CFLAGS) $(CFLAGS) -MT src/cms_static_la-cms-static.lo -MD -MP -MF src/$(DEPDIR)/cms_static_la-cms-static.Tpo -c -o src/cms_static_la-cms-static.lo `test -f 'src/cms-static.c' || echo '$(srcdir)/'`src/cms-static.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/cms_static_la-cms-static.Tpo src/$(DEPDIR)/cms_static_la-cms-static.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/cms-static.c' object='src/cms_static_la-cms-static.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_static_la_CFLAGS) $(CFLAGS) -c -o src/cms_static_la-cms-static.lo `test -f 'src/cms-static.c' || echo '$(srcdir)/'`src/cms-static.c src/cms_static_la-cms-helper.lo: src/cms-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_static_la_CFLAGS) $(CFLAGS) -MT src/cms_static_la-cms-helper.lo -MD -MP -MF src/$(DEPDIR)/cms_static_la-cms-helper.Tpo -c -o src/cms_static_la-cms-helper.lo `test -f 'src/cms-helper.c' || echo '$(srcdir)/'`src/cms-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/cms_static_la-cms-helper.Tpo src/$(DEPDIR)/cms_static_la-cms-helper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/cms-helper.c' object='src/cms_static_la-cms-helper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cms_static_la_CFLAGS) $(CFLAGS) -c -o src/cms_static_la-cms-helper.lo `test -f 'src/cms-helper.c' || echo '$(srcdir)/'`src/cms-helper.c desktop-shell/desktop_shell_la-shell.lo: desktop-shell/shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -MT desktop-shell/desktop_shell_la-shell.lo -MD -MP -MF desktop-shell/$(DEPDIR)/desktop_shell_la-shell.Tpo -c -o desktop-shell/desktop_shell_la-shell.lo `test -f 'desktop-shell/shell.c' || echo '$(srcdir)/'`desktop-shell/shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) desktop-shell/$(DEPDIR)/desktop_shell_la-shell.Tpo desktop-shell/$(DEPDIR)/desktop_shell_la-shell.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-shell/shell.c' object='desktop-shell/desktop_shell_la-shell.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -c -o desktop-shell/desktop_shell_la-shell.lo `test -f 'desktop-shell/shell.c' || echo '$(srcdir)/'`desktop-shell/shell.c desktop-shell/desktop_shell_la-exposay.lo: desktop-shell/exposay.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -MT desktop-shell/desktop_shell_la-exposay.lo -MD -MP -MF desktop-shell/$(DEPDIR)/desktop_shell_la-exposay.Tpo -c -o desktop-shell/desktop_shell_la-exposay.lo `test -f 'desktop-shell/exposay.c' || echo '$(srcdir)/'`desktop-shell/exposay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) desktop-shell/$(DEPDIR)/desktop_shell_la-exposay.Tpo desktop-shell/$(DEPDIR)/desktop_shell_la-exposay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-shell/exposay.c' object='desktop-shell/desktop_shell_la-exposay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -c -o desktop-shell/desktop_shell_la-exposay.lo `test -f 'desktop-shell/exposay.c' || echo '$(srcdir)/'`desktop-shell/exposay.c desktop-shell/desktop_shell_la-input-panel.lo: desktop-shell/input-panel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -MT desktop-shell/desktop_shell_la-input-panel.lo -MD -MP -MF desktop-shell/$(DEPDIR)/desktop_shell_la-input-panel.Tpo -c -o desktop-shell/desktop_shell_la-input-panel.lo `test -f 'desktop-shell/input-panel.c' || echo '$(srcdir)/'`desktop-shell/input-panel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) desktop-shell/$(DEPDIR)/desktop_shell_la-input-panel.Tpo desktop-shell/$(DEPDIR)/desktop_shell_la-input-panel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='desktop-shell/input-panel.c' object='desktop-shell/desktop_shell_la-input-panel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -c -o desktop-shell/desktop_shell_la-input-panel.lo `test -f 'desktop-shell/input-panel.c' || echo '$(srcdir)/'`desktop-shell/input-panel.c protocol/desktop_shell_la-desktop-shell-protocol.lo: protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -MT protocol/desktop_shell_la-desktop-shell-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/desktop_shell_la-desktop-shell-protocol.Tpo -c -o protocol/desktop_shell_la-desktop-shell-protocol.lo `test -f 'protocol/desktop-shell-protocol.c' || echo '$(srcdir)/'`protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/desktop_shell_la-desktop-shell-protocol.Tpo protocol/$(DEPDIR)/desktop_shell_la-desktop-shell-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/desktop-shell-protocol.c' object='protocol/desktop_shell_la-desktop-shell-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -c -o protocol/desktop_shell_la-desktop-shell-protocol.lo `test -f 'protocol/desktop-shell-protocol.c' || echo '$(srcdir)/'`protocol/desktop-shell-protocol.c protocol/desktop_shell_la-xdg-shell-protocol.lo: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -MT protocol/desktop_shell_la-xdg-shell-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/desktop_shell_la-xdg-shell-protocol.Tpo -c -o protocol/desktop_shell_la-xdg-shell-protocol.lo `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/desktop_shell_la-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/desktop_shell_la-xdg-shell-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/desktop_shell_la-xdg-shell-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(desktop_shell_la_CPPFLAGS) $(CPPFLAGS) $(desktop_shell_la_CFLAGS) $(CFLAGS) -c -o protocol/desktop_shell_la-xdg-shell-protocol.lo `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c src/drm_backend_la-compositor-drm.lo: src/compositor-drm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -MT src/drm_backend_la-compositor-drm.lo -MD -MP -MF src/$(DEPDIR)/drm_backend_la-compositor-drm.Tpo -c -o src/drm_backend_la-compositor-drm.lo `test -f 'src/compositor-drm.c' || echo '$(srcdir)/'`src/compositor-drm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/drm_backend_la-compositor-drm.Tpo src/$(DEPDIR)/drm_backend_la-compositor-drm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-drm.c' object='src/drm_backend_la-compositor-drm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -c -o src/drm_backend_la-compositor-drm.lo `test -f 'src/compositor-drm.c' || echo '$(srcdir)/'`src/compositor-drm.c src/drm_backend_la-libinput-seat.lo: src/libinput-seat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -MT src/drm_backend_la-libinput-seat.lo -MD -MP -MF src/$(DEPDIR)/drm_backend_la-libinput-seat.Tpo -c -o src/drm_backend_la-libinput-seat.lo `test -f 'src/libinput-seat.c' || echo '$(srcdir)/'`src/libinput-seat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/drm_backend_la-libinput-seat.Tpo src/$(DEPDIR)/drm_backend_la-libinput-seat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libinput-seat.c' object='src/drm_backend_la-libinput-seat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -c -o src/drm_backend_la-libinput-seat.lo `test -f 'src/libinput-seat.c' || echo '$(srcdir)/'`src/libinput-seat.c src/drm_backend_la-libinput-device.lo: src/libinput-device.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -MT src/drm_backend_la-libinput-device.lo -MD -MP -MF src/$(DEPDIR)/drm_backend_la-libinput-device.Tpo -c -o src/drm_backend_la-libinput-device.lo `test -f 'src/libinput-device.c' || echo '$(srcdir)/'`src/libinput-device.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/drm_backend_la-libinput-device.Tpo src/$(DEPDIR)/drm_backend_la-libinput-device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libinput-device.c' object='src/drm_backend_la-libinput-device.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -c -o src/drm_backend_la-libinput-device.lo `test -f 'src/libinput-device.c' || echo '$(srcdir)/'`src/libinput-device.c src/drm_backend_la-libbacklight.lo: src/libbacklight.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -MT src/drm_backend_la-libbacklight.lo -MD -MP -MF src/$(DEPDIR)/drm_backend_la-libbacklight.Tpo -c -o src/drm_backend_la-libbacklight.lo `test -f 'src/libbacklight.c' || echo '$(srcdir)/'`src/libbacklight.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/drm_backend_la-libbacklight.Tpo src/$(DEPDIR)/drm_backend_la-libbacklight.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libbacklight.c' object='src/drm_backend_la-libbacklight.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -c -o src/drm_backend_la-libbacklight.lo `test -f 'src/libbacklight.c' || echo '$(srcdir)/'`src/libbacklight.c src/drm_backend_la-vaapi-recorder.lo: src/vaapi-recorder.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -MT src/drm_backend_la-vaapi-recorder.lo -MD -MP -MF src/$(DEPDIR)/drm_backend_la-vaapi-recorder.Tpo -c -o src/drm_backend_la-vaapi-recorder.lo `test -f 'src/vaapi-recorder.c' || echo '$(srcdir)/'`src/vaapi-recorder.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/drm_backend_la-vaapi-recorder.Tpo src/$(DEPDIR)/drm_backend_la-vaapi-recorder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/vaapi-recorder.c' object='src/drm_backend_la-vaapi-recorder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(drm_backend_la_CFLAGS) $(CFLAGS) -c -o src/drm_backend_la-vaapi-recorder.lo `test -f 'src/vaapi-recorder.c' || echo '$(srcdir)/'`src/vaapi-recorder.c src/fbdev_backend_la-compositor-fbdev.lo: src/compositor-fbdev.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fbdev_backend_la_CFLAGS) $(CFLAGS) -MT src/fbdev_backend_la-compositor-fbdev.lo -MD -MP -MF src/$(DEPDIR)/fbdev_backend_la-compositor-fbdev.Tpo -c -o src/fbdev_backend_la-compositor-fbdev.lo `test -f 'src/compositor-fbdev.c' || echo '$(srcdir)/'`src/compositor-fbdev.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/fbdev_backend_la-compositor-fbdev.Tpo src/$(DEPDIR)/fbdev_backend_la-compositor-fbdev.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-fbdev.c' object='src/fbdev_backend_la-compositor-fbdev.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fbdev_backend_la_CFLAGS) $(CFLAGS) -c -o src/fbdev_backend_la-compositor-fbdev.lo `test -f 'src/compositor-fbdev.c' || echo '$(srcdir)/'`src/compositor-fbdev.c src/fbdev_backend_la-libinput-seat.lo: src/libinput-seat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fbdev_backend_la_CFLAGS) $(CFLAGS) -MT src/fbdev_backend_la-libinput-seat.lo -MD -MP -MF src/$(DEPDIR)/fbdev_backend_la-libinput-seat.Tpo -c -o src/fbdev_backend_la-libinput-seat.lo `test -f 'src/libinput-seat.c' || echo '$(srcdir)/'`src/libinput-seat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/fbdev_backend_la-libinput-seat.Tpo src/$(DEPDIR)/fbdev_backend_la-libinput-seat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libinput-seat.c' object='src/fbdev_backend_la-libinput-seat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fbdev_backend_la_CFLAGS) $(CFLAGS) -c -o src/fbdev_backend_la-libinput-seat.lo `test -f 'src/libinput-seat.c' || echo '$(srcdir)/'`src/libinput-seat.c src/fbdev_backend_la-libinput-device.lo: src/libinput-device.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fbdev_backend_la_CFLAGS) $(CFLAGS) -MT src/fbdev_backend_la-libinput-device.lo -MD -MP -MF src/$(DEPDIR)/fbdev_backend_la-libinput-device.Tpo -c -o src/fbdev_backend_la-libinput-device.lo `test -f 'src/libinput-device.c' || echo '$(srcdir)/'`src/libinput-device.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/fbdev_backend_la-libinput-device.Tpo src/$(DEPDIR)/fbdev_backend_la-libinput-device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libinput-device.c' object='src/fbdev_backend_la-libinput-device.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fbdev_backend_la_CFLAGS) $(CFLAGS) -c -o src/fbdev_backend_la-libinput-device.lo `test -f 'src/libinput-device.c' || echo '$(srcdir)/'`src/libinput-device.c fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo: fullscreen-shell/fullscreen-shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fullscreen_shell_la_CPPFLAGS) $(CPPFLAGS) $(fullscreen_shell_la_CFLAGS) $(CFLAGS) -MT fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo -MD -MP -MF fullscreen-shell/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell.Tpo -c -o fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo `test -f 'fullscreen-shell/fullscreen-shell.c' || echo '$(srcdir)/'`fullscreen-shell/fullscreen-shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) fullscreen-shell/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell.Tpo fullscreen-shell/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fullscreen-shell/fullscreen-shell.c' object='fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fullscreen_shell_la_CPPFLAGS) $(CPPFLAGS) $(fullscreen_shell_la_CFLAGS) $(CFLAGS) -c -o fullscreen-shell/fullscreen_shell_la-fullscreen-shell.lo `test -f 'fullscreen-shell/fullscreen-shell.c' || echo '$(srcdir)/'`fullscreen-shell/fullscreen-shell.c protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fullscreen_shell_la_CPPFLAGS) $(CPPFLAGS) $(fullscreen_shell_la_CFLAGS) $(CFLAGS) -MT protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell-protocol.Tpo -c -o protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/fullscreen_shell_la-fullscreen-shell-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(fullscreen_shell_la_CPPFLAGS) $(CPPFLAGS) $(fullscreen_shell_la_CFLAGS) $(CFLAGS) -c -o protocol/fullscreen_shell_la-fullscreen-shell-protocol.lo `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c src/gl_renderer_la-gl-renderer.lo: src/gl-renderer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gl_renderer_la_CFLAGS) $(CFLAGS) -MT src/gl_renderer_la-gl-renderer.lo -MD -MP -MF src/$(DEPDIR)/gl_renderer_la-gl-renderer.Tpo -c -o src/gl_renderer_la-gl-renderer.lo `test -f 'src/gl-renderer.c' || echo '$(srcdir)/'`src/gl-renderer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/gl_renderer_la-gl-renderer.Tpo src/$(DEPDIR)/gl_renderer_la-gl-renderer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/gl-renderer.c' object='src/gl_renderer_la-gl-renderer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gl_renderer_la_CFLAGS) $(CFLAGS) -c -o src/gl_renderer_la-gl-renderer.lo `test -f 'src/gl-renderer.c' || echo '$(srcdir)/'`src/gl-renderer.c src/gl_renderer_la-vertex-clipping.lo: src/vertex-clipping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gl_renderer_la_CFLAGS) $(CFLAGS) -MT src/gl_renderer_la-vertex-clipping.lo -MD -MP -MF src/$(DEPDIR)/gl_renderer_la-vertex-clipping.Tpo -c -o src/gl_renderer_la-vertex-clipping.lo `test -f 'src/vertex-clipping.c' || echo '$(srcdir)/'`src/vertex-clipping.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/gl_renderer_la-vertex-clipping.Tpo src/$(DEPDIR)/gl_renderer_la-vertex-clipping.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/vertex-clipping.c' object='src/gl_renderer_la-vertex-clipping.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gl_renderer_la_CFLAGS) $(CFLAGS) -c -o src/gl_renderer_la-vertex-clipping.lo `test -f 'src/vertex-clipping.c' || echo '$(srcdir)/'`src/vertex-clipping.c src/headless_backend_la-compositor-headless.lo: src/compositor-headless.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(headless_backend_la_CFLAGS) $(CFLAGS) -MT src/headless_backend_la-compositor-headless.lo -MD -MP -MF src/$(DEPDIR)/headless_backend_la-compositor-headless.Tpo -c -o src/headless_backend_la-compositor-headless.lo `test -f 'src/compositor-headless.c' || echo '$(srcdir)/'`src/compositor-headless.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/headless_backend_la-compositor-headless.Tpo src/$(DEPDIR)/headless_backend_la-compositor-headless.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-headless.c' object='src/headless_backend_la-compositor-headless.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(headless_backend_la_CFLAGS) $(CFLAGS) -c -o src/headless_backend_la-compositor-headless.lo `test -f 'src/compositor-headless.c' || echo '$(srcdir)/'`src/compositor-headless.c ivi-shell/hmi_controller_la-hmi-controller.lo: ivi-shell/hmi-controller.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hmi_controller_la_CFLAGS) $(CFLAGS) -MT ivi-shell/hmi_controller_la-hmi-controller.lo -MD -MP -MF ivi-shell/$(DEPDIR)/hmi_controller_la-hmi-controller.Tpo -c -o ivi-shell/hmi_controller_la-hmi-controller.lo `test -f 'ivi-shell/hmi-controller.c' || echo '$(srcdir)/'`ivi-shell/hmi-controller.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ivi-shell/$(DEPDIR)/hmi_controller_la-hmi-controller.Tpo ivi-shell/$(DEPDIR)/hmi_controller_la-hmi-controller.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ivi-shell/hmi-controller.c' object='ivi-shell/hmi_controller_la-hmi-controller.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hmi_controller_la_CFLAGS) $(CFLAGS) -c -o ivi-shell/hmi_controller_la-hmi-controller.lo `test -f 'ivi-shell/hmi-controller.c' || echo '$(srcdir)/'`ivi-shell/hmi-controller.c protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo: protocol/ivi-hmi-controller-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hmi_controller_la_CFLAGS) $(CFLAGS) -MT protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/hmi_controller_la-ivi-hmi-controller-protocol.Tpo -c -o protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo `test -f 'protocol/ivi-hmi-controller-protocol.c' || echo '$(srcdir)/'`protocol/ivi-hmi-controller-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/hmi_controller_la-ivi-hmi-controller-protocol.Tpo protocol/$(DEPDIR)/hmi_controller_la-ivi-hmi-controller-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-hmi-controller-protocol.c' object='protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hmi_controller_la_CFLAGS) $(CFLAGS) -c -o protocol/hmi_controller_la-ivi-hmi-controller-protocol.lo `test -f 'protocol/ivi-hmi-controller-protocol.c' || echo '$(srcdir)/'`protocol/ivi-hmi-controller-protocol.c tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo: tests/ivi_layout-internal-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_internal_test_la_CFLAGS) $(CFLAGS) -MT tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo -MD -MP -MF tests/$(DEPDIR)/ivi_layout_internal_test_la-ivi_layout-internal-test.Tpo -c -o tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo `test -f 'tests/ivi_layout-internal-test.c' || echo '$(srcdir)/'`tests/ivi_layout-internal-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/ivi_layout_internal_test_la-ivi_layout-internal-test.Tpo tests/$(DEPDIR)/ivi_layout_internal_test_la-ivi_layout-internal-test.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ivi_layout-internal-test.c' object='tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_internal_test_la_CFLAGS) $(CFLAGS) -c -o tests/ivi_layout_internal_test_la-ivi_layout-internal-test.lo `test -f 'tests/ivi_layout-internal-test.c' || echo '$(srcdir)/'`tests/ivi_layout-internal-test.c tests/ivi_layout_test_la-ivi_layout-test-plugin.lo: tests/ivi_layout-test-plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_test_la_CFLAGS) $(CFLAGS) -MT tests/ivi_layout_test_la-ivi_layout-test-plugin.lo -MD -MP -MF tests/$(DEPDIR)/ivi_layout_test_la-ivi_layout-test-plugin.Tpo -c -o tests/ivi_layout_test_la-ivi_layout-test-plugin.lo `test -f 'tests/ivi_layout-test-plugin.c' || echo '$(srcdir)/'`tests/ivi_layout-test-plugin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/ivi_layout_test_la-ivi_layout-test-plugin.Tpo tests/$(DEPDIR)/ivi_layout_test_la-ivi_layout-test-plugin.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ivi_layout-test-plugin.c' object='tests/ivi_layout_test_la-ivi_layout-test-plugin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_test_la_CFLAGS) $(CFLAGS) -c -o tests/ivi_layout_test_la-ivi_layout-test-plugin.lo `test -f 'tests/ivi_layout-test-plugin.c' || echo '$(srcdir)/'`tests/ivi_layout-test-plugin.c protocol/ivi_layout_test_la-weston-test-protocol.lo: protocol/weston-test-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_test_la_CFLAGS) $(CFLAGS) -MT protocol/ivi_layout_test_la-weston-test-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/ivi_layout_test_la-weston-test-protocol.Tpo -c -o protocol/ivi_layout_test_la-weston-test-protocol.lo `test -f 'protocol/weston-test-protocol.c' || echo '$(srcdir)/'`protocol/weston-test-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/ivi_layout_test_la-weston-test-protocol.Tpo protocol/$(DEPDIR)/ivi_layout_test_la-weston-test-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/weston-test-protocol.c' object='protocol/ivi_layout_test_la-weston-test-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_test_la_CFLAGS) $(CFLAGS) -c -o protocol/ivi_layout_test_la-weston-test-protocol.lo `test -f 'protocol/weston-test-protocol.c' || echo '$(srcdir)/'`protocol/weston-test-protocol.c ivi-shell/ivi_shell_la-ivi-layout.lo: ivi-shell/ivi-layout.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -MT ivi-shell/ivi_shell_la-ivi-layout.lo -MD -MP -MF ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout.Tpo -c -o ivi-shell/ivi_shell_la-ivi-layout.lo `test -f 'ivi-shell/ivi-layout.c' || echo '$(srcdir)/'`ivi-shell/ivi-layout.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout.Tpo ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ivi-shell/ivi-layout.c' object='ivi-shell/ivi_shell_la-ivi-layout.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -c -o ivi-shell/ivi_shell_la-ivi-layout.lo `test -f 'ivi-shell/ivi-layout.c' || echo '$(srcdir)/'`ivi-shell/ivi-layout.c ivi-shell/ivi_shell_la-ivi-layout-transition.lo: ivi-shell/ivi-layout-transition.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -MT ivi-shell/ivi_shell_la-ivi-layout-transition.lo -MD -MP -MF ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout-transition.Tpo -c -o ivi-shell/ivi_shell_la-ivi-layout-transition.lo `test -f 'ivi-shell/ivi-layout-transition.c' || echo '$(srcdir)/'`ivi-shell/ivi-layout-transition.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout-transition.Tpo ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-layout-transition.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ivi-shell/ivi-layout-transition.c' object='ivi-shell/ivi_shell_la-ivi-layout-transition.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -c -o ivi-shell/ivi_shell_la-ivi-layout-transition.lo `test -f 'ivi-shell/ivi-layout-transition.c' || echo '$(srcdir)/'`ivi-shell/ivi-layout-transition.c ivi-shell/ivi_shell_la-ivi-shell.lo: ivi-shell/ivi-shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -MT ivi-shell/ivi_shell_la-ivi-shell.lo -MD -MP -MF ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-shell.Tpo -c -o ivi-shell/ivi_shell_la-ivi-shell.lo `test -f 'ivi-shell/ivi-shell.c' || echo '$(srcdir)/'`ivi-shell/ivi-shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-shell.Tpo ivi-shell/$(DEPDIR)/ivi_shell_la-ivi-shell.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ivi-shell/ivi-shell.c' object='ivi-shell/ivi_shell_la-ivi-shell.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -c -o ivi-shell/ivi_shell_la-ivi-shell.lo `test -f 'ivi-shell/ivi-shell.c' || echo '$(srcdir)/'`ivi-shell/ivi-shell.c ivi-shell/ivi_shell_la-input-panel-ivi.lo: ivi-shell/input-panel-ivi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -MT ivi-shell/ivi_shell_la-input-panel-ivi.lo -MD -MP -MF ivi-shell/$(DEPDIR)/ivi_shell_la-input-panel-ivi.Tpo -c -o ivi-shell/ivi_shell_la-input-panel-ivi.lo `test -f 'ivi-shell/input-panel-ivi.c' || echo '$(srcdir)/'`ivi-shell/input-panel-ivi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ivi-shell/$(DEPDIR)/ivi_shell_la-input-panel-ivi.Tpo ivi-shell/$(DEPDIR)/ivi_shell_la-input-panel-ivi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ivi-shell/input-panel-ivi.c' object='ivi-shell/ivi_shell_la-input-panel-ivi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -c -o ivi-shell/ivi_shell_la-input-panel-ivi.lo `test -f 'ivi-shell/input-panel-ivi.c' || echo '$(srcdir)/'`ivi-shell/input-panel-ivi.c protocol/ivi_shell_la-ivi-application-protocol.lo: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -MT protocol/ivi_shell_la-ivi-application-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/ivi_shell_la-ivi-application-protocol.Tpo -c -o protocol/ivi_shell_la-ivi-application-protocol.lo `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/ivi_shell_la-ivi-application-protocol.Tpo protocol/$(DEPDIR)/ivi_shell_la-ivi-application-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/ivi_shell_la-ivi-application-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_la_CFLAGS) $(CFLAGS) -c -o protocol/ivi_shell_la-ivi-application-protocol.lo `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c src/libsession_helper_la-launcher-util.lo: src/launcher-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsession_helper_la_CFLAGS) $(CFLAGS) -MT src/libsession_helper_la-launcher-util.lo -MD -MP -MF src/$(DEPDIR)/libsession_helper_la-launcher-util.Tpo -c -o src/libsession_helper_la-launcher-util.lo `test -f 'src/launcher-util.c' || echo '$(srcdir)/'`src/launcher-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libsession_helper_la-launcher-util.Tpo src/$(DEPDIR)/libsession_helper_la-launcher-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/launcher-util.c' object='src/libsession_helper_la-launcher-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsession_helper_la_CFLAGS) $(CFLAGS) -c -o src/libsession_helper_la-launcher-util.lo `test -f 'src/launcher-util.c' || echo '$(srcdir)/'`src/launcher-util.c src/libsession_helper_la-dbus.lo: src/dbus.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsession_helper_la_CFLAGS) $(CFLAGS) -MT src/libsession_helper_la-dbus.lo -MD -MP -MF src/$(DEPDIR)/libsession_helper_la-dbus.Tpo -c -o src/libsession_helper_la-dbus.lo `test -f 'src/dbus.c' || echo '$(srcdir)/'`src/dbus.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libsession_helper_la-dbus.Tpo src/$(DEPDIR)/libsession_helper_la-dbus.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/dbus.c' object='src/libsession_helper_la-dbus.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsession_helper_la_CFLAGS) $(CFLAGS) -c -o src/libsession_helper_la-dbus.lo `test -f 'src/dbus.c' || echo '$(srcdir)/'`src/dbus.c src/libsession_helper_la-logind-util.lo: src/logind-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsession_helper_la_CFLAGS) $(CFLAGS) -MT src/libsession_helper_la-logind-util.lo -MD -MP -MF src/$(DEPDIR)/libsession_helper_la-logind-util.Tpo -c -o src/libsession_helper_la-logind-util.lo `test -f 'src/logind-util.c' || echo '$(srcdir)/'`src/logind-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libsession_helper_la-logind-util.Tpo src/$(DEPDIR)/libsession_helper_la-logind-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/logind-util.c' object='src/libsession_helper_la-logind-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsession_helper_la_CFLAGS) $(CFLAGS) -c -o src/libsession_helper_la-logind-util.lo `test -f 'src/logind-util.c' || echo '$(srcdir)/'`src/logind-util.c shared/libshared_cairo_la-config-parser.lo: shared/config-parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-config-parser.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-config-parser.Tpo -c -o shared/libshared_cairo_la-config-parser.lo `test -f 'shared/config-parser.c' || echo '$(srcdir)/'`shared/config-parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-config-parser.Tpo shared/$(DEPDIR)/libshared_cairo_la-config-parser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/config-parser.c' object='shared/libshared_cairo_la-config-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-config-parser.lo `test -f 'shared/config-parser.c' || echo '$(srcdir)/'`shared/config-parser.c shared/libshared_cairo_la-option-parser.lo: shared/option-parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-option-parser.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-option-parser.Tpo -c -o shared/libshared_cairo_la-option-parser.lo `test -f 'shared/option-parser.c' || echo '$(srcdir)/'`shared/option-parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-option-parser.Tpo shared/$(DEPDIR)/libshared_cairo_la-option-parser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/option-parser.c' object='shared/libshared_cairo_la-option-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-option-parser.lo `test -f 'shared/option-parser.c' || echo '$(srcdir)/'`shared/option-parser.c shared/libshared_cairo_la-file-util.lo: shared/file-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-file-util.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-file-util.Tpo -c -o shared/libshared_cairo_la-file-util.lo `test -f 'shared/file-util.c' || echo '$(srcdir)/'`shared/file-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-file-util.Tpo shared/$(DEPDIR)/libshared_cairo_la-file-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/file-util.c' object='shared/libshared_cairo_la-file-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-file-util.lo `test -f 'shared/file-util.c' || echo '$(srcdir)/'`shared/file-util.c shared/libshared_cairo_la-os-compatibility.lo: shared/os-compatibility.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-os-compatibility.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-os-compatibility.Tpo -c -o shared/libshared_cairo_la-os-compatibility.lo `test -f 'shared/os-compatibility.c' || echo '$(srcdir)/'`shared/os-compatibility.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-os-compatibility.Tpo shared/$(DEPDIR)/libshared_cairo_la-os-compatibility.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/os-compatibility.c' object='shared/libshared_cairo_la-os-compatibility.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-os-compatibility.lo `test -f 'shared/os-compatibility.c' || echo '$(srcdir)/'`shared/os-compatibility.c shared/libshared_cairo_la-image-loader.lo: shared/image-loader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-image-loader.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-image-loader.Tpo -c -o shared/libshared_cairo_la-image-loader.lo `test -f 'shared/image-loader.c' || echo '$(srcdir)/'`shared/image-loader.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-image-loader.Tpo shared/$(DEPDIR)/libshared_cairo_la-image-loader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/image-loader.c' object='shared/libshared_cairo_la-image-loader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-image-loader.lo `test -f 'shared/image-loader.c' || echo '$(srcdir)/'`shared/image-loader.c shared/libshared_cairo_la-cairo-util.lo: shared/cairo-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-cairo-util.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-cairo-util.Tpo -c -o shared/libshared_cairo_la-cairo-util.lo `test -f 'shared/cairo-util.c' || echo '$(srcdir)/'`shared/cairo-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-cairo-util.Tpo shared/$(DEPDIR)/libshared_cairo_la-cairo-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/cairo-util.c' object='shared/libshared_cairo_la-cairo-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-cairo-util.lo `test -f 'shared/cairo-util.c' || echo '$(srcdir)/'`shared/cairo-util.c shared/libshared_cairo_la-frame.lo: shared/frame.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -MT shared/libshared_cairo_la-frame.lo -MD -MP -MF shared/$(DEPDIR)/libshared_cairo_la-frame.Tpo -c -o shared/libshared_cairo_la-frame.lo `test -f 'shared/frame.c' || echo '$(srcdir)/'`shared/frame.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_cairo_la-frame.Tpo shared/$(DEPDIR)/libshared_cairo_la-frame.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/frame.c' object='shared/libshared_cairo_la-frame.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_cairo_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_cairo_la-frame.lo `test -f 'shared/frame.c' || echo '$(srcdir)/'`shared/frame.c shared/libshared_la-config-parser.lo: shared/config-parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -MT shared/libshared_la-config-parser.lo -MD -MP -MF shared/$(DEPDIR)/libshared_la-config-parser.Tpo -c -o shared/libshared_la-config-parser.lo `test -f 'shared/config-parser.c' || echo '$(srcdir)/'`shared/config-parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_la-config-parser.Tpo shared/$(DEPDIR)/libshared_la-config-parser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/config-parser.c' object='shared/libshared_la-config-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_la-config-parser.lo `test -f 'shared/config-parser.c' || echo '$(srcdir)/'`shared/config-parser.c shared/libshared_la-option-parser.lo: shared/option-parser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -MT shared/libshared_la-option-parser.lo -MD -MP -MF shared/$(DEPDIR)/libshared_la-option-parser.Tpo -c -o shared/libshared_la-option-parser.lo `test -f 'shared/option-parser.c' || echo '$(srcdir)/'`shared/option-parser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_la-option-parser.Tpo shared/$(DEPDIR)/libshared_la-option-parser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/option-parser.c' object='shared/libshared_la-option-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_la-option-parser.lo `test -f 'shared/option-parser.c' || echo '$(srcdir)/'`shared/option-parser.c shared/libshared_la-file-util.lo: shared/file-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -MT shared/libshared_la-file-util.lo -MD -MP -MF shared/$(DEPDIR)/libshared_la-file-util.Tpo -c -o shared/libshared_la-file-util.lo `test -f 'shared/file-util.c' || echo '$(srcdir)/'`shared/file-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_la-file-util.Tpo shared/$(DEPDIR)/libshared_la-file-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/file-util.c' object='shared/libshared_la-file-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_la-file-util.lo `test -f 'shared/file-util.c' || echo '$(srcdir)/'`shared/file-util.c shared/libshared_la-os-compatibility.lo: shared/os-compatibility.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -MT shared/libshared_la-os-compatibility.lo -MD -MP -MF shared/$(DEPDIR)/libshared_la-os-compatibility.Tpo -c -o shared/libshared_la-os-compatibility.lo `test -f 'shared/os-compatibility.c' || echo '$(srcdir)/'`shared/os-compatibility.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/libshared_la-os-compatibility.Tpo shared/$(DEPDIR)/libshared_la-os-compatibility.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/os-compatibility.c' object='shared/libshared_la-os-compatibility.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_la_CFLAGS) $(CFLAGS) -c -o shared/libshared_la-os-compatibility.lo `test -f 'shared/os-compatibility.c' || echo '$(srcdir)/'`shared/os-compatibility.c tests/libtest_client_la-weston-test-client-helper.lo: tests/weston-test-client-helper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtest_client_la_CFLAGS) $(CFLAGS) -MT tests/libtest_client_la-weston-test-client-helper.lo -MD -MP -MF tests/$(DEPDIR)/libtest_client_la-weston-test-client-helper.Tpo -c -o tests/libtest_client_la-weston-test-client-helper.lo `test -f 'tests/weston-test-client-helper.c' || echo '$(srcdir)/'`tests/weston-test-client-helper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/libtest_client_la-weston-test-client-helper.Tpo tests/$(DEPDIR)/libtest_client_la-weston-test-client-helper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/weston-test-client-helper.c' object='tests/libtest_client_la-weston-test-client-helper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtest_client_la_CFLAGS) $(CFLAGS) -c -o tests/libtest_client_la-weston-test-client-helper.lo `test -f 'tests/weston-test-client-helper.c' || echo '$(srcdir)/'`tests/weston-test-client-helper.c protocol/libtest_client_la-weston-test-protocol.lo: protocol/weston-test-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtest_client_la_CFLAGS) $(CFLAGS) -MT protocol/libtest_client_la-weston-test-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtest_client_la-weston-test-protocol.Tpo -c -o protocol/libtest_client_la-weston-test-protocol.lo `test -f 'protocol/weston-test-protocol.c' || echo '$(srcdir)/'`protocol/weston-test-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtest_client_la-weston-test-protocol.Tpo protocol/$(DEPDIR)/libtest_client_la-weston-test-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/weston-test-protocol.c' object='protocol/libtest_client_la-weston-test-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtest_client_la_CFLAGS) $(CFLAGS) -c -o protocol/libtest_client_la-weston-test-protocol.lo `test -f 'protocol/weston-test-protocol.c' || echo '$(srcdir)/'`protocol/weston-test-protocol.c tests/libtest_runner_la-weston-test-runner.lo: tests/weston-test-runner.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtest_runner_la_CFLAGS) $(CFLAGS) -MT tests/libtest_runner_la-weston-test-runner.lo -MD -MP -MF tests/$(DEPDIR)/libtest_runner_la-weston-test-runner.Tpo -c -o tests/libtest_runner_la-weston-test-runner.lo `test -f 'tests/weston-test-runner.c' || echo '$(srcdir)/'`tests/weston-test-runner.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/libtest_runner_la-weston-test-runner.Tpo tests/$(DEPDIR)/libtest_runner_la-weston-test-runner.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/weston-test-runner.c' object='tests/libtest_runner_la-weston-test-runner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtest_runner_la_CFLAGS) $(CFLAGS) -c -o tests/libtest_runner_la-weston-test-runner.lo `test -f 'tests/weston-test-runner.c' || echo '$(srcdir)/'`tests/weston-test-runner.c clients/libtoytoolkit_la-window.lo: clients/window.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT clients/libtoytoolkit_la-window.lo -MD -MP -MF clients/$(DEPDIR)/libtoytoolkit_la-window.Tpo -c -o clients/libtoytoolkit_la-window.lo `test -f 'clients/window.c' || echo '$(srcdir)/'`clients/window.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/libtoytoolkit_la-window.Tpo clients/$(DEPDIR)/libtoytoolkit_la-window.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/window.c' object='clients/libtoytoolkit_la-window.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o clients/libtoytoolkit_la-window.lo `test -f 'clients/window.c' || echo '$(srcdir)/'`clients/window.c protocol/libtoytoolkit_la-text-cursor-position-protocol.lo: protocol/text-cursor-position-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT protocol/libtoytoolkit_la-text-cursor-position-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtoytoolkit_la-text-cursor-position-protocol.Tpo -c -o protocol/libtoytoolkit_la-text-cursor-position-protocol.lo `test -f 'protocol/text-cursor-position-protocol.c' || echo '$(srcdir)/'`protocol/text-cursor-position-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtoytoolkit_la-text-cursor-position-protocol.Tpo protocol/$(DEPDIR)/libtoytoolkit_la-text-cursor-position-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-cursor-position-protocol.c' object='protocol/libtoytoolkit_la-text-cursor-position-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o protocol/libtoytoolkit_la-text-cursor-position-protocol.lo `test -f 'protocol/text-cursor-position-protocol.c' || echo '$(srcdir)/'`protocol/text-cursor-position-protocol.c protocol/libtoytoolkit_la-scaler-protocol.lo: protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT protocol/libtoytoolkit_la-scaler-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtoytoolkit_la-scaler-protocol.Tpo -c -o protocol/libtoytoolkit_la-scaler-protocol.lo `test -f 'protocol/scaler-protocol.c' || echo '$(srcdir)/'`protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtoytoolkit_la-scaler-protocol.Tpo protocol/$(DEPDIR)/libtoytoolkit_la-scaler-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/scaler-protocol.c' object='protocol/libtoytoolkit_la-scaler-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o protocol/libtoytoolkit_la-scaler-protocol.lo `test -f 'protocol/scaler-protocol.c' || echo '$(srcdir)/'`protocol/scaler-protocol.c protocol/libtoytoolkit_la-workspaces-protocol.lo: protocol/workspaces-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT protocol/libtoytoolkit_la-workspaces-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtoytoolkit_la-workspaces-protocol.Tpo -c -o protocol/libtoytoolkit_la-workspaces-protocol.lo `test -f 'protocol/workspaces-protocol.c' || echo '$(srcdir)/'`protocol/workspaces-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtoytoolkit_la-workspaces-protocol.Tpo protocol/$(DEPDIR)/libtoytoolkit_la-workspaces-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/workspaces-protocol.c' object='protocol/libtoytoolkit_la-workspaces-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o protocol/libtoytoolkit_la-workspaces-protocol.lo `test -f 'protocol/workspaces-protocol.c' || echo '$(srcdir)/'`protocol/workspaces-protocol.c protocol/libtoytoolkit_la-presentation_timing-protocol.lo: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT protocol/libtoytoolkit_la-presentation_timing-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtoytoolkit_la-presentation_timing-protocol.Tpo -c -o protocol/libtoytoolkit_la-presentation_timing-protocol.lo `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtoytoolkit_la-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/libtoytoolkit_la-presentation_timing-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/libtoytoolkit_la-presentation_timing-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o protocol/libtoytoolkit_la-presentation_timing-protocol.lo `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c protocol/libtoytoolkit_la-xdg-shell-protocol.lo: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT protocol/libtoytoolkit_la-xdg-shell-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtoytoolkit_la-xdg-shell-protocol.Tpo -c -o protocol/libtoytoolkit_la-xdg-shell-protocol.lo `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtoytoolkit_la-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/libtoytoolkit_la-xdg-shell-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/libtoytoolkit_la-xdg-shell-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o protocol/libtoytoolkit_la-xdg-shell-protocol.lo `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c protocol/libtoytoolkit_la-ivi-application-protocol.lo: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -MT protocol/libtoytoolkit_la-ivi-application-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/libtoytoolkit_la-ivi-application-protocol.Tpo -c -o protocol/libtoytoolkit_la-ivi-application-protocol.lo `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/libtoytoolkit_la-ivi-application-protocol.Tpo protocol/$(DEPDIR)/libtoytoolkit_la-ivi-application-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/libtoytoolkit_la-ivi-application-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libtoytoolkit_la_CFLAGS) $(CFLAGS) -c -o protocol/libtoytoolkit_la-ivi-application-protocol.lo `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c tools/zunitc/src/libzunitc_la-zuc_base_logger.lo: tools/zunitc/src/zuc_base_logger.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -MT tools/zunitc/src/libzunitc_la-zuc_base_logger.lo -MD -MP -MF tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_base_logger.Tpo -c -o tools/zunitc/src/libzunitc_la-zuc_base_logger.lo `test -f 'tools/zunitc/src/zuc_base_logger.c' || echo '$(srcdir)/'`tools/zunitc/src/zuc_base_logger.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_base_logger.Tpo tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_base_logger.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/src/zuc_base_logger.c' object='tools/zunitc/src/libzunitc_la-zuc_base_logger.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -c -o tools/zunitc/src/libzunitc_la-zuc_base_logger.lo `test -f 'tools/zunitc/src/zuc_base_logger.c' || echo '$(srcdir)/'`tools/zunitc/src/zuc_base_logger.c tools/zunitc/src/libzunitc_la-zuc_collector.lo: tools/zunitc/src/zuc_collector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -MT tools/zunitc/src/libzunitc_la-zuc_collector.lo -MD -MP -MF tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_collector.Tpo -c -o tools/zunitc/src/libzunitc_la-zuc_collector.lo `test -f 'tools/zunitc/src/zuc_collector.c' || echo '$(srcdir)/'`tools/zunitc/src/zuc_collector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_collector.Tpo tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_collector.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/src/zuc_collector.c' object='tools/zunitc/src/libzunitc_la-zuc_collector.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -c -o tools/zunitc/src/libzunitc_la-zuc_collector.lo `test -f 'tools/zunitc/src/zuc_collector.c' || echo '$(srcdir)/'`tools/zunitc/src/zuc_collector.c tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo: tools/zunitc/src/zuc_junit_reporter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -MT tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo -MD -MP -MF tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_junit_reporter.Tpo -c -o tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo `test -f 'tools/zunitc/src/zuc_junit_reporter.c' || echo '$(srcdir)/'`tools/zunitc/src/zuc_junit_reporter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_junit_reporter.Tpo tools/zunitc/src/$(DEPDIR)/libzunitc_la-zuc_junit_reporter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/src/zuc_junit_reporter.c' object='tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -c -o tools/zunitc/src/libzunitc_la-zuc_junit_reporter.lo `test -f 'tools/zunitc/src/zuc_junit_reporter.c' || echo '$(srcdir)/'`tools/zunitc/src/zuc_junit_reporter.c tools/zunitc/src/libzunitc_la-zunitc_impl.lo: tools/zunitc/src/zunitc_impl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -MT tools/zunitc/src/libzunitc_la-zunitc_impl.lo -MD -MP -MF tools/zunitc/src/$(DEPDIR)/libzunitc_la-zunitc_impl.Tpo -c -o tools/zunitc/src/libzunitc_la-zunitc_impl.lo `test -f 'tools/zunitc/src/zunitc_impl.c' || echo '$(srcdir)/'`tools/zunitc/src/zunitc_impl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/src/$(DEPDIR)/libzunitc_la-zunitc_impl.Tpo tools/zunitc/src/$(DEPDIR)/libzunitc_la-zunitc_impl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/src/zunitc_impl.c' object='tools/zunitc/src/libzunitc_la-zunitc_impl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitc_la_CFLAGS) $(CFLAGS) -c -o tools/zunitc/src/libzunitc_la-zunitc_impl.lo `test -f 'tools/zunitc/src/zunitc_impl.c' || echo '$(srcdir)/'`tools/zunitc/src/zunitc_impl.c tools/zunitc/src/libzunitcmain_la-main.lo: tools/zunitc/src/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitcmain_la_CFLAGS) $(CFLAGS) -MT tools/zunitc/src/libzunitcmain_la-main.lo -MD -MP -MF tools/zunitc/src/$(DEPDIR)/libzunitcmain_la-main.Tpo -c -o tools/zunitc/src/libzunitcmain_la-main.lo `test -f 'tools/zunitc/src/main.c' || echo '$(srcdir)/'`tools/zunitc/src/main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/src/$(DEPDIR)/libzunitcmain_la-main.Tpo tools/zunitc/src/$(DEPDIR)/libzunitcmain_la-main.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/src/main.c' object='tools/zunitc/src/libzunitcmain_la-main.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzunitcmain_la_CFLAGS) $(CFLAGS) -c -o tools/zunitc/src/libzunitcmain_la-main.lo `test -f 'tools/zunitc/src/main.c' || echo '$(srcdir)/'`tools/zunitc/src/main.c src/rdp_backend_la-compositor-rdp.lo: src/compositor-rdp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rdp_backend_la_CFLAGS) $(CFLAGS) -MT src/rdp_backend_la-compositor-rdp.lo -MD -MP -MF src/$(DEPDIR)/rdp_backend_la-compositor-rdp.Tpo -c -o src/rdp_backend_la-compositor-rdp.lo `test -f 'src/compositor-rdp.c' || echo '$(srcdir)/'`src/compositor-rdp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rdp_backend_la-compositor-rdp.Tpo src/$(DEPDIR)/rdp_backend_la-compositor-rdp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-rdp.c' object='src/rdp_backend_la-compositor-rdp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rdp_backend_la_CFLAGS) $(CFLAGS) -c -o src/rdp_backend_la-compositor-rdp.lo `test -f 'src/compositor-rdp.c' || echo '$(srcdir)/'`src/compositor-rdp.c src/rpi_backend_la-compositor-rpi.lo: src/compositor-rpi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -MT src/rpi_backend_la-compositor-rpi.lo -MD -MP -MF src/$(DEPDIR)/rpi_backend_la-compositor-rpi.Tpo -c -o src/rpi_backend_la-compositor-rpi.lo `test -f 'src/compositor-rpi.c' || echo '$(srcdir)/'`src/compositor-rpi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rpi_backend_la-compositor-rpi.Tpo src/$(DEPDIR)/rpi_backend_la-compositor-rpi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-rpi.c' object='src/rpi_backend_la-compositor-rpi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -c -o src/rpi_backend_la-compositor-rpi.lo `test -f 'src/compositor-rpi.c' || echo '$(srcdir)/'`src/compositor-rpi.c src/rpi_backend_la-rpi-renderer.lo: src/rpi-renderer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -MT src/rpi_backend_la-rpi-renderer.lo -MD -MP -MF src/$(DEPDIR)/rpi_backend_la-rpi-renderer.Tpo -c -o src/rpi_backend_la-rpi-renderer.lo `test -f 'src/rpi-renderer.c' || echo '$(srcdir)/'`src/rpi-renderer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rpi_backend_la-rpi-renderer.Tpo src/$(DEPDIR)/rpi_backend_la-rpi-renderer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/rpi-renderer.c' object='src/rpi_backend_la-rpi-renderer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -c -o src/rpi_backend_la-rpi-renderer.lo `test -f 'src/rpi-renderer.c' || echo '$(srcdir)/'`src/rpi-renderer.c src/rpi_backend_la-libinput-seat.lo: src/libinput-seat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -MT src/rpi_backend_la-libinput-seat.lo -MD -MP -MF src/$(DEPDIR)/rpi_backend_la-libinput-seat.Tpo -c -o src/rpi_backend_la-libinput-seat.lo `test -f 'src/libinput-seat.c' || echo '$(srcdir)/'`src/libinput-seat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rpi_backend_la-libinput-seat.Tpo src/$(DEPDIR)/rpi_backend_la-libinput-seat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libinput-seat.c' object='src/rpi_backend_la-libinput-seat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -c -o src/rpi_backend_la-libinput-seat.lo `test -f 'src/libinput-seat.c' || echo '$(srcdir)/'`src/libinput-seat.c src/rpi_backend_la-libinput-device.lo: src/libinput-device.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -MT src/rpi_backend_la-libinput-device.lo -MD -MP -MF src/$(DEPDIR)/rpi_backend_la-libinput-device.Tpo -c -o src/rpi_backend_la-libinput-device.lo `test -f 'src/libinput-device.c' || echo '$(srcdir)/'`src/libinput-device.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rpi_backend_la-libinput-device.Tpo src/$(DEPDIR)/rpi_backend_la-libinput-device.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libinput-device.c' object='src/rpi_backend_la-libinput-device.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rpi_backend_la_CFLAGS) $(CFLAGS) -c -o src/rpi_backend_la-libinput-device.lo `test -f 'src/libinput-device.c' || echo '$(srcdir)/'`src/libinput-device.c src/screen_share_la-screen-share.lo: src/screen-share.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(screen_share_la_CPPFLAGS) $(CPPFLAGS) $(screen_share_la_CFLAGS) $(CFLAGS) -MT src/screen_share_la-screen-share.lo -MD -MP -MF src/$(DEPDIR)/screen_share_la-screen-share.Tpo -c -o src/screen_share_la-screen-share.lo `test -f 'src/screen-share.c' || echo '$(srcdir)/'`src/screen-share.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/screen_share_la-screen-share.Tpo src/$(DEPDIR)/screen_share_la-screen-share.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/screen-share.c' object='src/screen_share_la-screen-share.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(screen_share_la_CPPFLAGS) $(CPPFLAGS) $(screen_share_la_CFLAGS) $(CFLAGS) -c -o src/screen_share_la-screen-share.lo `test -f 'src/screen-share.c' || echo '$(srcdir)/'`src/screen-share.c protocol/screen_share_la-fullscreen-shell-protocol.lo: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(screen_share_la_CPPFLAGS) $(CPPFLAGS) $(screen_share_la_CFLAGS) $(CFLAGS) -MT protocol/screen_share_la-fullscreen-shell-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/screen_share_la-fullscreen-shell-protocol.Tpo -c -o protocol/screen_share_la-fullscreen-shell-protocol.lo `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/screen_share_la-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/screen_share_la-fullscreen-shell-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/screen_share_la-fullscreen-shell-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(screen_share_la_CPPFLAGS) $(CPPFLAGS) $(screen_share_la_CFLAGS) $(CFLAGS) -c -o protocol/screen_share_la-fullscreen-shell-protocol.lo `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c tests/surface_global_test_la-surface-global-test.lo: tests/surface-global-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(surface_global_test_la_CFLAGS) $(CFLAGS) -MT tests/surface_global_test_la-surface-global-test.lo -MD -MP -MF tests/$(DEPDIR)/surface_global_test_la-surface-global-test.Tpo -c -o tests/surface_global_test_la-surface-global-test.lo `test -f 'tests/surface-global-test.c' || echo '$(srcdir)/'`tests/surface-global-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/surface_global_test_la-surface-global-test.Tpo tests/$(DEPDIR)/surface_global_test_la-surface-global-test.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/surface-global-test.c' object='tests/surface_global_test_la-surface-global-test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(surface_global_test_la_CFLAGS) $(CFLAGS) -c -o tests/surface_global_test_la-surface-global-test.lo `test -f 'tests/surface-global-test.c' || echo '$(srcdir)/'`tests/surface-global-test.c tests/surface_screenshot_la-surface-screenshot.lo: tests/surface-screenshot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(surface_screenshot_la_CFLAGS) $(CFLAGS) -MT tests/surface_screenshot_la-surface-screenshot.lo -MD -MP -MF tests/$(DEPDIR)/surface_screenshot_la-surface-screenshot.Tpo -c -o tests/surface_screenshot_la-surface-screenshot.lo `test -f 'tests/surface-screenshot.c' || echo '$(srcdir)/'`tests/surface-screenshot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/surface_screenshot_la-surface-screenshot.Tpo tests/$(DEPDIR)/surface_screenshot_la-surface-screenshot.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/surface-screenshot.c' object='tests/surface_screenshot_la-surface-screenshot.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(surface_screenshot_la_CFLAGS) $(CFLAGS) -c -o tests/surface_screenshot_la-surface-screenshot.lo `test -f 'tests/surface-screenshot.c' || echo '$(srcdir)/'`tests/surface-screenshot.c tests/surface_test_la-surface-test.lo: tests/surface-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(surface_test_la_CFLAGS) $(CFLAGS) -MT tests/surface_test_la-surface-test.lo -MD -MP -MF tests/$(DEPDIR)/surface_test_la-surface-test.Tpo -c -o tests/surface_test_la-surface-test.lo `test -f 'tests/surface-test.c' || echo '$(srcdir)/'`tests/surface-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/surface_test_la-surface-test.Tpo tests/$(DEPDIR)/surface_test_la-surface-test.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/surface-test.c' object='tests/surface_test_la-surface-test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(surface_test_la_CFLAGS) $(CFLAGS) -c -o tests/surface_test_la-surface-test.lo `test -f 'tests/surface-test.c' || echo '$(srcdir)/'`tests/surface-test.c src/wayland_backend_la-compositor-wayland.lo: src/compositor-wayland.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wayland_backend_la_CFLAGS) $(CFLAGS) -MT src/wayland_backend_la-compositor-wayland.lo -MD -MP -MF src/$(DEPDIR)/wayland_backend_la-compositor-wayland.Tpo -c -o src/wayland_backend_la-compositor-wayland.lo `test -f 'src/compositor-wayland.c' || echo '$(srcdir)/'`src/compositor-wayland.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/wayland_backend_la-compositor-wayland.Tpo src/$(DEPDIR)/wayland_backend_la-compositor-wayland.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-wayland.c' object='src/wayland_backend_la-compositor-wayland.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wayland_backend_la_CFLAGS) $(CFLAGS) -c -o src/wayland_backend_la-compositor-wayland.lo `test -f 'src/compositor-wayland.c' || echo '$(srcdir)/'`src/compositor-wayland.c protocol/wayland_backend_la-fullscreen-shell-protocol.lo: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wayland_backend_la_CFLAGS) $(CFLAGS) -MT protocol/wayland_backend_la-fullscreen-shell-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/wayland_backend_la-fullscreen-shell-protocol.Tpo -c -o protocol/wayland_backend_la-fullscreen-shell-protocol.lo `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/wayland_backend_la-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/wayland_backend_la-fullscreen-shell-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/wayland_backend_la-fullscreen-shell-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wayland_backend_la_CFLAGS) $(CFLAGS) -c -o protocol/wayland_backend_la-fullscreen-shell-protocol.lo `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c tests/weston_test_la-weston-test.lo: tests/weston-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_test_la_CFLAGS) $(CFLAGS) -MT tests/weston_test_la-weston-test.lo -MD -MP -MF tests/$(DEPDIR)/weston_test_la-weston-test.Tpo -c -o tests/weston_test_la-weston-test.lo `test -f 'tests/weston-test.c' || echo '$(srcdir)/'`tests/weston-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/weston_test_la-weston-test.Tpo tests/$(DEPDIR)/weston_test_la-weston-test.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/weston-test.c' object='tests/weston_test_la-weston-test.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_test_la_CFLAGS) $(CFLAGS) -c -o tests/weston_test_la-weston-test.lo `test -f 'tests/weston-test.c' || echo '$(srcdir)/'`tests/weston-test.c protocol/weston_test_la-weston-test-protocol.lo: protocol/weston-test-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_test_la_CFLAGS) $(CFLAGS) -MT protocol/weston_test_la-weston-test-protocol.lo -MD -MP -MF protocol/$(DEPDIR)/weston_test_la-weston-test-protocol.Tpo -c -o protocol/weston_test_la-weston-test-protocol.lo `test -f 'protocol/weston-test-protocol.c' || echo '$(srcdir)/'`protocol/weston-test-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_test_la-weston-test-protocol.Tpo protocol/$(DEPDIR)/weston_test_la-weston-test-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/weston-test-protocol.c' object='protocol/weston_test_la-weston-test-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_test_la_CFLAGS) $(CFLAGS) -c -o protocol/weston_test_la-weston-test-protocol.lo `test -f 'protocol/weston-test-protocol.c' || echo '$(srcdir)/'`protocol/weston-test-protocol.c src/x11_backend_la-compositor-x11.lo: src/compositor-x11.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(x11_backend_la_CFLAGS) $(CFLAGS) -MT src/x11_backend_la-compositor-x11.lo -MD -MP -MF src/$(DEPDIR)/x11_backend_la-compositor-x11.Tpo -c -o src/x11_backend_la-compositor-x11.lo `test -f 'src/compositor-x11.c' || echo '$(srcdir)/'`src/compositor-x11.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/x11_backend_la-compositor-x11.Tpo src/$(DEPDIR)/x11_backend_la-compositor-x11.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor-x11.c' object='src/x11_backend_la-compositor-x11.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(x11_backend_la_CFLAGS) $(CFLAGS) -c -o src/x11_backend_la-compositor-x11.lo `test -f 'src/compositor-x11.c' || echo '$(srcdir)/'`src/compositor-x11.c xwayland/xwayland_la-window-manager.lo: xwayland/window-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -MT xwayland/xwayland_la-window-manager.lo -MD -MP -MF xwayland/$(DEPDIR)/xwayland_la-window-manager.Tpo -c -o xwayland/xwayland_la-window-manager.lo `test -f 'xwayland/window-manager.c' || echo '$(srcdir)/'`xwayland/window-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xwayland/$(DEPDIR)/xwayland_la-window-manager.Tpo xwayland/$(DEPDIR)/xwayland_la-window-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland/window-manager.c' object='xwayland/xwayland_la-window-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -c -o xwayland/xwayland_la-window-manager.lo `test -f 'xwayland/window-manager.c' || echo '$(srcdir)/'`xwayland/window-manager.c xwayland/xwayland_la-selection.lo: xwayland/selection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -MT xwayland/xwayland_la-selection.lo -MD -MP -MF xwayland/$(DEPDIR)/xwayland_la-selection.Tpo -c -o xwayland/xwayland_la-selection.lo `test -f 'xwayland/selection.c' || echo '$(srcdir)/'`xwayland/selection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xwayland/$(DEPDIR)/xwayland_la-selection.Tpo xwayland/$(DEPDIR)/xwayland_la-selection.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland/selection.c' object='xwayland/xwayland_la-selection.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -c -o xwayland/xwayland_la-selection.lo `test -f 'xwayland/selection.c' || echo '$(srcdir)/'`xwayland/selection.c xwayland/xwayland_la-dnd.lo: xwayland/dnd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -MT xwayland/xwayland_la-dnd.lo -MD -MP -MF xwayland/$(DEPDIR)/xwayland_la-dnd.Tpo -c -o xwayland/xwayland_la-dnd.lo `test -f 'xwayland/dnd.c' || echo '$(srcdir)/'`xwayland/dnd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xwayland/$(DEPDIR)/xwayland_la-dnd.Tpo xwayland/$(DEPDIR)/xwayland_la-dnd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland/dnd.c' object='xwayland/xwayland_la-dnd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -c -o xwayland/xwayland_la-dnd.lo `test -f 'xwayland/dnd.c' || echo '$(srcdir)/'`xwayland/dnd.c xwayland/xwayland_la-launcher.lo: xwayland/launcher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -MT xwayland/xwayland_la-launcher.lo -MD -MP -MF xwayland/$(DEPDIR)/xwayland_la-launcher.Tpo -c -o xwayland/xwayland_la-launcher.lo `test -f 'xwayland/launcher.c' || echo '$(srcdir)/'`xwayland/launcher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xwayland/$(DEPDIR)/xwayland_la-launcher.Tpo xwayland/$(DEPDIR)/xwayland_la-launcher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland/launcher.c' object='xwayland/xwayland_la-launcher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -c -o xwayland/xwayland_la-launcher.lo `test -f 'xwayland/launcher.c' || echo '$(srcdir)/'`xwayland/launcher.c xwayland/xwayland_la-hash.lo: xwayland/hash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -MT xwayland/xwayland_la-hash.lo -MD -MP -MF xwayland/$(DEPDIR)/xwayland_la-hash.Tpo -c -o xwayland/xwayland_la-hash.lo `test -f 'xwayland/hash.c' || echo '$(srcdir)/'`xwayland/hash.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) xwayland/$(DEPDIR)/xwayland_la-hash.Tpo xwayland/$(DEPDIR)/xwayland_la-hash.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xwayland/hash.c' object='xwayland/xwayland_la-hash.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(xwayland_la_CPPFLAGS) $(CPPFLAGS) $(xwayland_la_CFLAGS) $(CFLAGS) -c -o xwayland/xwayland_la-hash.lo `test -f 'xwayland/hash.c' || echo '$(srcdir)/'`xwayland/hash.c tests/bad_buffer_weston-bad-buffer-test.o: tests/bad-buffer-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bad_buffer_weston_CFLAGS) $(CFLAGS) -MT tests/bad_buffer_weston-bad-buffer-test.o -MD -MP -MF tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Tpo -c -o tests/bad_buffer_weston-bad-buffer-test.o `test -f 'tests/bad-buffer-test.c' || echo '$(srcdir)/'`tests/bad-buffer-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Tpo tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/bad-buffer-test.c' object='tests/bad_buffer_weston-bad-buffer-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bad_buffer_weston_CFLAGS) $(CFLAGS) -c -o tests/bad_buffer_weston-bad-buffer-test.o `test -f 'tests/bad-buffer-test.c' || echo '$(srcdir)/'`tests/bad-buffer-test.c tests/bad_buffer_weston-bad-buffer-test.obj: tests/bad-buffer-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bad_buffer_weston_CFLAGS) $(CFLAGS) -MT tests/bad_buffer_weston-bad-buffer-test.obj -MD -MP -MF tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Tpo -c -o tests/bad_buffer_weston-bad-buffer-test.obj `if test -f 'tests/bad-buffer-test.c'; then $(CYGPATH_W) 'tests/bad-buffer-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/bad-buffer-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Tpo tests/$(DEPDIR)/bad_buffer_weston-bad-buffer-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/bad-buffer-test.c' object='tests/bad_buffer_weston-bad-buffer-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bad_buffer_weston_CFLAGS) $(CFLAGS) -c -o tests/bad_buffer_weston-bad-buffer-test.obj `if test -f 'tests/bad-buffer-test.c'; then $(CYGPATH_W) 'tests/bad-buffer-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/bad-buffer-test.c'; fi` tests/buffer_count_weston-buffer-count-test.o: tests/buffer-count-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(buffer_count_weston_CFLAGS) $(CFLAGS) -MT tests/buffer_count_weston-buffer-count-test.o -MD -MP -MF tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Tpo -c -o tests/buffer_count_weston-buffer-count-test.o `test -f 'tests/buffer-count-test.c' || echo '$(srcdir)/'`tests/buffer-count-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Tpo tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/buffer-count-test.c' object='tests/buffer_count_weston-buffer-count-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(buffer_count_weston_CFLAGS) $(CFLAGS) -c -o tests/buffer_count_weston-buffer-count-test.o `test -f 'tests/buffer-count-test.c' || echo '$(srcdir)/'`tests/buffer-count-test.c tests/buffer_count_weston-buffer-count-test.obj: tests/buffer-count-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(buffer_count_weston_CFLAGS) $(CFLAGS) -MT tests/buffer_count_weston-buffer-count-test.obj -MD -MP -MF tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Tpo -c -o tests/buffer_count_weston-buffer-count-test.obj `if test -f 'tests/buffer-count-test.c'; then $(CYGPATH_W) 'tests/buffer-count-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/buffer-count-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Tpo tests/$(DEPDIR)/buffer_count_weston-buffer-count-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/buffer-count-test.c' object='tests/buffer_count_weston-buffer-count-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(buffer_count_weston_CFLAGS) $(CFLAGS) -c -o tests/buffer_count_weston-buffer-count-test.obj `if test -f 'tests/buffer-count-test.c'; then $(CYGPATH_W) 'tests/buffer-count-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/buffer-count-test.c'; fi` tests/button_weston-button-test.o: tests/button-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(button_weston_CFLAGS) $(CFLAGS) -MT tests/button_weston-button-test.o -MD -MP -MF tests/$(DEPDIR)/button_weston-button-test.Tpo -c -o tests/button_weston-button-test.o `test -f 'tests/button-test.c' || echo '$(srcdir)/'`tests/button-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/button_weston-button-test.Tpo tests/$(DEPDIR)/button_weston-button-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/button-test.c' object='tests/button_weston-button-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(button_weston_CFLAGS) $(CFLAGS) -c -o tests/button_weston-button-test.o `test -f 'tests/button-test.c' || echo '$(srcdir)/'`tests/button-test.c tests/button_weston-button-test.obj: tests/button-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(button_weston_CFLAGS) $(CFLAGS) -MT tests/button_weston-button-test.obj -MD -MP -MF tests/$(DEPDIR)/button_weston-button-test.Tpo -c -o tests/button_weston-button-test.obj `if test -f 'tests/button-test.c'; then $(CYGPATH_W) 'tests/button-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/button-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/button_weston-button-test.Tpo tests/$(DEPDIR)/button_weston-button-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/button-test.c' object='tests/button_weston-button-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(button_weston_CFLAGS) $(CFLAGS) -c -o tests/button_weston-button-test.obj `if test -f 'tests/button-test.c'; then $(CYGPATH_W) 'tests/button-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/button-test.c'; fi` tests/config_parser_test-config-parser-test.o: tests/config-parser-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(config_parser_test_CFLAGS) $(CFLAGS) -MT tests/config_parser_test-config-parser-test.o -MD -MP -MF tests/$(DEPDIR)/config_parser_test-config-parser-test.Tpo -c -o tests/config_parser_test-config-parser-test.o `test -f 'tests/config-parser-test.c' || echo '$(srcdir)/'`tests/config-parser-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/config_parser_test-config-parser-test.Tpo tests/$(DEPDIR)/config_parser_test-config-parser-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/config-parser-test.c' object='tests/config_parser_test-config-parser-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(config_parser_test_CFLAGS) $(CFLAGS) -c -o tests/config_parser_test-config-parser-test.o `test -f 'tests/config-parser-test.c' || echo '$(srcdir)/'`tests/config-parser-test.c tests/config_parser_test-config-parser-test.obj: tests/config-parser-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(config_parser_test_CFLAGS) $(CFLAGS) -MT tests/config_parser_test-config-parser-test.obj -MD -MP -MF tests/$(DEPDIR)/config_parser_test-config-parser-test.Tpo -c -o tests/config_parser_test-config-parser-test.obj `if test -f 'tests/config-parser-test.c'; then $(CYGPATH_W) 'tests/config-parser-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/config-parser-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/config_parser_test-config-parser-test.Tpo tests/$(DEPDIR)/config_parser_test-config-parser-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/config-parser-test.c' object='tests/config_parser_test-config-parser-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(config_parser_test_CFLAGS) $(CFLAGS) -c -o tests/config_parser_test-config-parser-test.obj `if test -f 'tests/config-parser-test.c'; then $(CYGPATH_W) 'tests/config-parser-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/config-parser-test.c'; fi` tests/devices_weston-devices-test.o: tests/devices-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(devices_weston_CFLAGS) $(CFLAGS) -MT tests/devices_weston-devices-test.o -MD -MP -MF tests/$(DEPDIR)/devices_weston-devices-test.Tpo -c -o tests/devices_weston-devices-test.o `test -f 'tests/devices-test.c' || echo '$(srcdir)/'`tests/devices-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/devices_weston-devices-test.Tpo tests/$(DEPDIR)/devices_weston-devices-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/devices-test.c' object='tests/devices_weston-devices-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(devices_weston_CFLAGS) $(CFLAGS) -c -o tests/devices_weston-devices-test.o `test -f 'tests/devices-test.c' || echo '$(srcdir)/'`tests/devices-test.c tests/devices_weston-devices-test.obj: tests/devices-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(devices_weston_CFLAGS) $(CFLAGS) -MT tests/devices_weston-devices-test.obj -MD -MP -MF tests/$(DEPDIR)/devices_weston-devices-test.Tpo -c -o tests/devices_weston-devices-test.obj `if test -f 'tests/devices-test.c'; then $(CYGPATH_W) 'tests/devices-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/devices-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/devices_weston-devices-test.Tpo tests/$(DEPDIR)/devices_weston-devices-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/devices-test.c' object='tests/devices_weston-devices-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(devices_weston_CFLAGS) $(CFLAGS) -c -o tests/devices_weston-devices-test.obj `if test -f 'tests/devices-test.c'; then $(CYGPATH_W) 'tests/devices-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/devices-test.c'; fi` tests/event_weston-event-test.o: tests/event-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(event_weston_CFLAGS) $(CFLAGS) -MT tests/event_weston-event-test.o -MD -MP -MF tests/$(DEPDIR)/event_weston-event-test.Tpo -c -o tests/event_weston-event-test.o `test -f 'tests/event-test.c' || echo '$(srcdir)/'`tests/event-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/event_weston-event-test.Tpo tests/$(DEPDIR)/event_weston-event-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/event-test.c' object='tests/event_weston-event-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(event_weston_CFLAGS) $(CFLAGS) -c -o tests/event_weston-event-test.o `test -f 'tests/event-test.c' || echo '$(srcdir)/'`tests/event-test.c tests/event_weston-event-test.obj: tests/event-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(event_weston_CFLAGS) $(CFLAGS) -MT tests/event_weston-event-test.obj -MD -MP -MF tests/$(DEPDIR)/event_weston-event-test.Tpo -c -o tests/event_weston-event-test.obj `if test -f 'tests/event-test.c'; then $(CYGPATH_W) 'tests/event-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/event-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/event_weston-event-test.Tpo tests/$(DEPDIR)/event_weston-event-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/event-test.c' object='tests/event_weston-event-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(event_weston_CFLAGS) $(CFLAGS) -c -o tests/event_weston-event-test.obj `if test -f 'tests/event-test.c'; then $(CYGPATH_W) 'tests/event-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/event-test.c'; fi` tests/internal_screenshot_weston-internal-screenshot-test.o: tests/internal-screenshot-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(internal_screenshot_weston_CFLAGS) $(CFLAGS) -MT tests/internal_screenshot_weston-internal-screenshot-test.o -MD -MP -MF tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Tpo -c -o tests/internal_screenshot_weston-internal-screenshot-test.o `test -f 'tests/internal-screenshot-test.c' || echo '$(srcdir)/'`tests/internal-screenshot-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Tpo tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/internal-screenshot-test.c' object='tests/internal_screenshot_weston-internal-screenshot-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(internal_screenshot_weston_CFLAGS) $(CFLAGS) -c -o tests/internal_screenshot_weston-internal-screenshot-test.o `test -f 'tests/internal-screenshot-test.c' || echo '$(srcdir)/'`tests/internal-screenshot-test.c tests/internal_screenshot_weston-internal-screenshot-test.obj: tests/internal-screenshot-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(internal_screenshot_weston_CFLAGS) $(CFLAGS) -MT tests/internal_screenshot_weston-internal-screenshot-test.obj -MD -MP -MF tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Tpo -c -o tests/internal_screenshot_weston-internal-screenshot-test.obj `if test -f 'tests/internal-screenshot-test.c'; then $(CYGPATH_W) 'tests/internal-screenshot-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/internal-screenshot-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Tpo tests/$(DEPDIR)/internal_screenshot_weston-internal-screenshot-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/internal-screenshot-test.c' object='tests/internal_screenshot_weston-internal-screenshot-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(internal_screenshot_weston_CFLAGS) $(CFLAGS) -c -o tests/internal_screenshot_weston-internal-screenshot-test.obj `if test -f 'tests/internal-screenshot-test.c'; then $(CYGPATH_W) 'tests/internal-screenshot-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/internal-screenshot-test.c'; fi` tests/ivi_layout_ivi-ivi_layout-test.o: tests/ivi_layout-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -MT tests/ivi_layout_ivi-ivi_layout-test.o -MD -MP -MF tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Tpo -c -o tests/ivi_layout_ivi-ivi_layout-test.o `test -f 'tests/ivi_layout-test.c' || echo '$(srcdir)/'`tests/ivi_layout-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Tpo tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ivi_layout-test.c' object='tests/ivi_layout_ivi-ivi_layout-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -c -o tests/ivi_layout_ivi-ivi_layout-test.o `test -f 'tests/ivi_layout-test.c' || echo '$(srcdir)/'`tests/ivi_layout-test.c tests/ivi_layout_ivi-ivi_layout-test.obj: tests/ivi_layout-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -MT tests/ivi_layout_ivi-ivi_layout-test.obj -MD -MP -MF tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Tpo -c -o tests/ivi_layout_ivi-ivi_layout-test.obj `if test -f 'tests/ivi_layout-test.c'; then $(CYGPATH_W) 'tests/ivi_layout-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/ivi_layout-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Tpo tests/$(DEPDIR)/ivi_layout_ivi-ivi_layout-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ivi_layout-test.c' object='tests/ivi_layout_ivi-ivi_layout-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -c -o tests/ivi_layout_ivi-ivi_layout-test.obj `if test -f 'tests/ivi_layout-test.c'; then $(CYGPATH_W) 'tests/ivi_layout-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/ivi_layout-test.c'; fi` protocol/ivi_layout_ivi-ivi-application-protocol.o: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -MT protocol/ivi_layout_ivi-ivi-application-protocol.o -MD -MP -MF protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Tpo -c -o protocol/ivi_layout_ivi-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Tpo protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/ivi_layout_ivi-ivi-application-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -c -o protocol/ivi_layout_ivi-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c protocol/ivi_layout_ivi-ivi-application-protocol.obj: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -MT protocol/ivi_layout_ivi-ivi-application-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Tpo -c -o protocol/ivi_layout_ivi-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Tpo protocol/$(DEPDIR)/ivi_layout_ivi-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/ivi_layout_ivi-ivi-application-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_layout_ivi_CFLAGS) $(CFLAGS) -c -o protocol/ivi_layout_ivi-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` tests/ivi_shell_app_weston-ivi-shell-app-test.o: tests/ivi-shell-app-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -MT tests/ivi_shell_app_weston-ivi-shell-app-test.o -MD -MP -MF tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Tpo -c -o tests/ivi_shell_app_weston-ivi-shell-app-test.o `test -f 'tests/ivi-shell-app-test.c' || echo '$(srcdir)/'`tests/ivi-shell-app-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Tpo tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ivi-shell-app-test.c' object='tests/ivi_shell_app_weston-ivi-shell-app-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -c -o tests/ivi_shell_app_weston-ivi-shell-app-test.o `test -f 'tests/ivi-shell-app-test.c' || echo '$(srcdir)/'`tests/ivi-shell-app-test.c tests/ivi_shell_app_weston-ivi-shell-app-test.obj: tests/ivi-shell-app-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -MT tests/ivi_shell_app_weston-ivi-shell-app-test.obj -MD -MP -MF tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Tpo -c -o tests/ivi_shell_app_weston-ivi-shell-app-test.obj `if test -f 'tests/ivi-shell-app-test.c'; then $(CYGPATH_W) 'tests/ivi-shell-app-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/ivi-shell-app-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Tpo tests/$(DEPDIR)/ivi_shell_app_weston-ivi-shell-app-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/ivi-shell-app-test.c' object='tests/ivi_shell_app_weston-ivi-shell-app-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -c -o tests/ivi_shell_app_weston-ivi-shell-app-test.obj `if test -f 'tests/ivi-shell-app-test.c'; then $(CYGPATH_W) 'tests/ivi-shell-app-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/ivi-shell-app-test.c'; fi` protocol/ivi_shell_app_weston-ivi-application-protocol.o: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -MT protocol/ivi_shell_app_weston-ivi-application-protocol.o -MD -MP -MF protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Tpo -c -o protocol/ivi_shell_app_weston-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Tpo protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/ivi_shell_app_weston-ivi-application-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -c -o protocol/ivi_shell_app_weston-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c protocol/ivi_shell_app_weston-ivi-application-protocol.obj: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -MT protocol/ivi_shell_app_weston-ivi-application-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Tpo -c -o protocol/ivi_shell_app_weston-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Tpo protocol/$(DEPDIR)/ivi_shell_app_weston-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/ivi_shell_app_weston-ivi-application-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ivi_shell_app_weston_CFLAGS) $(CFLAGS) -c -o protocol/ivi_shell_app_weston-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` tests/keyboard_weston-keyboard-test.o: tests/keyboard-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keyboard_weston_CFLAGS) $(CFLAGS) -MT tests/keyboard_weston-keyboard-test.o -MD -MP -MF tests/$(DEPDIR)/keyboard_weston-keyboard-test.Tpo -c -o tests/keyboard_weston-keyboard-test.o `test -f 'tests/keyboard-test.c' || echo '$(srcdir)/'`tests/keyboard-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/keyboard_weston-keyboard-test.Tpo tests/$(DEPDIR)/keyboard_weston-keyboard-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/keyboard-test.c' object='tests/keyboard_weston-keyboard-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keyboard_weston_CFLAGS) $(CFLAGS) -c -o tests/keyboard_weston-keyboard-test.o `test -f 'tests/keyboard-test.c' || echo '$(srcdir)/'`tests/keyboard-test.c tests/keyboard_weston-keyboard-test.obj: tests/keyboard-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keyboard_weston_CFLAGS) $(CFLAGS) -MT tests/keyboard_weston-keyboard-test.obj -MD -MP -MF tests/$(DEPDIR)/keyboard_weston-keyboard-test.Tpo -c -o tests/keyboard_weston-keyboard-test.obj `if test -f 'tests/keyboard-test.c'; then $(CYGPATH_W) 'tests/keyboard-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/keyboard-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/keyboard_weston-keyboard-test.Tpo tests/$(DEPDIR)/keyboard_weston-keyboard-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/keyboard-test.c' object='tests/keyboard_weston-keyboard-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(keyboard_weston_CFLAGS) $(CFLAGS) -c -o tests/keyboard_weston-keyboard-test.obj `if test -f 'tests/keyboard-test.c'; then $(CYGPATH_W) 'tests/keyboard-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/keyboard-test.c'; fi` tests/matrix_test-matrix-test.o: tests/matrix-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests/matrix_test-matrix-test.o -MD -MP -MF tests/$(DEPDIR)/matrix_test-matrix-test.Tpo -c -o tests/matrix_test-matrix-test.o `test -f 'tests/matrix-test.c' || echo '$(srcdir)/'`tests/matrix-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/matrix_test-matrix-test.Tpo tests/$(DEPDIR)/matrix_test-matrix-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/matrix-test.c' object='tests/matrix_test-matrix-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests/matrix_test-matrix-test.o `test -f 'tests/matrix-test.c' || echo '$(srcdir)/'`tests/matrix-test.c tests/matrix_test-matrix-test.obj: tests/matrix-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tests/matrix_test-matrix-test.obj -MD -MP -MF tests/$(DEPDIR)/matrix_test-matrix-test.Tpo -c -o tests/matrix_test-matrix-test.obj `if test -f 'tests/matrix-test.c'; then $(CYGPATH_W) 'tests/matrix-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/matrix-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/matrix_test-matrix-test.Tpo tests/$(DEPDIR)/matrix_test-matrix-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/matrix-test.c' object='tests/matrix_test-matrix-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tests/matrix_test-matrix-test.obj `if test -f 'tests/matrix-test.c'; then $(CYGPATH_W) 'tests/matrix-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/matrix-test.c'; fi` shared/matrix_test-matrix.o: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shared/matrix_test-matrix.o -MD -MP -MF shared/$(DEPDIR)/matrix_test-matrix.Tpo -c -o shared/matrix_test-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/matrix_test-matrix.Tpo shared/$(DEPDIR)/matrix_test-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/matrix_test-matrix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shared/matrix_test-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c shared/matrix_test-matrix.obj: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shared/matrix_test-matrix.obj -MD -MP -MF shared/$(DEPDIR)/matrix_test-matrix.Tpo -c -o shared/matrix_test-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/matrix_test-matrix.Tpo shared/$(DEPDIR)/matrix_test-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/matrix_test-matrix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(matrix_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shared/matrix_test-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` tests/presentation_weston-presentation-test.o: tests/presentation-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -MT tests/presentation_weston-presentation-test.o -MD -MP -MF tests/$(DEPDIR)/presentation_weston-presentation-test.Tpo -c -o tests/presentation_weston-presentation-test.o `test -f 'tests/presentation-test.c' || echo '$(srcdir)/'`tests/presentation-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/presentation_weston-presentation-test.Tpo tests/$(DEPDIR)/presentation_weston-presentation-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/presentation-test.c' object='tests/presentation_weston-presentation-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -c -o tests/presentation_weston-presentation-test.o `test -f 'tests/presentation-test.c' || echo '$(srcdir)/'`tests/presentation-test.c tests/presentation_weston-presentation-test.obj: tests/presentation-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -MT tests/presentation_weston-presentation-test.obj -MD -MP -MF tests/$(DEPDIR)/presentation_weston-presentation-test.Tpo -c -o tests/presentation_weston-presentation-test.obj `if test -f 'tests/presentation-test.c'; then $(CYGPATH_W) 'tests/presentation-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/presentation-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/presentation_weston-presentation-test.Tpo tests/$(DEPDIR)/presentation_weston-presentation-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/presentation-test.c' object='tests/presentation_weston-presentation-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -c -o tests/presentation_weston-presentation-test.obj `if test -f 'tests/presentation-test.c'; then $(CYGPATH_W) 'tests/presentation-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/presentation-test.c'; fi` protocol/presentation_weston-presentation_timing-protocol.o: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -MT protocol/presentation_weston-presentation_timing-protocol.o -MD -MP -MF protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Tpo -c -o protocol/presentation_weston-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/presentation_weston-presentation_timing-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -c -o protocol/presentation_weston-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c protocol/presentation_weston-presentation_timing-protocol.obj: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -MT protocol/presentation_weston-presentation_timing-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Tpo -c -o protocol/presentation_weston-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/presentation_weston-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/presentation_weston-presentation_timing-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(presentation_weston_CFLAGS) $(CFLAGS) -c -o protocol/presentation_weston-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` tests/roles_weston-roles-test.o: tests/roles-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(roles_weston_CFLAGS) $(CFLAGS) -MT tests/roles_weston-roles-test.o -MD -MP -MF tests/$(DEPDIR)/roles_weston-roles-test.Tpo -c -o tests/roles_weston-roles-test.o `test -f 'tests/roles-test.c' || echo '$(srcdir)/'`tests/roles-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/roles_weston-roles-test.Tpo tests/$(DEPDIR)/roles_weston-roles-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/roles-test.c' object='tests/roles_weston-roles-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(roles_weston_CFLAGS) $(CFLAGS) -c -o tests/roles_weston-roles-test.o `test -f 'tests/roles-test.c' || echo '$(srcdir)/'`tests/roles-test.c tests/roles_weston-roles-test.obj: tests/roles-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(roles_weston_CFLAGS) $(CFLAGS) -MT tests/roles_weston-roles-test.obj -MD -MP -MF tests/$(DEPDIR)/roles_weston-roles-test.Tpo -c -o tests/roles_weston-roles-test.obj `if test -f 'tests/roles-test.c'; then $(CYGPATH_W) 'tests/roles-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/roles-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/roles_weston-roles-test.Tpo tests/$(DEPDIR)/roles_weston-roles-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/roles-test.c' object='tests/roles_weston-roles-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(roles_weston_CFLAGS) $(CFLAGS) -c -o tests/roles_weston-roles-test.obj `if test -f 'tests/roles-test.c'; then $(CYGPATH_W) 'tests/roles-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/roles-test.c'; fi` tests/setbacklight-setbacklight.o: tests/setbacklight.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -MT tests/setbacklight-setbacklight.o -MD -MP -MF tests/$(DEPDIR)/setbacklight-setbacklight.Tpo -c -o tests/setbacklight-setbacklight.o `test -f 'tests/setbacklight.c' || echo '$(srcdir)/'`tests/setbacklight.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/setbacklight-setbacklight.Tpo tests/$(DEPDIR)/setbacklight-setbacklight.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/setbacklight.c' object='tests/setbacklight-setbacklight.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -c -o tests/setbacklight-setbacklight.o `test -f 'tests/setbacklight.c' || echo '$(srcdir)/'`tests/setbacklight.c tests/setbacklight-setbacklight.obj: tests/setbacklight.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -MT tests/setbacklight-setbacklight.obj -MD -MP -MF tests/$(DEPDIR)/setbacklight-setbacklight.Tpo -c -o tests/setbacklight-setbacklight.obj `if test -f 'tests/setbacklight.c'; then $(CYGPATH_W) 'tests/setbacklight.c'; else $(CYGPATH_W) '$(srcdir)/tests/setbacklight.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/setbacklight-setbacklight.Tpo tests/$(DEPDIR)/setbacklight-setbacklight.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/setbacklight.c' object='tests/setbacklight-setbacklight.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -c -o tests/setbacklight-setbacklight.obj `if test -f 'tests/setbacklight.c'; then $(CYGPATH_W) 'tests/setbacklight.c'; else $(CYGPATH_W) '$(srcdir)/tests/setbacklight.c'; fi` src/setbacklight-libbacklight.o: src/libbacklight.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -MT src/setbacklight-libbacklight.o -MD -MP -MF src/$(DEPDIR)/setbacklight-libbacklight.Tpo -c -o src/setbacklight-libbacklight.o `test -f 'src/libbacklight.c' || echo '$(srcdir)/'`src/libbacklight.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/setbacklight-libbacklight.Tpo src/$(DEPDIR)/setbacklight-libbacklight.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libbacklight.c' object='src/setbacklight-libbacklight.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -c -o src/setbacklight-libbacklight.o `test -f 'src/libbacklight.c' || echo '$(srcdir)/'`src/libbacklight.c src/setbacklight-libbacklight.obj: src/libbacklight.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -MT src/setbacklight-libbacklight.obj -MD -MP -MF src/$(DEPDIR)/setbacklight-libbacklight.Tpo -c -o src/setbacklight-libbacklight.obj `if test -f 'src/libbacklight.c'; then $(CYGPATH_W) 'src/libbacklight.c'; else $(CYGPATH_W) '$(srcdir)/src/libbacklight.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/setbacklight-libbacklight.Tpo src/$(DEPDIR)/setbacklight-libbacklight.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/libbacklight.c' object='src/setbacklight-libbacklight.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(setbacklight_CFLAGS) $(CFLAGS) -c -o src/setbacklight-libbacklight.obj `if test -f 'src/libbacklight.c'; then $(CYGPATH_W) 'src/libbacklight.c'; else $(CYGPATH_W) '$(srcdir)/src/libbacklight.c'; fi` src/spring_tool-spring-tool.o: src/spring-tool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -MT src/spring_tool-spring-tool.o -MD -MP -MF src/$(DEPDIR)/spring_tool-spring-tool.Tpo -c -o src/spring_tool-spring-tool.o `test -f 'src/spring-tool.c' || echo '$(srcdir)/'`src/spring-tool.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/spring_tool-spring-tool.Tpo src/$(DEPDIR)/spring_tool-spring-tool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/spring-tool.c' object='src/spring_tool-spring-tool.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -c -o src/spring_tool-spring-tool.o `test -f 'src/spring-tool.c' || echo '$(srcdir)/'`src/spring-tool.c src/spring_tool-spring-tool.obj: src/spring-tool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -MT src/spring_tool-spring-tool.obj -MD -MP -MF src/$(DEPDIR)/spring_tool-spring-tool.Tpo -c -o src/spring_tool-spring-tool.obj `if test -f 'src/spring-tool.c'; then $(CYGPATH_W) 'src/spring-tool.c'; else $(CYGPATH_W) '$(srcdir)/src/spring-tool.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/spring_tool-spring-tool.Tpo src/$(DEPDIR)/spring_tool-spring-tool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/spring-tool.c' object='src/spring_tool-spring-tool.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -c -o src/spring_tool-spring-tool.obj `if test -f 'src/spring-tool.c'; then $(CYGPATH_W) 'src/spring-tool.c'; else $(CYGPATH_W) '$(srcdir)/src/spring-tool.c'; fi` src/spring_tool-animation.o: src/animation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -MT src/spring_tool-animation.o -MD -MP -MF src/$(DEPDIR)/spring_tool-animation.Tpo -c -o src/spring_tool-animation.o `test -f 'src/animation.c' || echo '$(srcdir)/'`src/animation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/spring_tool-animation.Tpo src/$(DEPDIR)/spring_tool-animation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/animation.c' object='src/spring_tool-animation.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -c -o src/spring_tool-animation.o `test -f 'src/animation.c' || echo '$(srcdir)/'`src/animation.c src/spring_tool-animation.obj: src/animation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -MT src/spring_tool-animation.obj -MD -MP -MF src/$(DEPDIR)/spring_tool-animation.Tpo -c -o src/spring_tool-animation.obj `if test -f 'src/animation.c'; then $(CYGPATH_W) 'src/animation.c'; else $(CYGPATH_W) '$(srcdir)/src/animation.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/spring_tool-animation.Tpo src/$(DEPDIR)/spring_tool-animation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/animation.c' object='src/spring_tool-animation.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -c -o src/spring_tool-animation.obj `if test -f 'src/animation.c'; then $(CYGPATH_W) 'src/animation.c'; else $(CYGPATH_W) '$(srcdir)/src/animation.c'; fi` shared/spring_tool-matrix.o: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -MT shared/spring_tool-matrix.o -MD -MP -MF shared/$(DEPDIR)/spring_tool-matrix.Tpo -c -o shared/spring_tool-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/spring_tool-matrix.Tpo shared/$(DEPDIR)/spring_tool-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/spring_tool-matrix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -c -o shared/spring_tool-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c shared/spring_tool-matrix.obj: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -MT shared/spring_tool-matrix.obj -MD -MP -MF shared/$(DEPDIR)/spring_tool-matrix.Tpo -c -o shared/spring_tool-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/spring_tool-matrix.Tpo shared/$(DEPDIR)/spring_tool-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/spring_tool-matrix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(spring_tool_CFLAGS) $(CFLAGS) -c -o shared/spring_tool-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` tests/subsurface_weston-subsurface-test.o: tests/subsurface-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(subsurface_weston_CFLAGS) $(CFLAGS) -MT tests/subsurface_weston-subsurface-test.o -MD -MP -MF tests/$(DEPDIR)/subsurface_weston-subsurface-test.Tpo -c -o tests/subsurface_weston-subsurface-test.o `test -f 'tests/subsurface-test.c' || echo '$(srcdir)/'`tests/subsurface-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/subsurface_weston-subsurface-test.Tpo tests/$(DEPDIR)/subsurface_weston-subsurface-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/subsurface-test.c' object='tests/subsurface_weston-subsurface-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(subsurface_weston_CFLAGS) $(CFLAGS) -c -o tests/subsurface_weston-subsurface-test.o `test -f 'tests/subsurface-test.c' || echo '$(srcdir)/'`tests/subsurface-test.c tests/subsurface_weston-subsurface-test.obj: tests/subsurface-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(subsurface_weston_CFLAGS) $(CFLAGS) -MT tests/subsurface_weston-subsurface-test.obj -MD -MP -MF tests/$(DEPDIR)/subsurface_weston-subsurface-test.Tpo -c -o tests/subsurface_weston-subsurface-test.obj `if test -f 'tests/subsurface-test.c'; then $(CYGPATH_W) 'tests/subsurface-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/subsurface-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/subsurface_weston-subsurface-test.Tpo tests/$(DEPDIR)/subsurface_weston-subsurface-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/subsurface-test.c' object='tests/subsurface_weston-subsurface-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(subsurface_weston_CFLAGS) $(CFLAGS) -c -o tests/subsurface_weston-subsurface-test.obj `if test -f 'tests/subsurface-test.c'; then $(CYGPATH_W) 'tests/subsurface-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/subsurface-test.c'; fi` tests/text_weston-text-test.o: tests/text-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -MT tests/text_weston-text-test.o -MD -MP -MF tests/$(DEPDIR)/text_weston-text-test.Tpo -c -o tests/text_weston-text-test.o `test -f 'tests/text-test.c' || echo '$(srcdir)/'`tests/text-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/text_weston-text-test.Tpo tests/$(DEPDIR)/text_weston-text-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/text-test.c' object='tests/text_weston-text-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -c -o tests/text_weston-text-test.o `test -f 'tests/text-test.c' || echo '$(srcdir)/'`tests/text-test.c tests/text_weston-text-test.obj: tests/text-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -MT tests/text_weston-text-test.obj -MD -MP -MF tests/$(DEPDIR)/text_weston-text-test.Tpo -c -o tests/text_weston-text-test.obj `if test -f 'tests/text-test.c'; then $(CYGPATH_W) 'tests/text-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/text-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/text_weston-text-test.Tpo tests/$(DEPDIR)/text_weston-text-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/text-test.c' object='tests/text_weston-text-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -c -o tests/text_weston-text-test.obj `if test -f 'tests/text-test.c'; then $(CYGPATH_W) 'tests/text-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/text-test.c'; fi` protocol/text_weston-text-protocol.o: protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -MT protocol/text_weston-text-protocol.o -MD -MP -MF protocol/$(DEPDIR)/text_weston-text-protocol.Tpo -c -o protocol/text_weston-text-protocol.o `test -f 'protocol/text-protocol.c' || echo '$(srcdir)/'`protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/text_weston-text-protocol.Tpo protocol/$(DEPDIR)/text_weston-text-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-protocol.c' object='protocol/text_weston-text-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -c -o protocol/text_weston-text-protocol.o `test -f 'protocol/text-protocol.c' || echo '$(srcdir)/'`protocol/text-protocol.c protocol/text_weston-text-protocol.obj: protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -MT protocol/text_weston-text-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/text_weston-text-protocol.Tpo -c -o protocol/text_weston-text-protocol.obj `if test -f 'protocol/text-protocol.c'; then $(CYGPATH_W) 'protocol/text-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/text_weston-text-protocol.Tpo protocol/$(DEPDIR)/text_weston-text-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-protocol.c' object='protocol/text_weston-text-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(text_weston_CFLAGS) $(CFLAGS) -c -o protocol/text_weston-text-protocol.obj `if test -f 'protocol/text-protocol.c'; then $(CYGPATH_W) 'protocol/text-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-protocol.c'; fi` wcap/wcap_decode-main.o: wcap/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -MT wcap/wcap_decode-main.o -MD -MP -MF wcap/$(DEPDIR)/wcap_decode-main.Tpo -c -o wcap/wcap_decode-main.o `test -f 'wcap/main.c' || echo '$(srcdir)/'`wcap/main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) wcap/$(DEPDIR)/wcap_decode-main.Tpo wcap/$(DEPDIR)/wcap_decode-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcap/main.c' object='wcap/wcap_decode-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -c -o wcap/wcap_decode-main.o `test -f 'wcap/main.c' || echo '$(srcdir)/'`wcap/main.c wcap/wcap_decode-main.obj: wcap/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -MT wcap/wcap_decode-main.obj -MD -MP -MF wcap/$(DEPDIR)/wcap_decode-main.Tpo -c -o wcap/wcap_decode-main.obj `if test -f 'wcap/main.c'; then $(CYGPATH_W) 'wcap/main.c'; else $(CYGPATH_W) '$(srcdir)/wcap/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) wcap/$(DEPDIR)/wcap_decode-main.Tpo wcap/$(DEPDIR)/wcap_decode-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcap/main.c' object='wcap/wcap_decode-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -c -o wcap/wcap_decode-main.obj `if test -f 'wcap/main.c'; then $(CYGPATH_W) 'wcap/main.c'; else $(CYGPATH_W) '$(srcdir)/wcap/main.c'; fi` wcap/wcap_decode-wcap-decode.o: wcap/wcap-decode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -MT wcap/wcap_decode-wcap-decode.o -MD -MP -MF wcap/$(DEPDIR)/wcap_decode-wcap-decode.Tpo -c -o wcap/wcap_decode-wcap-decode.o `test -f 'wcap/wcap-decode.c' || echo '$(srcdir)/'`wcap/wcap-decode.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) wcap/$(DEPDIR)/wcap_decode-wcap-decode.Tpo wcap/$(DEPDIR)/wcap_decode-wcap-decode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcap/wcap-decode.c' object='wcap/wcap_decode-wcap-decode.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -c -o wcap/wcap_decode-wcap-decode.o `test -f 'wcap/wcap-decode.c' || echo '$(srcdir)/'`wcap/wcap-decode.c wcap/wcap_decode-wcap-decode.obj: wcap/wcap-decode.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -MT wcap/wcap_decode-wcap-decode.obj -MD -MP -MF wcap/$(DEPDIR)/wcap_decode-wcap-decode.Tpo -c -o wcap/wcap_decode-wcap-decode.obj `if test -f 'wcap/wcap-decode.c'; then $(CYGPATH_W) 'wcap/wcap-decode.c'; else $(CYGPATH_W) '$(srcdir)/wcap/wcap-decode.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) wcap/$(DEPDIR)/wcap_decode-wcap-decode.Tpo wcap/$(DEPDIR)/wcap_decode-wcap-decode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wcap/wcap-decode.c' object='wcap/wcap_decode-wcap-decode.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(wcap_decode_CFLAGS) $(CFLAGS) -c -o wcap/wcap_decode-wcap-decode.obj `if test -f 'wcap/wcap-decode.c'; then $(CYGPATH_W) 'wcap/wcap-decode.c'; else $(CYGPATH_W) '$(srcdir)/wcap/wcap-decode.c'; fi` src/weston-log.o: src/log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-log.o -MD -MP -MF src/$(DEPDIR)/weston-log.Tpo -c -o src/weston-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-log.Tpo src/$(DEPDIR)/weston-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/weston-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-log.o `test -f 'src/log.c' || echo '$(srcdir)/'`src/log.c src/weston-log.obj: src/log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-log.obj -MD -MP -MF src/$(DEPDIR)/weston-log.Tpo -c -o src/weston-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-log.Tpo src/$(DEPDIR)/weston-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/log.c' object='src/weston-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-log.obj `if test -f 'src/log.c'; then $(CYGPATH_W) 'src/log.c'; else $(CYGPATH_W) '$(srcdir)/src/log.c'; fi` src/weston-compositor.o: src/compositor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-compositor.o -MD -MP -MF src/$(DEPDIR)/weston-compositor.Tpo -c -o src/weston-compositor.o `test -f 'src/compositor.c' || echo '$(srcdir)/'`src/compositor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-compositor.Tpo src/$(DEPDIR)/weston-compositor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor.c' object='src/weston-compositor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-compositor.o `test -f 'src/compositor.c' || echo '$(srcdir)/'`src/compositor.c src/weston-compositor.obj: src/compositor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-compositor.obj -MD -MP -MF src/$(DEPDIR)/weston-compositor.Tpo -c -o src/weston-compositor.obj `if test -f 'src/compositor.c'; then $(CYGPATH_W) 'src/compositor.c'; else $(CYGPATH_W) '$(srcdir)/src/compositor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-compositor.Tpo src/$(DEPDIR)/weston-compositor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/compositor.c' object='src/weston-compositor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-compositor.obj `if test -f 'src/compositor.c'; then $(CYGPATH_W) 'src/compositor.c'; else $(CYGPATH_W) '$(srcdir)/src/compositor.c'; fi` src/weston-input.o: src/input.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-input.o -MD -MP -MF src/$(DEPDIR)/weston-input.Tpo -c -o src/weston-input.o `test -f 'src/input.c' || echo '$(srcdir)/'`src/input.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-input.Tpo src/$(DEPDIR)/weston-input.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/input.c' object='src/weston-input.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-input.o `test -f 'src/input.c' || echo '$(srcdir)/'`src/input.c src/weston-input.obj: src/input.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-input.obj -MD -MP -MF src/$(DEPDIR)/weston-input.Tpo -c -o src/weston-input.obj `if test -f 'src/input.c'; then $(CYGPATH_W) 'src/input.c'; else $(CYGPATH_W) '$(srcdir)/src/input.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-input.Tpo src/$(DEPDIR)/weston-input.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/input.c' object='src/weston-input.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-input.obj `if test -f 'src/input.c'; then $(CYGPATH_W) 'src/input.c'; else $(CYGPATH_W) '$(srcdir)/src/input.c'; fi` src/weston-data-device.o: src/data-device.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-data-device.o -MD -MP -MF src/$(DEPDIR)/weston-data-device.Tpo -c -o src/weston-data-device.o `test -f 'src/data-device.c' || echo '$(srcdir)/'`src/data-device.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-data-device.Tpo src/$(DEPDIR)/weston-data-device.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/data-device.c' object='src/weston-data-device.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-data-device.o `test -f 'src/data-device.c' || echo '$(srcdir)/'`src/data-device.c src/weston-data-device.obj: src/data-device.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-data-device.obj -MD -MP -MF src/$(DEPDIR)/weston-data-device.Tpo -c -o src/weston-data-device.obj `if test -f 'src/data-device.c'; then $(CYGPATH_W) 'src/data-device.c'; else $(CYGPATH_W) '$(srcdir)/src/data-device.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-data-device.Tpo src/$(DEPDIR)/weston-data-device.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/data-device.c' object='src/weston-data-device.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-data-device.obj `if test -f 'src/data-device.c'; then $(CYGPATH_W) 'src/data-device.c'; else $(CYGPATH_W) '$(srcdir)/src/data-device.c'; fi` src/weston-screenshooter.o: src/screenshooter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-screenshooter.o -MD -MP -MF src/$(DEPDIR)/weston-screenshooter.Tpo -c -o src/weston-screenshooter.o `test -f 'src/screenshooter.c' || echo '$(srcdir)/'`src/screenshooter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-screenshooter.Tpo src/$(DEPDIR)/weston-screenshooter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/screenshooter.c' object='src/weston-screenshooter.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-screenshooter.o `test -f 'src/screenshooter.c' || echo '$(srcdir)/'`src/screenshooter.c src/weston-screenshooter.obj: src/screenshooter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-screenshooter.obj -MD -MP -MF src/$(DEPDIR)/weston-screenshooter.Tpo -c -o src/weston-screenshooter.obj `if test -f 'src/screenshooter.c'; then $(CYGPATH_W) 'src/screenshooter.c'; else $(CYGPATH_W) '$(srcdir)/src/screenshooter.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-screenshooter.Tpo src/$(DEPDIR)/weston-screenshooter.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/screenshooter.c' object='src/weston-screenshooter.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-screenshooter.obj `if test -f 'src/screenshooter.c'; then $(CYGPATH_W) 'src/screenshooter.c'; else $(CYGPATH_W) '$(srcdir)/src/screenshooter.c'; fi` src/weston-clipboard.o: src/clipboard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-clipboard.o -MD -MP -MF src/$(DEPDIR)/weston-clipboard.Tpo -c -o src/weston-clipboard.o `test -f 'src/clipboard.c' || echo '$(srcdir)/'`src/clipboard.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-clipboard.Tpo src/$(DEPDIR)/weston-clipboard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/clipboard.c' object='src/weston-clipboard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-clipboard.o `test -f 'src/clipboard.c' || echo '$(srcdir)/'`src/clipboard.c src/weston-clipboard.obj: src/clipboard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-clipboard.obj -MD -MP -MF src/$(DEPDIR)/weston-clipboard.Tpo -c -o src/weston-clipboard.obj `if test -f 'src/clipboard.c'; then $(CYGPATH_W) 'src/clipboard.c'; else $(CYGPATH_W) '$(srcdir)/src/clipboard.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-clipboard.Tpo src/$(DEPDIR)/weston-clipboard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/clipboard.c' object='src/weston-clipboard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-clipboard.obj `if test -f 'src/clipboard.c'; then $(CYGPATH_W) 'src/clipboard.c'; else $(CYGPATH_W) '$(srcdir)/src/clipboard.c'; fi` src/weston-zoom.o: src/zoom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-zoom.o -MD -MP -MF src/$(DEPDIR)/weston-zoom.Tpo -c -o src/weston-zoom.o `test -f 'src/zoom.c' || echo '$(srcdir)/'`src/zoom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-zoom.Tpo src/$(DEPDIR)/weston-zoom.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/zoom.c' object='src/weston-zoom.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-zoom.o `test -f 'src/zoom.c' || echo '$(srcdir)/'`src/zoom.c src/weston-zoom.obj: src/zoom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-zoom.obj -MD -MP -MF src/$(DEPDIR)/weston-zoom.Tpo -c -o src/weston-zoom.obj `if test -f 'src/zoom.c'; then $(CYGPATH_W) 'src/zoom.c'; else $(CYGPATH_W) '$(srcdir)/src/zoom.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-zoom.Tpo src/$(DEPDIR)/weston-zoom.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/zoom.c' object='src/weston-zoom.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-zoom.obj `if test -f 'src/zoom.c'; then $(CYGPATH_W) 'src/zoom.c'; else $(CYGPATH_W) '$(srcdir)/src/zoom.c'; fi` src/weston-text-backend.o: src/text-backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-text-backend.o -MD -MP -MF src/$(DEPDIR)/weston-text-backend.Tpo -c -o src/weston-text-backend.o `test -f 'src/text-backend.c' || echo '$(srcdir)/'`src/text-backend.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-text-backend.Tpo src/$(DEPDIR)/weston-text-backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/text-backend.c' object='src/weston-text-backend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-text-backend.o `test -f 'src/text-backend.c' || echo '$(srcdir)/'`src/text-backend.c src/weston-text-backend.obj: src/text-backend.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-text-backend.obj -MD -MP -MF src/$(DEPDIR)/weston-text-backend.Tpo -c -o src/weston-text-backend.obj `if test -f 'src/text-backend.c'; then $(CYGPATH_W) 'src/text-backend.c'; else $(CYGPATH_W) '$(srcdir)/src/text-backend.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-text-backend.Tpo src/$(DEPDIR)/weston-text-backend.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/text-backend.c' object='src/weston-text-backend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-text-backend.obj `if test -f 'src/text-backend.c'; then $(CYGPATH_W) 'src/text-backend.c'; else $(CYGPATH_W) '$(srcdir)/src/text-backend.c'; fi` src/weston-bindings.o: src/bindings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-bindings.o -MD -MP -MF src/$(DEPDIR)/weston-bindings.Tpo -c -o src/weston-bindings.o `test -f 'src/bindings.c' || echo '$(srcdir)/'`src/bindings.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-bindings.Tpo src/$(DEPDIR)/weston-bindings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bindings.c' object='src/weston-bindings.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-bindings.o `test -f 'src/bindings.c' || echo '$(srcdir)/'`src/bindings.c src/weston-bindings.obj: src/bindings.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-bindings.obj -MD -MP -MF src/$(DEPDIR)/weston-bindings.Tpo -c -o src/weston-bindings.obj `if test -f 'src/bindings.c'; then $(CYGPATH_W) 'src/bindings.c'; else $(CYGPATH_W) '$(srcdir)/src/bindings.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-bindings.Tpo src/$(DEPDIR)/weston-bindings.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/bindings.c' object='src/weston-bindings.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-bindings.obj `if test -f 'src/bindings.c'; then $(CYGPATH_W) 'src/bindings.c'; else $(CYGPATH_W) '$(srcdir)/src/bindings.c'; fi` src/weston-animation.o: src/animation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-animation.o -MD -MP -MF src/$(DEPDIR)/weston-animation.Tpo -c -o src/weston-animation.o `test -f 'src/animation.c' || echo '$(srcdir)/'`src/animation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-animation.Tpo src/$(DEPDIR)/weston-animation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/animation.c' object='src/weston-animation.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-animation.o `test -f 'src/animation.c' || echo '$(srcdir)/'`src/animation.c src/weston-animation.obj: src/animation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-animation.obj -MD -MP -MF src/$(DEPDIR)/weston-animation.Tpo -c -o src/weston-animation.obj `if test -f 'src/animation.c'; then $(CYGPATH_W) 'src/animation.c'; else $(CYGPATH_W) '$(srcdir)/src/animation.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-animation.Tpo src/$(DEPDIR)/weston-animation.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/animation.c' object='src/weston-animation.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-animation.obj `if test -f 'src/animation.c'; then $(CYGPATH_W) 'src/animation.c'; else $(CYGPATH_W) '$(srcdir)/src/animation.c'; fi` src/weston-noop-renderer.o: src/noop-renderer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-noop-renderer.o -MD -MP -MF src/$(DEPDIR)/weston-noop-renderer.Tpo -c -o src/weston-noop-renderer.o `test -f 'src/noop-renderer.c' || echo '$(srcdir)/'`src/noop-renderer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-noop-renderer.Tpo src/$(DEPDIR)/weston-noop-renderer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/noop-renderer.c' object='src/weston-noop-renderer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-noop-renderer.o `test -f 'src/noop-renderer.c' || echo '$(srcdir)/'`src/noop-renderer.c src/weston-noop-renderer.obj: src/noop-renderer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-noop-renderer.obj -MD -MP -MF src/$(DEPDIR)/weston-noop-renderer.Tpo -c -o src/weston-noop-renderer.obj `if test -f 'src/noop-renderer.c'; then $(CYGPATH_W) 'src/noop-renderer.c'; else $(CYGPATH_W) '$(srcdir)/src/noop-renderer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-noop-renderer.Tpo src/$(DEPDIR)/weston-noop-renderer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/noop-renderer.c' object='src/weston-noop-renderer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-noop-renderer.obj `if test -f 'src/noop-renderer.c'; then $(CYGPATH_W) 'src/noop-renderer.c'; else $(CYGPATH_W) '$(srcdir)/src/noop-renderer.c'; fi` src/weston-pixman-renderer.o: src/pixman-renderer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-pixman-renderer.o -MD -MP -MF src/$(DEPDIR)/weston-pixman-renderer.Tpo -c -o src/weston-pixman-renderer.o `test -f 'src/pixman-renderer.c' || echo '$(srcdir)/'`src/pixman-renderer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-pixman-renderer.Tpo src/$(DEPDIR)/weston-pixman-renderer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pixman-renderer.c' object='src/weston-pixman-renderer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-pixman-renderer.o `test -f 'src/pixman-renderer.c' || echo '$(srcdir)/'`src/pixman-renderer.c src/weston-pixman-renderer.obj: src/pixman-renderer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-pixman-renderer.obj -MD -MP -MF src/$(DEPDIR)/weston-pixman-renderer.Tpo -c -o src/weston-pixman-renderer.obj `if test -f 'src/pixman-renderer.c'; then $(CYGPATH_W) 'src/pixman-renderer.c'; else $(CYGPATH_W) '$(srcdir)/src/pixman-renderer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-pixman-renderer.Tpo src/$(DEPDIR)/weston-pixman-renderer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pixman-renderer.c' object='src/weston-pixman-renderer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-pixman-renderer.obj `if test -f 'src/pixman-renderer.c'; then $(CYGPATH_W) 'src/pixman-renderer.c'; else $(CYGPATH_W) '$(srcdir)/src/pixman-renderer.c'; fi` src/weston-timeline.o: src/timeline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-timeline.o -MD -MP -MF src/$(DEPDIR)/weston-timeline.Tpo -c -o src/weston-timeline.o `test -f 'src/timeline.c' || echo '$(srcdir)/'`src/timeline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-timeline.Tpo src/$(DEPDIR)/weston-timeline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/timeline.c' object='src/weston-timeline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-timeline.o `test -f 'src/timeline.c' || echo '$(srcdir)/'`src/timeline.c src/weston-timeline.obj: src/timeline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-timeline.obj -MD -MP -MF src/$(DEPDIR)/weston-timeline.Tpo -c -o src/weston-timeline.obj `if test -f 'src/timeline.c'; then $(CYGPATH_W) 'src/timeline.c'; else $(CYGPATH_W) '$(srcdir)/src/timeline.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-timeline.Tpo src/$(DEPDIR)/weston-timeline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/timeline.c' object='src/weston-timeline.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-timeline.obj `if test -f 'src/timeline.c'; then $(CYGPATH_W) 'src/timeline.c'; else $(CYGPATH_W) '$(srcdir)/src/timeline.c'; fi` src/weston-main.o: src/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-main.o -MD -MP -MF src/$(DEPDIR)/weston-main.Tpo -c -o src/weston-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-main.Tpo src/$(DEPDIR)/weston-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/weston-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-main.o `test -f 'src/main.c' || echo '$(srcdir)/'`src/main.c src/weston-main.obj: src/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-main.obj -MD -MP -MF src/$(DEPDIR)/weston-main.Tpo -c -o src/weston-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-main.Tpo src/$(DEPDIR)/weston-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/main.c' object='src/weston-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-main.obj `if test -f 'src/main.c'; then $(CYGPATH_W) 'src/main.c'; else $(CYGPATH_W) '$(srcdir)/src/main.c'; fi` src/weston-linux-dmabuf.o: src/linux-dmabuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-linux-dmabuf.o -MD -MP -MF src/$(DEPDIR)/weston-linux-dmabuf.Tpo -c -o src/weston-linux-dmabuf.o `test -f 'src/linux-dmabuf.c' || echo '$(srcdir)/'`src/linux-dmabuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-linux-dmabuf.Tpo src/$(DEPDIR)/weston-linux-dmabuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/linux-dmabuf.c' object='src/weston-linux-dmabuf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-linux-dmabuf.o `test -f 'src/linux-dmabuf.c' || echo '$(srcdir)/'`src/linux-dmabuf.c src/weston-linux-dmabuf.obj: src/linux-dmabuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT src/weston-linux-dmabuf.obj -MD -MP -MF src/$(DEPDIR)/weston-linux-dmabuf.Tpo -c -o src/weston-linux-dmabuf.obj `if test -f 'src/linux-dmabuf.c'; then $(CYGPATH_W) 'src/linux-dmabuf.c'; else $(CYGPATH_W) '$(srcdir)/src/linux-dmabuf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston-linux-dmabuf.Tpo src/$(DEPDIR)/weston-linux-dmabuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/linux-dmabuf.c' object='src/weston-linux-dmabuf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o src/weston-linux-dmabuf.obj `if test -f 'src/linux-dmabuf.c'; then $(CYGPATH_W) 'src/linux-dmabuf.c'; else $(CYGPATH_W) '$(srcdir)/src/linux-dmabuf.c'; fi` shared/weston-matrix.o: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT shared/weston-matrix.o -MD -MP -MF shared/$(DEPDIR)/weston-matrix.Tpo -c -o shared/weston-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/weston-matrix.Tpo shared/$(DEPDIR)/weston-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/weston-matrix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o shared/weston-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c shared/weston-matrix.obj: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT shared/weston-matrix.obj -MD -MP -MF shared/$(DEPDIR)/weston-matrix.Tpo -c -o shared/weston-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/weston-matrix.Tpo shared/$(DEPDIR)/weston-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/weston-matrix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o shared/weston-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` protocol/weston-screenshooter-protocol.o: protocol/screenshooter-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-screenshooter-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-screenshooter-protocol.Tpo -c -o protocol/weston-screenshooter-protocol.o `test -f 'protocol/screenshooter-protocol.c' || echo '$(srcdir)/'`protocol/screenshooter-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-screenshooter-protocol.Tpo protocol/$(DEPDIR)/weston-screenshooter-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/screenshooter-protocol.c' object='protocol/weston-screenshooter-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-screenshooter-protocol.o `test -f 'protocol/screenshooter-protocol.c' || echo '$(srcdir)/'`protocol/screenshooter-protocol.c protocol/weston-screenshooter-protocol.obj: protocol/screenshooter-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-screenshooter-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-screenshooter-protocol.Tpo -c -o protocol/weston-screenshooter-protocol.obj `if test -f 'protocol/screenshooter-protocol.c'; then $(CYGPATH_W) 'protocol/screenshooter-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/screenshooter-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-screenshooter-protocol.Tpo protocol/$(DEPDIR)/weston-screenshooter-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/screenshooter-protocol.c' object='protocol/weston-screenshooter-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-screenshooter-protocol.obj `if test -f 'protocol/screenshooter-protocol.c'; then $(CYGPATH_W) 'protocol/screenshooter-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/screenshooter-protocol.c'; fi` protocol/weston-text-cursor-position-protocol.o: protocol/text-cursor-position-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-text-cursor-position-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Tpo -c -o protocol/weston-text-cursor-position-protocol.o `test -f 'protocol/text-cursor-position-protocol.c' || echo '$(srcdir)/'`protocol/text-cursor-position-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Tpo protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-cursor-position-protocol.c' object='protocol/weston-text-cursor-position-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-text-cursor-position-protocol.o `test -f 'protocol/text-cursor-position-protocol.c' || echo '$(srcdir)/'`protocol/text-cursor-position-protocol.c protocol/weston-text-cursor-position-protocol.obj: protocol/text-cursor-position-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-text-cursor-position-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Tpo -c -o protocol/weston-text-cursor-position-protocol.obj `if test -f 'protocol/text-cursor-position-protocol.c'; then $(CYGPATH_W) 'protocol/text-cursor-position-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-cursor-position-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Tpo protocol/$(DEPDIR)/weston-text-cursor-position-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-cursor-position-protocol.c' object='protocol/weston-text-cursor-position-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-text-cursor-position-protocol.obj `if test -f 'protocol/text-cursor-position-protocol.c'; then $(CYGPATH_W) 'protocol/text-cursor-position-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-cursor-position-protocol.c'; fi` protocol/weston-text-protocol.o: protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-text-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-text-protocol.Tpo -c -o protocol/weston-text-protocol.o `test -f 'protocol/text-protocol.c' || echo '$(srcdir)/'`protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-text-protocol.Tpo protocol/$(DEPDIR)/weston-text-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-protocol.c' object='protocol/weston-text-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-text-protocol.o `test -f 'protocol/text-protocol.c' || echo '$(srcdir)/'`protocol/text-protocol.c protocol/weston-text-protocol.obj: protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-text-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-text-protocol.Tpo -c -o protocol/weston-text-protocol.obj `if test -f 'protocol/text-protocol.c'; then $(CYGPATH_W) 'protocol/text-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-text-protocol.Tpo protocol/$(DEPDIR)/weston-text-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-protocol.c' object='protocol/weston-text-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-text-protocol.obj `if test -f 'protocol/text-protocol.c'; then $(CYGPATH_W) 'protocol/text-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-protocol.c'; fi` protocol/weston-input-method-protocol.o: protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-input-method-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-input-method-protocol.Tpo -c -o protocol/weston-input-method-protocol.o `test -f 'protocol/input-method-protocol.c' || echo '$(srcdir)/'`protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-input-method-protocol.Tpo protocol/$(DEPDIR)/weston-input-method-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/input-method-protocol.c' object='protocol/weston-input-method-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-input-method-protocol.o `test -f 'protocol/input-method-protocol.c' || echo '$(srcdir)/'`protocol/input-method-protocol.c protocol/weston-input-method-protocol.obj: protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-input-method-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-input-method-protocol.Tpo -c -o protocol/weston-input-method-protocol.obj `if test -f 'protocol/input-method-protocol.c'; then $(CYGPATH_W) 'protocol/input-method-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/input-method-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-input-method-protocol.Tpo protocol/$(DEPDIR)/weston-input-method-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/input-method-protocol.c' object='protocol/weston-input-method-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-input-method-protocol.obj `if test -f 'protocol/input-method-protocol.c'; then $(CYGPATH_W) 'protocol/input-method-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/input-method-protocol.c'; fi` protocol/weston-workspaces-protocol.o: protocol/workspaces-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-workspaces-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-workspaces-protocol.Tpo -c -o protocol/weston-workspaces-protocol.o `test -f 'protocol/workspaces-protocol.c' || echo '$(srcdir)/'`protocol/workspaces-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-workspaces-protocol.Tpo protocol/$(DEPDIR)/weston-workspaces-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/workspaces-protocol.c' object='protocol/weston-workspaces-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-workspaces-protocol.o `test -f 'protocol/workspaces-protocol.c' || echo '$(srcdir)/'`protocol/workspaces-protocol.c protocol/weston-workspaces-protocol.obj: protocol/workspaces-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-workspaces-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-workspaces-protocol.Tpo -c -o protocol/weston-workspaces-protocol.obj `if test -f 'protocol/workspaces-protocol.c'; then $(CYGPATH_W) 'protocol/workspaces-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/workspaces-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-workspaces-protocol.Tpo protocol/$(DEPDIR)/weston-workspaces-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/workspaces-protocol.c' object='protocol/weston-workspaces-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-workspaces-protocol.obj `if test -f 'protocol/workspaces-protocol.c'; then $(CYGPATH_W) 'protocol/workspaces-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/workspaces-protocol.c'; fi` protocol/weston-presentation_timing-protocol.o: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-presentation_timing-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-presentation_timing-protocol.Tpo -c -o protocol/weston-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/weston-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/weston-presentation_timing-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c protocol/weston-presentation_timing-protocol.obj: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-presentation_timing-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-presentation_timing-protocol.Tpo -c -o protocol/weston-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/weston-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/weston-presentation_timing-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` protocol/weston-scaler-protocol.o: protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-scaler-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-scaler-protocol.Tpo -c -o protocol/weston-scaler-protocol.o `test -f 'protocol/scaler-protocol.c' || echo '$(srcdir)/'`protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-scaler-protocol.Tpo protocol/$(DEPDIR)/weston-scaler-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/scaler-protocol.c' object='protocol/weston-scaler-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-scaler-protocol.o `test -f 'protocol/scaler-protocol.c' || echo '$(srcdir)/'`protocol/scaler-protocol.c protocol/weston-scaler-protocol.obj: protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-scaler-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-scaler-protocol.Tpo -c -o protocol/weston-scaler-protocol.obj `if test -f 'protocol/scaler-protocol.c'; then $(CYGPATH_W) 'protocol/scaler-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/scaler-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-scaler-protocol.Tpo protocol/$(DEPDIR)/weston-scaler-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/scaler-protocol.c' object='protocol/weston-scaler-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-scaler-protocol.obj `if test -f 'protocol/scaler-protocol.c'; then $(CYGPATH_W) 'protocol/scaler-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/scaler-protocol.c'; fi` protocol/weston-linux-dmabuf-protocol.o: protocol/linux-dmabuf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-linux-dmabuf-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Tpo -c -o protocol/weston-linux-dmabuf-protocol.o `test -f 'protocol/linux-dmabuf-protocol.c' || echo '$(srcdir)/'`protocol/linux-dmabuf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Tpo protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/linux-dmabuf-protocol.c' object='protocol/weston-linux-dmabuf-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-linux-dmabuf-protocol.o `test -f 'protocol/linux-dmabuf-protocol.c' || echo '$(srcdir)/'`protocol/linux-dmabuf-protocol.c protocol/weston-linux-dmabuf-protocol.obj: protocol/linux-dmabuf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -MT protocol/weston-linux-dmabuf-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Tpo -c -o protocol/weston-linux-dmabuf-protocol.obj `if test -f 'protocol/linux-dmabuf-protocol.c'; then $(CYGPATH_W) 'protocol/linux-dmabuf-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/linux-dmabuf-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Tpo protocol/$(DEPDIR)/weston-linux-dmabuf-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/linux-dmabuf-protocol.c' object='protocol/weston-linux-dmabuf-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_CPPFLAGS) $(CPPFLAGS) $(weston_CFLAGS) $(CFLAGS) -c -o protocol/weston-linux-dmabuf-protocol.obj `if test -f 'protocol/linux-dmabuf-protocol.c'; then $(CYGPATH_W) 'protocol/linux-dmabuf-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/linux-dmabuf-protocol.c'; fi` clients/weston_calibrator-calibrator.o: clients/calibrator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -MT clients/weston_calibrator-calibrator.o -MD -MP -MF clients/$(DEPDIR)/weston_calibrator-calibrator.Tpo -c -o clients/weston_calibrator-calibrator.o `test -f 'clients/calibrator.c' || echo '$(srcdir)/'`clients/calibrator.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_calibrator-calibrator.Tpo clients/$(DEPDIR)/weston_calibrator-calibrator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/calibrator.c' object='clients/weston_calibrator-calibrator.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -c -o clients/weston_calibrator-calibrator.o `test -f 'clients/calibrator.c' || echo '$(srcdir)/'`clients/calibrator.c clients/weston_calibrator-calibrator.obj: clients/calibrator.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -MT clients/weston_calibrator-calibrator.obj -MD -MP -MF clients/$(DEPDIR)/weston_calibrator-calibrator.Tpo -c -o clients/weston_calibrator-calibrator.obj `if test -f 'clients/calibrator.c'; then $(CYGPATH_W) 'clients/calibrator.c'; else $(CYGPATH_W) '$(srcdir)/clients/calibrator.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_calibrator-calibrator.Tpo clients/$(DEPDIR)/weston_calibrator-calibrator.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/calibrator.c' object='clients/weston_calibrator-calibrator.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -c -o clients/weston_calibrator-calibrator.obj `if test -f 'clients/calibrator.c'; then $(CYGPATH_W) 'clients/calibrator.c'; else $(CYGPATH_W) '$(srcdir)/clients/calibrator.c'; fi` shared/weston_calibrator-matrix.o: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -MT shared/weston_calibrator-matrix.o -MD -MP -MF shared/$(DEPDIR)/weston_calibrator-matrix.Tpo -c -o shared/weston_calibrator-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/weston_calibrator-matrix.Tpo shared/$(DEPDIR)/weston_calibrator-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/weston_calibrator-matrix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -c -o shared/weston_calibrator-matrix.o `test -f 'shared/matrix.c' || echo '$(srcdir)/'`shared/matrix.c shared/weston_calibrator-matrix.obj: shared/matrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -MT shared/weston_calibrator-matrix.obj -MD -MP -MF shared/$(DEPDIR)/weston_calibrator-matrix.Tpo -c -o shared/weston_calibrator-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) shared/$(DEPDIR)/weston_calibrator-matrix.Tpo shared/$(DEPDIR)/weston_calibrator-matrix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shared/matrix.c' object='shared/weston_calibrator-matrix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_calibrator_CFLAGS) $(CFLAGS) -c -o shared/weston_calibrator-matrix.obj `if test -f 'shared/matrix.c'; then $(CYGPATH_W) 'shared/matrix.c'; else $(CYGPATH_W) '$(srcdir)/shared/matrix.c'; fi` clients/weston_clickdot-clickdot.o: clients/clickdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_clickdot_CFLAGS) $(CFLAGS) -MT clients/weston_clickdot-clickdot.o -MD -MP -MF clients/$(DEPDIR)/weston_clickdot-clickdot.Tpo -c -o clients/weston_clickdot-clickdot.o `test -f 'clients/clickdot.c' || echo '$(srcdir)/'`clients/clickdot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_clickdot-clickdot.Tpo clients/$(DEPDIR)/weston_clickdot-clickdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/clickdot.c' object='clients/weston_clickdot-clickdot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_clickdot_CFLAGS) $(CFLAGS) -c -o clients/weston_clickdot-clickdot.o `test -f 'clients/clickdot.c' || echo '$(srcdir)/'`clients/clickdot.c clients/weston_clickdot-clickdot.obj: clients/clickdot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_clickdot_CFLAGS) $(CFLAGS) -MT clients/weston_clickdot-clickdot.obj -MD -MP -MF clients/$(DEPDIR)/weston_clickdot-clickdot.Tpo -c -o clients/weston_clickdot-clickdot.obj `if test -f 'clients/clickdot.c'; then $(CYGPATH_W) 'clients/clickdot.c'; else $(CYGPATH_W) '$(srcdir)/clients/clickdot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_clickdot-clickdot.Tpo clients/$(DEPDIR)/weston_clickdot-clickdot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/clickdot.c' object='clients/weston_clickdot-clickdot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_clickdot_CFLAGS) $(CFLAGS) -c -o clients/weston_clickdot-clickdot.obj `if test -f 'clients/clickdot.c'; then $(CYGPATH_W) 'clients/clickdot.c'; else $(CYGPATH_W) '$(srcdir)/clients/clickdot.c'; fi` clients/weston_cliptest-cliptest.o: clients/cliptest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -MT clients/weston_cliptest-cliptest.o -MD -MP -MF clients/$(DEPDIR)/weston_cliptest-cliptest.Tpo -c -o clients/weston_cliptest-cliptest.o `test -f 'clients/cliptest.c' || echo '$(srcdir)/'`clients/cliptest.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_cliptest-cliptest.Tpo clients/$(DEPDIR)/weston_cliptest-cliptest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/cliptest.c' object='clients/weston_cliptest-cliptest.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -c -o clients/weston_cliptest-cliptest.o `test -f 'clients/cliptest.c' || echo '$(srcdir)/'`clients/cliptest.c clients/weston_cliptest-cliptest.obj: clients/cliptest.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -MT clients/weston_cliptest-cliptest.obj -MD -MP -MF clients/$(DEPDIR)/weston_cliptest-cliptest.Tpo -c -o clients/weston_cliptest-cliptest.obj `if test -f 'clients/cliptest.c'; then $(CYGPATH_W) 'clients/cliptest.c'; else $(CYGPATH_W) '$(srcdir)/clients/cliptest.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_cliptest-cliptest.Tpo clients/$(DEPDIR)/weston_cliptest-cliptest.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/cliptest.c' object='clients/weston_cliptest-cliptest.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -c -o clients/weston_cliptest-cliptest.obj `if test -f 'clients/cliptest.c'; then $(CYGPATH_W) 'clients/cliptest.c'; else $(CYGPATH_W) '$(srcdir)/clients/cliptest.c'; fi` src/weston_cliptest-vertex-clipping.o: src/vertex-clipping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -MT src/weston_cliptest-vertex-clipping.o -MD -MP -MF src/$(DEPDIR)/weston_cliptest-vertex-clipping.Tpo -c -o src/weston_cliptest-vertex-clipping.o `test -f 'src/vertex-clipping.c' || echo '$(srcdir)/'`src/vertex-clipping.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston_cliptest-vertex-clipping.Tpo src/$(DEPDIR)/weston_cliptest-vertex-clipping.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/vertex-clipping.c' object='src/weston_cliptest-vertex-clipping.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -c -o src/weston_cliptest-vertex-clipping.o `test -f 'src/vertex-clipping.c' || echo '$(srcdir)/'`src/vertex-clipping.c src/weston_cliptest-vertex-clipping.obj: src/vertex-clipping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -MT src/weston_cliptest-vertex-clipping.obj -MD -MP -MF src/$(DEPDIR)/weston_cliptest-vertex-clipping.Tpo -c -o src/weston_cliptest-vertex-clipping.obj `if test -f 'src/vertex-clipping.c'; then $(CYGPATH_W) 'src/vertex-clipping.c'; else $(CYGPATH_W) '$(srcdir)/src/vertex-clipping.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston_cliptest-vertex-clipping.Tpo src/$(DEPDIR)/weston_cliptest-vertex-clipping.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/vertex-clipping.c' object='src/weston_cliptest-vertex-clipping.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_cliptest_CFLAGS) $(CFLAGS) -c -o src/weston_cliptest-vertex-clipping.obj `if test -f 'src/vertex-clipping.c'; then $(CYGPATH_W) 'src/vertex-clipping.c'; else $(CYGPATH_W) '$(srcdir)/src/vertex-clipping.c'; fi` clients/weston_desktop_shell-desktop-shell.o: clients/desktop-shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -MT clients/weston_desktop_shell-desktop-shell.o -MD -MP -MF clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Tpo -c -o clients/weston_desktop_shell-desktop-shell.o `test -f 'clients/desktop-shell.c' || echo '$(srcdir)/'`clients/desktop-shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Tpo clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/desktop-shell.c' object='clients/weston_desktop_shell-desktop-shell.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -c -o clients/weston_desktop_shell-desktop-shell.o `test -f 'clients/desktop-shell.c' || echo '$(srcdir)/'`clients/desktop-shell.c clients/weston_desktop_shell-desktop-shell.obj: clients/desktop-shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -MT clients/weston_desktop_shell-desktop-shell.obj -MD -MP -MF clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Tpo -c -o clients/weston_desktop_shell-desktop-shell.obj `if test -f 'clients/desktop-shell.c'; then $(CYGPATH_W) 'clients/desktop-shell.c'; else $(CYGPATH_W) '$(srcdir)/clients/desktop-shell.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Tpo clients/$(DEPDIR)/weston_desktop_shell-desktop-shell.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/desktop-shell.c' object='clients/weston_desktop_shell-desktop-shell.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -c -o clients/weston_desktop_shell-desktop-shell.obj `if test -f 'clients/desktop-shell.c'; then $(CYGPATH_W) 'clients/desktop-shell.c'; else $(CYGPATH_W) '$(srcdir)/clients/desktop-shell.c'; fi` protocol/weston_desktop_shell-desktop-shell-protocol.o: protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -MT protocol/weston_desktop_shell-desktop-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Tpo -c -o protocol/weston_desktop_shell-desktop-shell-protocol.o `test -f 'protocol/desktop-shell-protocol.c' || echo '$(srcdir)/'`protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Tpo protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/desktop-shell-protocol.c' object='protocol/weston_desktop_shell-desktop-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -c -o protocol/weston_desktop_shell-desktop-shell-protocol.o `test -f 'protocol/desktop-shell-protocol.c' || echo '$(srcdir)/'`protocol/desktop-shell-protocol.c protocol/weston_desktop_shell-desktop-shell-protocol.obj: protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -MT protocol/weston_desktop_shell-desktop-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Tpo -c -o protocol/weston_desktop_shell-desktop-shell-protocol.obj `if test -f 'protocol/desktop-shell-protocol.c'; then $(CYGPATH_W) 'protocol/desktop-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/desktop-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Tpo protocol/$(DEPDIR)/weston_desktop_shell-desktop-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/desktop-shell-protocol.c' object='protocol/weston_desktop_shell-desktop-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_desktop_shell_CFLAGS) $(CFLAGS) -c -o protocol/weston_desktop_shell-desktop-shell-protocol.obj `if test -f 'protocol/desktop-shell-protocol.c'; then $(CYGPATH_W) 'protocol/desktop-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/desktop-shell-protocol.c'; fi` clients/weston_dnd-dnd.o: clients/dnd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_dnd_CFLAGS) $(CFLAGS) -MT clients/weston_dnd-dnd.o -MD -MP -MF clients/$(DEPDIR)/weston_dnd-dnd.Tpo -c -o clients/weston_dnd-dnd.o `test -f 'clients/dnd.c' || echo '$(srcdir)/'`clients/dnd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_dnd-dnd.Tpo clients/$(DEPDIR)/weston_dnd-dnd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/dnd.c' object='clients/weston_dnd-dnd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_dnd_CFLAGS) $(CFLAGS) -c -o clients/weston_dnd-dnd.o `test -f 'clients/dnd.c' || echo '$(srcdir)/'`clients/dnd.c clients/weston_dnd-dnd.obj: clients/dnd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_dnd_CFLAGS) $(CFLAGS) -MT clients/weston_dnd-dnd.obj -MD -MP -MF clients/$(DEPDIR)/weston_dnd-dnd.Tpo -c -o clients/weston_dnd-dnd.obj `if test -f 'clients/dnd.c'; then $(CYGPATH_W) 'clients/dnd.c'; else $(CYGPATH_W) '$(srcdir)/clients/dnd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_dnd-dnd.Tpo clients/$(DEPDIR)/weston_dnd-dnd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/dnd.c' object='clients/weston_dnd-dnd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_dnd_CFLAGS) $(CFLAGS) -c -o clients/weston_dnd-dnd.obj `if test -f 'clients/dnd.c'; then $(CYGPATH_W) 'clients/dnd.c'; else $(CYGPATH_W) '$(srcdir)/clients/dnd.c'; fi` clients/weston_editor-editor.o: clients/editor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -MT clients/weston_editor-editor.o -MD -MP -MF clients/$(DEPDIR)/weston_editor-editor.Tpo -c -o clients/weston_editor-editor.o `test -f 'clients/editor.c' || echo '$(srcdir)/'`clients/editor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_editor-editor.Tpo clients/$(DEPDIR)/weston_editor-editor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/editor.c' object='clients/weston_editor-editor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -c -o clients/weston_editor-editor.o `test -f 'clients/editor.c' || echo '$(srcdir)/'`clients/editor.c clients/weston_editor-editor.obj: clients/editor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -MT clients/weston_editor-editor.obj -MD -MP -MF clients/$(DEPDIR)/weston_editor-editor.Tpo -c -o clients/weston_editor-editor.obj `if test -f 'clients/editor.c'; then $(CYGPATH_W) 'clients/editor.c'; else $(CYGPATH_W) '$(srcdir)/clients/editor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_editor-editor.Tpo clients/$(DEPDIR)/weston_editor-editor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/editor.c' object='clients/weston_editor-editor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -c -o clients/weston_editor-editor.obj `if test -f 'clients/editor.c'; then $(CYGPATH_W) 'clients/editor.c'; else $(CYGPATH_W) '$(srcdir)/clients/editor.c'; fi` protocol/weston_editor-text-protocol.o: protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -MT protocol/weston_editor-text-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_editor-text-protocol.Tpo -c -o protocol/weston_editor-text-protocol.o `test -f 'protocol/text-protocol.c' || echo '$(srcdir)/'`protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_editor-text-protocol.Tpo protocol/$(DEPDIR)/weston_editor-text-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-protocol.c' object='protocol/weston_editor-text-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -c -o protocol/weston_editor-text-protocol.o `test -f 'protocol/text-protocol.c' || echo '$(srcdir)/'`protocol/text-protocol.c protocol/weston_editor-text-protocol.obj: protocol/text-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -MT protocol/weston_editor-text-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_editor-text-protocol.Tpo -c -o protocol/weston_editor-text-protocol.obj `if test -f 'protocol/text-protocol.c'; then $(CYGPATH_W) 'protocol/text-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_editor-text-protocol.Tpo protocol/$(DEPDIR)/weston_editor-text-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/text-protocol.c' object='protocol/weston_editor-text-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_editor_CFLAGS) $(CFLAGS) -c -o protocol/weston_editor-text-protocol.obj `if test -f 'protocol/text-protocol.c'; then $(CYGPATH_W) 'protocol/text-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/text-protocol.c'; fi` clients/weston_eventdemo-eventdemo.o: clients/eventdemo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_eventdemo_CFLAGS) $(CFLAGS) -MT clients/weston_eventdemo-eventdemo.o -MD -MP -MF clients/$(DEPDIR)/weston_eventdemo-eventdemo.Tpo -c -o clients/weston_eventdemo-eventdemo.o `test -f 'clients/eventdemo.c' || echo '$(srcdir)/'`clients/eventdemo.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_eventdemo-eventdemo.Tpo clients/$(DEPDIR)/weston_eventdemo-eventdemo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/eventdemo.c' object='clients/weston_eventdemo-eventdemo.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_eventdemo_CFLAGS) $(CFLAGS) -c -o clients/weston_eventdemo-eventdemo.o `test -f 'clients/eventdemo.c' || echo '$(srcdir)/'`clients/eventdemo.c clients/weston_eventdemo-eventdemo.obj: clients/eventdemo.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_eventdemo_CFLAGS) $(CFLAGS) -MT clients/weston_eventdemo-eventdemo.obj -MD -MP -MF clients/$(DEPDIR)/weston_eventdemo-eventdemo.Tpo -c -o clients/weston_eventdemo-eventdemo.obj `if test -f 'clients/eventdemo.c'; then $(CYGPATH_W) 'clients/eventdemo.c'; else $(CYGPATH_W) '$(srcdir)/clients/eventdemo.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_eventdemo-eventdemo.Tpo clients/$(DEPDIR)/weston_eventdemo-eventdemo.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/eventdemo.c' object='clients/weston_eventdemo-eventdemo.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_eventdemo_CFLAGS) $(CFLAGS) -c -o clients/weston_eventdemo-eventdemo.obj `if test -f 'clients/eventdemo.c'; then $(CYGPATH_W) 'clients/eventdemo.c'; else $(CYGPATH_W) '$(srcdir)/clients/eventdemo.c'; fi` clients/weston_flower-flower.o: clients/flower.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_flower_CFLAGS) $(CFLAGS) -MT clients/weston_flower-flower.o -MD -MP -MF clients/$(DEPDIR)/weston_flower-flower.Tpo -c -o clients/weston_flower-flower.o `test -f 'clients/flower.c' || echo '$(srcdir)/'`clients/flower.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_flower-flower.Tpo clients/$(DEPDIR)/weston_flower-flower.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/flower.c' object='clients/weston_flower-flower.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_flower_CFLAGS) $(CFLAGS) -c -o clients/weston_flower-flower.o `test -f 'clients/flower.c' || echo '$(srcdir)/'`clients/flower.c clients/weston_flower-flower.obj: clients/flower.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_flower_CFLAGS) $(CFLAGS) -MT clients/weston_flower-flower.obj -MD -MP -MF clients/$(DEPDIR)/weston_flower-flower.Tpo -c -o clients/weston_flower-flower.obj `if test -f 'clients/flower.c'; then $(CYGPATH_W) 'clients/flower.c'; else $(CYGPATH_W) '$(srcdir)/clients/flower.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_flower-flower.Tpo clients/$(DEPDIR)/weston_flower-flower.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/flower.c' object='clients/weston_flower-flower.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_flower_CFLAGS) $(CFLAGS) -c -o clients/weston_flower-flower.obj `if test -f 'clients/flower.c'; then $(CYGPATH_W) 'clients/flower.c'; else $(CYGPATH_W) '$(srcdir)/clients/flower.c'; fi` clients/weston_fullscreen-fullscreen.o: clients/fullscreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -MT clients/weston_fullscreen-fullscreen.o -MD -MP -MF clients/$(DEPDIR)/weston_fullscreen-fullscreen.Tpo -c -o clients/weston_fullscreen-fullscreen.o `test -f 'clients/fullscreen.c' || echo '$(srcdir)/'`clients/fullscreen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_fullscreen-fullscreen.Tpo clients/$(DEPDIR)/weston_fullscreen-fullscreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/fullscreen.c' object='clients/weston_fullscreen-fullscreen.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -c -o clients/weston_fullscreen-fullscreen.o `test -f 'clients/fullscreen.c' || echo '$(srcdir)/'`clients/fullscreen.c clients/weston_fullscreen-fullscreen.obj: clients/fullscreen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -MT clients/weston_fullscreen-fullscreen.obj -MD -MP -MF clients/$(DEPDIR)/weston_fullscreen-fullscreen.Tpo -c -o clients/weston_fullscreen-fullscreen.obj `if test -f 'clients/fullscreen.c'; then $(CYGPATH_W) 'clients/fullscreen.c'; else $(CYGPATH_W) '$(srcdir)/clients/fullscreen.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_fullscreen-fullscreen.Tpo clients/$(DEPDIR)/weston_fullscreen-fullscreen.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/fullscreen.c' object='clients/weston_fullscreen-fullscreen.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -c -o clients/weston_fullscreen-fullscreen.obj `if test -f 'clients/fullscreen.c'; then $(CYGPATH_W) 'clients/fullscreen.c'; else $(CYGPATH_W) '$(srcdir)/clients/fullscreen.c'; fi` protocol/weston_fullscreen-fullscreen-shell-protocol.o: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -MT protocol/weston_fullscreen-fullscreen-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Tpo -c -o protocol/weston_fullscreen-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_fullscreen-fullscreen-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -c -o protocol/weston_fullscreen-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c protocol/weston_fullscreen-fullscreen-shell-protocol.obj: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -MT protocol/weston_fullscreen-fullscreen-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Tpo -c -o protocol/weston_fullscreen-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_fullscreen-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_fullscreen-fullscreen-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_fullscreen_CFLAGS) $(CFLAGS) -c -o protocol/weston_fullscreen-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` clients/weston_gears-gears.o: clients/gears.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_gears_CFLAGS) $(CFLAGS) -MT clients/weston_gears-gears.o -MD -MP -MF clients/$(DEPDIR)/weston_gears-gears.Tpo -c -o clients/weston_gears-gears.o `test -f 'clients/gears.c' || echo '$(srcdir)/'`clients/gears.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_gears-gears.Tpo clients/$(DEPDIR)/weston_gears-gears.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/gears.c' object='clients/weston_gears-gears.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_gears_CFLAGS) $(CFLAGS) -c -o clients/weston_gears-gears.o `test -f 'clients/gears.c' || echo '$(srcdir)/'`clients/gears.c clients/weston_gears-gears.obj: clients/gears.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_gears_CFLAGS) $(CFLAGS) -MT clients/weston_gears-gears.obj -MD -MP -MF clients/$(DEPDIR)/weston_gears-gears.Tpo -c -o clients/weston_gears-gears.obj `if test -f 'clients/gears.c'; then $(CYGPATH_W) 'clients/gears.c'; else $(CYGPATH_W) '$(srcdir)/clients/gears.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_gears-gears.Tpo clients/$(DEPDIR)/weston_gears-gears.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/gears.c' object='clients/weston_gears-gears.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_gears_CFLAGS) $(CFLAGS) -c -o clients/weston_gears-gears.obj `if test -f 'clients/gears.c'; then $(CYGPATH_W) 'clients/gears.c'; else $(CYGPATH_W) '$(srcdir)/clients/gears.c'; fi` clients/weston_image-image.o: clients/image.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_image_CFLAGS) $(CFLAGS) -MT clients/weston_image-image.o -MD -MP -MF clients/$(DEPDIR)/weston_image-image.Tpo -c -o clients/weston_image-image.o `test -f 'clients/image.c' || echo '$(srcdir)/'`clients/image.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_image-image.Tpo clients/$(DEPDIR)/weston_image-image.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/image.c' object='clients/weston_image-image.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_image_CFLAGS) $(CFLAGS) -c -o clients/weston_image-image.o `test -f 'clients/image.c' || echo '$(srcdir)/'`clients/image.c clients/weston_image-image.obj: clients/image.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_image_CFLAGS) $(CFLAGS) -MT clients/weston_image-image.obj -MD -MP -MF clients/$(DEPDIR)/weston_image-image.Tpo -c -o clients/weston_image-image.obj `if test -f 'clients/image.c'; then $(CYGPATH_W) 'clients/image.c'; else $(CYGPATH_W) '$(srcdir)/clients/image.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_image-image.Tpo clients/$(DEPDIR)/weston_image-image.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/image.c' object='clients/weston_image-image.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_image_CFLAGS) $(CFLAGS) -c -o clients/weston_image-image.obj `if test -f 'clients/image.c'; then $(CYGPATH_W) 'clients/image.c'; else $(CYGPATH_W) '$(srcdir)/clients/image.c'; fi` clients/weston_info-weston-info.o: clients/weston-info.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -MT clients/weston_info-weston-info.o -MD -MP -MF clients/$(DEPDIR)/weston_info-weston-info.Tpo -c -o clients/weston_info-weston-info.o `test -f 'clients/weston-info.c' || echo '$(srcdir)/'`clients/weston-info.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_info-weston-info.Tpo clients/$(DEPDIR)/weston_info-weston-info.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/weston-info.c' object='clients/weston_info-weston-info.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -c -o clients/weston_info-weston-info.o `test -f 'clients/weston-info.c' || echo '$(srcdir)/'`clients/weston-info.c clients/weston_info-weston-info.obj: clients/weston-info.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -MT clients/weston_info-weston-info.obj -MD -MP -MF clients/$(DEPDIR)/weston_info-weston-info.Tpo -c -o clients/weston_info-weston-info.obj `if test -f 'clients/weston-info.c'; then $(CYGPATH_W) 'clients/weston-info.c'; else $(CYGPATH_W) '$(srcdir)/clients/weston-info.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_info-weston-info.Tpo clients/$(DEPDIR)/weston_info-weston-info.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/weston-info.c' object='clients/weston_info-weston-info.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -c -o clients/weston_info-weston-info.obj `if test -f 'clients/weston-info.c'; then $(CYGPATH_W) 'clients/weston-info.c'; else $(CYGPATH_W) '$(srcdir)/clients/weston-info.c'; fi` protocol/weston_info-presentation_timing-protocol.o: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -MT protocol/weston_info-presentation_timing-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Tpo -c -o protocol/weston_info-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/weston_info-presentation_timing-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -c -o protocol/weston_info-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c protocol/weston_info-presentation_timing-protocol.obj: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -MT protocol/weston_info-presentation_timing-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Tpo -c -o protocol/weston_info-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/weston_info-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/weston_info-presentation_timing-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_info_CFLAGS) $(CFLAGS) -c -o protocol/weston_info-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.o: clients/ivi-shell-user-interface.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -MT clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.o -MD -MP -MF clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Tpo -c -o clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.o `test -f 'clients/ivi-shell-user-interface.c' || echo '$(srcdir)/'`clients/ivi-shell-user-interface.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Tpo clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/ivi-shell-user-interface.c' object='clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -c -o clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.o `test -f 'clients/ivi-shell-user-interface.c' || echo '$(srcdir)/'`clients/ivi-shell-user-interface.c clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.obj: clients/ivi-shell-user-interface.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -MT clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.obj -MD -MP -MF clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Tpo -c -o clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.obj `if test -f 'clients/ivi-shell-user-interface.c'; then $(CYGPATH_W) 'clients/ivi-shell-user-interface.c'; else $(CYGPATH_W) '$(srcdir)/clients/ivi-shell-user-interface.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Tpo clients/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-shell-user-interface.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/ivi-shell-user-interface.c' object='clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -c -o clients/weston_ivi_shell_user_interface-ivi-shell-user-interface.obj `if test -f 'clients/ivi-shell-user-interface.c'; then $(CYGPATH_W) 'clients/ivi-shell-user-interface.c'; else $(CYGPATH_W) '$(srcdir)/clients/ivi-shell-user-interface.c'; fi` protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.o: protocol/ivi-hmi-controller-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -MT protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Tpo -c -o protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.o `test -f 'protocol/ivi-hmi-controller-protocol.c' || echo '$(srcdir)/'`protocol/ivi-hmi-controller-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Tpo protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-hmi-controller-protocol.c' object='protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -c -o protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.o `test -f 'protocol/ivi-hmi-controller-protocol.c' || echo '$(srcdir)/'`protocol/ivi-hmi-controller-protocol.c protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.obj: protocol/ivi-hmi-controller-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -MT protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Tpo -c -o protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.obj `if test -f 'protocol/ivi-hmi-controller-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-hmi-controller-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-hmi-controller-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Tpo protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-hmi-controller-protocol.c' object='protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -c -o protocol/weston_ivi_shell_user_interface-ivi-hmi-controller-protocol.obj `if test -f 'protocol/ivi-hmi-controller-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-hmi-controller-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-hmi-controller-protocol.c'; fi` protocol/weston_ivi_shell_user_interface-ivi-application-protocol.o: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -MT protocol/weston_ivi_shell_user_interface-ivi-application-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Tpo -c -o protocol/weston_ivi_shell_user_interface-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Tpo protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/weston_ivi_shell_user_interface-ivi-application-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -c -o protocol/weston_ivi_shell_user_interface-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c protocol/weston_ivi_shell_user_interface-ivi-application-protocol.obj: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -MT protocol/weston_ivi_shell_user_interface-ivi-application-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Tpo -c -o protocol/weston_ivi_shell_user_interface-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Tpo protocol/$(DEPDIR)/weston_ivi_shell_user_interface-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/weston_ivi_shell_user_interface-ivi-application-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_ivi_shell_user_interface_CFLAGS) $(CFLAGS) -c -o protocol/weston_ivi_shell_user_interface-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` clients/weston_keyboard-keyboard.o: clients/keyboard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -MT clients/weston_keyboard-keyboard.o -MD -MP -MF clients/$(DEPDIR)/weston_keyboard-keyboard.Tpo -c -o clients/weston_keyboard-keyboard.o `test -f 'clients/keyboard.c' || echo '$(srcdir)/'`clients/keyboard.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_keyboard-keyboard.Tpo clients/$(DEPDIR)/weston_keyboard-keyboard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/keyboard.c' object='clients/weston_keyboard-keyboard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -c -o clients/weston_keyboard-keyboard.o `test -f 'clients/keyboard.c' || echo '$(srcdir)/'`clients/keyboard.c clients/weston_keyboard-keyboard.obj: clients/keyboard.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -MT clients/weston_keyboard-keyboard.obj -MD -MP -MF clients/$(DEPDIR)/weston_keyboard-keyboard.Tpo -c -o clients/weston_keyboard-keyboard.obj `if test -f 'clients/keyboard.c'; then $(CYGPATH_W) 'clients/keyboard.c'; else $(CYGPATH_W) '$(srcdir)/clients/keyboard.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_keyboard-keyboard.Tpo clients/$(DEPDIR)/weston_keyboard-keyboard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/keyboard.c' object='clients/weston_keyboard-keyboard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -c -o clients/weston_keyboard-keyboard.obj `if test -f 'clients/keyboard.c'; then $(CYGPATH_W) 'clients/keyboard.c'; else $(CYGPATH_W) '$(srcdir)/clients/keyboard.c'; fi` protocol/weston_keyboard-desktop-shell-protocol.o: protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -MT protocol/weston_keyboard-desktop-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Tpo -c -o protocol/weston_keyboard-desktop-shell-protocol.o `test -f 'protocol/desktop-shell-protocol.c' || echo '$(srcdir)/'`protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Tpo protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/desktop-shell-protocol.c' object='protocol/weston_keyboard-desktop-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -c -o protocol/weston_keyboard-desktop-shell-protocol.o `test -f 'protocol/desktop-shell-protocol.c' || echo '$(srcdir)/'`protocol/desktop-shell-protocol.c protocol/weston_keyboard-desktop-shell-protocol.obj: protocol/desktop-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -MT protocol/weston_keyboard-desktop-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Tpo -c -o protocol/weston_keyboard-desktop-shell-protocol.obj `if test -f 'protocol/desktop-shell-protocol.c'; then $(CYGPATH_W) 'protocol/desktop-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/desktop-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Tpo protocol/$(DEPDIR)/weston_keyboard-desktop-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/desktop-shell-protocol.c' object='protocol/weston_keyboard-desktop-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -c -o protocol/weston_keyboard-desktop-shell-protocol.obj `if test -f 'protocol/desktop-shell-protocol.c'; then $(CYGPATH_W) 'protocol/desktop-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/desktop-shell-protocol.c'; fi` protocol/weston_keyboard-input-method-protocol.o: protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -MT protocol/weston_keyboard-input-method-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Tpo -c -o protocol/weston_keyboard-input-method-protocol.o `test -f 'protocol/input-method-protocol.c' || echo '$(srcdir)/'`protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Tpo protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/input-method-protocol.c' object='protocol/weston_keyboard-input-method-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -c -o protocol/weston_keyboard-input-method-protocol.o `test -f 'protocol/input-method-protocol.c' || echo '$(srcdir)/'`protocol/input-method-protocol.c protocol/weston_keyboard-input-method-protocol.obj: protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -MT protocol/weston_keyboard-input-method-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Tpo -c -o protocol/weston_keyboard-input-method-protocol.obj `if test -f 'protocol/input-method-protocol.c'; then $(CYGPATH_W) 'protocol/input-method-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/input-method-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Tpo protocol/$(DEPDIR)/weston_keyboard-input-method-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/input-method-protocol.c' object='protocol/weston_keyboard-input-method-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_keyboard_CFLAGS) $(CFLAGS) -c -o protocol/weston_keyboard-input-method-protocol.obj `if test -f 'protocol/input-method-protocol.c'; then $(CYGPATH_W) 'protocol/input-method-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/input-method-protocol.c'; fi` src/weston_launch-weston-launch.o: src/weston-launch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_launch_CPPFLAGS) $(CPPFLAGS) $(weston_launch_CFLAGS) $(CFLAGS) -MT src/weston_launch-weston-launch.o -MD -MP -MF src/$(DEPDIR)/weston_launch-weston-launch.Tpo -c -o src/weston_launch-weston-launch.o `test -f 'src/weston-launch.c' || echo '$(srcdir)/'`src/weston-launch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston_launch-weston-launch.Tpo src/$(DEPDIR)/weston_launch-weston-launch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/weston-launch.c' object='src/weston_launch-weston-launch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_launch_CPPFLAGS) $(CPPFLAGS) $(weston_launch_CFLAGS) $(CFLAGS) -c -o src/weston_launch-weston-launch.o `test -f 'src/weston-launch.c' || echo '$(srcdir)/'`src/weston-launch.c src/weston_launch-weston-launch.obj: src/weston-launch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_launch_CPPFLAGS) $(CPPFLAGS) $(weston_launch_CFLAGS) $(CFLAGS) -MT src/weston_launch-weston-launch.obj -MD -MP -MF src/$(DEPDIR)/weston_launch-weston-launch.Tpo -c -o src/weston_launch-weston-launch.obj `if test -f 'src/weston-launch.c'; then $(CYGPATH_W) 'src/weston-launch.c'; else $(CYGPATH_W) '$(srcdir)/src/weston-launch.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/weston_launch-weston-launch.Tpo src/$(DEPDIR)/weston_launch-weston-launch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/weston-launch.c' object='src/weston_launch-weston-launch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(weston_launch_CPPFLAGS) $(CPPFLAGS) $(weston_launch_CFLAGS) $(CFLAGS) -c -o src/weston_launch-weston-launch.obj `if test -f 'src/weston-launch.c'; then $(CYGPATH_W) 'src/weston-launch.c'; else $(CYGPATH_W) '$(srcdir)/src/weston-launch.c'; fi` clients/weston_multi_resource-multi-resource.o: clients/multi-resource.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_multi_resource_CFLAGS) $(CFLAGS) -MT clients/weston_multi_resource-multi-resource.o -MD -MP -MF clients/$(DEPDIR)/weston_multi_resource-multi-resource.Tpo -c -o clients/weston_multi_resource-multi-resource.o `test -f 'clients/multi-resource.c' || echo '$(srcdir)/'`clients/multi-resource.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_multi_resource-multi-resource.Tpo clients/$(DEPDIR)/weston_multi_resource-multi-resource.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/multi-resource.c' object='clients/weston_multi_resource-multi-resource.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_multi_resource_CFLAGS) $(CFLAGS) -c -o clients/weston_multi_resource-multi-resource.o `test -f 'clients/multi-resource.c' || echo '$(srcdir)/'`clients/multi-resource.c clients/weston_multi_resource-multi-resource.obj: clients/multi-resource.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_multi_resource_CFLAGS) $(CFLAGS) -MT clients/weston_multi_resource-multi-resource.obj -MD -MP -MF clients/$(DEPDIR)/weston_multi_resource-multi-resource.Tpo -c -o clients/weston_multi_resource-multi-resource.obj `if test -f 'clients/multi-resource.c'; then $(CYGPATH_W) 'clients/multi-resource.c'; else $(CYGPATH_W) '$(srcdir)/clients/multi-resource.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_multi_resource-multi-resource.Tpo clients/$(DEPDIR)/weston_multi_resource-multi-resource.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/multi-resource.c' object='clients/weston_multi_resource-multi-resource.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_multi_resource_CFLAGS) $(CFLAGS) -c -o clients/weston_multi_resource-multi-resource.obj `if test -f 'clients/multi-resource.c'; then $(CYGPATH_W) 'clients/multi-resource.c'; else $(CYGPATH_W) '$(srcdir)/clients/multi-resource.c'; fi` clients/weston_nested-nested.o: clients/nested.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_CFLAGS) $(CFLAGS) -MT clients/weston_nested-nested.o -MD -MP -MF clients/$(DEPDIR)/weston_nested-nested.Tpo -c -o clients/weston_nested-nested.o `test -f 'clients/nested.c' || echo '$(srcdir)/'`clients/nested.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_nested-nested.Tpo clients/$(DEPDIR)/weston_nested-nested.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/nested.c' object='clients/weston_nested-nested.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_CFLAGS) $(CFLAGS) -c -o clients/weston_nested-nested.o `test -f 'clients/nested.c' || echo '$(srcdir)/'`clients/nested.c clients/weston_nested-nested.obj: clients/nested.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_CFLAGS) $(CFLAGS) -MT clients/weston_nested-nested.obj -MD -MP -MF clients/$(DEPDIR)/weston_nested-nested.Tpo -c -o clients/weston_nested-nested.obj `if test -f 'clients/nested.c'; then $(CYGPATH_W) 'clients/nested.c'; else $(CYGPATH_W) '$(srcdir)/clients/nested.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_nested-nested.Tpo clients/$(DEPDIR)/weston_nested-nested.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/nested.c' object='clients/weston_nested-nested.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_CFLAGS) $(CFLAGS) -c -o clients/weston_nested-nested.obj `if test -f 'clients/nested.c'; then $(CYGPATH_W) 'clients/nested.c'; else $(CYGPATH_W) '$(srcdir)/clients/nested.c'; fi` clients/weston_nested_client-nested-client.o: clients/nested-client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_client_CFLAGS) $(CFLAGS) -MT clients/weston_nested_client-nested-client.o -MD -MP -MF clients/$(DEPDIR)/weston_nested_client-nested-client.Tpo -c -o clients/weston_nested_client-nested-client.o `test -f 'clients/nested-client.c' || echo '$(srcdir)/'`clients/nested-client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_nested_client-nested-client.Tpo clients/$(DEPDIR)/weston_nested_client-nested-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/nested-client.c' object='clients/weston_nested_client-nested-client.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_client_CFLAGS) $(CFLAGS) -c -o clients/weston_nested_client-nested-client.o `test -f 'clients/nested-client.c' || echo '$(srcdir)/'`clients/nested-client.c clients/weston_nested_client-nested-client.obj: clients/nested-client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_client_CFLAGS) $(CFLAGS) -MT clients/weston_nested_client-nested-client.obj -MD -MP -MF clients/$(DEPDIR)/weston_nested_client-nested-client.Tpo -c -o clients/weston_nested_client-nested-client.obj `if test -f 'clients/nested-client.c'; then $(CYGPATH_W) 'clients/nested-client.c'; else $(CYGPATH_W) '$(srcdir)/clients/nested-client.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_nested_client-nested-client.Tpo clients/$(DEPDIR)/weston_nested_client-nested-client.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/nested-client.c' object='clients/weston_nested_client-nested-client.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_nested_client_CFLAGS) $(CFLAGS) -c -o clients/weston_nested_client-nested-client.obj `if test -f 'clients/nested-client.c'; then $(CYGPATH_W) 'clients/nested-client.c'; else $(CYGPATH_W) '$(srcdir)/clients/nested-client.c'; fi` clients/weston_presentation_shm-presentation-shm.o: clients/presentation-shm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -MT clients/weston_presentation_shm-presentation-shm.o -MD -MP -MF clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Tpo -c -o clients/weston_presentation_shm-presentation-shm.o `test -f 'clients/presentation-shm.c' || echo '$(srcdir)/'`clients/presentation-shm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Tpo clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/presentation-shm.c' object='clients/weston_presentation_shm-presentation-shm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -c -o clients/weston_presentation_shm-presentation-shm.o `test -f 'clients/presentation-shm.c' || echo '$(srcdir)/'`clients/presentation-shm.c clients/weston_presentation_shm-presentation-shm.obj: clients/presentation-shm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -MT clients/weston_presentation_shm-presentation-shm.obj -MD -MP -MF clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Tpo -c -o clients/weston_presentation_shm-presentation-shm.obj `if test -f 'clients/presentation-shm.c'; then $(CYGPATH_W) 'clients/presentation-shm.c'; else $(CYGPATH_W) '$(srcdir)/clients/presentation-shm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Tpo clients/$(DEPDIR)/weston_presentation_shm-presentation-shm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/presentation-shm.c' object='clients/weston_presentation_shm-presentation-shm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -c -o clients/weston_presentation_shm-presentation-shm.obj `if test -f 'clients/presentation-shm.c'; then $(CYGPATH_W) 'clients/presentation-shm.c'; else $(CYGPATH_W) '$(srcdir)/clients/presentation-shm.c'; fi` protocol/weston_presentation_shm-presentation_timing-protocol.o: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_presentation_shm-presentation_timing-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Tpo -c -o protocol/weston_presentation_shm-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/weston_presentation_shm-presentation_timing-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_presentation_shm-presentation_timing-protocol.o `test -f 'protocol/presentation_timing-protocol.c' || echo '$(srcdir)/'`protocol/presentation_timing-protocol.c protocol/weston_presentation_shm-presentation_timing-protocol.obj: protocol/presentation_timing-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_presentation_shm-presentation_timing-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Tpo -c -o protocol/weston_presentation_shm-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Tpo protocol/$(DEPDIR)/weston_presentation_shm-presentation_timing-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/presentation_timing-protocol.c' object='protocol/weston_presentation_shm-presentation_timing-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_presentation_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_presentation_shm-presentation_timing-protocol.obj `if test -f 'protocol/presentation_timing-protocol.c'; then $(CYGPATH_W) 'protocol/presentation_timing-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/presentation_timing-protocol.c'; fi` clients/weston_resizor-resizor.o: clients/resizor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_resizor_CFLAGS) $(CFLAGS) -MT clients/weston_resizor-resizor.o -MD -MP -MF clients/$(DEPDIR)/weston_resizor-resizor.Tpo -c -o clients/weston_resizor-resizor.o `test -f 'clients/resizor.c' || echo '$(srcdir)/'`clients/resizor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_resizor-resizor.Tpo clients/$(DEPDIR)/weston_resizor-resizor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/resizor.c' object='clients/weston_resizor-resizor.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_resizor_CFLAGS) $(CFLAGS) -c -o clients/weston_resizor-resizor.o `test -f 'clients/resizor.c' || echo '$(srcdir)/'`clients/resizor.c clients/weston_resizor-resizor.obj: clients/resizor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_resizor_CFLAGS) $(CFLAGS) -MT clients/weston_resizor-resizor.obj -MD -MP -MF clients/$(DEPDIR)/weston_resizor-resizor.Tpo -c -o clients/weston_resizor-resizor.obj `if test -f 'clients/resizor.c'; then $(CYGPATH_W) 'clients/resizor.c'; else $(CYGPATH_W) '$(srcdir)/clients/resizor.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_resizor-resizor.Tpo clients/$(DEPDIR)/weston_resizor-resizor.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/resizor.c' object='clients/weston_resizor-resizor.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_resizor_CFLAGS) $(CFLAGS) -c -o clients/weston_resizor-resizor.obj `if test -f 'clients/resizor.c'; then $(CYGPATH_W) 'clients/resizor.c'; else $(CYGPATH_W) '$(srcdir)/clients/resizor.c'; fi` clients/weston_scaler-scaler.o: clients/scaler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_scaler_CFLAGS) $(CFLAGS) -MT clients/weston_scaler-scaler.o -MD -MP -MF clients/$(DEPDIR)/weston_scaler-scaler.Tpo -c -o clients/weston_scaler-scaler.o `test -f 'clients/scaler.c' || echo '$(srcdir)/'`clients/scaler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_scaler-scaler.Tpo clients/$(DEPDIR)/weston_scaler-scaler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/scaler.c' object='clients/weston_scaler-scaler.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_scaler_CFLAGS) $(CFLAGS) -c -o clients/weston_scaler-scaler.o `test -f 'clients/scaler.c' || echo '$(srcdir)/'`clients/scaler.c clients/weston_scaler-scaler.obj: clients/scaler.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_scaler_CFLAGS) $(CFLAGS) -MT clients/weston_scaler-scaler.obj -MD -MP -MF clients/$(DEPDIR)/weston_scaler-scaler.Tpo -c -o clients/weston_scaler-scaler.obj `if test -f 'clients/scaler.c'; then $(CYGPATH_W) 'clients/scaler.c'; else $(CYGPATH_W) '$(srcdir)/clients/scaler.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_scaler-scaler.Tpo clients/$(DEPDIR)/weston_scaler-scaler.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/scaler.c' object='clients/weston_scaler-scaler.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_scaler_CFLAGS) $(CFLAGS) -c -o clients/weston_scaler-scaler.obj `if test -f 'clients/scaler.c'; then $(CYGPATH_W) 'clients/scaler.c'; else $(CYGPATH_W) '$(srcdir)/clients/scaler.c'; fi` clients/weston_screenshooter-screenshot.o: clients/screenshot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -MT clients/weston_screenshooter-screenshot.o -MD -MP -MF clients/$(DEPDIR)/weston_screenshooter-screenshot.Tpo -c -o clients/weston_screenshooter-screenshot.o `test -f 'clients/screenshot.c' || echo '$(srcdir)/'`clients/screenshot.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_screenshooter-screenshot.Tpo clients/$(DEPDIR)/weston_screenshooter-screenshot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/screenshot.c' object='clients/weston_screenshooter-screenshot.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -c -o clients/weston_screenshooter-screenshot.o `test -f 'clients/screenshot.c' || echo '$(srcdir)/'`clients/screenshot.c clients/weston_screenshooter-screenshot.obj: clients/screenshot.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -MT clients/weston_screenshooter-screenshot.obj -MD -MP -MF clients/$(DEPDIR)/weston_screenshooter-screenshot.Tpo -c -o clients/weston_screenshooter-screenshot.obj `if test -f 'clients/screenshot.c'; then $(CYGPATH_W) 'clients/screenshot.c'; else $(CYGPATH_W) '$(srcdir)/clients/screenshot.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_screenshooter-screenshot.Tpo clients/$(DEPDIR)/weston_screenshooter-screenshot.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/screenshot.c' object='clients/weston_screenshooter-screenshot.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -c -o clients/weston_screenshooter-screenshot.obj `if test -f 'clients/screenshot.c'; then $(CYGPATH_W) 'clients/screenshot.c'; else $(CYGPATH_W) '$(srcdir)/clients/screenshot.c'; fi` protocol/weston_screenshooter-screenshooter-protocol.o: protocol/screenshooter-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -MT protocol/weston_screenshooter-screenshooter-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Tpo -c -o protocol/weston_screenshooter-screenshooter-protocol.o `test -f 'protocol/screenshooter-protocol.c' || echo '$(srcdir)/'`protocol/screenshooter-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Tpo protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/screenshooter-protocol.c' object='protocol/weston_screenshooter-screenshooter-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -c -o protocol/weston_screenshooter-screenshooter-protocol.o `test -f 'protocol/screenshooter-protocol.c' || echo '$(srcdir)/'`protocol/screenshooter-protocol.c protocol/weston_screenshooter-screenshooter-protocol.obj: protocol/screenshooter-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -MT protocol/weston_screenshooter-screenshooter-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Tpo -c -o protocol/weston_screenshooter-screenshooter-protocol.obj `if test -f 'protocol/screenshooter-protocol.c'; then $(CYGPATH_W) 'protocol/screenshooter-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/screenshooter-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Tpo protocol/$(DEPDIR)/weston_screenshooter-screenshooter-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/screenshooter-protocol.c' object='protocol/weston_screenshooter-screenshooter-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_screenshooter_CFLAGS) $(CFLAGS) -c -o protocol/weston_screenshooter-screenshooter-protocol.obj `if test -f 'protocol/screenshooter-protocol.c'; then $(CYGPATH_W) 'protocol/screenshooter-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/screenshooter-protocol.c'; fi` clients/weston_simple_damage-simple-damage.o: clients/simple-damage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT clients/weston_simple_damage-simple-damage.o -MD -MP -MF clients/$(DEPDIR)/weston_simple_damage-simple-damage.Tpo -c -o clients/weston_simple_damage-simple-damage.o `test -f 'clients/simple-damage.c' || echo '$(srcdir)/'`clients/simple-damage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_damage-simple-damage.Tpo clients/$(DEPDIR)/weston_simple_damage-simple-damage.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-damage.c' object='clients/weston_simple_damage-simple-damage.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_damage-simple-damage.o `test -f 'clients/simple-damage.c' || echo '$(srcdir)/'`clients/simple-damage.c clients/weston_simple_damage-simple-damage.obj: clients/simple-damage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT clients/weston_simple_damage-simple-damage.obj -MD -MP -MF clients/$(DEPDIR)/weston_simple_damage-simple-damage.Tpo -c -o clients/weston_simple_damage-simple-damage.obj `if test -f 'clients/simple-damage.c'; then $(CYGPATH_W) 'clients/simple-damage.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-damage.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_damage-simple-damage.Tpo clients/$(DEPDIR)/weston_simple_damage-simple-damage.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-damage.c' object='clients/weston_simple_damage-simple-damage.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_damage-simple-damage.obj `if test -f 'clients/simple-damage.c'; then $(CYGPATH_W) 'clients/simple-damage.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-damage.c'; fi` protocol/weston_simple_damage-scaler-protocol.o: protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_damage-scaler-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Tpo -c -o protocol/weston_simple_damage-scaler-protocol.o `test -f 'protocol/scaler-protocol.c' || echo '$(srcdir)/'`protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Tpo protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/scaler-protocol.c' object='protocol/weston_simple_damage-scaler-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_damage-scaler-protocol.o `test -f 'protocol/scaler-protocol.c' || echo '$(srcdir)/'`protocol/scaler-protocol.c protocol/weston_simple_damage-scaler-protocol.obj: protocol/scaler-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_damage-scaler-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Tpo -c -o protocol/weston_simple_damage-scaler-protocol.obj `if test -f 'protocol/scaler-protocol.c'; then $(CYGPATH_W) 'protocol/scaler-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/scaler-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Tpo protocol/$(DEPDIR)/weston_simple_damage-scaler-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/scaler-protocol.c' object='protocol/weston_simple_damage-scaler-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_damage-scaler-protocol.obj `if test -f 'protocol/scaler-protocol.c'; then $(CYGPATH_W) 'protocol/scaler-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/scaler-protocol.c'; fi` protocol/weston_simple_damage-xdg-shell-protocol.o: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_damage-xdg-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_damage-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_damage-xdg-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_damage-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c protocol/weston_simple_damage-xdg-shell-protocol.obj: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_damage-xdg-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_damage-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_damage-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_damage-xdg-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_damage-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` protocol/weston_simple_damage-fullscreen-shell-protocol.o: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_damage-fullscreen-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Tpo -c -o protocol/weston_simple_damage-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_simple_damage-fullscreen-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_damage-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c protocol/weston_simple_damage-fullscreen-shell-protocol.obj: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_damage-fullscreen-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Tpo -c -o protocol/weston_simple_damage-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_damage-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_simple_damage-fullscreen-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_damage_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_damage-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` clients/weston_simple_dmabuf-simple-dmabuf.o: clients/simple-dmabuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT clients/weston_simple_dmabuf-simple-dmabuf.o -MD -MP -MF clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Tpo -c -o clients/weston_simple_dmabuf-simple-dmabuf.o `test -f 'clients/simple-dmabuf.c' || echo '$(srcdir)/'`clients/simple-dmabuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Tpo clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-dmabuf.c' object='clients/weston_simple_dmabuf-simple-dmabuf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_dmabuf-simple-dmabuf.o `test -f 'clients/simple-dmabuf.c' || echo '$(srcdir)/'`clients/simple-dmabuf.c clients/weston_simple_dmabuf-simple-dmabuf.obj: clients/simple-dmabuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT clients/weston_simple_dmabuf-simple-dmabuf.obj -MD -MP -MF clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Tpo -c -o clients/weston_simple_dmabuf-simple-dmabuf.obj `if test -f 'clients/simple-dmabuf.c'; then $(CYGPATH_W) 'clients/simple-dmabuf.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-dmabuf.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Tpo clients/$(DEPDIR)/weston_simple_dmabuf-simple-dmabuf.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-dmabuf.c' object='clients/weston_simple_dmabuf-simple-dmabuf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_dmabuf-simple-dmabuf.obj `if test -f 'clients/simple-dmabuf.c'; then $(CYGPATH_W) 'clients/simple-dmabuf.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-dmabuf.c'; fi` protocol/weston_simple_dmabuf-xdg-shell-protocol.o: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_dmabuf-xdg-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_dmabuf-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_dmabuf-xdg-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_dmabuf-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c protocol/weston_simple_dmabuf-xdg-shell-protocol.obj: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_dmabuf-xdg-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_dmabuf-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_dmabuf-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_dmabuf-xdg-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_dmabuf-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` protocol/weston_simple_dmabuf-fullscreen-shell-protocol.o: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_dmabuf-fullscreen-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Tpo -c -o protocol/weston_simple_dmabuf-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_simple_dmabuf-fullscreen-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_dmabuf-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c protocol/weston_simple_dmabuf-fullscreen-shell-protocol.obj: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_dmabuf-fullscreen-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Tpo -c -o protocol/weston_simple_dmabuf-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_dmabuf-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_simple_dmabuf-fullscreen-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_dmabuf-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` protocol/weston_simple_dmabuf-linux-dmabuf-protocol.o: protocol/linux-dmabuf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_dmabuf-linux-dmabuf-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Tpo -c -o protocol/weston_simple_dmabuf-linux-dmabuf-protocol.o `test -f 'protocol/linux-dmabuf-protocol.c' || echo '$(srcdir)/'`protocol/linux-dmabuf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Tpo protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/linux-dmabuf-protocol.c' object='protocol/weston_simple_dmabuf-linux-dmabuf-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_dmabuf-linux-dmabuf-protocol.o `test -f 'protocol/linux-dmabuf-protocol.c' || echo '$(srcdir)/'`protocol/linux-dmabuf-protocol.c protocol/weston_simple_dmabuf-linux-dmabuf-protocol.obj: protocol/linux-dmabuf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_dmabuf-linux-dmabuf-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Tpo -c -o protocol/weston_simple_dmabuf-linux-dmabuf-protocol.obj `if test -f 'protocol/linux-dmabuf-protocol.c'; then $(CYGPATH_W) 'protocol/linux-dmabuf-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/linux-dmabuf-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Tpo protocol/$(DEPDIR)/weston_simple_dmabuf-linux-dmabuf-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/linux-dmabuf-protocol.c' object='protocol/weston_simple_dmabuf-linux-dmabuf-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_dmabuf_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_dmabuf-linux-dmabuf-protocol.obj `if test -f 'protocol/linux-dmabuf-protocol.c'; then $(CYGPATH_W) 'protocol/linux-dmabuf-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/linux-dmabuf-protocol.c'; fi` clients/weston_simple_egl-simple-egl.o: clients/simple-egl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -MT clients/weston_simple_egl-simple-egl.o -MD -MP -MF clients/$(DEPDIR)/weston_simple_egl-simple-egl.Tpo -c -o clients/weston_simple_egl-simple-egl.o `test -f 'clients/simple-egl.c' || echo '$(srcdir)/'`clients/simple-egl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_egl-simple-egl.Tpo clients/$(DEPDIR)/weston_simple_egl-simple-egl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-egl.c' object='clients/weston_simple_egl-simple-egl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_egl-simple-egl.o `test -f 'clients/simple-egl.c' || echo '$(srcdir)/'`clients/simple-egl.c clients/weston_simple_egl-simple-egl.obj: clients/simple-egl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -MT clients/weston_simple_egl-simple-egl.obj -MD -MP -MF clients/$(DEPDIR)/weston_simple_egl-simple-egl.Tpo -c -o clients/weston_simple_egl-simple-egl.obj `if test -f 'clients/simple-egl.c'; then $(CYGPATH_W) 'clients/simple-egl.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-egl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_egl-simple-egl.Tpo clients/$(DEPDIR)/weston_simple_egl-simple-egl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-egl.c' object='clients/weston_simple_egl-simple-egl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_egl-simple-egl.obj `if test -f 'clients/simple-egl.c'; then $(CYGPATH_W) 'clients/simple-egl.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-egl.c'; fi` protocol/weston_simple_egl-xdg-shell-protocol.o: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_egl-xdg-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_egl-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_egl-xdg-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_egl-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c protocol/weston_simple_egl-xdg-shell-protocol.obj: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_egl-xdg-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_egl-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_egl-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_egl-xdg-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_egl-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` protocol/weston_simple_egl-ivi-application-protocol.o: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_egl-ivi-application-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Tpo -c -o protocol/weston_simple_egl-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Tpo protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/weston_simple_egl-ivi-application-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_egl-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c protocol/weston_simple_egl-ivi-application-protocol.obj: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_egl-ivi-application-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Tpo -c -o protocol/weston_simple_egl-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Tpo protocol/$(DEPDIR)/weston_simple_egl-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/weston_simple_egl-ivi-application-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_egl_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_egl-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` clients/weston_simple_im-weston-simple-im.o: clients/weston-simple-im.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -MT clients/weston_simple_im-weston-simple-im.o -MD -MP -MF clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Tpo -c -o clients/weston_simple_im-weston-simple-im.o `test -f 'clients/weston-simple-im.c' || echo '$(srcdir)/'`clients/weston-simple-im.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Tpo clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/weston-simple-im.c' object='clients/weston_simple_im-weston-simple-im.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_im-weston-simple-im.o `test -f 'clients/weston-simple-im.c' || echo '$(srcdir)/'`clients/weston-simple-im.c clients/weston_simple_im-weston-simple-im.obj: clients/weston-simple-im.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -MT clients/weston_simple_im-weston-simple-im.obj -MD -MP -MF clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Tpo -c -o clients/weston_simple_im-weston-simple-im.obj `if test -f 'clients/weston-simple-im.c'; then $(CYGPATH_W) 'clients/weston-simple-im.c'; else $(CYGPATH_W) '$(srcdir)/clients/weston-simple-im.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Tpo clients/$(DEPDIR)/weston_simple_im-weston-simple-im.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/weston-simple-im.c' object='clients/weston_simple_im-weston-simple-im.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_im-weston-simple-im.obj `if test -f 'clients/weston-simple-im.c'; then $(CYGPATH_W) 'clients/weston-simple-im.c'; else $(CYGPATH_W) '$(srcdir)/clients/weston-simple-im.c'; fi` protocol/weston_simple_im-input-method-protocol.o: protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_im-input-method-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Tpo -c -o protocol/weston_simple_im-input-method-protocol.o `test -f 'protocol/input-method-protocol.c' || echo '$(srcdir)/'`protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Tpo protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/input-method-protocol.c' object='protocol/weston_simple_im-input-method-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_im-input-method-protocol.o `test -f 'protocol/input-method-protocol.c' || echo '$(srcdir)/'`protocol/input-method-protocol.c protocol/weston_simple_im-input-method-protocol.obj: protocol/input-method-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_im-input-method-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Tpo -c -o protocol/weston_simple_im-input-method-protocol.obj `if test -f 'protocol/input-method-protocol.c'; then $(CYGPATH_W) 'protocol/input-method-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/input-method-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Tpo protocol/$(DEPDIR)/weston_simple_im-input-method-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/input-method-protocol.c' object='protocol/weston_simple_im-input-method-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_im_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_im-input-method-protocol.obj `if test -f 'protocol/input-method-protocol.c'; then $(CYGPATH_W) 'protocol/input-method-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/input-method-protocol.c'; fi` clients/weston_simple_shm-simple-shm.o: clients/simple-shm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT clients/weston_simple_shm-simple-shm.o -MD -MP -MF clients/$(DEPDIR)/weston_simple_shm-simple-shm.Tpo -c -o clients/weston_simple_shm-simple-shm.o `test -f 'clients/simple-shm.c' || echo '$(srcdir)/'`clients/simple-shm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_shm-simple-shm.Tpo clients/$(DEPDIR)/weston_simple_shm-simple-shm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-shm.c' object='clients/weston_simple_shm-simple-shm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_shm-simple-shm.o `test -f 'clients/simple-shm.c' || echo '$(srcdir)/'`clients/simple-shm.c clients/weston_simple_shm-simple-shm.obj: clients/simple-shm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT clients/weston_simple_shm-simple-shm.obj -MD -MP -MF clients/$(DEPDIR)/weston_simple_shm-simple-shm.Tpo -c -o clients/weston_simple_shm-simple-shm.obj `if test -f 'clients/simple-shm.c'; then $(CYGPATH_W) 'clients/simple-shm.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-shm.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_shm-simple-shm.Tpo clients/$(DEPDIR)/weston_simple_shm-simple-shm.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-shm.c' object='clients/weston_simple_shm-simple-shm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_shm-simple-shm.obj `if test -f 'clients/simple-shm.c'; then $(CYGPATH_W) 'clients/simple-shm.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-shm.c'; fi` protocol/weston_simple_shm-xdg-shell-protocol.o: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_shm-xdg-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_shm-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_shm-xdg-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_shm-xdg-shell-protocol.o `test -f 'protocol/xdg-shell-protocol.c' || echo '$(srcdir)/'`protocol/xdg-shell-protocol.c protocol/weston_simple_shm-xdg-shell-protocol.obj: protocol/xdg-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_shm-xdg-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Tpo -c -o protocol/weston_simple_shm-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_shm-xdg-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/xdg-shell-protocol.c' object='protocol/weston_simple_shm-xdg-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_shm-xdg-shell-protocol.obj `if test -f 'protocol/xdg-shell-protocol.c'; then $(CYGPATH_W) 'protocol/xdg-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/xdg-shell-protocol.c'; fi` protocol/weston_simple_shm-fullscreen-shell-protocol.o: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_shm-fullscreen-shell-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Tpo -c -o protocol/weston_simple_shm-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_simple_shm-fullscreen-shell-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_shm-fullscreen-shell-protocol.o `test -f 'protocol/fullscreen-shell-protocol.c' || echo '$(srcdir)/'`protocol/fullscreen-shell-protocol.c protocol/weston_simple_shm-fullscreen-shell-protocol.obj: protocol/fullscreen-shell-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_shm-fullscreen-shell-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Tpo -c -o protocol/weston_simple_shm-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Tpo protocol/$(DEPDIR)/weston_simple_shm-fullscreen-shell-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/fullscreen-shell-protocol.c' object='protocol/weston_simple_shm-fullscreen-shell-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_shm-fullscreen-shell-protocol.obj `if test -f 'protocol/fullscreen-shell-protocol.c'; then $(CYGPATH_W) 'protocol/fullscreen-shell-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/fullscreen-shell-protocol.c'; fi` protocol/weston_simple_shm-ivi-application-protocol.o: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_shm-ivi-application-protocol.o -MD -MP -MF protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Tpo -c -o protocol/weston_simple_shm-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Tpo protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/weston_simple_shm-ivi-application-protocol.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_shm-ivi-application-protocol.o `test -f 'protocol/ivi-application-protocol.c' || echo '$(srcdir)/'`protocol/ivi-application-protocol.c protocol/weston_simple_shm-ivi-application-protocol.obj: protocol/ivi-application-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -MT protocol/weston_simple_shm-ivi-application-protocol.obj -MD -MP -MF protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Tpo -c -o protocol/weston_simple_shm-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Tpo protocol/$(DEPDIR)/weston_simple_shm-ivi-application-protocol.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='protocol/ivi-application-protocol.c' object='protocol/weston_simple_shm-ivi-application-protocol.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_shm_CFLAGS) $(CFLAGS) -c -o protocol/weston_simple_shm-ivi-application-protocol.obj `if test -f 'protocol/ivi-application-protocol.c'; then $(CYGPATH_W) 'protocol/ivi-application-protocol.c'; else $(CYGPATH_W) '$(srcdir)/protocol/ivi-application-protocol.c'; fi` clients/weston_simple_touch-simple-touch.o: clients/simple-touch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_touch_CFLAGS) $(CFLAGS) -MT clients/weston_simple_touch-simple-touch.o -MD -MP -MF clients/$(DEPDIR)/weston_simple_touch-simple-touch.Tpo -c -o clients/weston_simple_touch-simple-touch.o `test -f 'clients/simple-touch.c' || echo '$(srcdir)/'`clients/simple-touch.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_touch-simple-touch.Tpo clients/$(DEPDIR)/weston_simple_touch-simple-touch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-touch.c' object='clients/weston_simple_touch-simple-touch.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_touch_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_touch-simple-touch.o `test -f 'clients/simple-touch.c' || echo '$(srcdir)/'`clients/simple-touch.c clients/weston_simple_touch-simple-touch.obj: clients/simple-touch.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_touch_CFLAGS) $(CFLAGS) -MT clients/weston_simple_touch-simple-touch.obj -MD -MP -MF clients/$(DEPDIR)/weston_simple_touch-simple-touch.Tpo -c -o clients/weston_simple_touch-simple-touch.obj `if test -f 'clients/simple-touch.c'; then $(CYGPATH_W) 'clients/simple-touch.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-touch.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_simple_touch-simple-touch.Tpo clients/$(DEPDIR)/weston_simple_touch-simple-touch.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/simple-touch.c' object='clients/weston_simple_touch-simple-touch.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_simple_touch_CFLAGS) $(CFLAGS) -c -o clients/weston_simple_touch-simple-touch.obj `if test -f 'clients/simple-touch.c'; then $(CYGPATH_W) 'clients/simple-touch.c'; else $(CYGPATH_W) '$(srcdir)/clients/simple-touch.c'; fi` clients/weston_smoke-smoke.o: clients/smoke.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_smoke_CFLAGS) $(CFLAGS) -MT clients/weston_smoke-smoke.o -MD -MP -MF clients/$(DEPDIR)/weston_smoke-smoke.Tpo -c -o clients/weston_smoke-smoke.o `test -f 'clients/smoke.c' || echo '$(srcdir)/'`clients/smoke.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_smoke-smoke.Tpo clients/$(DEPDIR)/weston_smoke-smoke.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/smoke.c' object='clients/weston_smoke-smoke.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_smoke_CFLAGS) $(CFLAGS) -c -o clients/weston_smoke-smoke.o `test -f 'clients/smoke.c' || echo '$(srcdir)/'`clients/smoke.c clients/weston_smoke-smoke.obj: clients/smoke.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_smoke_CFLAGS) $(CFLAGS) -MT clients/weston_smoke-smoke.obj -MD -MP -MF clients/$(DEPDIR)/weston_smoke-smoke.Tpo -c -o clients/weston_smoke-smoke.obj `if test -f 'clients/smoke.c'; then $(CYGPATH_W) 'clients/smoke.c'; else $(CYGPATH_W) '$(srcdir)/clients/smoke.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_smoke-smoke.Tpo clients/$(DEPDIR)/weston_smoke-smoke.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/smoke.c' object='clients/weston_smoke-smoke.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_smoke_CFLAGS) $(CFLAGS) -c -o clients/weston_smoke-smoke.obj `if test -f 'clients/smoke.c'; then $(CYGPATH_W) 'clients/smoke.c'; else $(CYGPATH_W) '$(srcdir)/clients/smoke.c'; fi` clients/weston_stacking-stacking.o: clients/stacking.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_stacking_CFLAGS) $(CFLAGS) -MT clients/weston_stacking-stacking.o -MD -MP -MF clients/$(DEPDIR)/weston_stacking-stacking.Tpo -c -o clients/weston_stacking-stacking.o `test -f 'clients/stacking.c' || echo '$(srcdir)/'`clients/stacking.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_stacking-stacking.Tpo clients/$(DEPDIR)/weston_stacking-stacking.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/stacking.c' object='clients/weston_stacking-stacking.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_stacking_CFLAGS) $(CFLAGS) -c -o clients/weston_stacking-stacking.o `test -f 'clients/stacking.c' || echo '$(srcdir)/'`clients/stacking.c clients/weston_stacking-stacking.obj: clients/stacking.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_stacking_CFLAGS) $(CFLAGS) -MT clients/weston_stacking-stacking.obj -MD -MP -MF clients/$(DEPDIR)/weston_stacking-stacking.Tpo -c -o clients/weston_stacking-stacking.obj `if test -f 'clients/stacking.c'; then $(CYGPATH_W) 'clients/stacking.c'; else $(CYGPATH_W) '$(srcdir)/clients/stacking.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_stacking-stacking.Tpo clients/$(DEPDIR)/weston_stacking-stacking.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/stacking.c' object='clients/weston_stacking-stacking.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_stacking_CFLAGS) $(CFLAGS) -c -o clients/weston_stacking-stacking.obj `if test -f 'clients/stacking.c'; then $(CYGPATH_W) 'clients/stacking.c'; else $(CYGPATH_W) '$(srcdir)/clients/stacking.c'; fi` clients/weston_subsurfaces-subsurfaces.o: clients/subsurfaces.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_subsurfaces_CFLAGS) $(CFLAGS) -MT clients/weston_subsurfaces-subsurfaces.o -MD -MP -MF clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Tpo -c -o clients/weston_subsurfaces-subsurfaces.o `test -f 'clients/subsurfaces.c' || echo '$(srcdir)/'`clients/subsurfaces.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Tpo clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/subsurfaces.c' object='clients/weston_subsurfaces-subsurfaces.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_subsurfaces_CFLAGS) $(CFLAGS) -c -o clients/weston_subsurfaces-subsurfaces.o `test -f 'clients/subsurfaces.c' || echo '$(srcdir)/'`clients/subsurfaces.c clients/weston_subsurfaces-subsurfaces.obj: clients/subsurfaces.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_subsurfaces_CFLAGS) $(CFLAGS) -MT clients/weston_subsurfaces-subsurfaces.obj -MD -MP -MF clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Tpo -c -o clients/weston_subsurfaces-subsurfaces.obj `if test -f 'clients/subsurfaces.c'; then $(CYGPATH_W) 'clients/subsurfaces.c'; else $(CYGPATH_W) '$(srcdir)/clients/subsurfaces.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Tpo clients/$(DEPDIR)/weston_subsurfaces-subsurfaces.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/subsurfaces.c' object='clients/weston_subsurfaces-subsurfaces.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_subsurfaces_CFLAGS) $(CFLAGS) -c -o clients/weston_subsurfaces-subsurfaces.obj `if test -f 'clients/subsurfaces.c'; then $(CYGPATH_W) 'clients/subsurfaces.c'; else $(CYGPATH_W) '$(srcdir)/clients/subsurfaces.c'; fi` clients/weston_terminal-terminal.o: clients/terminal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_terminal_CFLAGS) $(CFLAGS) -MT clients/weston_terminal-terminal.o -MD -MP -MF clients/$(DEPDIR)/weston_terminal-terminal.Tpo -c -o clients/weston_terminal-terminal.o `test -f 'clients/terminal.c' || echo '$(srcdir)/'`clients/terminal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_terminal-terminal.Tpo clients/$(DEPDIR)/weston_terminal-terminal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/terminal.c' object='clients/weston_terminal-terminal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_terminal_CFLAGS) $(CFLAGS) -c -o clients/weston_terminal-terminal.o `test -f 'clients/terminal.c' || echo '$(srcdir)/'`clients/terminal.c clients/weston_terminal-terminal.obj: clients/terminal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_terminal_CFLAGS) $(CFLAGS) -MT clients/weston_terminal-terminal.obj -MD -MP -MF clients/$(DEPDIR)/weston_terminal-terminal.Tpo -c -o clients/weston_terminal-terminal.obj `if test -f 'clients/terminal.c'; then $(CYGPATH_W) 'clients/terminal.c'; else $(CYGPATH_W) '$(srcdir)/clients/terminal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_terminal-terminal.Tpo clients/$(DEPDIR)/weston_terminal-terminal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/terminal.c' object='clients/weston_terminal-terminal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_terminal_CFLAGS) $(CFLAGS) -c -o clients/weston_terminal-terminal.obj `if test -f 'clients/terminal.c'; then $(CYGPATH_W) 'clients/terminal.c'; else $(CYGPATH_W) '$(srcdir)/clients/terminal.c'; fi` clients/weston_transformed-transformed.o: clients/transformed.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_transformed_CFLAGS) $(CFLAGS) -MT clients/weston_transformed-transformed.o -MD -MP -MF clients/$(DEPDIR)/weston_transformed-transformed.Tpo -c -o clients/weston_transformed-transformed.o `test -f 'clients/transformed.c' || echo '$(srcdir)/'`clients/transformed.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_transformed-transformed.Tpo clients/$(DEPDIR)/weston_transformed-transformed.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/transformed.c' object='clients/weston_transformed-transformed.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_transformed_CFLAGS) $(CFLAGS) -c -o clients/weston_transformed-transformed.o `test -f 'clients/transformed.c' || echo '$(srcdir)/'`clients/transformed.c clients/weston_transformed-transformed.obj: clients/transformed.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_transformed_CFLAGS) $(CFLAGS) -MT clients/weston_transformed-transformed.obj -MD -MP -MF clients/$(DEPDIR)/weston_transformed-transformed.Tpo -c -o clients/weston_transformed-transformed.obj `if test -f 'clients/transformed.c'; then $(CYGPATH_W) 'clients/transformed.c'; else $(CYGPATH_W) '$(srcdir)/clients/transformed.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) clients/$(DEPDIR)/weston_transformed-transformed.Tpo clients/$(DEPDIR)/weston_transformed-transformed.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='clients/transformed.c' object='clients/weston_transformed-transformed.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(weston_transformed_CFLAGS) $(CFLAGS) -c -o clients/weston_transformed-transformed.obj `if test -f 'clients/transformed.c'; then $(CYGPATH_W) 'clients/transformed.c'; else $(CYGPATH_W) '$(srcdir)/clients/transformed.c'; fi` tests/xwayland_test_weston-xwayland-test.o: tests/xwayland-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwayland_test_weston_CFLAGS) $(CFLAGS) -MT tests/xwayland_test_weston-xwayland-test.o -MD -MP -MF tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Tpo -c -o tests/xwayland_test_weston-xwayland-test.o `test -f 'tests/xwayland-test.c' || echo '$(srcdir)/'`tests/xwayland-test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Tpo tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/xwayland-test.c' object='tests/xwayland_test_weston-xwayland-test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwayland_test_weston_CFLAGS) $(CFLAGS) -c -o tests/xwayland_test_weston-xwayland-test.o `test -f 'tests/xwayland-test.c' || echo '$(srcdir)/'`tests/xwayland-test.c tests/xwayland_test_weston-xwayland-test.obj: tests/xwayland-test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwayland_test_weston_CFLAGS) $(CFLAGS) -MT tests/xwayland_test_weston-xwayland-test.obj -MD -MP -MF tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Tpo -c -o tests/xwayland_test_weston-xwayland-test.obj `if test -f 'tests/xwayland-test.c'; then $(CYGPATH_W) 'tests/xwayland-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/xwayland-test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Tpo tests/$(DEPDIR)/xwayland_test_weston-xwayland-test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tests/xwayland-test.c' object='tests/xwayland_test_weston-xwayland-test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xwayland_test_weston_CFLAGS) $(CFLAGS) -c -o tests/xwayland_test_weston-xwayland-test.obj `if test -f 'tests/xwayland-test.c'; then $(CYGPATH_W) 'tests/xwayland-test.c'; else $(CYGPATH_W) '$(srcdir)/tests/xwayland-test.c'; fi` tools/zunitc/test/zuctest-fixtures_test.o: tools/zunitc/test/fixtures_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -MT tools/zunitc/test/zuctest-fixtures_test.o -MD -MP -MF tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Tpo -c -o tools/zunitc/test/zuctest-fixtures_test.o `test -f 'tools/zunitc/test/fixtures_test.c' || echo '$(srcdir)/'`tools/zunitc/test/fixtures_test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Tpo tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/test/fixtures_test.c' object='tools/zunitc/test/zuctest-fixtures_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -c -o tools/zunitc/test/zuctest-fixtures_test.o `test -f 'tools/zunitc/test/fixtures_test.c' || echo '$(srcdir)/'`tools/zunitc/test/fixtures_test.c tools/zunitc/test/zuctest-fixtures_test.obj: tools/zunitc/test/fixtures_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -MT tools/zunitc/test/zuctest-fixtures_test.obj -MD -MP -MF tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Tpo -c -o tools/zunitc/test/zuctest-fixtures_test.obj `if test -f 'tools/zunitc/test/fixtures_test.c'; then $(CYGPATH_W) 'tools/zunitc/test/fixtures_test.c'; else $(CYGPATH_W) '$(srcdir)/tools/zunitc/test/fixtures_test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Tpo tools/zunitc/test/$(DEPDIR)/zuctest-fixtures_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/test/fixtures_test.c' object='tools/zunitc/test/zuctest-fixtures_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -c -o tools/zunitc/test/zuctest-fixtures_test.obj `if test -f 'tools/zunitc/test/fixtures_test.c'; then $(CYGPATH_W) 'tools/zunitc/test/fixtures_test.c'; else $(CYGPATH_W) '$(srcdir)/tools/zunitc/test/fixtures_test.c'; fi` tools/zunitc/test/zuctest-zunitc_test.o: tools/zunitc/test/zunitc_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -MT tools/zunitc/test/zuctest-zunitc_test.o -MD -MP -MF tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Tpo -c -o tools/zunitc/test/zuctest-zunitc_test.o `test -f 'tools/zunitc/test/zunitc_test.c' || echo '$(srcdir)/'`tools/zunitc/test/zunitc_test.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Tpo tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/test/zunitc_test.c' object='tools/zunitc/test/zuctest-zunitc_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -c -o tools/zunitc/test/zuctest-zunitc_test.o `test -f 'tools/zunitc/test/zunitc_test.c' || echo '$(srcdir)/'`tools/zunitc/test/zunitc_test.c tools/zunitc/test/zuctest-zunitc_test.obj: tools/zunitc/test/zunitc_test.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -MT tools/zunitc/test/zuctest-zunitc_test.obj -MD -MP -MF tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Tpo -c -o tools/zunitc/test/zuctest-zunitc_test.obj `if test -f 'tools/zunitc/test/zunitc_test.c'; then $(CYGPATH_W) 'tools/zunitc/test/zunitc_test.c'; else $(CYGPATH_W) '$(srcdir)/tools/zunitc/test/zunitc_test.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Tpo tools/zunitc/test/$(DEPDIR)/zuctest-zunitc_test.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tools/zunitc/test/zunitc_test.c' object='tools/zunitc/test/zuctest-zunitc_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(zuctest_CFLAGS) $(CFLAGS) -c -o tools/zunitc/test/zuctest-zunitc_test.obj `if test -f 'tools/zunitc/test/zunitc_test.c'; then $(CYGPATH_W) 'tools/zunitc/test/zunitc_test.c'; else $(CYGPATH_W) '$(srcdir)/tools/zunitc/test/zunitc_test.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf clients/.libs clients/_libs -rm -rf desktop-shell/.libs desktop-shell/_libs -rm -rf fullscreen-shell/.libs fullscreen-shell/_libs -rm -rf ivi-shell/.libs ivi-shell/_libs -rm -rf protocol/.libs protocol/_libs -rm -rf shared/.libs shared/_libs -rm -rf src/.libs src/_libs -rm -rf tests/.libs tests/_libs -rm -rf tools/zunitc/src/.libs tools/zunitc/src/_libs -rm -rf xwayland/.libs xwayland/_libs distclean-libtool: -rm -f libtool config.lt install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man7: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-dist_wayland_sessionDATA: $(dist_wayland_session_DATA) @$(NORMAL_INSTALL) @list='$(dist_wayland_session_DATA)'; test -n "$(wayland_sessiondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(wayland_sessiondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(wayland_sessiondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(wayland_sessiondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(wayland_sessiondir)" || exit $$?; \ done uninstall-dist_wayland_sessionDATA: @$(NORMAL_UNINSTALL) @list='$(dist_wayland_session_DATA)'; test -n "$(wayland_sessiondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(wayland_sessiondir)'; $(am__uninstall_files_from_dir) install-dist_westondataDATA: $(dist_westondata_DATA) @$(NORMAL_INSTALL) @list='$(dist_westondata_DATA)'; test -n "$(westondatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(westondatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(westondatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(westondatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(westondatadir)" || exit $$?; \ done uninstall-dist_westondataDATA: @$(NORMAL_UNINSTALL) @list='$(dist_westondata_DATA)'; test -n "$(westondatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(westondatadir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-westonincludeHEADERS: $(westoninclude_HEADERS) @$(NORMAL_INSTALL) @list='$(westoninclude_HEADERS)'; test -n "$(westonincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(westonincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(westonincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(westonincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(westonincludedir)" || exit $$?; \ done uninstall-westonincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(westoninclude_HEADERS)'; test -n "$(westonincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(westonincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? config-parser.test.log: config-parser.test$(EXEEXT) @p='config-parser.test$(EXEEXT)'; \ b='config-parser.test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) vertex-clip.test.log: vertex-clip.test$(EXEEXT) @p='vertex-clip.test$(EXEEXT)'; \ b='vertex-clip.test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) zuctest.log: zuctest$(EXEEXT) @p='zuctest$(EXEEXT)'; \ b='zuctest'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .la.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(LA_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LA_LOG_DRIVER_FLAGS) $(LA_LOG_DRIVER_FLAGS) -- $(LA_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.la$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(LA_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_LA_LOG_DRIVER_FLAGS) $(LA_LOG_DRIVER_FLAGS) -- $(LA_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) .weston.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(WESTON_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_WESTON_LOG_DRIVER_FLAGS) $(WESTON_LOG_DRIVER_FLAGS) -- $(WESTON_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.weston$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(WESTON_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_WESTON_LOG_DRIVER_FLAGS) $(WESTON_LOG_DRIVER_FLAGS) -- $(WESTON_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \ config.h all-local installdirs: for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(wayland_sessiondir)" "$(DESTDIR)$(westondatadir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(westonincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f clients/$(DEPDIR)/$(am__dirstamp) -rm -f clients/$(am__dirstamp) -rm -f desktop-shell/$(DEPDIR)/$(am__dirstamp) -rm -f desktop-shell/$(am__dirstamp) -rm -f fullscreen-shell/$(DEPDIR)/$(am__dirstamp) -rm -f fullscreen-shell/$(am__dirstamp) -rm -f ivi-shell/$(DEPDIR)/$(am__dirstamp) -rm -f ivi-shell/$(am__dirstamp) -rm -f protocol/$(DEPDIR)/$(am__dirstamp) -rm -f protocol/$(am__dirstamp) -rm -f shared/$(DEPDIR)/$(am__dirstamp) -rm -f shared/$(am__dirstamp) -rm -f src/$(DEPDIR)/$(am__dirstamp) -rm -f src/$(am__dirstamp) -rm -f tests/$(DEPDIR)/$(am__dirstamp) -rm -f tests/$(am__dirstamp) -rm -f tools/zunitc/src/$(DEPDIR)/$(am__dirstamp) -rm -f tools/zunitc/src/$(am__dirstamp) -rm -f tools/zunitc/test/$(DEPDIR)/$(am__dirstamp) -rm -f tools/zunitc/test/$(am__dirstamp) -rm -f wcap/$(DEPDIR)/$(am__dirstamp) -rm -f wcap/$(am__dirstamp) -rm -f xwayland/$(DEPDIR)/$(am__dirstamp) -rm -f xwayland/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) @BUILD_WESTON_LAUNCH_FALSE@install-exec-hook: @ENABLE_SETUID_INSTALL_FALSE@install-exec-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ clean-libtool clean-local clean-moduleLTLIBRARIES \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf clients/$(DEPDIR) desktop-shell/$(DEPDIR) fullscreen-shell/$(DEPDIR) ivi-shell/$(DEPDIR) protocol/$(DEPDIR) shared/$(DEPDIR) src/$(DEPDIR) tests/$(DEPDIR) tools/zunitc/src/$(DEPDIR) tools/zunitc/test/$(DEPDIR) wcap/$(DEPDIR) xwayland/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_wayland_sessionDATA \ install-dist_westondataDATA install-man \ install-moduleLTLIBRARIES install-pkgconfigDATA \ install-westonincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-libexecPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-man5 install-man7 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf clients/$(DEPDIR) desktop-shell/$(DEPDIR) fullscreen-shell/$(DEPDIR) ivi-shell/$(DEPDIR) protocol/$(DEPDIR) shared/$(DEPDIR) src/$(DEPDIR) tests/$(DEPDIR) tools/zunitc/src/$(DEPDIR) tools/zunitc/test/$(DEPDIR) wcap/$(DEPDIR) xwayland/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_wayland_sessionDATA \ uninstall-dist_westondataDATA uninstall-libexecPROGRAMS \ uninstall-man uninstall-moduleLTLIBRARIES \ uninstall-pkgconfigDATA uninstall-westonincludeHEADERS uninstall-man: uninstall-man1 uninstall-man5 uninstall-man7 .MAKE: all check check-am install install-am install-exec-am \ install-strip .PHONY: CTAGS GTAGS TAGS all all-am all-local am--refresh check \ check-TESTS check-am clean clean-binPROGRAMS clean-cscope \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-moduleLTLIBRARIES clean-noinstLTLIBRARIES \ clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dist_wayland_sessionDATA install-dist_westondataDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-exec-hook install-html install-html-am install-info \ install-info-am install-libexecPROGRAMS install-man \ install-man1 install-man5 install-man7 \ install-moduleLTLIBRARIES install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ install-westonincludeHEADERS installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dist_wayland_sessionDATA \ uninstall-dist_westondataDATA uninstall-libexecPROGRAMS \ uninstall-man uninstall-man1 uninstall-man5 uninstall-man7 \ uninstall-moduleLTLIBRARIES uninstall-pkgconfigDATA \ uninstall-westonincludeHEADERS weston.ini : $(srcdir)/weston.ini.in $(AM_V_GEN)$(SED) \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ -e 's|@libexecdir[@]|$(libexecdir)|g' \ $< > $@ ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \ -e 's|@libexecdir[@]|$(libexecdir)|g' \ -e 's|@plugin_prefix[@]||g' \ $< > $@ tests/weston-ivi.ini : $(srcdir)/ivi-shell/weston.ini.in $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \ -e 's|@libexecdir[@]|$(abs_builddir)|g' \ -e 's|@plugin_prefix[@]|$(abs_top_builddir)/.libs/|g' \ $< > $@ all-local : weston.ini ivi-shell/weston.ini # Track this dependency explicitly instead of using BUILT_SOURCES. We # add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h # in case we're building from tarballs. src/compositor.c : $(top_builddir)/src/git-version.h @HAVE_GIT_REPO_TRUE@src/git-version.h : $(top_srcdir)/.git/logs/HEAD @HAVE_GIT_REPO_TRUE@ $(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@ @HAVE_GIT_REPO_FALSE@src/git-version.h : @HAVE_GIT_REPO_FALSE@ $(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@ .FORCE : @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@install-exec-hook: @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ can_suid_files=no; \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ chown root $(DESTDIR)$(bindir)/weston-launch \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ && chmod u+s $(DESTDIR)$(bindir)/weston-launch \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ && can_suid_files=yes;\ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ if test $$can_suid_files = no; then \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ echo 'Error: unable to unable to change ownership/setuid on weston-launch.'; \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ echo 'To skip this step, re-run ./configure using --disable-setuid-install'; \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ false; \ @BUILD_WESTON_LAUNCH_TRUE@@ENABLE_SETUID_INSTALL_TRUE@ fi $(ivi_tests) : $(builddir)/tests/weston-ivi.ini clean-local: -rm -rf logs -rm -rf $(DOCDIRS) # To remove when automake 1.11 support is dropped export abs_builddir all-local: zuctest$(EXEEXT) %.1 %.5 %.7 : man/%.man $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ @ENABLE_DEVDOCS_TRUE@docs/developer/html/index.html: doc/doxygen/tooldev.doxygen | docs/developer @ENABLE_DEVDOCS_TRUE@ cd doc/doxygen && $(DOXYGEN) tooldev.doxygen @ENABLE_DEVDOCS_TRUE@docs/tools/html/index.html: doc/doxygen/tools.doxygen | docs/tools @ENABLE_DEVDOCS_TRUE@ cd doc/doxygen && $(DOXYGEN) tools.doxygen $(DOCDIRS): $(MKDIR_P) $@ .PHONY: doc $(DOXYGEN_INDICES) doc: $(DOXYGEN_INDICES) protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@ protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@ protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: weston-1.9.0/README0000664000175000017500000001314312552265076010657 00000000000000 Weston ====== Weston is the reference implementation of a Wayland compositor, and a useful compositor in its own right. Weston has various backends that lets it run on Linux kernel modesetting and evdev input as well as under X11. Weston ships with a few example clients, from simple clients that demonstrate certain aspects of the protocol to more complete clients and a simplistic toolkit. There is also a quite capable terminal emulator (weston-terminal) and an toy/example desktop shell. Finally, weston also provides integration with the Xorg server and can pull X clients into the Wayland desktop and act as a X window manager. Refer to http://wayland.freedesktop.org/building.html for building weston and its dependencies. The test suite can be invoked via `make check`; see http://wayland.freedesktop.org/testing.html for additional details. Developer documentation can be built via `make doc`. Output will be in the build root under docs/developer/html/index.html docs/tools/html/index.html Libweston ========= Libweston is an effort to separate the re-usable parts of Weston into a library. Libweston provides most of the boring and tedious bits of correctly implementing core Wayland protocols and interfacing with input and output systems, so that people who just want to write a new "Wayland window manager" (WM) or a small desktop environment (DE) can focus on the WM part. Libweston was first introduced in Weston 1.9, and is expected to continue evolving through many Weston releases before it achieves a stable API and feature completeness. API (in)stability and parallel installability --------------------------------------------- As libweston's API surface is huge, it is impossible to get it right in one go. Therefore developers reserve the right to break the API between every 1.x.0 Weston release (minor version bumps), just like Weston's plugin API does. For git snapshots of the master branch, the API can break any time without warning or version bump. Libweston API or ABI will not be broken between Weston's stable releases 1.x.0 and 1.x.y, where y < 90. To make things tolerable for libweston users despite ABI breakages, libweston is designed to be perfectly parallel-installable. An ABI-version is defined for libweston, and it is bumped for releases as needed. Different ABI-versions of libweston can be installed in parallel, so that external projects can easily depend on a particular ABI-version, and they do not have to fight over which ABI-version is installed in a user's system. This allows a user to install many different compositors each requiring a different libweston ABI-version without tricks or conflicts. Note, that versions of Weston itself will not be parallel-installable, only libweston is. For more information about parallel installability, see http://ometer.com/parallel.html Libweston design goals ---------------------- The high-level goal of libweston is that what used to be shell plugins will be main executables. Instead of launching 'weston' with various arguments to choose the shell, one would be launching 'weston-desktop', 'weston-ivi', 'orbital', etc. The main executable (the hosting program) links to libweston for a fundamental compositor implementation. Libweston is also intended for use by other projects who want to create new "Wayland WMs". The libweston API/ABI will be separating the shell logic and main program from the rest of the "Weston compositor" (libweston internals). Details: - All configuration and user interfaces will be outside of libweston. This includes command line parsing, configuration files, and runtime (graphical) UI. - The hosting program (main executable) will be in full control of all libweston options. Libweston should not have user settable options that would work behind the hosting program's back, except perhaps debugging features and such. - Signal handling will be outside of libweston. - Child process execution and management will be outside of libweston. - The different backends (drm, fbdev, x11, etc) will be an internal detail of libweston. Libweston will not support third party backends. However, hosting programs need to handle backend-specific configuration due to differences in behaviour and available features. - Renderers will be libweston internal details too, though again the hosting program may affect the choice of renderer if the backend allows, and maybe set renderer-specific options. - plugin design ??? - xwayland ??? There are still many more details to be decided. For packagers ------------- Always build Weston with --with-cairo=image. The Weston project is (will be) intended to be split into several binary packages, each with its own dependencies. The maximal split would be roughly like this: - libweston (minimal dependencies): + headless backend + wayland backend - gl-renderer (depends on GL libs etc.) - drm-backend (depends on libdrm, libgbm, libudev, libinput, ...) - x11-backend (depends of X11/xcb libs) - xwayland (depends on X11/xcb libs) - rpi-backend (depends on DispmanX, libudev, ...) - fbdev-backend (depends on libudev...) - rdp-backend (depends on freerdp) + screen-share - weston (the executable, not parallel-installable): + desktop shell + ivi-shell + fullscreen shell + weston-info, weston-terminal, etc. we install by default - weston demos (not parallel-installable) + weston-simple-* programs + possibly all the programs we build but do not install by default - and possibly more... Everything should be parallel-installable across libweston ABI-versions, except those explicitly mentioned. Weston's build may not sanely allow this yet, but this is the intention. weston-1.9.0/m4/0000775000175000017500000000000012600133270010355 500000000000000weston-1.9.0/m4/libtool.m40000644000175000017500000106011112563437574012227 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS weston-1.9.0/m4/ltversion.m40000644000175000017500000000126212563437574012611 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) weston-1.9.0/m4/lt~obsolete.m40000644000175000017500000001375612563437574013151 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) weston-1.9.0/m4/ltsugar.m40000644000175000017500000001042412563437574012245 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) weston-1.9.0/m4/ltoptions.m40000644000175000017500000003007312563437574012621 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) weston-1.9.0/configure.ac0000664000175000017500000005673112600125276012266 00000000000000m4_define([weston_major_version], [1]) m4_define([weston_minor_version], [9]) m4_define([weston_micro_version], [0]) m4_define([weston_version], [weston_major_version.weston_minor_version.weston_micro_version]) AC_PREREQ([2.64]) AC_INIT([weston], [weston_version], [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=weston_version], [weston], [http://wayland.freedesktop.org]) AC_SUBST([WESTON_VERSION_MAJOR], [weston_major_version]) AC_SUBST([WESTON_VERSION_MINOR], [weston_minor_version]) AC_SUBST([WESTON_VERSION_MICRO], [weston_micro_version]) AC_SUBST([WESTON_VERSION], [weston_version]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AM_INIT_AUTOMAKE([1.11 parallel-tests foreign no-dist-gzip dist-xz color-tests subdir-objects]) AM_SILENT_RULES([yes]) # Check for programs AC_PROG_CC AC_PROG_SED # Initialize libtool LT_PREREQ([2.2]) LT_INIT([disable-static]) AC_ARG_VAR([WESTON_NATIVE_BACKEND], [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@]) AC_ARG_VAR([WESTON_SHELL_CLIENT], [Set the default desktop shell client to load if none is specified in weston.ini. @<:@default=weston-desktop-shell@:>@]) PKG_PROG_PKG_CONFIG() AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) AC_SUBST(DLOPEN_LIBS) AC_CHECK_DECL(SFD_CLOEXEC,[], [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")], [[#include ]]) AC_CHECK_DECL(TFD_CLOEXEC,[], [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile weston")], [[#include ]]) AC_CHECK_DECL(CLOCK_MONOTONIC,[], [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile weston")], [[#include ]]) AC_CHECK_HEADERS([execinfo.h]) AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate]) COMPOSITOR_MODULES="wayland-server >= 1.9.0 pixman-1 >= 0.25.2" AC_CONFIG_FILES([doc/doxygen/tools.doxygen doc/doxygen/tooldev.doxygen]) AC_ARG_ENABLE(devdocs, AS_HELP_STRING([--disable-devdocs], [do not enable building of developer documentation]),, enable_devdocs=auto) if test "x$enable_devdocs" != "xno"; then AC_CHECK_PROGS([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x" -a "x$enable_devdocs" = "xyes"; then AC_MSG_ERROR([Developer documentation explicitly requested, but Doxygen couldn't be found]) fi if test "x$DOXYGEN" != "x"; then enable_devdocs=yes else enable_devdocs=no fi fi AM_CONDITIONAL(ENABLE_DEVDOCS, test "x$enable_devdocs" = "xyes") AC_ARG_ENABLE(egl, [ --disable-egl],, enable_egl=yes) AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes) if test x$enable_egl = xyes; then AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support]) PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2]) PKG_CHECK_MODULES([EGL_TESTS], [egl >= 7.10 glesv2 wayland-client wayland-egl]) PKG_CHECK_MODULES([GL_RENDERER], [libdrm]) fi AC_ARG_ENABLE(xkbcommon, AS_HELP_STRING([--disable-xkbcommon], [Disable libxkbcommon support: This is only useful in environments where you do not have a hardware keyboard. If libxkbcommon support is disabled clients will not be sent a keymap and and must know how to interpret the keycode sent for any key event.]),, enable_xkbcommon=yes) if test x$enable_xkbcommon = xyes; then AC_DEFINE(ENABLE_XKBCOMMON, [1], [Build Weston with libxkbcommon support]) COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0" fi AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],, enable_setuid_install=yes) AM_CONDITIONAL(ENABLE_SETUID_INSTALL, test x$enable_setuid_install = xyes) AC_ARG_ENABLE(xwayland, [ --enable-xwayland],, enable_xwayland=yes) AC_ARG_ENABLE(xwayland-test, [ --enable-xwayland-test],, enable_xwayland_test=yes) AM_CONDITIONAL(ENABLE_XWAYLAND, test x$enable_xwayland = xyes) AM_CONDITIONAL(ENABLE_XWAYLAND_TEST, test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes) if test x$enable_xwayland = xyes; then PKG_CHECK_MODULES([XWAYLAND], xcb xcb-xfixes xcb-composite xcursor cairo-xcb) AC_DEFINE([BUILD_XWAYLAND], [1], [Build the X server launcher]) AC_ARG_WITH(xserver-path, AS_HELP_STRING([--with-xserver-path=PATH], [Path to X server]), [XSERVER_PATH="$withval"], [XSERVER_PATH="/usr/bin/Xwayland"]) AC_SUBST([XSERVER_PATH]) if test x$enable_xwayland_test = xyes; then PKG_CHECK_MODULES([XWAYLAND_TEST], x11) fi fi PKG_CHECK_MODULES(LIBDRM, [libdrm], [AC_DEFINE(HAVE_LIBDRM, 1, [Define if libdrm is available]) have_libdrm=yes], have_libdrm=no) AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],, enable_x11_compositor=yes) AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes) if test x$enable_x11_compositor = xyes; then PKG_CHECK_MODULES([XCB], xcb) xcb_save_LIBS=$LIBS xcb_save_CFLAGS=$CFLAGS CFLAGS=$XCB_CFLAGS LIBS=$XCB_LIBS AC_CHECK_FUNCS([xcb_poll_for_queued_event]) LIBS=$xcb_save_LIBS CFLAGS=$xcb_save_CFLAGS X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm" PKG_CHECK_MODULES(X11_COMPOSITOR_XKB, [xcb-xkb], [have_xcb_xkb="yes"], [have_xcb_xkb="no"]) if test "x$have_xcb_xkb" = xyes; then # Most versions of XCB have totally broken XKB bindings, where the # events don't work. Make sure we can actually use them. xcb_xkb_save_CFLAGS=$CFLAGS CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS AC_CHECK_MEMBER([struct xcb_xkb_state_notify_event_t.xkbType], [], [have_xcb_xkb=no], [[#include ]]) CFLAGS=$xcb_xkb_save_CFLAGS fi if test "x$have_xcb_xkb" = xyes; then X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb" AC_DEFINE([HAVE_XCB_XKB], [1], [libxcb supports XKB protocol]) fi PKG_CHECK_MODULES(X11_COMPOSITOR, [$X11_COMPOSITOR_MODULES]) AC_DEFINE([BUILD_X11_COMPOSITOR], [1], [Build the X11 compositor]) fi AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],, enable_drm_compositor=yes) AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes) if test x$enable_drm_compositor = xyes; then AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor]) PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0]) PKG_CHECK_MODULES(DRM_COMPOSITOR_GBM, [gbm >= 10.2], [AC_DEFINE([HAVE_GBM_FD_IMPORT], 1, [gbm supports dmabuf import])], [AC_MSG_WARN([gbm does not support dmabuf import, will omit that capability])]) fi PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0]) PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES]) AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],, enable_wayland_compositor=yes) AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR, test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes) if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1], [Build the Wayland (nested) compositor]) PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client >= 1.5.91 wayland-egl wayland-cursor]) fi AC_ARG_ENABLE(headless-compositor, [ --enable-headless-compositor],, enable_headless_compositor=yes) AM_CONDITIONAL(ENABLE_HEADLESS_COMPOSITOR, test x$enable_headless_compositor = xyes) if test x$enable_headless_compositor = xyes; then AC_DEFINE([BUILD_HEADLESS_COMPOSITOR], [1], [Build the headless compositor]) fi AC_ARG_ENABLE(rpi-compositor, AS_HELP_STRING([--disable-rpi-compositor], [do not build the Raspberry Pi backend]),, enable_rpi_compositor=yes) AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes") have_bcm_host="no" if test "x$enable_rpi_compositor" = "xyes"; then AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi]) PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0]) PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host], [have_bcm_host="yes" AC_DEFINE([HAVE_BCM_HOST], [1], [have Raspberry Pi BCM headers])], [AC_MSG_WARN([Raspberry Pi BCM host libraries not found, will use stubs instead.])]) fi AM_CONDITIONAL(INSTALL_RPI_COMPOSITOR, test "x$have_bcm_host" = "xyes") AC_ARG_ENABLE([fbdev-compositor], [ --enable-fbdev-compositor],, enable_fbdev_compositor=yes) AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR], [test x$enable_fbdev_compositor = xyes]) AS_IF([test x$enable_fbdev_compositor = xyes], [ AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor]) PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0]) ]) AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],, enable_rdp_compositor=no) AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR], [test x$enable_rdp_compositor = xyes]) if test x$enable_rdp_compositor = xyes; then AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor]) PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0]) SAVED_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS" AC_CHECK_HEADERS([freerdp/version.h]) CPPFLAGS="$SAVED_CPPFLAGS" fi AC_ARG_ENABLE([screen-sharing], [ --enable-screen-sharing],, enable_screen_sharing=no) AM_CONDITIONAL([ENABLE_SCREEN_SHARING], [test x$enable_screen_sharing = xyes]) if test x$enable_screen_sharing = xyes; then PKG_CHECK_MODULES(SCREEN_SHARE, [wayland-client]) if test x$enable_rdp_compositor != xyes; then AC_MSG_WARN([The screen-share.so module requires the RDP backend.]) fi fi AC_ARG_WITH(cairo, AS_HELP_STRING([--with-cairo=@<:@image|gl|glesv2@:>@] [Which Cairo renderer to use for the clients]), [],[with_cairo="image"]) if test "x$with_cairo" = "ximage"; then cairo_modules="cairo" else if test "x$with_cairo" = "xgl"; then cairo_modules="cairo-gl" AC_MSG_WARN([The --with-cairo=gl option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs.]) else if test "x$with_cairo" = "xglesv2"; then cairo_modules="cairo-glesv2" AC_MSG_WARN([The --with-cairo=gles2 option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs.]) else AC_ERROR([Unknown cairo renderer requested]) fi fi fi # Included for legacy compat AC_ARG_WITH(cairo-glesv2, AS_HELP_STRING([--with-cairo-glesv2], [Use GLESv2 cairo])) if test "x$with_cairo_glesv2" = "xyes"; then cairo_modules="cairo-glesv2" with_cairo="glesv2" fi if test "x$cairo_modules" = "xcairo-glesv2"; then AC_DEFINE([USE_CAIRO_GLESV2], [1], [Use the GLESv2 GL cairo backend]) fi PKG_CHECK_MODULES(PIXMAN, [pixman-1]) PKG_CHECK_MODULES(PNG, [libpng]) PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no]) AS_IF([test "x$have_webp" = "xyes"], [AC_DEFINE([HAVE_WEBP], [1], [Have webp])]) AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],, enable_vaapi_recorder=auto) if test x$enable_vaapi_recorder != xno; then PKG_CHECK_MODULES(LIBVA, [libva >= 0.34.0 libva-drm >= 0.34.0], [have_libva=yes], [have_libva=no]) if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then AC_MSG_ERROR([vaapi-recorder explicitly enabled, but libva couldn't be found]) fi AS_IF([test "x$have_libva" = "xyes"], [AC_DEFINE([BUILD_VAAPI_RECORDER], [1], [Build the vaapi recorder])]) fi AM_CONDITIONAL(ENABLE_VAAPI_RECORDER, test "x$have_libva" = xyes) AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], have_jpeglib=yes) if test x$have_jpeglib = xyes; then JPEG_LIBS="-ljpeg" else AC_ERROR([libjpeg not found]) fi AC_SUBST(JPEG_LIBS) PKG_CHECK_MODULES(CAIRO, [cairo]) PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client >= 1.9.0]) AC_ARG_ENABLE(simple-clients, AS_HELP_STRING([--disable-simple-clients], [do not build the simple wl_shm clients]),, enable_simple_clients=yes) AM_CONDITIONAL(BUILD_SIMPLE_CLIENTS, test "x$enable_simple_clients" = "xyes") if test x$enable_simple_clients = xyes; then PKG_CHECK_MODULES(SIMPLE_CLIENT, [wayland-client]) fi AC_ARG_ENABLE(simple-egl-clients, AS_HELP_STRING([--disable-simple-egl-clients], [do not build the simple EGL clients]),, enable_simple_egl_clients="$enable_egl") AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes") if test x$enable_simple_egl_clients = xyes; then PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT, [egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor]) fi AC_ARG_ENABLE(simple-intel-dmabuf-client, AS_HELP_STRING([--disable-simple-intel-dmabuf-client], [do not build the simple intel dmabuf client]),, enable_simple_intel_dmabuf_client="auto") if ! test "x$enable_simple_intel_dmabuf_client" = "xno"; then PKG_CHECK_MODULES(SIMPLE_DMABUF_CLIENT, [wayland-client libdrm libdrm_intel], have_simple_dmabuf_client=yes, have_simple_dmabuf_client=no) if test "x$have_simple_dmabuf_client" = "xno" -a "x$enable_simple_intel_dmabuf_client" = "xyes"; then AC_MSG_ERROR([Intel dmabuf client explicitly enabled, but libdrm_intel couldn't be found]) fi enable_simple_intel_dmabuf_client="$have_simple_dmabuf_client" fi AM_CONDITIONAL(BUILD_SIMPLE_INTEL_DMABUF_CLIENT, test "x$enable_simple_intel_dmabuf_client" = "xyes") AC_ARG_ENABLE(clients, [ --enable-clients],, enable_clients=yes) AM_CONDITIONAL(BUILD_CLIENTS, test x$enable_clients = xyes) if test x$enable_clients = xyes; then AC_DEFINE([BUILD_CLIENTS], [1], [Build the Wayland clients]) PKG_CHECK_MODULES(CLIENT, [wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor]) PKG_CHECK_MODULES(SERVER, [wayland-server]) PKG_CHECK_MODULES(WESTON_INFO, [wayland-client >= 1.5.91]) # Only check for cairo-egl if a GL or GLES renderer requested AS_IF([test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"], [ PKG_CHECK_MODULES(CAIRO_EGL, [wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules], [have_cairo_egl=yes], [have_cairo_egl=no]) AS_IF([test "x$have_cairo_egl" = "xyes"], [AC_DEFINE([HAVE_CAIRO_EGL], [1], [Have cairo-egl])], [AC_ERROR([cairo-egl not used because $CAIRO_EGL_PKG_ERRORS])])], [have_cairo_egl=no]) PKG_CHECK_MODULES(PANGO, [pangocairo], [have_pango=yes], [have_pango=no]) fi AC_ARG_ENABLE(resize-optimization, AS_HELP_STRING([--disable-resize-optimization], [disable resize optimization allocating a big buffer in toytoolkit]),, enable_resize_optimization=yes) AS_IF([test "x$enable_resize_optimization" = "xyes"], [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])]) PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login >= 198], [have_systemd_login=yes], [have_systemd_login=no]) AS_IF([test "x$have_systemd_login" = "xyes"], [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])]) AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes") PKG_CHECK_MODULES(SYSTEMD_LOGIN_209, [libsystemd-login >= 209], [have_systemd_login_209=yes], [have_systemd_login_209=no]) AS_IF([test "x$have_systemd_login_209" = "xyes"], [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])]) AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes) AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes) if test x$enable_weston_launch == xyes; then AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no]) if test x$have_pam == xno; then AC_ERROR([weston-launch requires pam]) fi PAM_LIBS=-lpam AC_SUBST(PAM_LIBS) fi AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes") AM_CONDITIONAL(HAVE_CAIRO_GLESV2, [test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"]) AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS, test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes") AM_CONDITIONAL(BUILD_SUBSURFACES_CLIENT, [test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"]) AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true) AC_ARG_ENABLE(fullscreen-shell, AS_HELP_STRING([--disable-fullscreen-shell], [do not build fullscreen-shell server plugin]),, enable_fullscreen_shell=yes) AM_CONDITIONAL(ENABLE_FULLSCREEN_SHELL, test "x$enable_fullscreen_shell" = "xyes") # CMS modules AC_ARG_ENABLE(colord, AS_HELP_STRING([--disable-colord], [do not build colord CMS support]),, enable_colord=auto) if test "x$enable_colord" != "xno"; then PKG_CHECK_MODULES(COLORD, colord >= 0.1.27, have_colord=yes, have_colord=no) if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then AC_MSG_ERROR([colord support explicitly requested, but colord couldn't be found]) fi if test "x$have_colord" = "xyes"; then enable_colord=yes fi fi AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes") # dbus support AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [do not build with dbus support]),, enable_dbus=auto) if test "x$enable_dbus" != "xno"; then PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.6, have_dbus=yes, have_dbus=no) if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then AC_MSG_ERROR([dbus support explicitly requested, but libdbus couldn't be found]) fi if test "x$have_dbus" = "xyes"; then enable_dbus=yes AC_DEFINE([HAVE_DBUS], [1], [Build with dbus support]) else enable_dbus=no fi fi AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes") # Note that other features might want libxml2, or this feature might use # alternative xml libraries at some point. Therefore the feature and # pre-requisite concepts are split. AC_ARG_ENABLE(junit_xml, AS_HELP_STRING([--disable-junit-xml], [do not build with JUnit XML output]),, enable_junit_xml=auto) if test "x$enable_junit_xml" != "xno"; then PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= 2.6], have_libxml2=yes, have_libxml2=no) if test "x$have_libxml2" = "xno" -a "x$enable_junit_xml" = "xyes"; then AC_MSG_ERROR([JUnit XML support explicitly requested, but libxml2 couldn't be found]) fi if test "x$have_libxml2" = "xyes"; then enable_junit_xml=yes AC_DEFINE(ENABLE_JUNIT_XML, [1], [Build Weston with JUnit output support]) else enable_junit_xml=no fi fi AM_CONDITIONAL(ENABLE_JUNIT_XML, test "x$enable_junit_xml" = "xyes") # ivi-shell support AC_ARG_ENABLE(ivi-shell, AS_HELP_STRING([--disable-ivi-shell], [do not build ivi-shell server plugin and client]),, enable_ivi_shell=yes) AM_CONDITIONAL(ENABLE_IVI_SHELL, test "x$enable_ivi_shell" = "xyes") AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes) AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes) if test x$enable_wcap_tools = xyes; then AC_DEFINE([BUILD_WCAP_TOOLS], [1], [Build the wcap tools]) PKG_CHECK_MODULES(WCAP, [cairo]) WCAP_LIBS="$WCAP_LIBS -lm" fi PKG_CHECK_MODULES(SETBACKLIGHT, [libudev libdrm], enable_setbacklight=yes, enable_setbacklight=no) AM_CONDITIONAL(BUILD_SETBACKLIGHT, test "x$enable_setbacklight" = "xyes") if test "x$GCC" = "xyes"; then GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \ -Wno-missing-field-initializers -g -fvisibility=hidden \ -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare" fi AC_SUBST(GCC_CFLAGS) AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--disable-libunwind], [Disable libunwind usage for backtraces]),, enable_libunwind=auto) AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes]) if test "x$enable_libunwind" != "xno"; then PKG_CHECK_MODULES(LIBUNWIND, libunwind, have_libunwind=yes, have_libunwind=no) if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then AC_MSG_ERROR([libunwind support explicitly requested, but libunwind couldn't be found]) fi if test "x$have_libunwind" = "xyes"; then enable_libunwind=yes AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support]) fi fi if test "x$WESTON_NATIVE_BACKEND" = "x"; then WESTON_NATIVE_BACKEND="drm-backend.so" fi AC_MSG_NOTICE([Weston's native backend: $WESTON_NATIVE_BACKEND]) AC_DEFINE_UNQUOTED([WESTON_NATIVE_BACKEND], ["$WESTON_NATIVE_BACKEND"], [The default backend to load, if not wayland nor x11.]) if test "x$WESTON_SHELL_CLIENT" = "x"; then WESTON_SHELL_CLIENT="weston-desktop-shell" fi AC_MSG_NOTICE([Weston's default desktop shell client: $WESTON_SHELL_CLIENT]) AC_DEFINE_UNQUOTED([WESTON_SHELL_CLIENT], ["$WESTON_SHELL_CLIENT"], [The default desktop shell client to load.]) AC_ARG_ENABLE(demo-clients-install, AS_HELP_STRING([--enable-demo-clients-install], [Install demo clients built with weston]),, enable_demo_clients_install=no) AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"]) PKG_CHECK_MODULES(LCMS, lcms2, [have_lcms=yes], [have_lcms=no]) if test "x$have_lcms" = xyes; then AC_DEFINE(HAVE_LCMS, 1, [Have lcms support]) fi AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes]) AC_PATH_PROG([wayland_scanner], [wayland-scanner]) if test x$wayland_scanner = x; then PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner]) wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` fi AC_CONFIG_FILES([Makefile src/version.h src/weston.pc]) AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD]) AC_OUTPUT AC_MSG_RESULT([ Native Backend ${WESTON_NATIVE_BACKEND} setuid Install ${enable_setuid_install} Cairo Renderer ${with_cairo} EGL ${enable_egl} libxkbcommon ${enable_xkbcommon} xcb_xkb ${have_xcb_xkb} XWayland ${enable_xwayland} dbus ${enable_dbus} ivi-shell ${enable_ivi_shell} Build wcap utility ${enable_wcap_tools} Build Fullscreen Shell ${enable_fullscreen_shell} Enable developer documentation ${enable_devdocs} weston-launch utility ${enable_weston_launch} systemd-login support ${have_systemd_login} DRM Compositor ${enable_drm_compositor} X11 Compositor ${enable_x11_compositor} Wayland Compositor ${enable_wayland_compositor} Headless Compositor ${enable_headless_compositor} RPI Compositor ${enable_rpi_compositor} FBDEV Compositor ${enable_fbdev_compositor} RDP Compositor ${enable_rdp_compositor} Screen Sharing ${enable_screen_sharing} JUnit XML output ${enable_junit_xml} Raspberry Pi BCM headers ${have_bcm_host} Build Clients ${enable_clients} Build EGL Clients ${have_cairo_egl} Build Simple Clients ${enable_simple_clients} Build Simple EGL Clients ${enable_simple_egl_clients} Install Demo Clients ${enable_demo_clients_install} Colord Support ${have_colord} LCMS2 Support ${have_lcms} libwebp Support ${have_webp} libunwind Support ${have_libunwind} VA H.264 encoding Support ${have_libva} ]) weston-1.9.0/wcap/0000775000175000017500000000000012600133270010767 500000000000000weston-1.9.0/wcap/wcap-decode.c0000664000175000017500000000763712537627703013265 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "wcap-decode.h" static void wcap_decoder_decode_rectangle(struct wcap_decoder *decoder, struct wcap_rectangle *rect) { uint32_t v, *p = decoder->p, *d; int width = rect->x2 - rect->x1, height = rect->y2 - rect->y1; int x, i, j, k, l, count = width * height; unsigned char r, g, b, dr, dg, db; d = decoder->frame + (rect->y2 - 1) * decoder->width; x = rect->x1; i = 0; while (i < count) { v = *p++; l = v >> 24; if (l < 0xe0) { j = l + 1; } else { j = 1 << (l - 0xe0 + 7); } dr = (v >> 16); dg = (v >> 8); db = (v >> 0); for (k = 0; k < j; k++) { r = (d[x] >> 16) + dr; g = (d[x] >> 8) + dg; b = (d[x] >> 0) + db; d[x] = 0xff000000 | (r << 16) | (g << 8) | b; x++; if (x == rect->x2) { x = rect->x1; d -= decoder->width; } } i += j; } if (i != count) printf("rle encoding longer than expected (%d expected %d)\n", i, count); decoder->p = p; } int wcap_decoder_get_frame(struct wcap_decoder *decoder) { struct wcap_rectangle *rects; struct wcap_frame_header *header; uint32_t i; if (decoder->p == decoder->end) return 0; header = decoder->p; decoder->msecs = header->msecs; decoder->count++; rects = (void *) (header + 1); decoder->p = (uint32_t *) (rects + header->nrects); for (i = 0; i < header->nrects; i++) wcap_decoder_decode_rectangle(decoder, &rects[i]); return 1; } struct wcap_decoder * wcap_decoder_create(const char *filename) { struct wcap_decoder *decoder; struct wcap_header *header; int frame_size; struct stat buf; decoder = malloc(sizeof *decoder); if (decoder == NULL) return NULL; decoder->fd = open(filename, O_RDONLY); if (decoder->fd == -1) { free(decoder); return NULL; } fstat(decoder->fd, &buf); decoder->size = buf.st_size; decoder->map = mmap(NULL, decoder->size, PROT_READ, MAP_PRIVATE, decoder->fd, 0); if (decoder->map == MAP_FAILED) { fprintf(stderr, "mmap failed\n"); free(decoder); return NULL; } header = decoder->map; decoder->format = header->format; decoder->count = 0; decoder->width = header->width; decoder->height = header->height; decoder->p = header + 1; decoder->end = decoder->map + decoder->size; frame_size = header->width * header->height * 4; decoder->frame = malloc(frame_size); if (decoder->frame == NULL) { free(decoder); return NULL; } memset(decoder->frame, 0, frame_size); return decoder; } void wcap_decoder_destroy(struct wcap_decoder *decoder) { munmap(decoder->map, decoder->size); close(decoder->fd); free(decoder->frame); free(decoder); } weston-1.9.0/wcap/main.c0000664000175000017500000001700412575610240012011 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "wcap-decode.h" static void write_png(struct wcap_decoder *decoder, const char *filename) { cairo_surface_t *surface; surface = cairo_image_surface_create_for_data((unsigned char *) decoder->frame, CAIRO_FORMAT_ARGB32, decoder->width, decoder->height, decoder->width * 4); cairo_surface_write_to_png(surface, filename); cairo_surface_destroy(surface); } static inline int rgb_to_yuv(uint32_t format, uint32_t p, int *u, int *v) { int r, g, b, y; switch (format) { case WCAP_FORMAT_XRGB8888: r = (p >> 16) & 0xff; g = (p >> 8) & 0xff; b = (p >> 0) & 0xff; break; case WCAP_FORMAT_XBGR8888: r = (p >> 0) & 0xff; g = (p >> 8) & 0xff; b = (p >> 16) & 0xff; break; default: assert(0); } y = (19595 * r + 38469 * g + 7472 * b) >> 16; if (y > 255) y = 255; *u += 46727 * (r - y); *v += 36962 * (b - y); return y; } static inline int clamp_uv(int u) { int clamp = (u >> 18) + 128; if (clamp < 0) return 0; else if (clamp > 255) return 255; else return clamp; } static void convert_to_yv12(struct wcap_decoder *decoder, unsigned char *out) { unsigned char *y1, *y2, *u, *v; uint32_t *p1, *p2, *end; int i, u_accum, v_accum, stride0, stride1; uint32_t format = decoder->format; stride0 = decoder->width; stride1 = decoder->width / 2; for (i = 0; i < decoder->height; i += 2) { y1 = out + stride0 * i; y2 = y1 + stride0; v = out + stride0 * decoder->height + stride1 * i / 2; u = v + stride1 * decoder->height / 2; p1 = decoder->frame + decoder->width * i; p2 = p1 + decoder->width; end = p1 + decoder->width; while (p1 < end) { u_accum = 0; v_accum = 0; y1[0] = rgb_to_yuv(format, p1[0], &u_accum, &v_accum); y1[1] = rgb_to_yuv(format, p1[1], &u_accum, &v_accum); y2[0] = rgb_to_yuv(format, p2[0], &u_accum, &v_accum); y2[1] = rgb_to_yuv(format, p2[1], &u_accum, &v_accum); u[0] = clamp_uv(u_accum); v[0] = clamp_uv(v_accum); y1 += 2; p1 += 2; y2 += 2; p2 += 2; u++; v++; } } } static void convert_to_yuv444(struct wcap_decoder *decoder, unsigned char *out) { unsigned char *yp, *up, *vp; uint32_t *rp, *end; int u, v; int i, stride, psize; uint32_t format = decoder->format; stride = decoder->width; psize = stride * decoder->height; for (i = 0; i < decoder->height; i++) { yp = out + stride * i; up = yp + (psize * 2); vp = yp + (psize * 1); rp = decoder->frame + decoder->width * i; end = rp + decoder->width; while (rp < end) { u = 0; v = 0; yp[0] = rgb_to_yuv(format, rp[0], &u, &v); up[0] = clamp_uv(u/.3); vp[0] = clamp_uv(v/.3); up++; vp++; yp++; rp++; } } } static void output_yuv_frame(struct wcap_decoder *decoder, int depth) { static unsigned char *out; int size; if (depth == 444) { size = decoder->width * decoder->height * 3; } else { size = decoder->width * decoder->height * 3 / 2; } if (out == NULL) out = malloc(size); if (depth == 444) { convert_to_yuv444(decoder, out); } else { convert_to_yv12(decoder, out); } printf("FRAME\n"); fwrite(out, 1, size, stdout); } static void usage(int exit_code) { fprintf(stderr, "usage: wcap-decode " "[--help] [--yuv4mpeg2] [--frame=] [--all] \n" "\t[--rate=] \n\n" "\t--help\t\t\tthis help text\n" "\t--yuv4mpeg2\t\tdump wcap file to stdout in yuv4mpeg2 format\n" "\t--yuv4mpeg2-444\t\tdump wcap file to stdout in yuv4mpeg2 444 format\n" "\t--frame=\t\twrite out the given frame number as png\n" "\t--all\t\t\twrite all frames as pngs\n" "\t--rate=\treplay frame rate for yuv4mpeg2,\n" "\t\t\t\tspecified as an integer fraction\n\n"); exit(exit_code); } int main(int argc, char *argv[]) { struct wcap_decoder *decoder; int i, j, output_frame = -1, yuv4mpeg2 = 0, all = 0, has_frame; int num = 30, denom = 1; char filename[200]; char *mode; uint32_t msecs, frame_time; for (i = 1, j = 1; i < argc; i++) { if (strcmp(argv[i], "--yuv4mpeg2-444") == 0) { yuv4mpeg2 = 444; } else if (strcmp(argv[i], "--yuv4mpeg2") == 0) { yuv4mpeg2 = 420; } else if (strcmp(argv[i], "--help") == 0) { usage(EXIT_SUCCESS); } else if (strcmp(argv[i], "--all") == 0) { all = 1; } else if (sscanf(argv[i], "--frame=%d", &output_frame) == 1) { ; } else if (sscanf(argv[i], "--rate=%d", &num) == 1) { ; } else if (sscanf(argv[i], "--rate=%d:%d", &num, &denom) == 2) { ; } else if (strcmp(argv[i], "--") == 0) { break; } else if (argv[i][0] == '-') { fprintf(stderr, "unknown option or invalid argument: %s\n", argv[i]); usage(EXIT_FAILURE); } else { argv[j++] = argv[i]; } } argc = j; if (argc != 2) usage(EXIT_FAILURE); if (denom == 0) { fprintf(stderr, "invalid rate, denom can not be 0\n"); exit(EXIT_FAILURE); } decoder = wcap_decoder_create(argv[1]); if (decoder == NULL) { fprintf(stderr, "Creating wcap decoder failed\n"); exit(EXIT_FAILURE); } if (yuv4mpeg2 && isatty(1)) { fprintf(stderr, "Not dumping yuv4mpeg2 data to terminal. Pipe output to a file or a process.\n"); fprintf(stderr, "For example, to encode to webm, use something like\n\n"); fprintf(stderr, "\t$ wcap-decode --yuv4mpeg2 ../capture.wcap |\n" "\t\tvpxenc --target-bitrate=1024 --best -t 4 -o foo.webm -\n\n"); exit(EXIT_FAILURE); } if (yuv4mpeg2) { if (yuv4mpeg2 == 444) { mode = "C444"; } else { mode = "C420jpeg"; } printf("YUV4MPEG2 %s W%d H%d F%d:%d Ip A0:0\n", mode, decoder->width, decoder->height, num, denom); fflush(stdout); } i = 0; has_frame = wcap_decoder_get_frame(decoder); msecs = decoder->msecs; frame_time = 1000 * denom / num; while (has_frame) { if (all || i == output_frame) { snprintf(filename, sizeof filename, "wcap-frame-%d.png", i); write_png(decoder, filename); fprintf(stderr, "wrote %s\n", filename); } if (yuv4mpeg2) output_yuv_frame(decoder, yuv4mpeg2); i++; msecs += frame_time; while (decoder->msecs < msecs && has_frame) has_frame = wcap_decoder_get_frame(decoder); } fprintf(stderr, "wcap file: size %dx%d, %d frames\n", decoder->width, decoder->height, i); wcap_decoder_destroy(decoder); return EXIT_SUCCESS; } weston-1.9.0/wcap/wcap-decode.h0000664000175000017500000000364712537627703013267 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WCAP_DECODE_ #define _WCAP_DECODE_ #define WCAP_HEADER_MAGIC 0x57434150 #define WCAP_FORMAT_XRGB8888 0x34325258 #define WCAP_FORMAT_XBGR8888 0x34324258 #define WCAP_FORMAT_RGBX8888 0x34325852 #define WCAP_FORMAT_BGRX8888 0x34325842 struct wcap_header { uint32_t magic; uint32_t format; uint32_t width, height; }; struct wcap_frame_header { uint32_t msecs; uint32_t nrects; }; struct wcap_rectangle { int32_t x1, y1, x2, y2; }; struct wcap_decoder { int fd; size_t size; void *map, *p, *end; uint32_t *frame; uint32_t format; uint32_t msecs; uint32_t count; int width, height; }; int wcap_decoder_get_frame(struct wcap_decoder *decoder); struct wcap_decoder *wcap_decoder_create(const char *filename); void wcap_decoder_destroy(struct wcap_decoder *decoder); #endif weston-1.9.0/Makefile.am0000664000175000017500000011527212563431500012026 00000000000000ACLOCAL_AMFLAGS = -I m4 bin_PROGRAMS = noinst_PROGRAMS = libexec_PROGRAMS = moduledir = $(libdir)/weston module_LTLIBRARIES = noinst_LTLIBRARIES = BUILT_SOURCES = AM_DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install EXTRA_DIST = weston.ini.in ivi-shell/weston.ini.in weston.ini : $(srcdir)/weston.ini.in $(AM_V_GEN)$(SED) \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ -e 's|@libexecdir[@]|$(libexecdir)|g' \ $< > $@ ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \ -e 's|@libexecdir[@]|$(libexecdir)|g' \ -e 's|@plugin_prefix[@]||g' \ $< > $@ tests/weston-ivi.ini : $(srcdir)/ivi-shell/weston.ini.in $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \ -e 's|@bindir[@]|$(bindir)|g' \ -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \ -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \ -e 's|@libexecdir[@]|$(abs_builddir)|g' \ -e 's|@plugin_prefix[@]|$(abs_top_builddir)/.libs/|g' \ $< > $@ all-local : weston.ini ivi-shell/weston.ini AM_CFLAGS = $(GCC_CFLAGS) AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -I$(top_builddir)/clients \ -I$(top_builddir)/tests \ -I$(top_srcdir)/shared \ -I$(top_builddir)/protocol \ -DDATADIR='"$(datadir)"' \ -DMODULEDIR='"$(moduledir)"' \ -DLIBEXECDIR='"$(libexecdir)"' \ -DBINDIR='"$(bindir)"' CLEANFILES = weston.ini \ ivi-shell/weston.ini \ tests/weston-ivi.ini \ internal-screenshot-00.png \ $(BUILT_SOURCES) bin_PROGRAMS += weston weston_LDFLAGS = -export-dynamic weston_CPPFLAGS = $(AM_CPPFLAGS) -DIN_WESTON weston_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LIBUNWIND_CFLAGS) weston_LDADD = $(COMPOSITOR_LIBS) $(LIBUNWIND_LIBS) \ $(DLOPEN_LIBS) -lm libshared.la weston_SOURCES = \ src/git-version.h \ src/log.c \ src/compositor.c \ src/compositor.h \ src/input.c \ src/data-device.c \ src/screenshooter.c \ src/clipboard.c \ src/zoom.c \ src/text-backend.c \ src/bindings.c \ src/animation.c \ src/noop-renderer.c \ src/pixman-renderer.c \ src/pixman-renderer.h \ src/timeline.c \ src/timeline.h \ src/timeline-object.h \ src/main.c \ src/linux-dmabuf.c \ src/linux-dmabuf.h \ shared/helpers.h \ shared/matrix.c \ shared/matrix.h \ shared/timespec-util.h \ shared/zalloc.h \ shared/platform.h \ src/weston-egl-ext.h nodist_weston_SOURCES = \ protocol/screenshooter-protocol.c \ protocol/screenshooter-server-protocol.h \ protocol/text-cursor-position-protocol.c \ protocol/text-cursor-position-server-protocol.h \ protocol/text-protocol.c \ protocol/text-server-protocol.h \ protocol/input-method-protocol.c \ protocol/input-method-server-protocol.h \ protocol/workspaces-protocol.c \ protocol/workspaces-server-protocol.h \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-server-protocol.h \ protocol/scaler-protocol.c \ protocol/scaler-server-protocol.h \ protocol/linux-dmabuf-protocol.c \ protocol/linux-dmabuf-server-protocol.h BUILT_SOURCES += $(nodist_weston_SOURCES) # Track this dependency explicitly instead of using BUILT_SOURCES. We # add BUILT_SOURCES to CLEANFILES, but we want to keep git-version.h # in case we're building from tarballs. src/compositor.c : $(top_builddir)/src/git-version.h noinst_LTLIBRARIES += \ libsession-helper.la libsession_helper_la_SOURCES = \ src/weston-launch.h \ src/launcher-util.c \ src/launcher-util.h libsession_helper_la_CFLAGS = $(AM_CFLAGS) $(LIBDRM_CFLAGS) $(PIXMAN_CFLAGS) $(COMPOSITOR_CFLAGS) libsession_helper_la_LIBADD = $(LIBDRM_LIBS) if ENABLE_DBUS if HAVE_SYSTEMD_LOGIN libsession_helper_la_SOURCES += \ src/dbus.h \ src/dbus.c \ src/logind-util.h \ src/logind-util.c libsession_helper_la_CFLAGS += $(SYSTEMD_LOGIN_CFLAGS) $(DBUS_CFLAGS) libsession_helper_la_LIBADD += $(SYSTEMD_LOGIN_LIBS) $(DBUS_LIBS) endif endif if HAVE_GIT_REPO src/git-version.h : $(top_srcdir)/.git/logs/HEAD $(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@ else src/git-version.h : $(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@ endif .FORCE : if BUILD_WESTON_LAUNCH bin_PROGRAMS += weston-launch weston_launch_SOURCES = src/weston-launch.c src/weston-launch.h weston_launch_CPPFLAGS = -DBINDIR='"$(bindir)"' weston_launch_CFLAGS= \ $(AM_CFLAGS) \ $(PAM_CFLAGS) \ $(SYSTEMD_LOGIN_CFLAGS) \ $(LIBDRM_CFLAGS) weston_launch_LDADD = $(PAM_LIBS) $(SYSTEMD_LOGIN_LIBS) $(LIBDRM_LIBS) if ENABLE_SETUID_INSTALL install-exec-hook: can_suid_files=no; \ chown root $(DESTDIR)$(bindir)/weston-launch \ && chmod u+s $(DESTDIR)$(bindir)/weston-launch \ && can_suid_files=yes;\ if test $$can_suid_files = no; then \ echo 'Error: unable to unable to change ownership/setuid on weston-launch.'; \ echo 'To skip this step, re-run ./configure using --disable-setuid-install'; \ false; \ fi endif endif # BUILD_WESTON_LAUNCH pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = src/weston.pc wayland_sessiondir = $(datadir)/wayland-sessions dist_wayland_session_DATA = src/weston.desktop westonincludedir = $(includedir)/weston westoninclude_HEADERS = \ src/version.h \ src/compositor.h \ src/timeline-object.h \ shared/matrix.h \ shared/config-parser.h \ shared/zalloc.h \ shared/platform.h if ENABLE_EGL module_LTLIBRARIES += gl-renderer.la gl_renderer_la_LDFLAGS = -module -avoid-version gl_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS) gl_renderer_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(EGL_CFLAGS) \ $(GL_RENDERER_CFLAGS) \ $(AM_CFLAGS) gl_renderer_la_SOURCES = \ src/gl-renderer.h \ src/gl-renderer.c \ src/vertex-clipping.c \ src/vertex-clipping.h \ shared/helpers.h endif if ENABLE_X11_COMPOSITOR module_LTLIBRARIES += x11-backend.la x11_backend_la_LDFLAGS = -module -avoid-version x11_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(X11_COMPOSITOR_LIBS) \ libshared-cairo.la x11_backend_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(EGL_CFLAGS) \ $(PIXMAN_CFLAGS) \ $(CAIRO_CFLAGS) \ $(X11_COMPOSITOR_CFLAGS) \ $(AM_CFLAGS) x11_backend_la_SOURCES = \ src/compositor-x11.c \ shared/helpers.h endif INPUT_BACKEND_LIBS = $(LIBINPUT_BACKEND_LIBS) INPUT_BACKEND_SOURCES = \ src/libinput-seat.c \ src/libinput-seat.h \ src/libinput-device.c \ src/libinput-device.h \ shared/helpers.h if ENABLE_DRM_COMPOSITOR module_LTLIBRARIES += drm-backend.la drm_backend_la_LDFLAGS = -module -avoid-version drm_backend_la_LIBADD = \ $(COMPOSITOR_LIBS) \ $(DRM_COMPOSITOR_LIBS) \ $(INPUT_BACKEND_LIBS) \ libshared.la -lrt \ libsession-helper.la drm_backend_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(EGL_CFLAGS) \ $(DRM_COMPOSITOR_CFLAGS) \ $(AM_CFLAGS) drm_backend_la_SOURCES = \ src/compositor-drm.c \ $(INPUT_BACKEND_SOURCES) \ shared/helpers.h \ shared/timespec-util.h \ src/libbacklight.c \ src/libbacklight.h if ENABLE_VAAPI_RECORDER drm_backend_la_SOURCES += src/vaapi-recorder.c src/vaapi-recorder.h drm_backend_la_LIBADD += $(LIBVA_LIBS) drm_backend_la_CFLAGS += $(LIBVA_CFLAGS) endif endif if ENABLE_WAYLAND_COMPOSITOR module_LTLIBRARIES += wayland-backend.la wayland_backend_la_LDFLAGS = -module -avoid-version wayland_backend_la_LIBADD = \ $(COMPOSITOR_LIBS) \ $(WAYLAND_COMPOSITOR_LIBS) \ libshared-cairo.la wayland_backend_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(EGL_CFLAGS) \ $(PIXMAN_CFLAGS) \ $(CAIRO_CFLAGS) \ $(WAYLAND_COMPOSITOR_CFLAGS) \ $(AM_CFLAGS) wayland_backend_la_SOURCES = \ src/compositor-wayland.c \ shared/helpers.h nodist_wayland_backend_la_SOURCES = \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h endif if ENABLE_RPI_COMPOSITOR if INSTALL_RPI_COMPOSITOR module_LTLIBRARIES += rpi-backend.la else noinst_LTLIBRARIES += rpi-backend.la endif rpi_backend_la_LDFLAGS = -module -avoid-version rpi_backend_la_LIBADD = $(COMPOSITOR_LIBS) \ $(RPI_COMPOSITOR_LIBS) \ $(RPI_BCM_HOST_LIBS) \ $(INPUT_BACKEND_LIBS) \ libsession-helper.la \ libshared.la rpi_backend_la_CFLAGS = \ $(AM_CFLAGS) \ $(COMPOSITOR_CFLAGS) \ $(RPI_COMPOSITOR_CFLAGS) \ $(RPI_BCM_HOST_CFLAGS) rpi_backend_la_SOURCES = \ src/compositor-rpi.c \ src/rpi-renderer.c \ src/rpi-renderer.h \ src/rpi-bcm-stubs.h \ shared/helpers.h \ $(INPUT_BACKEND_SOURCES) if ENABLE_EGL rpi_backend_la_LIBADD += $(EGL_LIBS) rpi_backend_la_CFLAGS += $(EGL_CFLAGS) endif endif if ENABLE_HEADLESS_COMPOSITOR module_LTLIBRARIES += headless-backend.la headless_backend_la_LDFLAGS = -module -avoid-version headless_backend_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la headless_backend_la_CFLAGS = $(COMPOSITOR_CFLAGS) $(AM_CFLAGS) headless_backend_la_SOURCES = \ src/compositor-headless.c \ shared/helpers.h endif if ENABLE_FBDEV_COMPOSITOR module_LTLIBRARIES += fbdev-backend.la fbdev_backend_la_LDFLAGS = -module -avoid-version fbdev_backend_la_LIBADD = \ $(COMPOSITOR_LIBS) \ $(FBDEV_COMPOSITOR_LIBS) \ $(INPUT_BACKEND_LIBS) \ libsession-helper.la \ libshared.la fbdev_backend_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(EGL_CFLAGS) \ $(FBDEV_COMPOSITOR_CFLAGS) \ $(PIXMAN_CFLAGS) \ $(AM_CFLAGS) fbdev_backend_la_SOURCES = \ src/compositor-fbdev.c \ shared/helpers.h \ $(INPUT_BACKEND_SOURCES) endif if ENABLE_RDP_COMPOSITOR module_LTLIBRARIES += rdp-backend.la rdp_backend_la_LDFLAGS = -module -avoid-version rdp_backend_la_LIBADD = $(COMPOSITOR_LIBS) \ $(RDP_COMPOSITOR_LIBS) \ libshared.la rdp_backend_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(RDP_COMPOSITOR_CFLAGS) \ $(AM_CFLAGS) rdp_backend_la_SOURCES = \ src/compositor-rdp.c \ shared/helpers.h endif if HAVE_LCMS module_LTLIBRARIES += cms-static.la cms_static_la_LDFLAGS = -module -avoid-version cms_static_la_LIBADD = $(COMPOSITOR_LIBS) $(LCMS_LIBS) libshared.la cms_static_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(LCMS_CFLAGS) cms_static_la_SOURCES = \ src/cms-static.c \ src/cms-helper.c \ src/cms-helper.h \ shared/helpers.h if ENABLE_COLORD module_LTLIBRARIES += cms-colord.la cms_colord_la_LDFLAGS = -module -avoid-version cms_colord_la_LIBADD = $(COMPOSITOR_LIBS) $(COLORD_LIBS) cms_colord_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) $(COLORD_CFLAGS) cms_colord_la_SOURCES = \ src/cms-colord.c \ src/cms-helper.c \ src/cms-helper.h \ shared/helpers.h endif endif noinst_PROGRAMS += spring-tool spring_tool_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) spring_tool_LDADD = $(COMPOSITOR_LIBS) -lm spring_tool_SOURCES = \ src/spring-tool.c \ src/animation.c \ shared/matrix.c \ shared/matrix.h \ src/compositor.h if BUILD_CLIENTS bin_PROGRAMS += weston-terminal weston-info libexec_PROGRAMS += \ weston-desktop-shell \ weston-screenshooter \ weston-keyboard \ weston-simple-im if ENABLE_IVI_SHELL libexec_PROGRAMS += \ weston-ivi-shell-user-interface endif demo_clients = \ weston-flower \ weston-image \ weston-cliptest \ weston-dnd \ weston-smoke \ weston-resizor \ weston-eventdemo \ weston-clickdot \ weston-transformed \ weston-fullscreen \ weston-stacking \ weston-calibrator \ weston-scaler if INSTALL_DEMO_CLIENTS bin_PROGRAMS += $(demo_clients) else noinst_PROGRAMS += $(demo_clients) endif if BUILD_SIMPLE_CLIENTS demo_clients += \ weston-simple-shm \ weston-simple-damage \ weston-simple-touch \ weston-presentation-shm \ weston-multi-resource weston_simple_shm_SOURCES = clients/simple-shm.c nodist_weston_simple_shm_SOURCES = \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la weston_simple_damage_SOURCES = clients/simple-damage.c nodist_weston_simple_damage_SOURCES = \ protocol/scaler-protocol.c \ protocol/scaler-client-protocol.h \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la weston_simple_touch_SOURCES = \ clients/simple-touch.c \ shared/helpers.h weston_simple_touch_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_simple_touch_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la weston_presentation_shm_SOURCES = \ clients/presentation-shm.c \ shared/helpers.h nodist_weston_presentation_shm_SOURCES = \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-client-protocol.h weston_presentation_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_presentation_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lm weston_multi_resource_SOURCES = clients/multi-resource.c weston_multi_resource_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS) weston_multi_resource_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lrt -lm endif if BUILD_SIMPLE_EGL_CLIENTS demo_clients += weston-simple-egl weston_simple_egl_SOURCES = clients/simple-egl.c nodist_weston_simple_egl_SOURCES = \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS) weston_simple_egl_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm endif if BUILD_SIMPLE_INTEL_DMABUF_CLIENT demo_clients += weston-simple-dmabuf weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c nodist_weston_simple_dmabuf_SOURCES = \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h \ protocol/linux-dmabuf-protocol.c \ protocol/linux-dmabuf-client-protocol.h weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS) weston_simple_dmabuf_LDADD = $(SIMPLE_DMABUF_CLIENT_LIBS) libshared.la BUILT_SOURCES += protocol/linux-dmabuf-client-protocol.h endif noinst_LTLIBRARIES += libtoytoolkit.la libtoytoolkit_la_SOURCES = \ clients/window.c \ clients/window.h \ shared/helpers.h nodist_libtoytoolkit_la_SOURCES = \ protocol/text-cursor-position-protocol.c \ protocol/text-cursor-position-client-protocol.h \ protocol/scaler-protocol.c \ protocol/scaler-client-protocol.h \ protocol/workspaces-protocol.c \ protocol/workspaces-client-protocol.h \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-client-protocol.h \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h BUILT_SOURCES += $(nodist_libtoytoolkit_la_SOURCES) libtoytoolkit_la_LIBADD = \ $(CLIENT_LIBS) \ $(CAIRO_EGL_LIBS) \ libshared-cairo.la -lrt -lm libtoytoolkit_la_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(CAIRO_EGL_CFLAGS) weston_flower_SOURCES = clients/flower.c weston_flower_LDADD = libtoytoolkit.la weston_flower_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_screenshooter_SOURCES = \ clients/screenshot.c nodist_weston_screenshooter_SOURCES = \ protocol/screenshooter-protocol.c \ protocol/screenshooter-client-protocol.h weston_screenshooter_LDADD = $(CLIENT_LIBS) libshared.la weston_screenshooter_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_terminal_SOURCES = \ clients/terminal.c \ shared/helpers.h weston_terminal_LDADD = libtoytoolkit.la -lutil weston_terminal_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_image_SOURCES = clients/image.c weston_image_LDADD = libtoytoolkit.la weston_image_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_cliptest_SOURCES = \ clients/cliptest.c \ src/vertex-clipping.c \ src/vertex-clipping.h weston_cliptest_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_cliptest_LDADD = libtoytoolkit.la weston_dnd_SOURCES = \ clients/dnd.c \ shared/helpers.h weston_dnd_LDADD = libtoytoolkit.la weston_dnd_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_smoke_SOURCES = clients/smoke.c weston_smoke_LDADD = libtoytoolkit.la weston_smoke_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_resizor_SOURCES = clients/resizor.c weston_resizor_LDADD = libtoytoolkit.la weston_resizor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_scaler_SOURCES = clients/scaler.c weston_scaler_LDADD = libtoytoolkit.la weston_scaler_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) if HAVE_CAIRO_GLESV2 demo_clients += weston-nested weston-nested-client weston_nested_SOURCES = \ clients/nested.c \ shared/helpers.h weston_nested_LDADD = libtoytoolkit.la $(SERVER_LIBS) weston_nested_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_nested_client_SOURCES = clients/nested-client.c weston_nested_client_LDADD = $(SIMPLE_EGL_CLIENT_LIBS) -lm weston_nested_client_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) endif weston_eventdemo_SOURCES = \ clients/eventdemo.c \ shared/helpers.h weston_eventdemo_LDADD = libtoytoolkit.la weston_eventdemo_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_clickdot_SOURCES = \ clients/clickdot.c \ shared/helpers.h weston_clickdot_LDADD = libtoytoolkit.la weston_clickdot_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_transformed_SOURCES = clients/transformed.c weston_transformed_LDADD = libtoytoolkit.la weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_fullscreen_SOURCES = clients/fullscreen.c nodist_weston_fullscreen_SOURCES = \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h weston_fullscreen_LDADD = libtoytoolkit.la weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_stacking_SOURCES = \ clients/stacking.c \ shared/helpers.h weston_stacking_LDADD = libtoytoolkit.la weston_stacking_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_calibrator_SOURCES = \ clients/calibrator.c \ shared/helpers.h \ shared/matrix.c \ shared/matrix.h weston_calibrator_LDADD = libtoytoolkit.la weston_calibrator_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) if BUILD_SUBSURFACES_CLIENT demo_clients += weston-subsurfaces weston_subsurfaces_SOURCES = \ clients/subsurfaces.c \ shared/helpers.h weston_subsurfaces_CFLAGS = \ $(AM_CFLAGS) \ $(SIMPLE_EGL_CLIENT_CFLAGS) \ $(CLIENT_CFLAGS) weston_subsurfaces_LDADD = libtoytoolkit.la $(SIMPLE_EGL_CLIENT_LIBS) -lm endif if HAVE_PANGO demo_clients += weston-editor weston_editor_SOURCES = \ clients/editor.c \ shared/helpers.h nodist_weston_editor_SOURCES = \ protocol/text-protocol.c \ protocol/text-client-protocol.h weston_editor_LDADD = libtoytoolkit.la $(PANGO_LIBS) weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS) endif weston_keyboard_SOURCES = clients/keyboard.c nodist_weston_keyboard_SOURCES = \ protocol/desktop-shell-client-protocol.h \ protocol/desktop-shell-protocol.c \ protocol/input-method-protocol.c \ protocol/input-method-client-protocol.h weston_keyboard_LDADD = libtoytoolkit.la weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_simple_im_SOURCES = clients/weston-simple-im.c nodist_weston_simple_im_SOURCES = \ protocol/input-method-protocol.c \ protocol/input-method-client-protocol.h weston_simple_im_LDADD = $(CLIENT_LIBS) weston_simple_im_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_info_SOURCES = \ clients/weston-info.c \ shared/helpers.h nodist_weston_info_SOURCES = \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-client-protocol.h weston_info_LDADD = $(WESTON_INFO_LIBS) libshared.la weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) weston_desktop_shell_SOURCES = \ clients/desktop-shell.c \ shared/helpers.h nodist_weston_desktop_shell_SOURCES = \ protocol/desktop-shell-client-protocol.h \ protocol/desktop-shell-protocol.c weston_desktop_shell_LDADD = libtoytoolkit.la weston_desktop_shell_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) if ENABLE_IVI_SHELL weston_ivi_shell_user_interface_SOURCES = \ clients/ivi-shell-user-interface.c \ shared/helpers.h nodist_weston_ivi_shell_user_interface_SOURCES = \ protocol/ivi-hmi-controller-client-protocol.h \ protocol/ivi-hmi-controller-protocol.c \ protocol/ivi-application-client-protocol.h \ protocol/ivi-application-protocol.c weston_ivi_shell_user_interface_LDADD = libtoytoolkit.la weston_ivi_shell_user_interface_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) endif if BUILD_FULL_GL_CLIENTS demo_clients += weston-gears weston_gears_SOURCES = clients/gears.c weston_gears_LDADD = libtoytoolkit.la weston_gears_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) endif endif BUILT_SOURCES += \ protocol/screenshooter-protocol.c \ protocol/screenshooter-client-protocol.h \ protocol/text-cursor-position-client-protocol.h \ protocol/text-cursor-position-protocol.c \ protocol/text-protocol.c \ protocol/text-client-protocol.h \ protocol/input-method-protocol.c \ protocol/input-method-client-protocol.h \ protocol/desktop-shell-client-protocol.h \ protocol/desktop-shell-protocol.c \ protocol/scaler-client-protocol.h \ protocol/scaler-protocol.c \ protocol/workspaces-client-protocol.h \ protocol/workspaces-protocol.c \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-client-protocol.h \ protocol/ivi-hmi-controller-protocol.c \ protocol/ivi-hmi-controller-client-protocol.h \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h westondatadir = $(datadir)/weston dist_westondata_DATA = \ data/wayland.svg \ data/wayland.png \ data/pattern.png \ data/terminal.png \ data/border.png \ data/icon_window.png \ data/sign_close.png \ data/sign_maximize.png \ data/sign_minimize.png if ENABLE_IVI_SHELL dist_westondata_DATA += \ data/background.png \ data/tiling.png \ data/fullscreen.png \ data/panel.png \ data/random.png \ data/sidebyside.png \ data/home.png \ data/icon_ivi_clickdot.png \ data/icon_ivi_flower.png \ data/icon_ivi_simple-egl.png \ data/icon_ivi_simple-shm.png \ data/icon_ivi_smoke.png endif if BUILD_WCAP_TOOLS bin_PROGRAMS += wcap-decode wcap_decode_SOURCES = \ wcap/main.c \ wcap/wcap-decode.c \ wcap/wcap-decode.h wcap_decode_CFLAGS = $(AM_CFLAGS) $(WCAP_CFLAGS) wcap_decode_LDADD = $(WCAP_LIBS) endif if ENABLE_DESKTOP_SHELL module_LTLIBRARIES += desktop-shell.la desktop_shell_la_CPPFLAGS = \ -I$(top_builddir)/protocol \ -I$(top_srcdir)/shared \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -I$(top_builddir)/desktop-shell \ -DDATADIR='"$(datadir)"' \ -DMODULEDIR='"$(moduledir)"' \ -DLIBEXECDIR='"$(libexecdir)"' \ -DIN_WESTON desktop_shell_la_LDFLAGS = -module -avoid-version desktop_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la desktop_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) desktop_shell_la_SOURCES = \ desktop-shell/shell.h \ desktop-shell/shell.c \ desktop-shell/exposay.c \ desktop-shell/input-panel.c \ shared/helpers.h nodist_desktop_shell_la_SOURCES = \ protocol/desktop-shell-protocol.c \ protocol/desktop-shell-server-protocol.h \ protocol/xdg-shell-protocol.c \ protocol/xdg-shell-server-protocol.h BUILT_SOURCES += $(nodist_desktop_shell_la_SOURCES) endif if ENABLE_FULLSCREEN_SHELL module_LTLIBRARIES += fullscreen-shell.la fullscreen_shell_la_CPPFLAGS = \ -I$(top_builddir)/protocol \ -I$(top_srcdir)/shared \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -DIN_WESTON fullscreen_shell_la_LDFLAGS = -module -avoid-version fullscreen_shell_la_LIBADD = $(COMPOSITOR_LIBS) fullscreen_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) fullscreen_shell_la_SOURCES = \ fullscreen-shell/fullscreen-shell.c \ shared/helpers.h nodist_fullscreen_shell_la_SOURCES = \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-server-protocol.h BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES) endif if ENABLE_IVI_SHELL module_LTLIBRARIES += \ $(ivi_shell) \ $(hmi_controller) ivi_shell = ivi-shell.la ivi_shell_la_LDFLAGS = -module -avoid-version ivi_shell_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la ivi_shell_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_shell_la_SOURCES = \ ivi-shell/ivi-layout-export.h \ ivi-shell/ivi-layout-private.h \ ivi-shell/ivi-layout.c \ ivi-shell/ivi-layout-transition.c \ ivi-shell/ivi-shell.h \ ivi-shell/ivi-shell.c \ ivi-shell/input-panel-ivi.c \ shared/helpers.h nodist_ivi_shell_la_SOURCES = \ protocol/ivi-application-protocol.c \ protocol/ivi-application-server-protocol.h BUILT_SOURCES += $(nodist_ivi_shell_la_SOURCES) hmi_controller = hmi-controller.la hmi_controller_la_LDFLAGS = -module -avoid-version hmi_controller_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la hmi_controller_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) hmi_controller_la_SOURCES = \ ivi-shell/ivi-layout-export.h \ ivi-shell/hmi-controller.c \ shared/helpers.h nodist_hmi_controller_la_SOURCES = \ protocol/ivi-hmi-controller-protocol.c \ protocol/ivi-hmi-controller-server-protocol.h BUILT_SOURCES += $(nodist_hmi_controller_la_SOURCES) endif if ENABLE_SCREEN_SHARING module_LTLIBRARIES += screen-share.la screen_share_la_CPPFLAGS = $(AM_CPPFLAGS) -DBINDIR='"$(bindir)"' screen_share_la_LDFLAGS = -module -avoid-version screen_share_la_LIBADD = \ $(COMPOSITOR_LIBS) \ $(SCREEN_SHARE_LIBS) \ libshared-cairo.la screen_share_la_CFLAGS = \ $(COMPOSITOR_CFLAGS) \ $(SCREEN_SHARE_CFLAGS) \ $(AM_CFLAGS) screen_share_la_SOURCES = \ src/screen-share.c \ shared/helpers.h nodist_screen_share_la_SOURCES = \ protocol/fullscreen-shell-protocol.c \ protocol/fullscreen-shell-client-protocol.h endif if ENABLE_XWAYLAND module_LTLIBRARIES += xwayland.la xwayland_la_CPPFLAGS = \ -I$(top_builddir)/protocol \ -I$(top_srcdir)/shared \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ -I$(top_builddir)/xwayland \ -DDATADIR='"$(datadir)"' \ -DMODULEDIR='"$(moduledir)"' \ -DLIBEXECDIR='"$(libexecdir)"' \ -DXSERVER_PATH='"@XSERVER_PATH@"' xwayland_la_LDFLAGS = -module -avoid-version xwayland_la_LIBADD = \ $(XWAYLAND_LIBS) \ $(top_builddir)/libshared-cairo.la xwayland_la_CFLAGS = \ $(AM_CFLAGS) \ $(COMPOSITOR_CFLAGS) \ $(PIXMAN_CFLAGS) \ $(CAIRO_CFLAGS) xwayland_la_SOURCES = \ xwayland/xwayland.h \ xwayland/window-manager.c \ xwayland/selection.c \ xwayland/dnd.c \ xwayland/launcher.c \ xwayland/hash.c \ xwayland/hash.h \ shared/helpers.h endif # # Shared utilities # noinst_LTLIBRARIES += libshared.la libshared-cairo.la \ libzunitc.la libzunitcmain.la libshared_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) libshared_la_SOURCES = \ shared/config-parser.c \ shared/option-parser.c \ shared/config-parser.h \ shared/file-util.c \ shared/file-util.h \ shared/helpers.h \ shared/os-compatibility.c \ shared/os-compatibility.h libshared_cairo_la_CFLAGS = \ -DDATADIR='"$(datadir)"' \ $(AM_CFLAGS) \ $(COMPOSITOR_CFLAGS) \ $(PIXMAN_CFLAGS) \ $(CAIRO_CFLAGS) \ $(PNG_CFLAGS) \ $(WEBP_CFLAGS) libshared_cairo_la_LIBADD = \ $(PIXMAN_LIBS) \ $(CAIRO_LIBS) \ $(PNG_LIBS) \ $(WEBP_LIBS) \ $(JPEG_LIBS) libshared_cairo_la_SOURCES = \ $(libshared_la_SOURCES) \ shared/helpers.h \ shared/image-loader.c \ shared/image-loader.h \ shared/cairo-util.c \ shared/frame.c \ shared/cairo-util.h libzunitc_la_SOURCES = \ tools/zunitc/inc/zunitc/zunitc.h \ tools/zunitc/inc/zunitc/zunitc_impl.h \ tools/zunitc/src/zuc_base_logger.c \ tools/zunitc/src/zuc_base_logger.h \ tools/zunitc/src/zuc_collector.c \ tools/zunitc/src/zuc_collector.h \ tools/zunitc/src/zuc_context.h \ tools/zunitc/src/zuc_event.h \ tools/zunitc/src/zuc_event_listener.h \ tools/zunitc/src/zuc_junit_reporter.c \ tools/zunitc/src/zuc_junit_reporter.h \ tools/zunitc/src/zuc_types.h \ tools/zunitc/src/zunitc_impl.c \ shared/helpers.h libzunitc_la_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc libzunitc_la_LIBADD = \ libshared.la if ENABLE_JUNIT_XML libzunitc_la_CFLAGS += \ $(LIBXML2_CFLAGS) libzunitc_la_LIBADD += \ $(LIBXML2_LIBS) endif libzunitcmain_la_SOURCES = \ tools/zunitc/src/main.c libzunitcmain_la_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc libzunitcmain_la_LIBADD = \ libzunitc.la \ libshared.la # # tests subdirectory # TESTS = $(internal_tests) $(shared_tests) $(module_tests) $(weston_tests) $(ivi_tests) internal_tests = \ internal-screenshot.weston shared_tests = \ config-parser.test \ vertex-clip.test \ zuctest module_tests = \ surface-test.la \ surface-global-test.la weston_tests = \ bad_buffer.weston \ keyboard.weston \ event.weston \ button.weston \ text.weston \ presentation.weston \ roles.weston \ subsurface.weston \ devices.weston ivi_tests = $(ivi_tests) : $(builddir)/tests/weston-ivi.ini AM_TESTS_ENVIRONMENT = \ abs_builddir='$(abs_builddir)'; export abs_builddir; \ abs_top_srcdir='$(abs_top_srcdir)'; export abs_top_srcdir; TEST_EXTENSIONS = .la .weston LA_LOG_COMPILER = $(srcdir)/tests/weston-tests-env WESTON_LOG_COMPILER = $(srcdir)/tests/weston-tests-env clean-local: -rm -rf logs -rm -rf $(DOCDIRS) # To remove when automake 1.11 support is dropped export abs_builddir noinst_LTLIBRARIES += \ weston-test.la \ $(module_tests) \ libtest-runner.la \ libtest-client.la noinst_PROGRAMS += \ $(setbacklight) \ $(internal_tests) \ $(shared_tests) \ $(weston_tests) \ $(ivi_tests) \ matrix-test test_module_ldflags = \ -module -avoid-version -rpath $(libdir) $(COMPOSITOR_LIBS) surface_global_test_la_SOURCES = tests/surface-global-test.c surface_global_test_la_LDFLAGS = $(test_module_ldflags) surface_global_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) surface_test_la_SOURCES = tests/surface-test.c surface_test_la_LDFLAGS = $(test_module_ldflags) surface_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) weston_test_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la weston_test_la_LDFLAGS = $(test_module_ldflags) weston_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) weston_test_la_SOURCES = \ tests/weston-test.c \ shared/helpers.h nodist_weston_test_la_SOURCES = \ protocol/weston-test-protocol.c \ protocol/weston-test-server-protocol.h if ENABLE_EGL weston_test_la_CFLAGS += $(EGL_TESTS_CFLAGS) weston_test_la_LDFLAGS += $(EGL_TESTS_LIBS) endif libtest_runner_la_SOURCES = \ tests/weston-test-runner.c \ tests/weston-test-runner.h libtest_runner_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) config_parser_test_SOURCES = tests/config-parser-test.c config_parser_test_LDADD = \ libshared.la \ $(COMPOSITOR_LIBS) \ libzunitc.la \ libzunitcmain.la config_parser_test_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc vertex_clip_test_SOURCES = \ tests/vertex-clip-test.c \ shared/helpers.h \ src/vertex-clipping.c \ src/vertex-clipping.h vertex_clip_test_LDADD = libtest-runner.la -lm -lrt libtest_client_la_SOURCES = \ tests/weston-test-client-helper.c \ tests/weston-test-client-helper.h nodist_libtest_client_la_SOURCES = \ protocol/weston-test-protocol.c \ protocol/weston-test-client-protocol.h libtest_client_la_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) libtest_client_la_LIBADD = $(TEST_CLIENT_LIBS) libshared.la libtest-runner.la # # Internal tests - tests functionality of the testsuite itself # internal_screenshot_weston_SOURCES = tests/internal-screenshot-test.c internal_screenshot_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) $(CAIRO_CFLAGS) internal_screenshot_weston_LDADD = libtest-client.la $(CAIRO_LIBS) # # Weston Tests # bad_buffer_weston_SOURCES = tests/bad-buffer-test.c bad_buffer_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) bad_buffer_weston_LDADD = libtest-client.la keyboard_weston_SOURCES = tests/keyboard-test.c keyboard_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) keyboard_weston_LDADD = libtest-client.la event_weston_SOURCES = tests/event-test.c event_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) event_weston_LDADD = libtest-client.la button_weston_SOURCES = tests/button-test.c button_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) button_weston_LDADD = libtest-client.la devices_weston_SOURCES = tests/devices-test.c devices_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) devices_weston_LDADD = libtest-client.la text_weston_SOURCES = tests/text-test.c nodist_text_weston_SOURCES = \ protocol/text-protocol.c \ protocol/text-client-protocol.h text_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) text_weston_LDADD = libtest-client.la subsurface_weston_SOURCES = tests/subsurface-test.c subsurface_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) subsurface_weston_LDADD = libtest-client.la presentation_weston_SOURCES = \ tests/presentation-test.c \ shared/helpers.h nodist_presentation_weston_SOURCES = \ protocol/presentation_timing-protocol.c \ protocol/presentation_timing-client-protocol.h presentation_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) presentation_weston_LDADD = libtest-client.la roles_weston_SOURCES = tests/roles-test.c roles_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) roles_weston_LDADD = libtest-client.la if ENABLE_EGL weston_tests += buffer-count.weston buffer_count_weston_SOURCES = tests/buffer-count-test.c buffer_count_weston_CFLAGS = $(AM_CFLAGS) $(EGL_TESTS_CFLAGS) buffer_count_weston_LDADD = libtest-client.la $(EGL_TESTS_LIBS) endif if ENABLE_XWAYLAND_TEST weston_tests += xwayland-test.weston xwayland_test_weston_SOURCES = tests/xwayland-test.c xwayland_test_weston_CFLAGS = $(AM_CFLAGS) $(XWAYLAND_TEST_CFLAGS) xwayland_test_weston_LDADD = libtest-client.la $(XWAYLAND_TEST_LIBS) endif matrix_test_SOURCES = \ tests/matrix-test.c \ shared/matrix.c \ shared/matrix.h matrix_test_CPPFLAGS = -DUNIT_TEST matrix_test_LDADD = -lm -lrt if ENABLE_IVI_SHELL module_tests += \ ivi-layout-internal-test.la \ ivi-layout-test.la ivi_layout_internal_test_la_LIBADD = $(COMPOSITOR_LIBS) ivi_layout_internal_test_la_LDFLAGS = $(test_module_ldflags) ivi_layout_internal_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_layout_internal_test_la_SOURCES = \ tests/ivi_layout-internal-test.c ivi_layout_test_la_LIBADD = $(COMPOSITOR_LIBS) ivi_layout_test_la_LDFLAGS = $(test_module_ldflags) ivi_layout_test_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) ivi_layout_test_la_SOURCES = \ tests/ivi_layout-test-plugin.c \ tests/ivi-test.h \ shared/helpers.h nodist_ivi_layout_test_la_SOURCES = \ protocol/weston-test-protocol.c \ protocol/weston-test-server-protocol.h ivi_tests += \ ivi-shell-app.weston ivi_shell_app_weston_SOURCES = tests/ivi-shell-app-test.c nodist_ivi_shell_app_weston_SOURCES = \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h ivi_shell_app_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) ivi_shell_app_weston_LDADD = libtest-client.la noinst_PROGRAMS += ivi-layout.ivi ivi_layout_ivi_SOURCES = \ tests/ivi_layout-test.c \ tests/ivi-test.h \ shared/helpers.h nodist_ivi_layout_ivi_SOURCES = \ protocol/ivi-application-protocol.c \ protocol/ivi-application-client-protocol.h ivi_layout_ivi_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS) ivi_layout_ivi_LDADD = libtest-client.la endif if BUILD_SETBACKLIGHT noinst_PROGRAMS += setbacklight setbacklight_SOURCES = \ tests/setbacklight.c \ src/libbacklight.c \ src/libbacklight.h setbacklight_CFLAGS = $(AM_CFLAGS) $(SETBACKLIGHT_CFLAGS) setbacklight_LDADD = $(SETBACKLIGHT_LIBS) endif all-local: zuctest$(EXEEXT) noinst_PROGRAMS += zuctest$(EXEEXT) zuctest_LDADD = \ libzunitc.la \ libzunitcmain.la zuctest_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/tools/zunitc/inc zuctest_SOURCES = \ tools/zunitc/test/fixtures_test.c \ tools/zunitc/test/zunitc_test.c EXTRA_DIST += \ tests/weston-tests-env \ tests/internal-screenshot.ini \ tests/reference/internal-screenshot-bad-00.png \ tests/reference/internal-screenshot-good-00.png BUILT_SOURCES += \ protocol/weston-test-protocol.c \ protocol/weston-test-server-protocol.h \ protocol/weston-test-client-protocol.h \ protocol/text-protocol.c \ protocol/text-client-protocol.h EXTRA_DIST += \ protocol/desktop-shell.xml \ protocol/screenshooter.xml \ protocol/text.xml \ protocol/input-method.xml \ protocol/workspaces.xml \ protocol/text-cursor-position.xml \ protocol/weston-test.xml \ protocol/xdg-shell.xml \ protocol/fullscreen-shell.xml \ protocol/presentation_timing.xml \ protocol/scaler.xml \ protocol/ivi-application.xml \ protocol/ivi-hmi-controller.xml \ protocol/linux-dmabuf.xml # # manual test modules in tests subdirectory # noinst_LTLIBRARIES += \ surface-screenshot.la surface_screenshot_la_LIBADD = $(COMPOSITOR_LIBS) libshared.la surface_screenshot_la_LDFLAGS = $(test_module_ldflags) surface_screenshot_la_CFLAGS = $(AM_CFLAGS) $(COMPOSITOR_CFLAGS) surface_screenshot_la_SOURCES = tests/surface-screenshot.c # # Documentation # man_MANS = weston.1 weston.ini.5 if ENABLE_DRM_COMPOSITOR man_MANS += weston-drm.7 endif MAN_SUBSTS = \ -e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \ -e 's|__weston_modules_dir__|$(pkglibdir)|g' \ -e 's|__weston_shell_client__|$(WESTON_SHELL_CLIENT)|g' \ -e 's|__version__|$(PACKAGE_VERSION)|g' SUFFIXES = .1 .5 .7 .man %.1 %.5 %.7 : man/%.man $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ EXTRA_DIST += \ man/weston.man \ man/weston-drm.man \ man/weston.ini.man CLEANFILES += $(man_MANS) if ENABLE_DEVDOCS DOXYGEN_INDICES = docs/developer/html/index.html docs/tools/html/index.html docs/developer/html/index.html: doc/doxygen/tooldev.doxygen | docs/developer cd doc/doxygen && $(DOXYGEN) tooldev.doxygen docs/tools/html/index.html: doc/doxygen/tools.doxygen | docs/tools cd doc/doxygen && $(DOXYGEN) tools.doxygen endif DOCDIRS = \ docs/developer \ docs/tools $(DOCDIRS): $(MKDIR_P) $@ .PHONY: doc $(DOXYGEN_INDICES) doc: $(DOXYGEN_INDICES) protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@ protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@ protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@ weston-1.9.0/data/0000775000175000017500000000000012600133270010746 500000000000000weston-1.9.0/data/sign_minimize.png0000664000175000017500000000027712456345006014256 00000000000000PNG  IHDRasRGBbKGD pHYs  tIME; ^*tEXtCommentCreated with GIMPWIDAT8c``XF,bI4 8HݚIENDB`weston-1.9.0/data/sign_maximize.png0000664000175000017500000000031412456345006014250 00000000000000PNG  IHDRasRGBbKGD pHYs  tIME;k[tEXtCommentCreated with GIMPW'IDAT8c`LtrSQ` Q9p]17IENDB`weston-1.9.0/data/home.png0000664000175000017500000001102512456345006012336 00000000000000PNG  IHDR``mo pHYsodtIME%$tgIDATx]nu>_Uupfz")k%Xk#&y<@ DVlx! !əTɏLߧi(!hɞO>unߩZ{sac=|wWGwĺSARJO y}yo{*!ܟN}uF_?Q/.{|ܡ)Sܴ9fcef%44%Ԍ3EKJhlXjbBC6WOݦ/Jɽd=O@:%{כYF(2xBMcvAľ]8vߪfcw<1f"Xz1-3 l6;j#y Mo6/ f3}fN+4Datzr|}yYLH)3{{B-={OC˪/0\_^^]팥R<$p0@GgNI ! 0&GRD7Ar(BTn![:aOQ,MoTApqY2̣xsHԝzH)bd46ԇbx45^4m< mpYվFДG?4ݽկzIIxZ% ԍ֛I)'@i)Z@5mxڋB׿(zm;uRDZ`9:RpҲs ir2;.;?UmhM8rCEEh&.$n^ٸCRʊ2A5C[=uUָVm7p;A7ذĆRFyPA=Xt'w)T۠V0VvuKündϠ0[hW` 54lϼ=*]:+(QZh\n4`PMu=u_* !J[AcbQ{ I\ sdlX/.(J)Хc?z2,иʅN\g=~ro"Gά"M/Wh=xzhj~E b+\_]^]팕`/-_(Jש)F%4YONHWrfUl7XAqUT#W[|<?h2I)=%$BL6F+Aʛcxzۈ5ӆmlr5H;u58kTrTڎʡi%Z9A$O٣TVg[O8 32YV| ״Q;Jl>V^gza/%W̿{.ғ2R-(q_W*5躖k^+`V!V )$!T`}/6" I ,6eԯsn46w|? tC[ :-|٫}]s5_и+{7zףgy&[:ꫯ^|ߎ6nFs7x#z嗣~_Ras=;B"FD휧^{-z뭷Z.]{õ`:A袋 ?p O<^̽eX3dO>YW^~W@GÆ Otov ]<|/Yg}Wo]6w%\bg}Q#ixN$]wvmx.҈g]o!>!J*27<7?yCs9Ǽ3š7z ַe|t뷿uX{̬k<#YX|y O<%lk1ɗ]vY5YL:F~Ug?Y>whĈ74uiތ aHgfa.~Q`4Hh>7fB: p-4 /Ш0,Lj c`ŵ (V`ҥ-~WplBV3@BC͜T+Ѫnh2r6@7ĎN0Fb#a`DL$"L S 07Yủd^`TwuB@eĬ 0p0;*&o\d>1S np}No,'O6;;N ؏@Ć"0 \0تU #͑0+̍]oFc@e 9sThg>P'`cCBnmq8uH~AFedy?`po>/'4yo&0p j7@/+ {za |ᇙ znMǠs0 AŒLǹV-l>MQ x@:6F N\j,07gC㌴:\hՆ8m7m20sha?|?a~EzYs裏pZ@K H>܁WUukNљy'?hu@Wuk$U@ msHZ8Ժ}78p`GՉ_LИ0>*י3HFL?6XڀL345qj9uߘkLQ# j>N#c10F58 3 @FNO63l~f:C^39ks+: @h$}[#iaBZ8o^}z 'TB2re!;fhi7;MDf#JURСp&L0EN)tե*>ew)q43s: he g*4E7%GŷSo)zް`gG;ieaa"H_[$9o?8~_nrIܡ yʢ:JO&t@2ĭ\m@̀mlH "l S\zpÐLX# b2Z 6V%*/ s#5O;4SC ^󾶕@O /Ơ}^ ࢽfLٻw~0vo6ĻIzf{0ҥKHVK!N[-L*t`L<=) &M*2Brx'ML[LkIh o&՗b:fL<ˏd u }] Yx禓h}&ۮRSY ;ys686^xH|:зm,$Gbl ש'2K/F_|q{QGDb_c5?6_4RlN T^qD.LT+I=EIhMb_,780Q)o~c쎄&9hS仴 \EPlʞ|;l%߰vuu D4k'%=CR߳sMu r e_+" pWX$>Y^HH}n: :9l脉hƉ=osUD%`[1 vs'2CTe8equ<a@ـ̾Ȁ-^zq^RO<[O0β_3T:O"GpQChMAc.LdVewS纭PRHx7>*>R_\{G 1G1K{üoϰE5 ``+W\~ U0jp_ax-)A3GvD~%{7x)SVwc=f[, C"tm*f']29'3~|ds-4,jwO'̐O%ҩ GN?]`x}*H"xS[mǖf_CTd()*1(ny4-{=UȐC*?ͦ*# 8׭[g. Z XnqM<lz`^jI's sC /,] G'KZ0(Zszma6MLP7,[̴bSB) @@ *?5 80iNi2Vr(fplǠ͵0ЮRvAmQ@R e`wg'[>w8G A澦3%ِТ0׼K*Q6YXcNq2:Ji|+^{s??~-!Hz|H=$orK[r'C)J7lLV )OD4,~Ld+bƂ0Iΰ̏> "ݑX{Ih!޾ #J08@QTz|+h3M(lC"&|Y%XEC7ݲlo+$N Llxr>AHMb͑VfE̼j<̋ O *B#`4x|(qFeZd$VuJ+V-[{w9PI>0oL' [۞hM0))z%A{F/-*ڎH?RXhX?s6EGoP6q=@8Ȥ뎉(م94% (桱jo(䱽x`EFl '?16;Rsd8*]؎H?O#<;{T|';4Yt]kn`ED$E޾.xi6mELJ❆yEPy:ZOM Haڷ|`@?Bټ4yH2Էmػۍ``ny~Z=o_}l@qWV\ v]8 W- C:JC|fs@Q~fwnwk P TQdĹH|85|+_1aǼ-뛙- $.FH&Nl-瞧ܘ^~HTҏ{ D<ƴ@E༃yxfJv1~4 tY3s@1bRavpM"h*hj|u6[@A<8 vل8PI`>uH8# ;],s@'ǣޝ8"_ۯ݉0/6KPc_Ur7ЪwMaR86%>sL Ӧi@֖G[~y NoЪ*ܛ%@#E '}.S6#Mdغr#N$-PQ QcC\Hf0+ EGw|G i[M8]׶l YyH BM>!5Ճ$#H>{@ĄqmʝGE`|8)S疤+@ %NhI/>|MU5JG!~r%x7Iځ\ϸu4⃈6n0 5BbH|I4h )ФZzNL/ޅ0 ߱[kf0(yHl^ +1Bh8͐`8\DuE %XܭjJ ǡGgP7.A8FD0w"X>IF<' |M]MI_:~HF%̋Bm%O58I0sT$$0ReGz,,BkBc Y`ۮS0<`F10:ڛ/ GU^F | iǯdCbG:+*?jwZF`̤, FsvKfؖ8؉,'jU~^N2EP6=Oj,ļ+ZfNu[|$KGLI_ P%CC3 o7VK6;O R۲F"`x $gBuů@6[U9~9a|@X 1<0P1ȀıXmu]:|- G6@@_AΨӡtSatxQ{fJO0&1aP}"CC@꣦y99`~KB wPQOF,`<կկկ+ٚO xTGb@TW[ 1pj~ *f9y矝> #v/~ kvM8ۑd%|_dG du4ރ>cqIf樫$7:Y0@q?yMꁰ~4*&*QƝ0~/w}&i=]-Vū""#sO2SޥZsu%y5 EߚˬQ'qbBն1H= &A̺GTN|O cA3߄Bƚ6s]:q@٭l)`0 H<0d(Oopx>SB\E=BqaI6I4f$6kAy5iSٔ1?5 {F’p펧"#PEz Ė%F0ߵ1)rBzs-sDp*{0V<ھ ʌ?Ӿ{.x)@rĊ$ەB-B =ہ8'6G PKF%xGjV;W5I#jP;֢s$ "EQIE^VS) rQ=0îM ax{AU`^9 0WM`#,Ug@B;#סޢu;ǵWs4:s0u?HG CO]i0$v ֦H䧁(ُ8hL-I5v޾j TM ֣VX=Lm7M H5{lwּaHw"jad$5*?:&Vu8:G]~;mM#@(;N>2h&JMr!81G"s+Kx #P]yۥSxI&|JJ.&L*>mUtO**7*9ь_w0?>ZOy^Բで;#%Ŵjib2)tYjwd:76}NdѶ +r `vG0` ՙ=M6}*?sKDKB*^W~O S >oQי~H<>v0j=GMO>fM`i}Aj sO\.N8$2f* isq,ڽꫜNxiAj/@LfbqВo޷sroO@Qv&7jҿo\2{p)'/tgji:hV!т>Va3lO@KQ:w:p[Kh3t衳J>}rB?TCp ʱ%Iz&۽\j+&vK T#m%}%ۨy.s;Î in/^@T`nus'˄(iw3 '?OMʆ /dڽ\pI 8:%A?ʼ3*ԥw+팼>'4$]j;lؐ1~On C݄A fn+O$_g?y|099X?_эz==w G ~eTـ;ޱs=ozb"ɸk<5o2,~w8 &b!dLby"%x Tk/JTPVJB`qii==_DzSh s4+3hVs I2޷}4=pA 瀢#JX{{%O?ISl(Ruh/u$V <ɇ`kQ,=E_m6!-cpR1ʎ(K è,ڒ< BOkH6TN*(i1#3AWd+jNE ]-H"ʈiw?DR=bJ<+p_010ݿ*-uDxnSCVEXVk8fz0⣊8XxRgBL1T YEO|"3?_Z%-ȇVUl|Tl$?ICc$wk6z.Ru@XM;kCE* EnEڦ^ Ag;b2(1Bh uFI.$T:vkI*vǮ FtO najU,޿Y`:@lMֶ ]6(SDC~zcHTє^ 8`zbxq۱0m{ ؾ})#{ ;ܱH]a9:[s^QAp>4!6qak8& S(ә ڥ\ݿ7-&'PȚk:)iRIj/vFjJ8좡:{\\x%=ZC@-Esb@D{HmVDP{PHz;ҵ7s< D >ƕHx|WhaZY3VtNL?v 8dpV "idvP1SP#E4CHIFpD]% !R(;l/(7`z3v{]s6 5Q@o}F@a]x4J7%n6{|(%Z]^e76v9vA^b[_¦pXHlYʜaz-)BZs q/rgy$v(=φz  :t]6v;Cy.tq%-kF -, U ŇD^&y,!n9@~L IZ4?Vl]DC"U ' ܔ2`+AK 5~PiߓW^PQlKaQb*@Bē[!y>#bѻ eVTd‹T!"m.*Vj1fb `vW{ߘTp `BHw=3| BިueZL[L|PNri!abRE0ƉlW3s"T[UleZ9pEGh+tM7EY '6t=~w v%*4F>@c/. {^8coh ʮ30.zC`K,z9:H/lg`=HNG0ؑ ݳxW{ƌ^rrrV7UvPwc (`n6ytV,an b&@`E?Eoh}juYxLp/ IL+K:176(+=TDF )"FC X#u׹YP "E=fCAv TOd]ܐ p 313#~HT Iټ5VT<].1۽^H:0?V?2v't,*H;͕I5  Ox<8pc6gefRVukeV!E rMy̙$26?e#!* rM 5d#E/2iP2BDՂ\Gܮ&E]rp!GYܖ-&R.)Bra^+tjpiC|oek;u -.'P8}l2zC .{|wH;QڢClK/K{^TWcE\ h8Hzڬn7Yq<\#@dѱ0G/mckR!m׸w.ʋ瞫VN"5 悳0-U=ǯUf.%w_kDʼܐP,Qh,sqHJT}ho\gL + KXҽ1˾Qg({1"@ 8 pp8y~ Hi ?S,ZD:%`0en|%`uOu+[f~^&(@3>NW&)K]wΜ&هzBifS>R;DG/?R'.%^kA LUP$I}0&*:t&{քj圵rg`'4Y# ϘfCUn'z< U;]Hl=4=8UXy/0" IIS̈vHrFϢv%Nx 1ә ̏{J|5 1̃GA[# !с]Q#~JiTcllMdD|;_%֡g5@"ODݯUfz<; ɹJKQ+0!m@ce|&Wȡ!v*@BT*oRUC7"Mc;pI$)rU_+ѳ ێ5(;ιhd~=v.U4=v2)b0t,yP5Wzw 6+sD&soh/@B=eOEkZ Ǣ+>Ru27o@ "u`1bbqX1"{>%63f#Lбn[ss u7G0LӬyCyf,(0}KβegR$H4 alݪ؈:B1yIJUލ;!;a?0a݋&S:ƷUm ?zBʻSN3赋det)s|R?hg@8 "9Z|)FvgI#>Y#;("NDaY瘱1`*!"јn#/ԠDQ⼍CչA8@64`G0v{E[u#g|E7)5|4Z]=Fha_#zT 4ch2=H%<:pؾp-Ygc*fj"APCJK%'--ef^؞S̸VcjL"tJC((37h{"Po&D]ޓgRU ?{{["Źg'|i M2M[nhȄ/W@*_p!?eK O$}LR/G.y!a6lZBL$/(|wX)wDɍr+ާҵsl[N/'v`kkh9iu0vj8Q,YrLCCgˆ#'J# ?ŏ~#[}G#h6U1eQ䃩1eD n86.ztӲ߱W!o9 =4\lj5.i|fό!c[L*1cdžo;{Zejr,dRqv-xcN"N6tx|TrYkQ/ z?“O>e" f#NDO:IC`d!X 󛭹؝G<4hBTMr~?LR 8ќO`o8 5cuE(2b{״ 3G/ɃGm=_jDDMT5A#hE*LKQ}ao\3*?Yw9+ y)!ǜ0t% !L!|R3ϔ.Bjz.\$++J* b%:NR`$^z']XTR_,6 r3+&$vsly2xf.>AT-t2U {A/2`uyQ#g~3gk2SS`ʒ9B4͜S?k ZTH/d}Z̼JCDElV*gh\yՆPKlHGesnΎ <Y5c'D\Oƫ]m"O,T[pL ϢڒG_*5*&CBL]rH_ZX*Kx5qks ݥs.{U0,*€vRFL|hw'=Hܨnh}Z :qo ޣyCtRKȁXCɢd(fecpLyjB\@#2.iJ.OIYT$dU#]\bdSyZTUs|_tI*!uxڿk V=&|MCNzs`E.Z"G[7;c|oO;=zz*Lz6kx8vD:& !_(9a|D#5 (l&ڄUS]Ş@ uSOO2 I^9V\tY'w\f6zlyޏgP)ղgAYe;NT44[:!꒯)z:TiM/pha}S'pwqSSg6D*AxD%U0mٱD%&P ==B`)b!OG%=B*͓!}ν ƞ{+VD#%GK ~G_`#TեgDf|3@4p6 Y(f,W ^4 qaBaULi*z^`[~e \MLD;3+E ]~_' Z6ETƊxBxؿ1b -ba5؊WDLPIK aBz?wqrt$ڂ'oBIŌz[}Brt8[vCr ]!Gy \>{(UNJ0ڄyOG;4WL+|_~%z`C1ǟAɯ2r6$MoWс$+$>jhF- 1r` 6nIjlGEk!DJ6]pTzwr|{Jj_ʤv^Vzf<%rI;bΓKW_Wg#Fe *3:9(T}%ؑ&>` 8Tyq֒kF$0RsC1FHM3iu&QZaog&7ϷRf5{t.7-' Q` d]cF&n0xyTa 9s!MFB#sQ3{#6Lɖ]t IPjexSqU\uPxܗ>E!WnE[8߽$/ˢ R#Ű|TW)rRvyR3]N/q.8UQ,,H4vkA;bN *w_8?ȓ"ڍSTt8%L E%"H*sy|$LV"Hsp l'pĹ<#iWr}L P '^CR[!I &BVQ˟zI(ğ%/f@HY hxU-iId"ӏf'j`/sL 3 \)<KAi61HEBCtK4o|ywCymu[ۗc4{iy K>E$Hi)c9w3Usi4 ] [KLlX f~Mv0e}UX*^e1)58{̷<9d7ՊxE kW q.erH{ZVB =NSGYDy?RKxzUJ& =%yE UZxף{~4Z~5Q $-hz(QfNy(8RqM(lѽJN$ܢPOpcK!vISxN3aPAHJYaO13N01\ƚ2Fj&PAmNgkTReHڤ3&IևxI0!eg$9$!|2JOzjT}&8wk].*5D0] )#OVUnR_LQ YU<[sy쨘G9z[i p<~Q`~'?go\?ē 0Ӛ{6nŕv< &r,b!@.P-Kf eAyVF~aɕ~hA쟁1Q/MMKc4;X4ΰ <8Eo؞jPpg EwH13[iH25(DڶVϖCk(PW%>QO}mt'ԚU<̉ *HINr*[ yifFZ- u}zjpʨn` /Kݾ  ̍&*H&qxkR>%Z9)ɨ)qJM^d2"NqjoP,d3B:&Ï0<ġF]fVsOxؙK.Ng(T\~ y K]֗#r$Oѳ%!DE'Ϙ+ԕ34m. sܶh+*&RT ;qX%!qO2'J;2pCd6tմ謚_f;.TdCO9N齄9oۛW(Y[TLRb[dU^h!(h Uщ 2 uw=; H>„0-SbhiR{~ Uv}V>d^Z3[|8:q dT)a$b 3{DV9νD kݬ.ġ `XoJb3_.vbȋ=}l7ZMDs-)[y|QcNi/>~Ɯh͏p,x%3h\Tu?P|nx~b3Ġ9jZS&a;ˇ`pV)1!aRѠꏄ;-ܑ['< MAB>il1'Fo;&gfh\)X1\ͳأjUvƐPOQ9y]EvRs,<=+חU+Lq_Խ1Bp+ ٭nh#Yp.s.156tɻT/ˑt[""ݨ[h娚 ۲E w|J>;^4S0=W_cz)ˆ'Jwm߲y(tDX[:7s=;Aj4aE hޓ"4{q4B^3t0ES~ 9f"&/|d@mVY*t, 0[I[p€Sp 誼@1x5IJa>~r~$:J^P3=?!bMuq1R]Q^q+¿UDOz}U 9F1$FyslS,=g& 8/fp9(yxlC8F[w⦝H~ZR-=lإt7ӵ 2$s :_ϝ)25YdFQD:&<;)(@pF cia)s0fu R3$a*Jɧ 09f6=c3PVa1SF'y\eDi%IW%2p b~K [g,6VcUR|2K,?(b,؊+ yji}QcF׉]-5!K?Cў\Sx$ln*/Q Jetrv0>evDTT䄓˘W98g@t|/(-p"]:pP&R2@4q٧piպu'1 qƩ߮ö% i@lvEzcr`]eaL@U-Ĥ2sL}Um'y&nnM^nMǺ &%xW`4GڷYbJ]oEKoTq}(:9Eaeo?̏ƒ'~Aoh2 )yy@Hg8 m ж_ hZފxif3_C^lkWǝ0%4:OvVK"٨P 2V;pT0QRB]ju+f ʘQ7Q%1 ל&B@5^n 8cF1SU֫iYۿ#n3 3;`xOV$hAFꪑKR\I S\Ux:&ܬp,9v|̇GģUc 3uܐۿ!/{]H-f(r3v"Uj (PU,凞GjGAʋF\.ƀSX+wnk0Zʁ|Pq2~?~)1Xk +rI~lOQl czY":wUFɳNSAWIs∜I "Dzm36\ TTR$ UZ#ˌ(;WsIfZTQ޾@%W%9EIQ@S4Yp*crۚk~0sgsPScJʁb '/t0n,RPFxo"#Ro6cW_3//@7mμVVCtLEZy﷫T1{>Z{kܾI5YuC9sW-ykijxr IN;h2$%q̣4jE%1+3#՟&VDʎid޲,,V$xL%£J"ӔLJc*阫~ƯS!'Mfu&nU}|3"VI5k l=VRC٢vSyzk$3̃<[q/9H`JY&YG*nYrnNlF,˩&huf#suPH!}LeH3Ԛl*fP^7UMsOJRJKI5hMOʏqjK)C2hYZ#ڋrFQl5ѝ3(~k :[`Lx'3syZ^Xc0hdBoyys%$/;HL3:!>lz% ^Η)3Ew*aTR[x:wxHm7Q?6qT:ʋ?UIKIB4I")j+rҼBlv ii ֢0#Fx!GH;P1Iܢy,[VdhJ;}ߚ#ѹOw̚(\t$e:&Nɞ7A5WvƧ)^T5q`P|zUQv k6?A(=1=WЍNr>T?w\D#4$=Y`uPL,l'ЃNS|Vг52?˜N+1y\cU?Y:*Ӛ.ګqA` +SH[97[uLJ 3Wޏ?H33"&lUOSe#ecĂL~<CF-bjנOGϖ"޷$}Ir:ZoˎhcZW#;mj8ߑ (IjPJ ͧi<ؠV{ ƏTպNSm|ۆ `L\_]W琨Ր(#'dM%uAĈ+(oϟ( @.?LP}KhTUy1x=g<|څR{!ʁ@ v8"OeB-fj4R{a~=ТrBle~M:@{3IR&.]h*#~^>'qUEqj@eN*x)y)P6ΒLq )SQ&[֢)h\p@$OI,}U)`)B%Ȉ>8H+;v~ATeLMChE<^ ]xheR?5a' I P'/;,P 9_plxn (s3z8b)ے~OqgƪJ%n2ܒX^81 ;L-0}6'3ղS$sqzDP|W@ɉX5#EKkG%qͣ)$`/?d-5P%i]5jL9pR dQ&Ahd챵IA|-"Чдjve3ǧP"Z{a~h&{!u`(ajC  Σƛo1>c嬢HiL" M@3mLr:vdۼ4]h sFf.2u|p2u$bPF0CR|>ӣÖ]FB3j2.h!GPg]bE-$]4tsg3#>`!88>jϼY^*޳.l$sP)Z!aDhOD>|)w2/Y6Cڛ2bϦاa4̯2gϓ䧑RlҠcP ~kل"/9ڐ1y$ubW;W5Ȏ>* 1xO_^ͬ}Byt5x/^A [2bF(/BH|x5A4b"&!'pqJ5Wh3γLEӂo'3Vwjv>J*]p|4ocã̑=[Eq_wnΘvCV xEi!ƩJ*#lCz!ƉFGL >e̕k}DnQ3_0;N1#'IO^?YkԵO{VNC`uڿ]aįPl*T.v &)9y蘥sfHDd}єfKVH%ooÔ#p/Thm&Dj$f,ӕ{NrL#4OoqMydFޒB08I66cS>#g+.:0ges=,R#M#[4Crk41]rO<lwQkH">/N8Js38lU PCICyIFE̍tA5!LK}(}GM| .400+\BhW\ ;R] Y;64pE~w*zcr |2{:|&-*9ޑDaR;NXyxvn+srmJ+rxb4VSemeApiuܤ?#Ezur(OC.(D2N@Q =5F_ȾlẪ^-!:Nqr$&!H@t;H8GM[/nQnP qjжlo|d\_^Fƣɯ guEdNx#DEH~R`D K>PTi枃vB<r!LG+=b 3-c \t>ȳgVF@Zg;~=%lA^׿6uR cO4?ODrF?8gdccjEŋB}f:%wI'XrHxDaru<)߅h>z Rd*}A=@pB pg\w*qOvm@\JS=7˷C%Mh {*c7O4naSg$va\S|8/>\[x yF9Uw~'F0Zi'yem=Eԃh H${#ڌ_.)&ega&OW^5!]5 {RF D!99kI!ҵÿ< αB q>"]iF**ʡ+0,֙aB`"a0̑ǃ U3h=z}pd:]3_(ȣљh/)C* 43#7fػ.19;#҇-3Ni7wpαr''E~ƌ71`#&;]!@Ö7ݿ^#/3B1B`t8qݬDf ڛsw瑱Av(6{jrʎ)K6 RirҜf M:J+p5 yՀhYEjL[:.hrJ}΃- 6yt}7 4A3T'c;}C &B :H1m!90ڦU~]Wsw:\?(FmR4>/{ JJU8]+481bttXC K̚8~i̓\sN6Tys$I.$]5$I"a|8i9C UarBǦN:s>g!p*sΚ?D4Jlͅ=-Zf)`͏ml`qRNxjʦ@5\wMB3[ǝuiPB8l$Дf^cQOJvaV[ͨiđ&iSӶmY'$9uj}j$3p2Ն J@؎w{CZ*,{@5]jv& juG$|sқi JR> krKJ~pۂj6( koEoU8ٞ)cs7Ǻ QhY@35ҨߒU)Ӣe96zR^g{>:p,̀sܣbj0vU*aQ7y.>¤eE-?wČng'=T>6E:> 2/V{ct",$(jij׉}Np|Pg՘& s4нݯMbd|J=Zaê1}ѵ@Oש#ГN@Tqa7K=6#6(I!Hc8@*$W`[E!$J͑Fsmw$@j` yIjS!8fBTIIk~b(3 D4 j%k1( {,RI+y0eN|l|q`f'8CuüVR1LA+/Vg#L^\ֱ6jLj;Р#5i$dLH}I8TKbfϗ@dAI64=4Rx 8Y`bE( % (hl  @2v@!3eBP=S$Ѣ1>xݥH! \/d2h Hg)yB`N<*eG]dAd$|!wnn8ji2`8ZssM2 DRј \>6Sj9AlD25 3XmOAI~F96,F$: 9 \sТ\uuK3*Qrf l~lim`vnv4lSPiA@aek"H=jL˨HtJ)D_K7uT4Xj?u* kT4 ˱Rfty!]BʧMVeRNfS$jHT=WGhNC~0$28,Hl M_*ݨD9~ʍ6pv[q,1 z lgDljp+SYpiP5 0Dev>c+ a" %vιPX>FU -ob 醾nj+&c@hr=&5uvw v>\~ .\{U? oئm_q %łEN4wH/ՓM4p/[oG_U߲/0{+\9@y2{$.UTݵ YoAKsUpʋgdnn''5 ͯj.y&~f +䏔hR~n{R469D>'JsU6/\ʛipcg̮ 5˰QewRLӖE*Nfzhel8=&ʜ}*;s t[IߖqI;.YX8wV! p642]Ј_]%fscҳi1f 8ݭOF A `vZ2s7;SҘ8]Nо0=urt%E==CIyN}ɧFofEn QEF̬`kX1Lqބ f4DUDjoTE0IlRn )Nb5/ߨ5륶)MANL^wu ɞm\ F5;iIϯs ߀e`l搜  r RLe$ٗ3>[̀*:a~8hᣣcTĖTxx6$3>5:r &a]P %MrqCf?*K6#bu~4vJ-h(lg=PaN|? J5;Pר1wz?WI5KU pW@&`0F?NqahӢxOPƨ-jG=gg$WH]M@ "( ~Gc$p(C ̩.~_ʴ/m 1&!P"t- K|Sn̝3Ոms_"{f2OjIw6.grr{g̓pv;&Ei* vj9- fwKm2AΨ[+7B[=]v)pA :1wL dbė"1]~GwsmpۘDPK=?URO;Mgq Vj27[bC$H-j"E)~zJ R /$ýwn{?k+m_uW Tqrj衋 $H,tb;G]*=|GLs%K NRyNr=7!OT<\|8wil^S"1<)\HUw= r2RFu ~zBRG9ͅ{s92Ѩszb\ 2|LIs*?y/[fI=sm0pfGH̓T~Dc85S/AojdzU%8yÿ*sw*vJ9cn?I hRD gi$w8pJ5[F-MƇFSUmkv4AI4TNy.q=pt`VS4t1Ds]Ǭ=*Lv)p:ҦދH"}{hrK/FɊ怆ӖEMrM{c|Aǐq:E)Ĝyi$S>o3@nz-;Vⷹj ~p| <0I?JÀJptb e7'[M00I'kb2aR޷9Ss 'N2J]ZS,Ow>(mh_TB T:y>ϔ`X\x):DZ'*p߭J]Y t~g8Mu ;|Khxљ(&>ܾ?e= 'F+rsjMz;q̰\lΥShauv0ګK Ld)R|Y?Wmc+# 1TjxD x`\vUkŽaNW⚿=4/X $'e]_piCgDmݧ9 vSsc!O=d_IoSxvYĖXsvMQ7❔mXv=-кn>^2e䋙953Ѻ#&w|;]# r}Z-ϭds5*ڗj{_ h9noz >s!`ZGÚ:Z z.u϶$,*sj<*!ĔaDz$deLC)1@|Kt2+\)pRC&];Y34U4b1_!tLجILǼ)ՔVXZ TcrQf΀`r=f7k2|jJ&뜕o0ax05)G.[`59 pfP PapN!`,8{Уo7+GUΗ:5=!N%HY21Bqjյ^gjC˧{.C׹plf+`bSeʟ;_R)Rqpwa`3cNݿCe) =Cj P Mz϶3W71jBHcόyT `lg$uX+ uU̬zK, Ԙ% >_V9늵kE/mj1]HFNmWĞ#+(\m5Tъ.@'vqvF{݄& Zɚ k!X 7 pLYLfe~dIr݆}mW|:^Ei F~lv%wnG)eeEϽbtʧHΓR$} yFM3 D,h~N F j6Ɓg^ÏJhh;d&o}BZ`;wS1p€ R0hwօ{RG[pxZCk :8=IjZc=#9PM!Q?+gavK?7"\0 dD9Ri7?xIۢ^aZgHXzVM|ZF%H ;oqvUSr`zhzo{:\wm@K4)P7*BfdW^6@4 AJ6D1:ŨPy(J0Ƀ;E")p\.HH߲x0$Nߙ!{5'˂g]8KڰS"D|Af8xNL6Zg[5LnIVw] %v&uC U%{2ў~lA ?Xk笁g"5̚[*(N)kVz`d/4^~5Z}۽S.`-x;:xehkwV%taX0Jշ,8 0$P rF K@F+[nW>?%K_|i@q]T@DFI8nB|g[q2DUXRY/jCsg#6ծ{$_N [w?}X0r:{`r ]e gF!370*NQ>՞qAâ򅰥1(z$i2ÂuL!d>Hm+S" 8 _<)l8z5ט yU̶z%`kx=GI[`~>O=U\'_4 8 A e gD fTDfr( {϶cy]ߣب֟uc:QAb[f2.F7̛F`)DXwŕT_re2WRe$@`lxfyhtF*MR|m$52 f)fj#=Ԥ )[XpE2RPb6.8Wyp|~}_S.]]}WYrԃB02#~,(`!C g!bxPbm>&2z" edƬ06Qy0 hZs143k \|J6a>}׭cn"{&FL֒0wA%@p)e:5}C<]z!1d>[ht^I}*Ia3 {Swa~o誄0o4 zDo3+:ѯhtsUE^ݓxFmw\E*NPY[|00& o cR&?1G 2ّ 'Ñ2u.Z!B;:mMix`֤ƞLG\`@<0vDFڑJ  zIYMnMJW9hd~)wfˮm<Öep%Fjc5r>Td^oOb8j'j2.3B'g#$Ba|X7L{SHwG# ]P܄h>3CBt2Us^vϽښ®_xtszM5O+ʱၙJ+Fk?}֪,Hc{ Hcôv$jS<:v4 =x,cۧ/{GR"Us\ KwWo)Mvdfi'X6z{gAnK9פ!SHy&h,L%6y+Wkd80:BݮnXD`Ǟ~&zYWfǟmvүQ&㺫ιhUt²3Ô>G`~fXPȾ;FD~w3l HM0Q$f=m&kpFjVJ*.@ЕIBhUn2kʌ9F<z-m¿ #kLHhCہQgI&#f`12\6O>Ob񧞊^Vg&vzLR$뮿>Z%Lm/w<cGBչy/AY.֙w?=wz7ڌ$ E"-;Ȟ29cXHS3f WR70 jx2< x#iԾ#f+/0S g\K2 :6UG|9j70eʜe {] #tw5rA`i_3y),6\{]v!MKUPYtkmםWˤXsш3VFqZcgtC7 n/B-Y{;Y_h^VrO4r_z3zw;ҿth` )%ϼ.-W^WDžr /E>bsd<-c<6<ޖ>ODGx\xYIm=rx\eOat=s{^{Cix碕M>{M4Q}7͹h E.5{͵ѤE[;ku4vEјWDcN[>qa|hDS.4h5GS^M[U4^ͼhE^h֕G3/N_g~qWD5x;;ދwckМͼeX;Cs}f܏)hZ!Z!˔4Χ?h_u.|*E,ELET?6pQxﳣo1q?;ګ ,Þ_5vUQ [嚥{'ÙSkk隟Aw5NY.҅ !VDCevE0p11(1h1X18xh@`ҥWG/&|>Dc?QXhs.Z䣖k#$~hx5ba] 1S7;aE?j IENDB`weston-1.9.0/data/tiling.png0000664000175000017500000001276412456345006012707 00000000000000PNG  IHDR``mo pHYsodtIME(IDATx]YsǑ̪`HM o`:??`Ê [~-+;`00GQ}UwW4ɫB 1:+++3+{0: Ԉk{a9 ݝ{}t$a4i}J13'VB Hr?EN+ھpWd{+Q.f|yUͨ24}u6?v=|⣏>uB5]j=yW6X !~3^>x}wwG^>5Ljx7Sw #3jN-HӳˉOwB2ۛ;x<Aߔ S >V̛A~{sO3FD!H 7;0ޑ,!"0ZQ$#Z3 "" .MR5y>&OFYGZ: 5R#e,i=z4w2U\fXx?#1S,VWsZI]16sel1NYGT[PI23؆ߛh )]Erabfm3**Nƪ-z4وkϔ$=>ּyr:tgT]6aLͲ99fPP5YEfc5pUƒuƦ"JDDьvlX,Z}B֚  uG\-hI1k yܘ@T M2R)\É-v5sBH"bs>uA@u %e!l24s?Eӌ4"Q㳳Vsb^&cԕ鯫œKq۽L/r27-)\pc-#BFJ9 RΧӿ||U9]7~ӗg"\Zu +IͮA 6?Zg'(Rqb0v; \q!\xx8긭y<;nW_.bFnq".ax|yu5SVDal"pqD!›.Urtzr9Ð x)ߊ'Ny@H2XD$fQm0y-*BMDJ)9L7d(u5lU2DHH`)|i2i5*!#^!/P"䥆P Xhi$B$ z#&Rؖ) oxtRuYҍwb-S .6ߑ-^ PC+FLʹX^gCL$LUker(V"lkjh]Z$ Eز (3Zȅg4P;׷}eVoP5Qf Ln>+塵-(,}r5 9 MzڎZ+da@i{h-bS#.Fů;uJ'vr.L2ޢm7M@ 7 u5]. xsS7i=#XZTqeQ"?mY6ZWo"5wX "7Uy.HҔmVƤI![d֒T E1 "b\O3ζ(pT߈(T#JiIJ )4 )ux 2d( rrR*!Q` B8J9 Db . 0AHD1*iF- FW5`&}vr\xne}8< h8+ bڭl, }+1b]F~-!dn |{Q&S``0>06Yku/|_9l8#rEaumn>}u(]Qw]``]13l ASeon>{n泲b( zW?ӗn#nomlL˗?ѓ^}F !0Ap2\./eiGzkPkjN6uXHo !67\䂬;bEPO#^%7N|扷D0#%WmR*֑LWc\AG&`GdDt-x&S?@AD (5rN_.H34A@ hO] n^&͵*?sܟLw=g?G?dz(;-AB}\J4u:+7aGv#3Nǧ;nۇrvK6.9G"wvv߼M̬ѬW8X$px $Q!oFC`f|XzbZ@:O;݃uV$CMţ Dh2 ®(0<=Z>9l'~t|'7 lz%")GᴈP `WeHd(!Xb\&WroEiݞQ:R"Bb.rqsݬjqWv!P/J" y۸T^8p  8-(!Ik0mo}N5QT@*F~8:[HA=IT޺)'fcb°/e ?Ȋf9C^=? >"!(RY$YUOq\ /+똜^y+$8~9Gv\.h4/po%3PJGtҚ`Q8{Gi!}X̊<< ^5"!iu2KJPJVPkQ8 , l9ܐ5a0/ƳS8T*^wƔ&7FAR-r~@YZ-AL|C_=WZu]rX l\?>ᣬ/0cm>UN_^uPE#4<`.b~PQ4_,P X;af̑֡q =zHR30A@.)xp#ÈXng@"!p2 H 9 i ׼2&>~ 0Rsf ֤\1Rfq |-ʼnZ秠$Vs80:䮫]DX~&F[>hBcrY|0gLٹ^[_k&MҠ>݅\b6864-UMk"pMMW/VԤ"\w+srk4M ͂U՘ɇd8lrAYP f\dbX9m\#u5%0 0BIudRe25lxY^^Qj5ަjJ9B ֚ӫƃ}lZtY4+'\BAvzrSgy#[ِ:fO:!ȇ??|E0:3V$dꔥ~V~tum+w~n-ZcK;M d*jU "[]bV`\iglx2я0jmv<e/A*{_nk0W_Zͭk$/,ۜ_Ë'9mm?' ȁוQj@CgJIENDB`weston-1.9.0/data/icon_ivi_smoke.png0000664000175000017500000013276112456345006014416 00000000000000PNG  IHDR\rfsRGBgAMA a pHYsodIDATx^7 ϟoNm_ީ7D{O2U}zHDC {- "P믿|'-ϭ#tǡ{,';~w8k2?|FM8rv|>Cyu]"O[?yڶ_ml^^Z˭b- [lƊ|tsAϚ6>~}{-rjëvǼ Sk]NY}}ہ7xc鍇97_=>3Q^?v!o2yN_MsڂPC}oڢ;񳝇'?v`"S潓ݸ{/vM lOk32bk6@4VGX_'Qvyݎɿoi*ok[?Oa?\]&ɴbuXL$[宭.oǦżȹAN.F#J=~U~p ɟ$Dg'o!&H &\=(\:Rni6t|oZf]G&? YN:C@lQd )6pnKَCWgϮ+51G?Z}(nx>2|2fҪW{%a!g$ ;%4D=;?`R lwN/ki&@*Gői5[[f@Y}V kgOCjH%?Xuc= .<9x<"L$Oh=恘 )7+'~pF5|z䳫kϮrL?d3> "p>;tRKT=*uUF AGS ItGde'?~@f?%`ĵKf q3# ӗo/[؞4*5 οK)¸Xwñ11wXͨ~BeC]Ld(( }LdHȔ$hOZ6͟.vwvfP61ow7},"^kb K}&ǁ 7$hD\G>Uzt>u\U=Jx/9=,SFP'ڃL( A6l&c?0c@Uk)kwyWp{ifIPwg%2A܈x>dg (&pT9|ZKkͤ2?L7TC< v1 ":^ڡt~_1BOj~Ed#`u$]H c{2Y29 C!pONdne`b$PgNQ i wcegI}ԉݡcuD~;WnWq`L%v C:o(oS G^w{6Rྸdw2ϕ_(A~&@⮽0$dh $J֐qKF>b^fO1 t&XJ=m8I.s<"N[%̡JF#CSABuW451lk3𪀘V6E &NjLeuE=c3}~}ϱ1Z9؉wК[C_qx^ɦˬ/z y5!{Ccw d`%Ē{މ;$Tϔ?e$3 @Bq§- qC~!^5_sk uc?>m;1_Qι4Wǽjc6{NHS5 *@h|E6hc幖:mX_\;Y }¨{Oҽt‡"(ږ%gf`B|[Fb$)R$#"l6Z]O=[loWDͼ {#WO8G"DEZx<>>q$.99[ztE e /͊Y -roA`"=.(Y+a*aYzr{:>*ثg2^u|ർ~Y{O}z??hep/K&KLgYi7'̐Jהп-3SLn\LI&'4t\OBR_'|3vЊSտ8ӿsIp59B7!%eXm8X:./OXSuc?lkM1M/zO G$$]cٶ%X!hVf#?LF"T ՟:g(u_hP^~3D>t~G!=P,dC eXq-F+0T fHe:-QIJП;A"HLI#p\_i 2DO0(+}~WCd;{40gCĴMhx, _K􇾼#M2 A99_nn{މ-c[*ksT_!xlADG k]_qR)lp7hf Nb\gxWf }Ag!J b[(CDP0˴bRdNJ)C3~&&_H$ӿ J멋:6m&K`"z¼>V?0/%lZ)w=>ǹd&}Q}MD("/iA$~~'&&#Ʃ=MLGl;%"hč#:eek)ʹ8nٍ~aXK%N]&$`٢.;0RLIPMK]Wꉂ)z7q_Jfc3c_zGX uY$EJP̪Qc&S'TI֘HN8O9fB(~Kko?-|L>>դM0CSuc2K{'c*0Ô0N}BJv1/ hsW@mE LH/7m:,Xj$cx3n m؋!=q4[kA%C`c\> k198nMHd8I%^] "ƺ^ן pW҄={ט L$Έx%& HJ'-ʵ-~ډ§=Bei\~m-Y8 So>Cgǫr| v Z`S x%0j% I4&aB}Y:a ҮajbXWk3_/{q<b!ƚo#Fb7__cbp0F ŘX7uy5&ZXp%EųH9}İluϢuM<Y1{,XC$%`5YEdh${,?i=UtNL'R< GBZi G_/·Ͻܢ] DgZ=sܫEۼt>q_Z p1ْLA/z[8[P(ϵ+y]4_F%ilN8cQcLIH`&IJIb"f(V$WNLW-\"?,~3*}fU9~[I{ua,ܯW8}9 k/c$^}8e0M6[F܆Pc[>m, c4bON%[IqQ|Gԉ&g S? V1H>lQ IBr=Mm{)Q-*U,Wc,@gGzv]nldevW+_~FHh*q'6~G\X\xxlk@P'a+aIc#x8Y Au.49 1JV4{VC8ؠ0cC'S,1?k 9ʘX=m844:D]V@Kd:Fuܗ%T{)ƽ:61#T'b}½g5:1O%<>}sfhbHJ%Z;WǯBZ26 :d\& U~/b1U CŗF? `L~#-? @mDqԢ{hԉ]3R$uR$H0}fff~YwZD !ps;_ORJ~th;%|鏩DY⏴A¢/o_H&ApĈX%<>;T =L;\oz_̀ku!ec^|?S|ƂUch2KKp"i|/S'uʹ$ _1(, fAH fiO ó?kJVtWm1{βx ! )߃:Vqk`bpnaY\ʅ_b; pYVi!Чh _Y=7c\~Y62m2T64d?kf%}v%׋^uc>WMGWğ>CI9X}K |H'gyf3)QD$Ibgg+NĿAeTqU-={%ư짘T]L[¢= 5 D~' x HtݣK(dby&r\h.c !h>E 4oGӸlӮleˡ@Σhձ .hU}dcEJh`1' xC4g]}y Ƴ;AxL$dLi09Ld40O ,K!_u{1iQOf-=,5{?įm>?c\g܎M҇ [ݴ|?8y1Ƌܟm旄S3EjߴXh2Dɾ!qxAXF ~|>)ËC^@<_k_˳'~ܓH c-G̾_^CYbD|c2=>5&ǒ{J h mJ^shIuut_]VV>6sg+#]+LJxˉ_DJ*̳ Y_L]ϒL}`l~ʤ7"iԱBL%8Nh)yId=onWlÛf2ߙM/ʉ 8+q#zO>j#^I'ߒ~įDMx{>S MgƨGm ~C6\G|W%goBw}x}6PDjJC~cn~r̚&2Y:ͫbőBܮq)T36xplA= YöolGbbn1 ]P)˶߀w #<;^APl6)q oޙ.hf??y_ -u4#.DF{UI؎I/3}oo+.51F5ԗbhsC6s2Ɋ%_=4("~eǴ%uF;#:dxd>8fh0%?}~>[IJ6vkpYdw,O() |FHrƤ3' NE*(ᮿz35>>}Q3ć9c_:_u%QnE{n뻜΢Q́ WgV($CI77?X^uy~HWwi+Ƒ~r0.h:+/eoM? "1%EZzpWV/VeVCH$1Nɍl$O4Dk4Ie 8I\Kr۱?~ ߊOQ$Q|{Ƥ<~=@w^V\r|ӎpsm蓞ca{ֵ j̢զ拠"2:ѝDB^ 8A66>\Uk??Θ&X0t%hŧgM?g-~ǥ\c}L ~Z-J>Яh'z,{@ a#Y Lb#Dq,C+V/V%8h}:QJB!Y0$6Ih +'݉%HXb0:>t7IO)o}LK?:fcʌdzaϡv1TBn}?F3hh?.A_3;YBdq@p4fua8gs`hb_:`=+1X:> t7\}>XԽqy<͛'}I?۸}h)"7Kr)S&9ԢG+VJզ<5R-v;- G$;!VC}Nt!cbv;8ViKKC3W`Vf,?8qnƁcM1%ؖeJ&|hJЪEj{]r J$$q/B@ n-xKNt$,/B+FZ8pؽHC_o6ĝqaEM/y#pD %U6*jOCߦi EGXEi%{ B^3LJ_ ;%?46\G6˽N,VLjZqO#5܇:S{/57lNw}G&7L~! 22,@PӴYV}ӴeZ"h(a*AɰZ&drBuXb H);& &ݛ6f`+确}wxi 0mz4x &#&޺;gM~nlδ]vZ5k`\=XmZ.CEi%,2!bBE!{{` XG46hŢ 6Ps Zq=2 mwq^3a6c?!+qdeudfuO>{Ɓc?Z_~. a'ycG޼s z mh'd/kn{1~xV}Eyg< l5k _yiŦncM]vRW7 yG'5-1_m69@+huk͸(2߲ ,X,XEbwb-ɶZkz:S.ԺߕЊOR׹,>N9v1Ƶ Z#MWok:GNOzi3v i;w, M ,ǔlsLw|aP)k((ēo&_xoOñw .0ؗt_Ws'b|MߗvO }Աa\_fhD1ŮKŐLt21xL<SDzc8s"ދIbp۩:7Obf_ _+etmXvȆZ ~6~O/VI0#|P@.7Qw P3`qtAD@8ёݗu?cuM}|bs[ĸ8Nf99u.o7ľ{8/;nbBA҅oXswӳ6fhKy2_b|+?=2m},Z~d g$XmAo1'0Q0 e~f״ʎ}iNj~MEŜYg~Ŀʭ ҳG|}G?m;3ujDK=to*[ 幖:b)BXG 2}0 [vɹn,Z}1[I]r٘%+L*˳?oN#FtN_:iTLtx3IG "Ph3A^"u& byV ۩덴6[:W fO1rD]1Kvm=B3!uZPe;&"8~=cjcc<ډs~NP5f᧥>g2MzCK)Nܕg.N>:vfᓓ?KM1 S֠q]eilc:9_%b2{X Vff!qas6M`܌J_IWJg}1 $<JkjvJ`&y}`1w* ?'/$tFἯ!D3U?[F00 Xk@gb83h\ת{Zu6>˦[+!jӌYbڊ}M\g=ZjmY_T+><iW=~LJ|pI:D^[l_ 3xK?:vv婋zP;'HP1߅ ~(ŰO>V&-lŻE\Ý#VfzO*R"=%̏uN Q I?N;mU'A\I?,` |ʌ`j>8|*o<幖ziFYܮ@(z|vB2f'!~;şPP 3 |j3@c]G `PZ~lT2-e'q\ꤪa(N9Xfur>ǍcS}b_u7ǿ˻>yY~INigW.n~H>N#^ZZ'-9Eѐ'4Y + =#?hMo%h330ϿهH/{ l<_;KG1A!D3(F;ށ )M1,WK2#~yx,c,Rf9I{i/?t.qlsQv9갑R7X=BlA%LrbE# ZꢍݷNM &H 'Ə(Io5+ǖݗ'W>Q-ѷOI<<[8뷄T_ }6;f0́2g &pPȀ_@˦?h])zZw_Z߯Ƀ%? |gZsz5 o8Ml \&QƮ)Hv4\xD>~,[8nI_UU-ož-|㣭%s@Q#(,G[ԽQ8oCz^a\HX(@ lmýr\ԉS2?8^cy=Y7W2՝/ & 5[%|߳"_v 3K|~.tQ+XbM?RvK{$ KYmഔ,x$l˼.,%+_~qGZa T(MQ]US\"ze?ſ񇙿%OGğAc~ro[K2nj#a ^\)$@ϧA[d׌G¿%zz~j(C?0q_hӃ@?RP#D yP 1e=3%u~_rDL.y±Ep2.K.Lv,Yd6}.s?)qJC+[N &)&!Vλ|M-3EDO_OHͷ݇yG%|x_77 gv4yt~ NU; h(>zY~ͪ\KJ8 %ѳ3:ۓaecz14g Ə&^-v!~~}{^ 2?f}?d!8GdE~6 {T$(f=/5 <xRP?m『sr rrOʫ>ꤊ5?f3"7!Ww~.N1߬6ɳ(H1|߉_o'4gЉşW21``Z7M^~<~=#8Db#Dc{T>g&)M"a>ء7GK))̟vz'sa0(%nidOQsBEM &a4V Nָ+BJVoe|lˎMC}d ~A=sz&הc)+.|ğ*l⯟-D%q7O^c,z$S00_d'D~B| %,ߏ5dgz[Q&+e1ꦽmz ٨b0x* $RK&PL@K58 z-. 'XN;PG Gh]עu평)A/cq[?@1ȶWnk%/%~@g?=cI3=N9v?/Wu7 0;">8rHA#<.޸D  `@ds,@nңCKr8Hs 'SL!1!] 8v2x}.ߺf._[Sj9ߍS>^.2'{ɀ|ؠlYFXV@4e ;?q dLjZ3kw$JnpEƥ>f' 1[>1:$+Bn1ib}cc?Yy8srUg/g@k%h6k 6Mg.M !`Հ-Ef}/585(ꀱOP90(~VV>d p:qB}Qm7~,ٟU%0ȷX0&~6Yb>8(-H] o\kLVz1zx,n͠ 6 l`-|alI YYέլcd:7xۃ;~I[ӳs%L*5n[D0|n Nt7~ SGE afvq| (S|vz,ܧnдd۬R| 'X 9yʽPAY#'gwh8 SL'LLy(ћ'#_]K] @J>1>fw&MIL 5O|&G%}M,a/rm bW޽!Gȟ$6:?_ EV\l:ggyܧo= @ vO2$ް YH>g,|'ߔ~Q/Nִ^m8B1&y=&.] hz$6j?fGofߟr% LOEC-H& 7M=~Xs\8BCE~-|9|>vv1>|K2uO>@|x` o1ӡ}Hu`V vI6qA-3Hq'(23ceL]u>\QŠ-c ˳ !VG4`KcMEIcןrl K S}*"|Xʿ!M('*Gx{׾?Y> oؓ6O킼.N9rO  ~/wlږ~@#ORW o@ty#qvf c۝4hkORD l-` poە38ȹPzdVdX<^SjӸL}<+7v,^k]-c,[)dGƓO&}o 9JHpNu?:x3$=E'z>M1 $#(&@NЙ@ u;4=IAt&w]w>Jnm:yɳOOn^tMe eӒݩw)I-C  6F'c8~P*cɡO*r{\h; @F~$8z2LJ f$A4iP31jGdՔus^,&V,O'Wnhv1 frHܑ0ӏCʾr-V5ەd}a w"&` 'jh.h+zAğ/8ΔK%kyX}22M2jsdG? @'q#bdm&y|G,A;6-uw)~3Ϸ-6q壐W ugG଑3)pq 2x sD3q/$RLe ?v[>F:ъq?/R4h_ cD?A?@" 8k@m<:I78 'Hj -ێ׬̠1X ʧraV@fA9Z.gqPx)1Kb`=8EK(ECm~ |Zȁh1E_2s~!HS  2C hWTwi~x?tQ73H @ v H-18%E W&{oM􃾑1^M` H-؊Z02+W%<Hm<@6~6z[f9X28`N`xO= J\Gp:hDC#5oMPJ 6KjP?ɬWZ.T/ E!Z|:a]X;ȵ˭h-7#e6 "wv\>٦54GbLdJ4w?i|܏&feS"~L/n4P#~Fp#{2CwP"m߉Ǒa`̓j{V$;/ߘl=e OxM 7&.7OoYP[:1lVBQӺw'&Ey>Ĥm!,V)اa"immoo}=-q&]d0m4ha& X/X @y1da2{dE;%>ۦ>:$~&?H&v> OO|qtNs3ktS8Vndϵ2{I@=Ad c M_%qYd>3/YIGC:`n~n^7]`?41gSeDӒgsJ%.b9lgy 1F ѮD8g3aN mbu\E(7Wj?0w!W H&  lL_*@9١)?ޯ#N2i9Gf%W3Zx"La6?mڞ >C.N79%rMv]nM%YeU߯6hkfN66g0WAThܸďx-hDf>1(Ϡ~vd3mZ~'YXN,.@Wr, Z9㳱xǯ;QƟގ E8iҋ߄b?B\/e`ddv@yjsVL:ȿM<'4&54 @N~\@y =? `c^q:/ dd[L-0!ӯoj@a xe7N_l>sQ` ^V7x&<{,A#j=.H$q(5\{n@[L.ԯ$~Up [f`~ă>SiDC,6+@gB| [yE0U6qJI$=Wɇ'wr|DI&OdHb WM7lO `ᓩi';7qzܼUd3`V! hCPQ\õ8u2:K=;77DLǫ{H%IE!347(k궍s]o1)cɄĸu>- 7ɋ "?/h !Lfh̀ 37Zp(5:yY7K}Wڦā{^X BBS[U@1(eh fe`᭄Z-Z>:W<2LPLLW'cĴ"W ׽ugNt.bOF7nK@7^"ݨ`l -,s8(u@=xRkLhc ~|`r_5oum>}ow됒{ 3U q{)8,z"kL(7fׄr&B2Qp>P5hןט1nO cjQV2%Wwr'W @iXyqQ'o) d*qIn  1 2:^ڈLjjhD_LB$=,_h h 檰@@-g}NޮٮW ʩ0Vz 8Uƾ_=XYIecyk9 }\רS6n"1nM`xe(u{:xoE}$W|Bǂ^j,_NIn 6^ 8|/V^z2FN; N`_)'eݷ _#8rw6jS)cSk:`&^ԷZ3}59 AoW|*"bojяQr+f >{Ztf9E<:Zu6Əǀ U_GUF~ `ydHbNIlY0zkWol 3t _`@p~1uhI3H _!ؗ \\2 lk> n~\03K&bL)ԿS fP :>ul#-\F t_ӘC*VyY ?Zͫ&8~KMjaЉXJ$^^]6LҊt5uy?43uOOȾ'Y#(ۄzV)/3N$ϢjLޠuM$DV(*^@a *@9 +'ҏʄIn,W뙇[GW3~VvLwH"$ ("Dԑ_un?DZxu]<5~P VJ~U$((% el*&LxW b0 yVz 8*@~΃QۃZ*ޡGVe1ik&J3EfvL3Cqh`#34g=Lޯ&/^<i* Ic>{(Jz'wY{h< `d '|)uݭ? 7뵟>.}B?ťcdlf=iƸ79gI$O*"mmqtm_&oZT㥎;Z1D }8{ ;aP^U l;s>y)엂~?x7P[O> QmyJ=R |} vu|~/j1^<]n#M3:½47Lg2b+pW$106'@ on( JJ/m0=Hb]Pl% eQ~`E loHdy#[bH.$(A\IAk6ʘk*<. kEKR ESF_./ogO㛁Y+jFwhP 6=$o%fr<8P6.ru=a; 4[ܫفY/Ib &g1U6@K ES^)s7\Ʋe%m?h h;>~sOeOj`[ǍE]yXq_ į  l1S228!xp|+O=Z`< lO_l@Qೆ Oyǵ|mʐX0NeyIZjb >.&9dH PR]Q 1F/KKmz0Q~DH,eh@B&Zdn]qV2#2 V WZ`; M`ĸN2/ W40pga"ʒZJJx@͇ >=B,qm`@X$5c3uB`<$ IpD@B-Epqclh}lP 7I>W゙ cuXR&P ǵ AC`d1L8 X WL`ML@E Z/&%& X#B'C# [L(3!7ȇd`:([d[f(zHve]A\cbգr.Mh8ˣƀEja -@KH׌i&Pՠ"9cv222cnMa2V~( &pn P>l 7bZ%&xžC)gXڢ7:pFy<8X;d4[99y0~ 8~# /䲑b\4b  > 2UB\uorx6,Z~$Do*0 3cFP6YZF('ϖm N}V2s23ON{8%8 M bZ`/] 8ǁS&[Ol7J@N Hpu1@J4o:(i]RO _>8fAspMsQ2EVik_rbx5;HID%("Ch 7:k4Q qج ӂfLK(h X1#1JVw -ô L}ߛV@18L`hpΤcʳq=R.rUoZtx 4%@\ى}A+e:x<Aط :-xإ ERGxX(lxkPOMa` 1o} 2/La볆s_[" uveM |");`1G < `e}M v>?vlz'@N09NL`L@DPNuh[L<10^r&KW:.e$L2Fc:eeYԟL|#X1Kγ %'RFT2 _-xC4_ڭ{b6cuAvrs D2_1pVpF14ӣ@y L.]ո.(,Nd&p8˗k㾷/A~ i& IܠUUo_uZ; bX^@@RpL@"N&P \G=@ ykZui<€$ Ƌ($GdaE[+ah-対Ih/1d{_ңd0 JDEK\k3aάwV"ϣL}oc 0@ G$$92^ jϣ%i!f2ĿԫVVA?p fB]s `<ں+}-0 Hˏ$,"8Z䳰^bn37eV~ 3s3(EB]~q(p"4*⚋|-PL] Wc?@kU@]1xVGq/JuhJ!&^0H 2ORP>KoI&] I1SK2:7؟DzQNV Kok U@4YfLcrrEP ܐԦu>_5&ă8oH3!Ζ@-% {%b{ .ӢfyXfo@0eQs3i A|Zf ZFtmX^ V]c}Οm2a4P < AB]R] l@"emFq/J-ֱuz1C]O90 _bd'4>D8W2e]m]@Y³&@d6/nQ=Sgƶ|zYIb893ZŚLSY V]cԟH*x(F_mz'/ gļ월$,BD 2eRnǟnAj*:{U6 ;$|H&=(8(/'اU.0W&F 3Dt =VO߶s N I3Y-0}؏Y!Һf\G| 0@ ^ǕHJҶ QgAۯ,Zי+ŷ㧲fZ15OJ' !~ XHpHL@vbW f`9?;d&Gٝge`i|99bI(qI^9 BsD/: .z)Kc E]>Ѫ/(V$젒̝}(Q+!/L |R]mf0lA5up.L&`#H H#dWdd0g1NN$~8&Q >r \O _V{ee$22m22L` +6b_ๆ0}|4j`,bs"GL_ϸq2(7ng>qU&s6Z*@`9s^ItkrQNV$¼vK\E_a]]/5>>F3 ϡmY~$Kg&ŇZ,?1 :M-,& *@c D04b:3(&ۛs]G}{\±3 ,~f nozaXz<Đkߎt؆ˌ]_1[`<ūJ+O̫ N"|> },Y&2lcvY k#kݗ|oY?{#-=T0g3zHM%= h\У `ً21VgxfXH[yVd.S]tWrOx!}3oDҶd϶2t W$Z#efmQcЧ@}.[ϳOl=8xH<\UKϛ/,س}x<7UJ0 :Qu8&Y؎OMg)qMr- _yr+ lLai6$x@FGl2C22>^nb;$ҧL*O vlG!ا,S/S/v Z{;hcŠ LeJ!oǺ 0k6;lùDfMà5s˵E1`=4 :G]R4hJ4+^ Rl9ѭ}S﷎]; .?13@3=?g O?ş 〶~3Q3l~ d幞U}!x z4ߋ}_+e-"c9&|NA{|E*7ڛ?k)9}Fc~WOx `)R%I̭"ϊN`@pTk2Sh0?`ٟOG P_t] C?}^V&'@-3@d$byjb{5M/l.k @2iHV7%hyBE'UՎi S׏ğ?_O 7;!* b \C={Hb4ט(Ei6B`_Ìrqn PBN얈=(Uֵh^;߽_5gf%<hQ'&j b&ҪŶ(O߻^_DC< $ %WN얀(YDVhb1wK-~j 16z5` 9 U3x&Da-:O/·aĽ[ fN=f=$٭JbE'ЪoZuՌ]36w?)KgyK[D8 $ `8sWϙ; -)s/@ `m4͢.?JЭ$[oX7#pCܩUܙAHU9GHPuF&8eIJ3}%VðqkA4q{(8oGZ~~,R:;_1NK?K%|8ҿp&`D>?R /'[V{dr*=(G<ѐuW{Qkd+MQ@#@M2[<0P  `7x7Iݴa#p<zV y]ɀۀ,N-!?9}Ȭ~^$@V|z9O-(| 7/Bm M <2S:7H.8X@K/' V (3562M! Y$1IE1f?2- kaXgMeZugl闄EZ%hc_me z;WܜF4Ծ 0cj璒7gPy ­8*ZefxL71C#@B2 @gEE"~<'24EE!&@~K@e\$'ɝ0 ܧǁd8."Uu&"B2z? dDo6I%#$pV{HrT>?8@SҜqA D"9~V (u4qxԃv= g"vk`1WN@-Ey8fjy0(iY/ЪoHK1K& _&_.gGDo38)0}q^ hr /Yy*gG!?ޣ<usct3eDď.A%Q$B@W>Itɳ -+U=[$c`l 42@ЌM&@ @X:mYhmь[Zl~%EaҪ3; {zf|ECf@4r169w2e<)3h@[E0Kt?$ 5bD4VRѲ F:aش(IwUu lNih ߴOlZbm->xu;6u|@ylqqVeipg?z& @ގNeñ+d+ Hƙ瞓g\I"_zEe]q'BZԔ2>ǧIeKA ?ΡtF q&#S  SF0cOKo f, u)G2 ԍ,~^N@oY3bP+a#P~1_%r2Թt %jah]ע|Z״i]S f@A7+VX. E28NYg y)~ $⟳_3*~__0,, &KH zIQBy_J&#Ƞ1 `HdyF}Y,ZT먉bK}k#h]ov0⍡{K+ Zc>0hV~WEyQ)hܖBp3s?/FIWËN3"4#G;)xc0*Lhu@q $XVZp(UVf4>:{н/J|O0x,>`6|cL$rra0_rOy;C,w-BDt$%Wmu@`=3 (ů%^ HOkP/*Ik'@:7~+M f%H{L*.}1q~!ijҼ&]L-|׻R\G 2}q%ֈg$QLd?x ^D_e; f`H/ P `l3 xQLVd5kw >~ _jXLS>qX0cآ6ͮ]% )9%?tRr~G LZ$bJ%| ا @Y~ɋb-u&OV!n/@w1&״ט?_+pNL:W`e#6 @2b$! aܙ#2C밎Q08 !&ĉx$%Ku|%  vdnDDe۸  xQr]}grU3Isۼ~˽R\f{iM)1<ʳu `̉>${ҵ];A5l 0BwUj+#7k+K<Շ'ޗ@X3Mj޼Fp+qL0¶ \\[5'\ee.Mk'G50Uste'ЗĔhYw=>s│x^ºqx{9%Pk5 @Y0 gSK_慨41Vt{-Gub$zm-YM`cjF @"3xMP~:W՚p712 `ٟF$w==}-L:N_'HRTD.Bwm,Lʸ8ćR DqM3Uq&pI710^p"9eN#zrmMkɉ q<}QW 8bv2fWEճ5# rWg(i1tU7Ζg0mø" ضL``6<q(Xl 8OYD__Gc0%yXZ{6=%cP_\34 fh#gE )(ǵ܁ȼ"Z(Y -;CݗN'~h 0vOWd6Y&kyʏg:=cc4_n U`Wqv> `!S?n)j`P$i^w_WjΑ0x<,0v9_[=0I"& aՀLF1>  \j,^^ >2M@NNJ 穃>?8NlwUנu<x<۱m@~a.too]]Z#Χ@^PI{JdzRm`GoH2?u:w )yHGGvJhޏ!EZzanԓhE_# NǨ6m w%2j.≟`W$~,wR>u5K@_[Ae  Lu>fD'qp e2W Yd6aiĽ Ldx]n'i`\/ϙ\s yuJDBO>/IZx)% /i};u-k w|7)6Ov< V.ݽWVw%⊁Mkג11O]x$}(}Ćx 7| L`&`'8xhYjY˲i0IfImXx B}uqͽoM&H$ 3>qJJ:"Y^Ӵʯ" ,(ex&@ ($ G2L@ L@$m bzuiE{0:߷ `"[EhW?k6#ll'Nvb"dxxR6 3,pMJ*7\ _wO-%5%% 9 @};zyP #X\G,^h/(kk:D$[t ܆Հݫ;L T&p@4b\@:G9"tWڤ7/\8;{oZ{gl>zLҧNi%75Չ'Iu4D8f3 H1x$9+?Չ V+| Q0/7F2ccX`0lo O $#0kk\\L8įM?#@rK;MiUa@KPcǓ W@ODZFPqʐp$`2 0+@|&)zSbQ&2x, A01V6M bs}?{p希׀^o,mk1ߝG6[A6- `#2z>kAF}2I{ڝ+IC}|*'3(4aYIyZ(vfm/.B&>x_2]632-#jf ܐ5%\ 61 ȓNjWO:1"VŐ{ ;_, o,xf1z6#b|nkJ-v<4-'8,Ծ!0%nH *yH%C< ^Su@ǁ2 l5ME4MN'dR6Ǯhg`;w3ǽ6Ǻr/>^|F.wfP(_qxL;8|]e0?UW:}1\O?W'yRǗaFϣBtc ?B%=Lm&c] MFRƍz<6GZF6 iGcx2*׀,CpJKjDE ޓT418礡}C:?6pݣŠyhEf@mu(h#׵z /6 31(g~wo6rO1'~g00Xܟs<$}=8 șniV}(3%a tI "IdJ'f.I<'g;BOpJey'W?=?Z~;_FxZdao4SD+%㶈5c4g2q+--{q137J-0AG4,=GqHW?{q\u0%Z82Sʙ7M4=Q:4s\}; o+D(&>~4/I3]^hy3k3WO9GY-^,_e=>V^_g">b(WRLoH'e(ϵԓDS=ӡ}w;a"1Eby G)e⵾Jgoc>>I~xR,/O]8}Ɲ9?uO$br[~Wm?xa* ZG3HBQl^ğVܷbcKx Ľm̰jb"p5$} BS [ Hl|r?mVW,\!z\>cq^?XbyI=?yĹsi#8e(qHEل "$XxId IRun AS(^)a `?>9{'1%|?$K VfY`j,|3&~c:!>'y mx]eaL"#r%ӧlc$?㆙3-N,\616h uZ}J@%Yvvvv><9X ! \4, Zf8P8CNd UVu-C9e6#NMXǀ@l (k3GEX1z lY]@K[GOp,pVK_+&ߔ`$$* `bJ2{J2;18Oyx#3J۩3۫h&S+ )nq$7eWey(G@8"# N걀\A}1w1D蟡Εc ķ3V@Z3+"lǬsD>6#Z&`8xXӚ.]>%O`~Ĭ! ? 4DSz݆_>_+2p7]|r,\ohYN ` &@ Z-p Rc,jDZ& ې󨯡. ܗo4+|0~\[70n|YM`~=hɁR":!%̛ $)|$?'SMx"kZ_= A^ l]&HFe"~6|7-prl\kkC Føvm%l,l lM gl{ؾGh:v۟cC0'ϝOq$H6$L>%@@e׎嶲PMO/u:YGh?SKSPGr!D\>Kyď|% Gf| `?/1L&#wU"Fg#nyPS8O!?pI=s:G60Wގߺ&fdɳ|o@&hy4OԌp.%ǵwOR2sRL!9ID0lӃsPgi%~jX;V 3{fZ>FL g~f\V{[& .M-rV(n޻ںǷ,<]&5C#d~L󱌧_01"yVb|Dļ3=A?tDJ.%4%WIJtjJ"M#2f-iAr,,b1x!D8Nj׮KW[?vL2lY&e:ZNfs+PMa, {gz G8vCT9MI'b _0DZ @D]-+د?>A>}bXC-~ ¯7+PJH,hէvj񬔿,@뺕LSlŦ1H8Ay;ɓg »3ߦEn'anp73k䲠Uuc*d dBJLA `5h 6nPh|-qxt!Zu[Y h],یa+F lO}Yg  |)qD_ gOp-P/B;e4ŇhmIB/"7ԉP?\myw&F y$ n%+(ǀh^0 ,d0W1`NH]&6*3E%e:GWǭ«(LdfFe9Έ?·=cQ50h^ h7 0ʬ<eL {5cck99Q'ۜ0VKs ga{ax<gmx>! cL=A=]UHN8^cIfg}sLQD|>,uq֧#O& G'zTcY{S OG^+,=""`?}~&  P"*@ɣsPF6>9^D5L=Aq(V93buV^5&z !H~IN|K˥ro{>1[ lbEiՓB[cxL303z/FP$ş虹 ?F6d?Йd6h6&ЇSa͡c&1L 63CwY'Em`. YZ"oܫȘ l8=| $7H}MqZ[bL cƠX$8nG#"7 3(D -:g )NHF Gї/^z>o_= ^`,Y,x>#jˉJգ%5Z]?r,/kYKB$:±P,E# A-yk}x/5BѐlX%9%} o?$]kc ccx~ oi>*?(F}BJ\+Ǯs!q篅ֹվ/Ͼ6~v wP5QauvnXw%}/=j+ Pu;$#C(=O ֽԛڴ3cxpPYHso2,{ۙw$zWؽ@b$ˑ'S"pIuKGe`N:_ .p-i|jZf]1S3Xa~7}³o z2q~}ƶ2\$.Zi fWA@-7,k-&)n;b梒YS^@;aWZ5ܘVR#wϯ E|=ߓ)࿁UK)qo G3w't]+r` v,"]q{Ɠ9wr6~L/g)Z -`߳a 0 bsoLݼ5QxXz vRSēhokVyms˱jד[| 32D,͊ȢY׏ދѪ#R#7o{ `i E|RghK@G%yZ1Ȥ8?D=NzF'tgyEK(+Ujcy*jo ^|ҹ>C%yw%$n{X>pMl'!#_8xQBrK^qS %cNN-ig&w<7n6cEXIL)EUg7=@,~/$г(exZrVT3L29 ;{z/l 43 勗Ln޾^>}ݟhqBFK ~bY-+)=swϢ"kmWBizAE* g[DxQ4ޯGbz;[q{X-MpQH..ʵ󓯾*oBvJ!1hcq?~?q,šП\ ukE$gMN<=CcX?ǶcvZ]#5>uYq! zp[ f(].v`wr2 _oI>v"!nl] (,کXENl_"|%ɓ&«X{sqVQ@, ,ļkrE5DtP׹=> | $QE2\G4g˼TBQ.9e`;AYo{?[nCeF"הxu+_&?ܼugrj}K?/?/j">hx |;&?xbND/ET2 s~>/Dat|>݋ֹly.ZhUS7o%%_rn7?P_1MoJb~2HKP/}cse@<06j:Uəyx:B'Q& 3~(~V}ϵDbY1 3<{ͷY;~u|mq7 P?vjRv3@*b~Ă\0fٺ2[m&@bC@ zBn/G/O^eǯ)t>pyu,F-)oWc÷P$6dm?R2/':t;O} hXWV/"~bϿFg-zɓRݼbzf}d?eOb+9kYt]ך -@6 E 7>$_ b4ka`P3"K7#FѴ*i"x)YǓO=@3=DP\tR?g|8&ՌOQ ESkeʾZ9, ~`A$tǦe5XƔec;|Lȶs_ en#@ii'ucf@fJJ.*Wy9(qc5 |#/U-I۳Qu:7)U 2+DO1k%PKw%۷'7Oe_+K%zVE$—A?G3yR {>qq8'cs5?$*@\p:mq!t}>ɪX.qMG;&ӝӰo?(S>~wZ:x ߓwĜ9iIf3 q0;z5To.Ye6>w𿺼Ox[WO'?=׫NDO/lObxgZQQZER U_? AKh<$ I4?0̸ l,(Bef3Kʵgz?/;ۏ 鋦J{hjh &FF#@T #fl̬lC@dD]s;Fµ~>~l* Ԃ{hjh2#yk#L̘0H,m 6f[~so{y?K_ eS z☼jrE( CR ^Z9 O %դxNB:k3PE,c_k#^i(1 M@KxN'n-(YE1(6WVPeh U5-ZJ0fѪEjhLZcC5~ a1h w5h(8,ZC"h%Y+AXVh%ˠ%բ/vъˤ5֯3 ?VZ7JyejcZzYUbZ"1ѺWV̢ -?/vъˤ5кWṾ-fъˤ5.]'ѽnIENDB`weston-1.9.0/data/terminal.png0000664000175000017500000000175512456345006013232 00000000000000PNG  IHDRw=sBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org<tEXtTitleTerminaltEXtAuthorLapo Calamandreiߑ*)tEXtDescriptionBased of Jakub Steiner's work''IDATH=oecv6 wbG  DH@A*!-H !!c[ݙw]b3Ҍ4ss{,)!`ybۋ$6Ϯ[}@eOvCBsUUnSR\ZG[Rb'M_ZzJ/]9yecvEriw Yl3``u&ܻm >UEY:ARbwof aR~~s!cȷUE` xk@Ik@}$Rj_?MIENDB`weston-1.9.0/data/pattern.png0000664000175000017500000000346612456345006013075 00000000000000PNG  IHDR;"n6 pHYs  tIME3eR]8IDATXíXے*${TNb %vԞSCCWE?N'sn۶snY΀}yrίwu>Gm]o?-Ku9維pE! |LZvlf)hRJ1Z 9O\1sQ_nUs)|)Zray>њMK1Ƙs{?ϧ{^Vw vن!F|uhgsc]oliYTdOӴwռټNqTU-e|ژK)땙mZv{czM9֜sZ9&Fʉ3ChZbpOĐ:hGfU;41s'ǯ~^3CDU-j!: s@K f>/ާz/YlY \.vI9Sj"b[^+%=,ΧeX'ׇ}e8,Ce0U1jʪF.uVvbU\.yRJ|: !,}~Z٪D}%yԾc >SUFxqm1F+|FD 0hߞm33t `^٠lkkcaVUQq9QQ f:Ms?a^O")K)D3pj35jsbLID1nnmw6}g_.3kyQ+谪23cײs&U%j)ц' i4WE$0DDDRm#{9խQ+[ c:\,@De+C_MEzO1O9T5qO!r)%a l81;)\kGU)e1=<>niSNu]f?*TJ>`zY5011K-ye,v18RJ#w TϺp˜Rg@@J]Fo;[K}jaY:-?ݦ4QFj::v>~ҽ<ûy;UVw }WhN$qT S(8IENDB`weston-1.9.0/data/icon_window.png0000664000175000017500000000024112456345006013723 00000000000000PNG  IHDRasRGB pHYs  tIMER3IDAT8c`0200&J]00000O^002205 P(ՆsIENDB`weston-1.9.0/data/border.png0000664000175000017500000000366112456345006012672 00000000000000PNG  IHDRtQbKGDVe' pHYs  tIMETiTXtCommentCreated with GIMPd.eIDATx흿nGƿYޙgCn4@JWR%Å>*wy HRaؒȻڕݽ;Q#)73;wmў.Z+{J p7Hx4o=R>vI=I̜RyXL 0T$e#TnSϹTLzU>PiD1Ff"@%*3%`Z^+FLb siO&Ӄ$܈QغPji͛7ϧ c9tH ///|_HoeZ׮6hwڟU@޾}{Y=l6CUU 2 >|Ǐxfi>}d,@ۜ띌N^~“'?,KiѨ,K6bqvWWW?3@̆ 37L܈6+w j1Lel6a:Sf~ KZc{Ddf HoNNNRj Ƙ\PPONNR`sP 6 "+.Ztv,]oSIt||l(^v``b( r*_;FaN.cSZyu3) Y2/4X b3+Щ혙-Yq@٠{Rեϟ*3?J4N(e,\UZ@!@+gVcP@Z Nf0.˕cQ*EHz͍l1͈vs%ʌSnXҩN]cGrSU]naKADPL]a(kL1B+EzEcj T$С`-Z; kLmJW[IH\Zعm@S!}QF*qbhjV0c;T!jGy@P衂TK@8mVSj TM)P@Ն[@Uj[R Uj(!L/<Oض ;:PFfjqk>w-*.7GTD>okVTfW}&5Yi)PTl:Pke: rZ8XN{`ۙn8r~__OSRB TVy~v /sN_Kydq~W˿ME ڵ\}Q*ɣ\F\XNȑ)lA\l"0Bw\mnݟ&bi(u΄ -HnD"\5ŏ($NeN ."`CebhYkUՑ9Azٖm16.Lpm[$E"5 u:̮Pa^$L@bo%riC^Cn,Zj[z&%Afc:#XsJW'"ZbQ>ߝ0wW%.̷Z)JX]Jpn*2#ؾ yh- ݾnr78UTiTz!*ͩ8̛EUvSwv]OB{p*d=;ǝ IENDB`weston-1.9.0/data/fullscreen.png0000664000175000017500000000651612456345006013561 00000000000000PNG  IHDR``mo pHYsodtIME);% IDATx\nSU=pZ)!1 ?$#|@!K^`2%rl]KWkFш Nwuխsso'gx9M!cxm퇔,vyt☩LlWQڊh)"FF%iJ IFqo𢡊6e#{H݈r2+ι" [Yq紱+Rha++>2 c a'jGÏ-{W]gu8т`e5M'/N^v_<<ݣ#I Q(lmW./;]!x-K}W&t2~$'Zhd4SRB>䁂K Mg8眃spKL2QFJ)b`B5.M{V>Ox+RRnRb1UI(?2N 2r@=o?ő Llv^AGU$Tzt2#$9CP>CoqJBF1`QQpr$i(i#ehW]8 4Ydx*b4A٠d)=ףG<%cFtT )#9P9s (`QD}^JL"GQ` /ˋ59m<}_"kUB )s8`<36M2A)Bsd$<;;4e!*Z_,H"jY#-gX\s$z?O?\d+i&q{O|eb|b#%qytggZkY} +(M!8r LᣇYb ڕUt8 ΅_O͍8KC)ըrHZ>`'Zl'GV;% Q*l4竍6ȔAŵq8IO˧71BAm23B)5l '7'ƺo[rYzlgd ?c򥉦^ ިK΀?) ,Vğ/eUCr43]{9>nYx Ec-dYf8h7̚0 1\BNTa+lb8B"sjGU4Eqҳ,G# ɾ( V>eN5= S^TŰTr/Tz1kS;APޏFel?ˆ{0%%?816Sc;z/po4,o3"A~y:o ]isbIIA`w79G$=̒ gf+¼+%xK=+[ʪAnY&#mZO椋T;yi٧?;>rw 8m o`/'D8Hak_X׋Z47tezj> Eu3.xl#[N6G˳7bCFzsPV9BNa'!dX h? 2%ukކK9\|%P8daA$}Gdݵ:w*;@>i*sRV|VMi\ RڒE֙*Y4H L)E%[{h6O_Ew0Zr#FZ|BndA**2a A*UGcBt:jer0o{} d%aޓ*8=$cblJ̠J`L%)fo?zlI0\]=51-TYeګ NQN@\l}`1=ouΟޖ.{_] \]̓5~%}Rtep֯Sw%3U[>sgU7g=um/"\|q[a kڶyz<{/'6Z'ӛ;ԾBٝH]gᗷew])=Sqgg\^hG%7\nնdcMWܛƊ}{D۟WaD Cp~HyewV繦/tOhڲ쭅x{9gpAÔq*>C3R*oR?UܙPKѤHRKbۍϷJ:yʩL+))5#M{ #7^ֽ,~u:n.b1u?UKŞW=?KGƁ@F.m|2mq"¾"ez*[CdSL]^7eי{H]7[W _s? zGzNwD=!rR=ZQź{VQ::& Z^;}Zv,/ŽN++_OY>:r7soQ꼻YzܿXtݡ^^U0:~8"?~]Oʆs~mz;A\Fo; P]CB~-.#UGѓ_sL jeޗ|Eީ;%]iqߨuR=,7EPgϳkIQQF.-=oRO.o ?"ײHO, ZU~3 ~2B/"*1GiEhTa)>f4fWjwVܰ,@-YN~^iiS~ +֑LE^"oa{SQ|G}!Nx:-m)ӪZ(ՓmDa)} %wTD%Rx&eH_/)tL< "Fpp&=P;Dp[dvN; -'2<{jyȏ~LLqSw+fnqAP~2o5YXveN_6]rX늞|< z=-pM-R[އz?! 36}W@\a;1}DžwBzVlzi9G0e$hG->>3qߌF8tP^>D&P.uaz"8unޟ"0"E3FЩ acڗ:;Fj{{@+n+sr iYen=OZZ2 ?({Tq/gp[p?z[|]ngolH.u zHyߝ ?Gs?CL_*3Dv԰aq 4ߖ1G$rqnȌ|1v~?o?n-̅ak6Vi!KsDaP0!%7XvoԊ2 nܯ~JxLbK-]0x0ְqG @9`dMt|.СI潧 ×Mg3 f&SlԲ|}~p;v@DdxhDŽxO/3<4!k@$aYy)>qC0a Lj؏{(12ƌ\?n/ZDA WO2Ch~0t' ׸jg7|UD@lV2/tmOS!o"Rꅸb U{_r'J>^Gƚpe@ a̻"c`w?r~aֿgy8%%%O .S,9w+"7]*t@S8N+"/i=bҏ†В7'~ ,c5L-A8DPby Zÿd!;Y?K.=naɘb~#f^?[_N `cˆp'69dR~psw3<3Rnj{W!DP s $P$ʓ6Z k`0$d`D0X0Sπ^1|eo|ۘsGZ)B қ}_ZÊMQ݄`)޵l} d&J.a$"yZ"B΂ rX#jj{/|y{k8 `e֪VI! m?~IVAE>#s-7Zk tvUm 6龎;$r80T&?\ݓtc w)y{g2 կs5A'/d2={{N2NVp)yv7 *ZH܂!i?dhiJ>NB(=Un+{NsLx`)**cr.,|Aw/e|Oly\wsL u}2lk JBÄ"jЇҰNT#"  uq[!>wc'^mW6+oߖҋǖ[zݘ{)C{abktQ,'>uɪ]q=I? `Xկ(9 `AՌ5%A%[G bl8fa[Tuk-{5ݲ~sw^B\!G Ҳ-rAOc XRV].Y;ۻmċɏON|Շ䯯oH }H+;x!VeO|<:_]TmZo+^0f{eU!Ӫ-zIcYQׄo ".RH{"s|".2> PYC? į_Y@wںER[ ~5" 9߯RfdW<4dZ03K A@XyΔ$qAܓ{ X[̟ 8hJBKc#u@.Lezrz҈=E`EQ 2?Eg߼TK8Tr3~ݣц{'WqBp;w\[d|uy5&! ``f7d敩`a hrg烈HEzW]qUǘqrhƺXi YYF>_C'Z*j>+vYRd6$K"BxF-Lċ4{bZVa OEuMrc=xzTʭ_J}>{uCW aG<Ҳ{xa2ΫMŞ\da&:h?y4"_́({,)'0܀9`@FLĬKp ~ @Oqjnc{X9P~f1;$  bXj7žY2aEhS9g,Z)!SuoFgD(z t:3qS_W{)љJ IN}\!-[s0f_ r?l 4ΊPgN.w|te|>1(`; ܀уe|>%₅;@ zH` $:9P 5i= @-Q-nёouM.I` `yy^dKh>q}}(+u orygj~2K5$~7 #s".j tw}[g{Occ/X]sŽsepy1 bUvϥ/iz'u]>(糟VrC u܁{ ^vo6' 3lސ!<;kPp` > ߓ'꠸p<ś[n)󗳐09ډ$r7ps,D6OWJ/c@GrDo,To[fI>uw׭x?t%iЗ54ۼBo_W,YR뿸'<5iL<07y7|(k2OhAꢻ񬮺_vӲlУ"[qwqfk\B{v!_2RGj_OX!sߓ<ΖفwҏƪEdb7)}K .͑qPO,AH*|n=YL:TcM |2DYS{+d"$Vp}/ Ȗ0k*=Fr)2 ^9$29o_qs+ː, gJw!Q \lοoZz֞\CAn֩vE@5"P(v0qcF꾇R6sgq~|}>!p/&[nF % &k7֭P,;"A{B"6xtɆ>RBD/i5Eوjp @{4ҴȴT%dd|#0KXMk д)yoFEkP`Z F֘B2)C;]Sl34ii Sg@q,M9&-s> ]zRdPQNtOL 5-7m ʊ{4ִsĨ*$#K0ph2^ǤkGp\),$>}ٶ/ p{54VdܥJ2lquֿ7WjݒIuNbBumL|-@|b|Ĝ?z:]Y$=g|@q/%fҏ(P=۪\{(G߀HF1C>{2Ѵ!%snhiK[Zqe%,7?$X WegX `ӝ yv`~wiޝ_qO:K  GN |O'YYV7Rq\3Gsr[,W*?8`tҪTk,G2%X%8m13eC?cԻz 2'bBvHU*ܶA/e *2#(9ʼ;b ζݻڲ}@/}Aw6nz~{pӤ4~Xnզ1kaD X&-5ʏ'Ue Y$dxi)XKy*-" q,BMӛ56?JӶ'K?d~!zƴ?ˡk!*@?7$g c6VݴZtzߔstGUF,Q,K5ʔaU!GoPՒXIs~4Vzm 6~\|{^ogEeKwէUlj`#Dɢ1+-FwL*^^.xCAHƜX'{#ˋ0-6 v,k4f+fӍ]sCoN~8謈bA<LV%`.p2I6!zRq@K 4`ۊ5X?ұ1Gjg[\sD^I]4u A7t81&d1Lwɱ!D41zmѲz}~}?3Dyx `0V xZh *ǫlpK--x[q_/S˥$~*[ܶ]٭+nO!ݮ|L|\[PK !Ƚ[n/tٖ/Y./9ñV) V/z;Q:) ! HhYM:]@(\DWa.Eꃹ^ϰg*l3* Tsi=0Y(yЄB>6ݐ܄PY$e / 2 "ۄܿAw ߽ˆmEˤحS#޿]PPVrQkx̥PyBTcUa<pp Ĭr#XĒ%ϨB` vFn\!_h%"cѱf3 V?&kS߿E8GÐݒn1!2>H*HI;:L K GCN/ZlWCD+<|y+-|: ?Wooe4K͞""(ΐ3))| n&u;:鼰debYiKhkXap~fyP+W58dsjxgc=j]W}K(~z;aH;~ igzi=npZu\c*L>AA@T*\7u"VfuKN?A1}2V2Y "{7drXGkϸ^ 3~(ooI0~fZg=naycDN6C)p6d("~X<$YG?//{9-}]7~ *Nʽz ,jkg5+VR3"|}5u{q4pd:fT Ǜуb#`NԠuN/ Zj)Ȇ1PFlSD@ɽy"hX`D dK`fÈz2{&ƼDe4_'*Y?h"?~ cK#{cx2Xļ\W7>_cPtܶ"3ITa6UZziS7X(c0} U@Ft"0:}UX{Gd||ǚj#'d%ǿǺ|Twa#O,rI;ck%l%w; ۍ텞z3e쒰F=@L {2쳡@=(@@00=/CV˷-wE_v^b8\ED>p#wƇ{=ZXpIEE.#ƅL?%@GHи .6uz1XK}OkѡqO~>Aΰ5%S!H`ɼ\&V0?gis զw +nJgziq 8\Р0TF1:*eſWShX UZjT|rbڏ>1$~V%1&g|Z *Ӊ.x&P_[/}) 3sh1S7*,’{7J1C qRB2))b Iq"V?}ELA>̚nd{WbZ[%-AR#BNsjŞO`E&h1eVDh8(iSZ_DVH?Y^6fS:6e}-S* Qwge<;܌#3,)rE>peNɳ&\0)z ߬lm ࡉc&Y!&32P0Jp[<>9'gK:7srKF;/k3KnD-?|/9-`lc52ɛ4h|!*֦/1GZlz6`,Fyh>ܲ9S +̀aL^;?sKD˗[;(Hc=N Z FYXW "?OIj(p/=+[GnFxן+~V"0y`nriBaYBQ:ayFL1\233DC2"9)12ozg*Nc ő0pQՆ3d~@7  E'O`"K-sfNvݒ*~M~:1S_ .u ^B`"#; ֎!HLXRH&d8,3Fpg(-1w/831D@1,H񹶛 cΌ?a 3r+ȖU#6T2U0gDe,1lӠvӲ]c'n o-\^|N.EA2_v_,LD.} pqW9 z\`碎{ k oL Jw N"u|W^5,#v_qGEg|x0Tv 䃑Ry?z2o04na""c E+XCQ0zOZoeˀ{@Z}3_x߼w="YGXr O.u3F?GOf =&BCL~>2&23sķ~LIDnLFApcOe\IYLl :ޭ`_d(:loɽcF7:!!@'!smCjyLFz\CUjн~g3")&BdnٲzJ~:IFjcԠ^c4'Q|~E222 ka$CO. 2u.1%q%I^z '%fJx:S\6d˦+iϱ{`M -L] ##cpEdlɲ 7z <|6].dܡG1uѭ(=& ˉF~@3d"X|rfdd|>p|jIo@@fM_G22pi b+ t^ ːCLۦYGDd>+Fq6P Lji|!'#㨁@ߐYA=@ .OCR(pK\7ê~~aՒҠO"klM6YrY|E ſö"R-ň˥eU6)KˤSeŲa{;Vzx=->m=ޟ*Röb^¶>[_/|=@oE~p˒&_,KgPH $ky 0s,UV;X* AoIx"@i#di @FF)3 ; |uHU`b'O~&#ۋe5+o"!S2[]/8:XxæӰ9? BDk˶ s&} 7~N0@SpD .1uYs"]"`5@F;IA ,  ~<ӎW*,s3dd=,|`j unhFj@~WI] ##cp `=4X5eMPFU""X^53ddE= @h P[q^Dgdd 6۟ϯ@6p9ddU뺛>V]Dgdd 6pPz͚,kO#kxieU4"322Xt@>k]^.'O1[220E;Bql}{4yt@ذA0#(;[ "YcxF@8(@4TNqD NMe1c*PZ檫8X'A0DI7i㈙2200I` Aqdѓ:Nt}1 Gh^Aߥ22#BNcX~ޛ:}t䤠G@ ?`GV 7\ÇE c 8z[e74dt`-'Mc6`Fk, @4E mƛmc 9]5R\@ܳ)o-Aׁt(0' wKv222ߜsg-f!Ms։R\|saΝ}Pq/މϬ`#@؀ `U̱ΊA2dd=|+8^MLo|~Ĩ l0XqKS"uŷU72r gE~Ę`\?de12vt"gtJNm|wi]}Zsc֠ϴM @l P]vWj,uSo'@-=^h)u0#^d!'@",WZLu|)j'֢OB&)YS:As= #(=(e5ܜ@18 `bhO `FF=%ӚVMno"+p|eA~\Β {[<<EF,`߮` %T-/ѻG7dGQ͒{84epfwtn?k6 }u M4ݟJvxmXʢq#'o 699D@SK6?[1N>'U#$"Ņ!A⹇Upuݓe݊;e//UWMsu=Zc|h(v|sgl`~Oo>@ ̋9ʲ/[Ő uήΐS*{6ղ^Q5"9Gop$pꢻ^m|S@>uk0a5VGU{6w^ʏ>u]Pip3UwefidLe1L!fD~*eQB{^n+ ù};'.. GHU y`ܲXrTmm !6w,ۙҊ/CAa6+nJ f L+g=x{wK콪u^ $3^ FdDEf+K:;I׈c~ۊMOmþwV,o>۝a{osY,B&G-䪗Zb19cz!3gK=:n lrDUAUxlL"Ft#ux{_WM^]y|jɽ[\vM)8Qz<ϴ s{XIVsh5ǝs7:6\;u^H/EC|?.϶)rXgea#d#LGaSŠ'0:A} cATLY :{ni*B'YDGR)Y񢇉X%?ȴ;ʌ͂30 N?μF$kem/xdm;( Bz``1`Mޑ%|vٲd kxF3"qEyU@U[sԅ <: ӉV;~) [XOX`ܲ_0[a]nvU$@4 Xab@K~T72wn')\UJb% vz#8>?^(FRёVV9ޗWd-.Y3s[<D#hV?i[&2~a_Z؄;/nlmyJij_uC/3V0O#5tF3fZula7q0|O|rd2WF/{@L/.Z\&?VK:?Gl΋|t5)?\aCq~h,}E"y` }Fȷdi#aϏzOnb!n? zu"*@}e=iٓ-?t7L~og/Of,9٭w^ % k@ 㪙򤾣ߨ.}Gi9f=]&\q/z˖ͭf(ZRێߓ&9=ݖ:َ?鎂aӚU:q 98+^*0u ٌlѨM̵m@NlhX@~+򸑬s9%sʕ:\޻ H <(7%0;ghL.i yUeGӉf>1XSK& RfÚ,E9BSr!&Kbd0hXhj3{7lFH:c&a Oأ^~Xz0*ƥ1yXL0^|!5A.Pr'_F?@Qq;0 Ȓi( !ȡAQb(uHj1k~;$VFRקo"I@g-V%Ĭ~_^unl=??d(ٶU6C4ƺ6w {i btbf3?\<# mۦ {\\{2k5:༩_[p,G#MC:utv[]sD6!Ӝ'h % U Ŕ}g7X3b ߅ (At0݅y#2?_djsnJɶ{HVMN4\\jLG 9 M>"PK޿9?˃iJ n0ߢZݑwmwCKӇLt3{5&aT\1:!ؙ!B|o%ɭ~ރb&!gt_y֝X"f G[tCFH3(6?kF?s0QX*o=M67D?U[,`[_?)?w|$?3q0U2Q/qZf2\WkkaRsP^: D5ay\Eya:u[@g| Ơ<,ɹe $ ` &pLv 'O5ͅ0PdFE@?hZ:fu!#c#QEހ@g%5 $됀'mG5)iK_8=\ –qC2''h7`a,V&=~:Yy4_۫v>zOyfj*b`NƿQ|1JY3'0,n>kЙ.?jfZCj]])?' ,6nNX($>OQz:,|"(C' &y?)R0iH@J.\tX'\'M@C#FD V|'.j$< {A\гЁo=l Lq BI|6 z@JUeHa>W: 1JiɭaU҇2)=,Ċ 2*nf@(/OU&TqH)^ˆg* kҭ}6) 1B,]DQbI术K$|;=[x{5n:VԹMz^X`^c''B@љBi(~}r3f 4gw@򐐄!=o?utK;V.Fʷ!v7Fߋ(Co檟-\>A*+#8ktlRbR;@א)l=f@/=}tzϴ]e飫w\l3;:7}}CD7(`zAol4+Ɨ Ff*t ~jװ>^O;I1$8YfTdd|I`fKJkPTmI l R@ h`.5I~_vվ~9?B\}ۡ;9v3muⶭ?HcczmIѫLсd _Zd6{Xg[W@IPR1l:$qlmA!3JFƗsg9 / "T:= @x#HIV𓉘BL e\#-= Ae@QXeN;UICLB22T`L'B3S)PX~혽 m15?[* #K_Ld)$tiTDU)VXW~!)8L=sɯf Tj{m}I30f;S}{ ۝g7,{u`IY⍏hn"6  Hr3NRjX|[q .'? h|`|Ba14:$/ >9DLUDEIN> + _Nv'dLu6Ket e  `%/,eHL+yӕ˰dbV]wBt 3dY&e|y2,a@fv= }Y")7R'0]!{r_xT94.x'H)gT70e;Xԝc[GMH*^+G7ԅRȒ̚]Q)hk/G Y us:mg Fw,jC O(~ M@@bYᣫ or_ֿ6׎on@n؎udlLl??j$G DSlG[ EPnI")-۲F }fA5$%{%^1Y29/BU|j@9g eRe7 4DM){ hi?~pDZ: snP|/y/5e ȅ20M- GE[6 Z :KU\ҞA(KXkz@]0:Kw ,^;wBNG3cl7 =lCEB._a[tP l^nx߸XYwV¹_ P~Z~baH?HdHl`}mF?e6C,EHE6n|Q=tۯRH@{`ڌoZx";[ ,\[ӿzW#nm{4E# A@">w_HEAX[<}}vl%Y²}{ku0ƿ770E`Th+ ~p'oDˁez#ęV 6$2S|; ?XF1f?u]&HO~Rʸ5wFYNݮڦI!0 w9& eO͵Z"fIFil|Ty{ϲ"#jcU$@@ÄL,[:HCo0AZIgP;~|1dB?o bӁzIUi 0XZ^]smUfJ?%ѽ[q^7lipK @$KZjS-6PVؒlϑ|+# V>?-{> Ų񾍲jVe8x@BDί=|@9h 84t庯g;& ،GXjK+ckvZ~:^Y/,SqEH7,($c[d|ɝ{P5!,erK3z)CYT ձuN0|uU8u@.}wtftu+|+%N!O"[aXcFoܕLE$3@3p0?JLY\d<"$T!S{ iبB} h? mP^-Gq[[ui $K2w඄vUrk []{6 1v+o/x|倍`iC+d~mo𠍗a*U75De*1ZA=4VPAxwPdY=l@~ޯ_28+U~[CBk og_U^S~+/S`:n t][DJRq=2]ݯXJ<L#pUpuA "R1"rC2ɻ`a}*_P*`Z-TW-dړ:K%^TsurenzEs+>XrPbs֠~~Qrw^-ĺTWOd5V=+l/Azm 9677fRUP!C-eb,2wT kDG&Γ(kEnuBR.7P^Pܖ*oj_ W}by{ςm;ƹWU|s͔K`ǀEh"[_F 2 "5x<_*'"| k갣wq[^ܶ;RI݃H(P#KMtN:6_fU@4>ZukZ/-{Q}?]^0Gp!#\yyR>uA^9^D^@O#F|@?r#pNf$zpfqE~l]5UϞz_blaT,&ܭ Ok"O.@<_+؊=Jʓ{1:Zؔ5A6wXc.ʤuw!9@y+:1tyٰ/b@ԋ@N*$[թ~^q}u%|#Ars^U?6>,~i8G'b Zȳ 4ncY pU-- rLK˟l[aXxF/Z)>({G <*$OZr㣛_v1Ʌ/g=@RQחli|DGOWl;[b)㠮 㧵Дl;$&kl-XFVCM$ `XK#Xis" EY(%gID Yc$丯b҃λqwl q]۷C(x_q[ a\>7ښYq辬dZ^~J0+#')l}V>Woqߞs\xXD̅`u$z@rV~c}q[ 爑zH'$k(["(H\/wi}| n:콲)zu Z3W(q X?齓t,)@N,O>}Zku|{˦!>>ǿm1|Ar]w("lek*Z˟lIlbny"+ V S7]1uQ^rC,+d,ޞ*븀!c6wߪ0(׀jߵ;ll_1q٨]=ʭo+KybsC:|L}P|V:6\%"z~%':REOVuD>cg=>׵/E??j@V$|;lI4/=$hC4a@ӁuQ|?F}>9Kgh0 2=mZTX%4cC_.='"pP|ާGL=CA+$aa: Z:mv^@A0u][,Q^6,ց1MYt(~_&mŚƙ(>\wbg\Z(e5䓙de!q=йI˷m[uY{˒_&>Iqf%`G2IA ٙ:@áDH4_Z|#9Xl/.:Q&ND!l 0ǟLV3 A r.ꗑn?z<. ^,e?jV)F DwmbL0I a&:+ΕW##YmoʽD6X$@}2G}i#C2 C@!Y 2㐖V1JAswӓQ\5$*iWq,|g~,ŧŷ ,! ER GNRҫnDpp2Ѕa q޴lJw4AڳO-.XG fJn?[oWRD4<a XZ5*(APtn@RkǷQsW ҷuŧ~_&}B`kjUQ: [,YbA!R}?~E{6tn @V}бwY[^/>Q" 'q U5<%Z=`?H! ?ݒ.X`ZȪlW=?nCM$_>># YB/>Q6H-&X;x̯ج4xSf"X.GM!NeB~hFgڶ5 aB+<!Ռ߳ yLd#0Ce8?w On&d/.?Z%X:XGB@)[Ȃ||f,b_?f ay;},\WԤM ;&3?+e8?,\rP &y⠄Lrsqzo%,XB'yֹn?a5!W\o N}q'iOd!w&·1_&CQZg#X {'릵t$2TGsb<߸}&Vl2 ¼a[ ؉{`%_U|^L,z$`{jF0@^!|!0y( 2%LQ34;M4S{q1p5vf9\#O\cDcŮnaO *Zy3u2{e?  " %=)@a٪~>OV I_HS@e8b(kES?F^aG/@__&࿵s0EdIENDB`weston-1.9.0/data/panel.png0000664000175000017500000012174312456345006012516 00000000000000PNG  IHDRFRSsRGBgAMA a pHYsodxIDATx^KӮ]#C@"@ c0@HB疄F1af +^ʬʪk]k`j~ݖ_/p >c ׈s~[_v>qVýdH{Nm|Kh7Q,i5gn/v6{_:ί?oߵf]>s>jΚ5|koAgswqhw E7?bٱy:ͫt7쾃q\qziW~sY3>x 鮞^{[{ctU:xo@|3?-;hy+~Kw\o׮/fၚ?x6cW oeoʟf8~׷ 7hjG}zog^g]o—4k'onϋnΜC?^v~jYYƮ-/V3x8ힷx1q<o[NW_fy.bz^<ޗ7p[#>i;/#N1xS}~/k{Ƨ aYqug홑{||/ૺci. Sw9\;\S{\f}x8}~MO@{Oyݽ6nw}o>~''n޼1ooa,j7j⿃j33c9ٿyư-zM/|3+\g|;Q[/v>`>[Smƅ~xlͺ7\|[?Oi^=.G>U+p}6zgkjq޼\5v\z?{ϡ_:j}wC4׻xS_kħ hnqo3?E{ _!`Y:?o˞#m{7g>/ig_+>'vכ={o-Qlx]/x;tW7o}qUcumEg|u]3Xoѯr̭;\Cs@^8U>r+ljYMy}s >*?W3sІw4#VN_@zT[mhgx|p[f97??>㽈7M+.]|ly8/g.p?mFy;6Sҕ ^]j5{prj8Uy>X5T[t=vgzg7n7M_8{'Wzϭ>z-ٷ=^Y{VOxӽ9_}m??HԿ_ڻo5mo͵OzG^8j[ 56W1Mg|3x}Sͱt]=?f~qG8?ai}N?_xOC\Aj/S 4 6=ǪWn-]i׺\<ν7ec/[>ԻΊmn>zG=o/ wmߖA7|=7vmvη} bun3f= zދ;=¯Wt[G>j7$_{j5ð:sVϨpx)C/Gm:}~%n<\w~xo3Ҋ=x/v37'?oޛ_q?moa?kk_h_\&kG[9Nǭv|nwCn㛯<qi{1֌m\[]wvܓsӹfcufe_|xP'7O~yW:[n}Е:5^z8xԜߚk-oGǨ]W\|4{_}v6}~bpٹ8ohn{nl_͸׹WU[=<6Z)>?WKG/0<fϋ?]x- t^x.[=oǍ?@~o@y1ܣy_}|K}o9TĘuK<޷5ߝiOuoa nֳ7||7=~׷8Gd&8׽Vͷ{ cA_/=/:>ߋ~c;wqb.iՆkEֺU|'O嚷q  >+|Ҫ^q:o81Pw}w^o=W9t?Vu{ ?y \}|Ĭ?fuxf,#Gsi8}^zo\wxw5om6~z4Kx~}9aݘ_7vA _ _kOwk"mO }wgOw-o >?rCpg:nG?&N5럠ݿ~W铯#'^ =}^{8qs7޾' _)lNx5՝]Yn?[X ou_AhBk7N=;z?-}TM "zq7wb75׽|y鳭ɷy9ӽ鿁oSC}kZ\ī܉W5CX+,Gi'o9?˻Ig=w=漾U ~ߏc_4=M'x;b;>wz\q7X|ã~$Wn +`ƍ/ O<ƷW3n^@/_|mC^< ^/Ὀ׬x}_ Q|C?$M>v_@{Ewհ>j{-> u|W^x?s߷ozn[^]_i|cngoXם{:NY^> w4?}=K3~ fqZnН"ߵK]> 7 ͓wwwyo>ˌC J{w1|ĨT O jջ0N6 "?u=n`]3j;GO/P}ǣxhǫ9u/!z:qZ|yY=vxq7`QԳPK\xG0u7 +~{][]ܹ_uozr+ǿV8 'Vy&|.fXM\]'G> ݋՞5SԸϣ'v:vHg+?Ot~gQ^D }B ]jZ>ük'͕.|0g%߆"AM6׵Ӽ 8ozeԄyU"JUo=q^~_HNqz;ځ;>^}Qg=w-/ri]{ԟW K;ք/yF\y Bӵ=we7SS;in3m?}Vt~֢f!.zhsxыD^93 --r<ʻ!.yӧyjN7f6Lh]k/14kiAx7'Hm y⬛6v.ʯdt1G>93w -uSٻZi\Nlzg!="oˣ=9 ]G9ZN<oh^c>rD?j+\9'{^+'+pM.xk/'E>. Mw쭘5^[\B G/g9j}9V3CzQ;gŇ?|h~;wΣ O9GUG ":[oϹY'ު[5jG/vAnP]El340>jk ^+>KCWƝq؋8u|74zW SoV@. rqȱj+&‹#!<~q+F#Ҟ3jkg6qWϙ«5A1Vr? ƏħϞ+h8Zǵ.܉7Z#6;Ws4}s>fjo،?0. _[!qO14qS`ΒVu덾s[V\sp2z+kOb?pU. 2>j_]:iT1w님8>M+ݣ\[8X:>pNp/Q`1=ƴ[xmKxp^\\\&@M=䣏G@]hiĩJH]e\=;5Fl(>ǿY:NB\ht^(>)sՏ3-Ҫ7;0V=sCz^@VfC5S~;^a:]tA]v{v zM}o:|['?=LCq2O{:9bl~CFܮjcGͽC\g{#/ MXӽ}V^KcړjpCyЬ9]Sb,v2ܭws%=;ćU }x[inl7'o{yKp~kjo^ 5@|hC]ڃ_8> uUg\9ߠO8P}G, kC`^y\ù[rnkopmj8o[>NX|{C<8շ@"n9N{gkUmٚioPVj^Ow=;fW;5]s]8yN/xK__F~sEz2:՘?88qg/g쉻Pyԟ3Z$myHzNO&zɵC!z̎[y}{7x&>{X=WOi83r;qCg[{<ЀgM>A;yጻǜg9Nzz/-jC:o\'=/8f_ζByCͳvS:rkݓjxw;Iyz+ZxS8*V+Q?SɯiO[C=bԨ}+;==^qf\<Ց9.4g;SKQO kjJsskf0ow}GDк~cΫ ^WQ睓so$ qs}מ'?9p^|#u*KqyWF.AO\<=kɻ;UzĆG}x;}='ӃOJ|1Wŧo7k/<5CJ=0ju~^w[{8]BO#?y~z9G}e~W{.ukUwm6֤: T/e4݉S3~Gmq1WQKhyyBЁK}y_yFNƥgOw-?`znu;=kG}94ZͫԞ?)g}R,>qW>}:F\9G} o\7.Nřx/Y>VK;s-l.췒/kqj^ܨf+D3VrS}NÇ=7_£z39O\pZ]3ܴ<}k=4~އ{ԙ>]yWre -5\3|{1={}}/jG9U'99VS^Y]k'NMTZ^r]y'Y9{yǨߦ'zc5wH.ǮS5C8{2CB P?v|9G5媃+ʝ/| s{|{D=wаV~ٗ =Ź҈۲8&j^'y쩹=#]/'>P<#wήwpT_fw/ubGs[_5iU]=wxm[n:U'w|]|i?azMFϷ{z5s^]Wty뼼=)xU:g I{˝h.t~ou]S}79~[}yOg|˝۽o} ;߸!vLmԣv;X>m5;fssu8#I'ssNnu׽ݧ ~'׿Ay=?翵sx;5MsOo&k׹43oyx{{Fo~X[K7VWOǛwZU5kõwxmFm׾ai['w՝W5o؞oݫ||Y֨Oغ#_g jp?ԍSЉ3.g8iX^ixs-Y/4Ӵ>=495QDW,AkOQkKM# 8ݍ E{(̉ݬ}W9%GTZA1'gڳQ?z`=34ԻKkI4v!:qq^{z];jǿ;ܻʚz{+㣶|#F,v^qi,zog{!VyN _yԌIAxǞTbx8{o\G=wjE[{^Oskg+0Aay?5gYz:XoPu߆ҿ']|nQު > ^qb믞OSKwgqZ}x[|~38MG@}G5 =#?cCpvX\55H<1Bz3[<\u.6>$18w,gz~7] D&k34{CC~HM.Yo X'<|p yƵO$rNp7kv?s /Ԣsi#goEyaySzzFsf'|vw<[߽kɳ~?݋9t:B=zϚt <g}a=ԁ^_;8١7ȓoyw-މqP#^wK"yyƬ3>bВ y%✙;@._Mɸ| ͧWCE-O'b:#>9}y?)Ǚ}#lEqOpJ{:?~ W_yj+}n{D|$זf͐fhk2sA5?7ݮ_yOu67ƽO?胵sk|?F?㟅{ho`CqBKs{\sUc^u/Mj[͘5qGnFL~Cǿ'_>_;P5ȳ4'bmڕ=f+\0,$wkyyƣvgEWMgs@>vF߉m㜺w'۳{ x;ymp*;`$ag}s{1'scwQ;} suG־xvM}cCoaw~>W᪻qY[z-8g5X> 7ډGm}*5p'o[[̭=?jx?c=W1419hN^ =[c?~F <z>/oDž> xbXwkNfU#}XO/O 7te|s됯qDg}V;]YS_|A{?=~ω뾨뤾<4!̀;fY;]<vs8+gj7brsflŃẕ<8άN>>kONq'k!oՃmSyyE,.݊_4^ƉX>Hյ{CڃZyPsP}k:o|Z {[9HSĉ ;wY~g-sl.=9bcw M u5]+]HW|2]=p4sNh>C~P1O?D5q?ϸ^Uw=[ҷF]LəEߪ|";|g}- j>87~x'4M\,_c~QQǾG3csvKkc7qK3w/qݟ,MG3bCi~pi?xhR}~_e=SZhxWs?N2w;(Sq<hߪXuW _F0Bљ}czUy_P:yLPOxz=9ԬQI>yb߸e-54q}ͫO\~]nsN=μ4*7|7S>i՟߀CӜxA\Ƽ<O=sNs<;e{N+?w11oΫG}KC=Wqgpuk125͗NwE],irg;aNG'fǴؑu5ל::[UW-rguļ;WLY9|~i'x}4718s^P-s맶=kVuԵO%݋K\B?f;ڳ+zKܠzYwgͺ4/k{ɝoj5j'0O OzGBNff7C݋qݱ弳/O'k#gdv;]yNqo֧9 |%?g1;{O?iZx쯻Tv͐zt\`}6usǿ 81{Q_+[sow;gx7ncy~Q{WOSw[\޸uyy}*vA| )޽=] ׾}~zp|o}vgoykWouV_ cW!qsYw5ykj7G_~j{~>+wK[܋[[~y^F=s^ iKw3pyCZ=yԳQ:߿w~~'^P5?cwa\dcpp?o7j^ak[?i&jtUs}V{|?=u"vǖּVۜ]8;5;o 1j4:Oo2VOy@DĬgг4GVG-ι[z_K .AK<6'!G]84yx0j`xS\O.w06/ͳў>&zN.I^'f~o-Y#pG/S:ik_R#.=G '|ZУ}. *.W>y>{Xg^qh䯷{!%?`#]<8D]Sw_䝊't]뢞w;wosnscjoyݸ |ϻO3NmL67̛9Z--qu4?si督w:jy!11{}&t~孉wj&S}skzURs=LQY^qW92uYs]םϚvwֹg|e횐z .P}V[xq80s&T?.GN^](z u[1! iNk8~dV9k7rg3znty1?j{y۽͞9Npop)AZwL]d^]޿wi񛮾^zw3ɋz,>yP'VsU({tm̵&m" 1[=6?.G[i1YKc:?{F.tߜr!8boP=ם>>ސܳS37 >r|^} p[189P7?5sʭ8;{d:w8w-M^Qq؛U }doރ=KU=|'kcǩ~@Dq"OM~(j^?ޚ]K'םO?#Qw >8o`(o *ǿ?{l{#7Mi#G,^`Nۚw1cW5`]g"<{Lgks?Izz?*Ʃg{8[ >= y̶\o_sQg5!fڙ ]Bo޻nW镺EZ&<)~i-sqcKi7cbs;v`oF}o1N^;QWo!/ߩřxx@^"=X:ss=x{;z䮵[ o8n#Vqw}O^^+g{CVhG_p[3nFW^F:8%T/o~7xr_aX&OuzҢF|ė4wOb?Wut@p=Ѻ}<|csf\Ũ+3Cc^<:# nYW|y.f{zĖ<ט.+OcoM~8q G<3vGkGX sJ3|p><yt8'U"8ߑmpY^(s ȹz G=+9뚥 vOx>tTM=9ONzbI>oT~w-ΪaNY^Z{u @3Q,%\7߿c 89j/ οk%9G޷[޳ssO~xsm`fi1qK|pߜqU <7ZFqu{wy1jxj;s7i=wߨ&ַ`{@?=jI{7<7x΄R3GNгrS^Sc\;O>gƼ9D/Q]SC Q.7NY}{qfu+%^K?ٵnc>uV͑|8ڞs=ҼsAU9'=}33Ω虚kf{#tYo:{Aި3.nťǙmIv)?ꆧЗsy|}[[֤KBzřޠwL̻1vM F36}yz`:m8/?ͼ9Ӛ7š7jzgOo\'ױG<j{&-t͓fA̋Zƭyyһ!}l.ω~_l<.~ ZhSzyիzjSjKn3uqf{gqH=n꼿n'w3m'z>w}ڥ?[{;;|䓏Z݇ʽ9}Ӊ}N{|>7⨑sXγZsz]6]O=C^@4.0jy!8μ"<{ճ>փ?5z ȥeNH ܣjS_{dzS}Z@^vu#F}zƠިIS\N\.#'r&?@~i"'{7kle-|)'Gm}8,rϚ}=C}53{(kCGonYcy }27p=5b tW_B}5U~z3{|^╣O:ҰV\ܧLƹ[}OyfiKnۼ{~}MoOs_S .}L ~ o<A{mfͽ/{P3^n3n޴Wm*wV. O5cc',f, 'z6_g~E~Ό5 b#8&ӛڱ1< k;1jWx4ԥgrf=Zc܏;yG>WwH'ӛ5D}YϹZ+]N57'b.AM譟ރKzy~!JMW}#/4Uc_Szhӟ`5CsZM. TθjL؅\'fw^@x?{ғ}z#X-&zsV)_Ӄ^#0'g5 s☁\3=v|=jا.Z9ݚS˞:3=u&R8gT/{`Ae]= `R{W}c_֔ ϞSo{ qQK 9qiǵef>MsVMMy>#L5"b{T-pš^=#9GeizB , {v>y׾1N+;?X;>҆|iU;qi'8ywt}qzRR}<^U@5#ub%>eo{|\/ujz %[:f}O{bx+/Vlѫ`<r칥=Z[5lbr+ԧ8μk3]G}[=9Uc*7=h?^/1!g瓏{MhqGDխUt@'KD@M{3e^>oz.[\o|qs"nlט;ٛ{.3foكK~%bzv{jYY[{ۿ'>|l\WSc|j[y֥5}?v<9:)rQ=U⹓YC9fn}5;܉ꥦ nc?;[w&O^Vo]]O'QB7C1؟7.7BJ]ғ#)?w@g]Wcw&uo힜ǝC<7uϞK'ܹ7kS;Izwoxcszƪ=go~ho==Slk}cz?1 3n>=mooѵ>73Yߓinxys~ow%||p&>7G'7>{UFU~wأglqt<}OB|ٓ>+}շ=w>S[{Ol{oG]ynezSs77ú=^^ZjN=uѳ߷!9G3#Y#\8?pQ -xh%gZ8^B'Ҟ7>4nvv3żjևS=W_+}#COyIՓGy6fzQ;|ķ>o^Ao8'=9䚵c.yR8yވTLߣ^3?bNM}iBsCzI=N̈Q}:G={#vP1z୓Cu)C3.hsG\f6椿1K>|#OϨ_sSw:ZzjF͒_^gkU{1' 5BN=i=\Cw/zp:T|!m9C#NаOGg~Qo\x+y~K=9kGڈE=FkCQKOy8;I9{Ω7ʾ]SǜDz6jO^SoЋgL571'fY|Ś{D3?Gxo]$s5ZxgiZ:Xg-g&QJzI:g 'UA_Άq>qZFrc]Ӛ뛆{AD]eNNwD^uq6jG838lz؞C?vӧ.KZs1O{H/]jգz~zG̡7`(c/7n/{\z6W{1˷ѻAp~cm<^gsL7ckCy@-ܯ~_Ss U}zLК;]֮7opo_o>/6"^^KW\^OF$^]ѻzw?7zzgN<`3>B@ߎGnNCUϥpKjyYk \l濗B?7a$tmOGQӉ{K(Y=!瞈7vcN-xfg7>ҷW٣{f 3SsP=y*=Xݫ]q賖N~5CQ>!{.rj8yWwOknpߜޱOyV:^sϳ{g[Cjl]J9|jFsw^o;#'2_;;f1I޽y>|ç@#cx͡sx!9#Ufo/;'Uϒ^JXsS^fyRyoʩ+.z l'uU 5>C[sܜs'3 W;gzV;`_Uw-sz[rG OL' ݨqb5>'5/My:u.qnWm;?r'W}<39Kp/}orWz>ENυPU+GFpW^s=>e~OtűW9仧3==@zdtBnnW:lF AcNCj8=P]gҡN>qhT.a>Hʸ|SMQ8gyųR37R-NWqFݵ.R+Iy7O?Qt-+F&7>И>} û[Ek=иGż{p/ZhjY=bOՈg؃GNsꭋMSo?kb8x+rcxUNx|/ytMq?~g>m bQҬ^cjV>sogf{0~Բ7|*؇wP}'^M=t7u7w)F {WroMtխa,`v\{⸧ k!Sn'HsƺPS~^Չ`ݰo.upEit7s@HBlB繝ڃOո`B*|L;χGe}CXFtuM=ߵ/1|jFO~/O/n/הmWhO`{ 8_KIsf=tqK.(/zd=| nΛ&7wuu-l~G,77_8sBZpɳf+P㹫Qol은%.Oo}q͜XwȺy&{G{x7\3#@h:}}yM3>w-ڛ9}70犷SYq|gQs݁{[<{9ywCfnzÍ;7QWy~WĜ%?{szfHN^>mК<\m]^Byy.;g I?n ;c8z{ǭAW3wڵg-gyv⬞g̮5k{Y=yJ::i&Us8v=\tV=k8˗yNdFgh/grAKM5z+y9_A9;{w< 2ހgg>Oh~``E}ג~mwJ {)?~@h}:Ѽz׮ne k' κ]1ВS?wy3 6[qY<wM[S^[Qʫ7|NݽV{E{dX}souNm.u8tVWH,_BIY '䝨74|D5Y}sv{=x;gܾZ 48ɉ-Ի\|stO_PgoZW<豺k~ ^.} 3jwrs9f)SyiN\s3{)7{}a}V.t3gިG?c{^#߽Gou5~C]c{8[(Ҵ~x&'q4Qx#yN?$Ǔ2lV] .44s z9ECC~,q'Vz$?~W}|ܺuud>iz^:⤋fU]':W5EsP\ ܪ'b}<5 >5õ7jgq<<bzx5saW/O~y0bǩxkrԐ ]G<Ԗ5KX| ܿ<ټ8grqzhh~~k[ugB XyևfOKc|&̣FhGMbhY riTY:bz}6b7X;=G,(rߩN5Q\}>6<8듾z2w{o{Wn߱%_!\䮫<}/jwS߃cݫ=><.a/ p&o)(g=GzyNĉO]=&AڭYDtz?ALyr٬kntZ~5O8|GW$\:ڜq֦FNndȸ5YWčsOvݧ\:<.4wE sz~;yHO׾CКgk}sb7R;|uzq{7v=߫i/d~5ݟ{&x9g陵=n;*v>~:{?~hS(Vx|'M/}ƽz.4힩VqBzK|'SϚvw}>xess]Cx˝xNOn[9X'74{/w{W;(NA߶c軧9OL.;s[OsOǝﻨ/Γ}ml΍Ϟw_j枊}gɹ.c͘Y:uǙ^ 潛s'os>{~oo5/?TO_8UO*^|r;\hٷ5Gwr]Nz}py9{A5g6b;լs~W9s{pxO昮8ؽ_3Uoi۫ޅym߃GvJHsG}}1xxXpMQɽ7zՍ߇|y5KVިj[w wv&p/w=~8a.p/OB-&-_{]uӿroP!jDo '?b^h ]Gn􇆵)޳]Y'jF,X-|<G1 ƻܻws43[}Uc ͉O-t8˻0Q}O׀99+k1n;>zfm3sB9#'.}^_|v՗&v-t#WsU-xhM(;8X}oA;-s{j_V~7=Q>XW593fsʡSuq@\g>/?>jZr72jvz}r9+ʓ=V9)'jnԎc͔&z 1FMǸ;45gohF@\gq./m"=G}ɣFX}gOݘM['sf詻s9'c١ /ds/@/]+:O]Oc q㬵[ƃS>F|zbO9sW>9 =u5;fyhC-95oursg{#Y'Wg}A4giQ'YoڇsFq38y;NڪӇ&u鋚KOob}yۨ9}9gu95pY{ګszp˧ f4mSߨo};7S/{sϬi3w5~Owi^ DդǙq @89W'"vte{qLk/Nۨ^QOμCrt\sFLkϜwNwwD5pO R^~ ߥzZ3 Ŧ̊uqwcb>wq5"-7o؍ޜoy<&\8}{/Ng_j{O5h>^s?xrz7z'zď?uHAM1vd^}'G<NOcs߿󶗰}M+ބͣwy5oxz~wl|=}oGaݣڛOj4V^wo^\3E{aһ1/O+{΋[yb1zcS:!t_5&?6?Χ?}sFؽ7׵Us塚5'w5=OK.:o|GDMsm֌:?>u "}ħFty5wK?K83~Zy2S}G9/:MlNyIoFp7iLϧ>xu3Tkh>oݍߒzr⽦;)OM~7.t/9n:=ińMK߼>cyL tJ/OGM;=waxCh]3N=NY6f]`w^te=?އ~w8^г}C<>x=YzL9w{[wG8I5"Y\ڑg)}~^sKKq}!-VZiݮvBgti}sOT4EbZƈU:v1|GSƃ[u}ěy:~V/p=k/ϟ|wByQZf.>N; ^g_ѯb}ip}')spQ8 ø׼zS71m#? 6ǓYOԺo|skw sS]7-M/Y,xmsEڊ^8wqbrgQx@N8;g};\_눡2I}iCg$zsQ7q5:O]&y?>kԓ+6.^k/;'w^= ZV/'c쫓}'ԗөXfJ]3>N|)NHNZ pu<[_sj5zW#˗7v[WB<~aks?8{fW{Nt|oɩ'xւZt_Ǭ5K^ h!Mz^>}V;PDtksbh;>kaP@S_Zwh3bfSS`ORs'<4Ч5i3lhGrR{|N..DNVmz9z"?u闚wu1ڞ% 1g+5#8߽>5Ꞅ{zP,逸67yiUӃ'~K;}=3O{dgr,C{F\X==/{k敏fuOm1d#N߅57NHC_͙_L\8|`iyI͡<=svpuUByQ7O~ U|ޓއ;餦~UڈF=O}]ywq yg=xUk~s͝Z]=z/}sַmouwE56ٓ]r#;]]fyBK^G+s[Ț~Λ g5zQ﫞[跕fa|?dM~_`=t#`>{W}SU];/µ3sǼM?`}W}]\W<7 {K%W9ǽ﫜ߞ֝{һG'Uym1?{-o.Tn܆4{ގ~/s#SǾcjUO`Xgw4y6N4}j1'g15;ō3f c_Ʈ'}4Nu7k}kB8pѻN øOE}O֣&-7|E'QWM|o^BX'S3=zk;v.ro}##;󡳿SDOqRSqW:WǻhƬW V?t(`os< 4ģڏ]_?4Yk^q=_jݣW-ŝk>/zQ:;3g'q̞3]WT-oD|>ΥCo\Ϻj\(w;P^0C[5i|j~izB<3G=|CKfϰ>Aڊ7 kJ3=S佧OhZ/^\x mqon!?{mCN߼ְo޹i=&޸7PAG:O{O{NKO햹{Gډڨ~Y=9cjoMb3kg&}Z9W=7w{u]O$zշ61yCY.W޾ӻ}5l]N}}j7#9o8w]QS?ѱ<YWmәGwޑkԓQiwwbwY,vlgZwHmCϣy>o׼jۣsTޱMsj/c._g퉬>퓚{9 y?}g`IW>|k~t1]xӵ~Кmyy~NF=%;"Oo&q(6ΚP{'\<ӫ5FqASGz{}ɝųYwROqw5z2k毳|mV9{7-w~ꅎNŨ3UiQ?|9;hzpM?ރAũM3[3y].Ԟx2o_ꑇ4s_zOk~#&.3oA"+EByWoֹr,ϒ&=Nq5g 0Ъ\2<:;m[RÓ'jq:X|wh䣙>F'xtpN9;zsfv;ZkD̈:SX<kWB=xfswݑ:(#g:U7}S1GoDnP"\ļ۩%ߚA~:SSzt~P?c%Z'N~YzU3Gc>sҺGiVOhwrG_py|#ybhVz{{?v}Wzv5zSy'W5U3t7/bCt>(kw8K }+.BO{@=Q\qN{Tyc` @GG. F~/MruGpE}]$xᛇ`<{g^1G@.wegՁ!>x?j-b&ꦵ;5;dp p?t/뾪=xAi9ɹ ^cұ˾_9&ITpj\y2~hVmf}I}Uw7N{'4Q">n87z}[\z}[y[x3kU+o)|j\{=[ɽϷgk?78]As8Zzwq, }P=$|Ş?q{ nX͵_A9ooZy/uSҿ43:b}{3< {]W7N5L-{U'k;}Kߡ)oWcЗZqƪrrAkb6\5+uk[n=9/<3?l_@ӿqD-1{3{=;60>UW޾91=N(rg~U"ASgV-{GEq@gpgCΕqd {f,]r'a{N x'Աkpvy{>~75}&O]C/GsLϙ_)ρwq4=)?{9w ?eǥvP\קeqxYPrKy?q繇zytݤ>ФgֻD}2?57j}٩ymށ)8j+Ys &saOrq= >{8?NG?b!ٓyɻIw=o5ųgcg~䈹;Tj{^{_㞁c83h~#ܧbv-sw+ z~} :{s1Kn~ܵ˼4Mpϩ}Kk 5^䤍7b}늣uoA]w?w*N|/?^fi? n/ӓ]&/Lw]I_XTW_>ZZcϪ# sƷQDNӌ wn"Ƭɻ]pj됶sy<os6l|#'zm~ok_ ڳ/㎾ 5/{z'iG~qD[zk@^~į{W}Zw~V1`mG /?sg;ğglЇ6{W1G~|fɧy9 !~eI8ɱp3zxX|BO/k|oc@C̦&z<>oXӯy]O>bhIZ8^xg6_s}P>Wϖ>N_5#9$:;yN}6zT&^{5$3pF3xf_bfkMgq쿽W='{۱y>ZrZQϸ.{dOy>r,U8O]#_^Ғ/o|åwvʾSiu 9Ƀ; L^ˋ'乻^^"W'6\yj֘y O!>4+,ħ/όyG;hQK~c^ȸ5<ًMЗ(N^|Į5+S&GϨ|e=@-҄k?bsWr/Գ'4׮>^Z\՟sLBߙgC}lF5>M瞽s3z+g_iϝʗHN9{F_=Wu!=>˷f#ߦ)g+6Am|rG5f/5Sg hOѯ{j֨{zS˃Ĩ7ryQϳC&ZC<K9̳|{\~q-8?rf%jC\4).X~~j} s/t> qgG>w ?<W0gJX;x{7o˝~|6wk | m3A[ğƳ_=}L;?[W^z]w<.|{m<:۳_;^?^+=~>.m/Mqy_#{E߇qwqW/u[,ĞU}o;{sCߪc _}㫹oܩKgf}}{ߧx_ S7į{wӜ|\0:Љ y,ً6U47M͕OsfJfC3y$/ԌT뾬 !q)4Syj9z[_u ]OIdRgB܉kDʚ`Zz(ZrYCp|Y"*gz+G3Nҵ&sGE3j*!11xixҤg kr5̼bgUc7UzB=c>{Sx7w߯jzjrttWjף]3 xzPgw}|;^?.gܿżt Џb"} ET9Î خ=,[5ӠVVONٗ]!8N}Սo=NWcjk#@b735K[A';n7{\yޱvC yp:g{#5ї׼/.zOq^]xh/]{p9wI/c6·|9g^o<˷:8|g}艹r&Ew#O]5WwՓu;C78j_}Ş'=v0XZ<"r,YQCLϸw>k4sx 9b|z9#j'5}^ g9_}899.}s~nU?3sJ#2q̗\s^k5;W|o'M~Yx}o mA`wx>kv{"L9 ]ꏿn4\קo1x-o~9ylf.^|6{ ks`߱۞{F$^m^C\D3xWz7I@K ?__%jZ3 A899}:sqc޹Wjw]y<J{8NG$ozzwS.5sF{zγ73w<;5 S[)>zS?سQ.Rޖw#5Ňq]Ƶ/{.+7O޽ QgyTm4=oRL.Du};gʣ]"FM}&:u8/wlm=wr}*֜+d~̼yᏽ1JwMj]y)_Ǽq4Q[}W-w1\Z}[ӻgP3>w螎yzӃ#+N fw|~ GmzJWW0fǜuל;w '';?r7''qԚ/H{m ^ 1fzNqg?|}t1 ^1y?q]Vr޹蝺C{w-k/Ny:ox7Zi.ߓK(>xc8 8g說{v4l䏙$:ip}X{񽢴kzyy`G S)꯸iWlwZi9/~u{ӽ{O{`^+3)5/NDhPؙ {C'.gyi7.^4{4/~5vq=W!9x~}ZxϮ7^&>k~kbzo=_;yt9>+~Zp^/[zyzp:gksz as7m>cz׽w]-vlwlN~Gnל8wxwql7M)5pl^_soTt8xPUS]oxrC,MեU}{y늋_NkA5- |ssyp &/?n~>8ϙ]W%wVMڵk[\ijgĸ؝6>;9Qu>{mMW|p/z;߰oM?_?~_j~{Kq*f+o>sȃym[]|ЉmrV ߙCkW|>Ǩ:#tgo[絥{ͼͿO^o#iq7Ń_t[н4~I6_n-~4C>wB=ºˣ0gsW|KkW/;x߮9Tۈ:wJ ||5Os.:}_Dx=~ηc[!ۼotHU ۽t[pb~=q7>7jsU{7|3愯[m;՝{qa_!\3r㫗tq*wq[ ,MyzlC#TMCQU{fw/jrr jFn:sbi^s{HS%'3N}CCj#<1׉FP34KgyS,E+nx ̽?yQM:+^<_ 9x/8ZB5ڀTgyT͵Wzd,ǡS,ۼ[7O\CCZ/zǩGTw̫v1NTG|UkWt4CG^W|hx^8Ӎ!\_YTkBk>u,ۧOOmkgr{{zx{ow6GSoW<&SXR=u]3VOs׺+}kw{?koغ־V']{fz8oz^t5 дS]n=Om̽Yzc?{ϳw_d<׺.4c{}Q:{9ũgi|;n;c9[;kɹ|[Z&|A.|>׫65^{xk;n=O~9^ۺ=]{eXڬg.νOmz|9p^G>!훦k~|}?߅<7p}\{8ϝnCUϯu}w g+wN׽ [>yZTb{s'_|3y?o݆9>>anIL/[vSOW3v;soW;w|zyo}7ֻ4S{N玟:n}|VSv}vps˝OoW};4\t§Um&x _hTۼ78IENDB`weston-1.9.0/data/icon_ivi_simple-egl.png0000664000175000017500000007120412456345006015330 00000000000000PNG  IHDR\rfsRGBgAMA a pHYsodrIDATx^}@ghMӴMӴ{c7" ( """"""b11&cI&od2L&3ٙݝݻ?vJI=9sSOUV$NEhHz;:\&mR>)}=Ǟpmzxma. v_.>JQ㘯w_'{c ֬cZ~ȀZVG #ӏL?Fn22  #ol9櫻oo٤v)͍|6rDk}oϥƢXal]v-r;l `ldd1r _#7{L-|2pׅK{]Co9^Onoڧ{]E?$=w  ##ӯPn22cn4\@FF!7~dd1rܗ0_v/ޯ*|e~;=iz;"5֎=bn?@N$e)T5m Toa€rOgF^&# ṬMxAB_* ͠+lyt@?#b ?' DOԪ]~,XE2FEnfz?p?к5fɘ{>%w4G"0oe3afP77 ɿMo ;G(btRtK[wG;nڿu;:T'oV;^<{X}}FNQt.͂¦J#-K廳FwRrZ7IknosF 5լgNpcox Oa7rwئ3un'ڻxNv8N}W#B;uk3n֋su7K\KWmWMxqƷu];4GNb_Q㯸+eD%sknG}o96;kz2W^^gPQC~xϐG{տ'P{ #_gfɜ2rxę Űߠ5*׸L_iטt_5n_cV}P SK$s<: gN|+\B}W _a _ ׯ|E[C2̣Àerxdlo_~z藸~K<|0KKt_%C_bU~i{/hf2rxDYb?%;._ 7h_x/}Y/V}A ܅;)ZCf(.1b)3.MsI.pf$ !}y2J;٨P p Mg 0PϘCrt}gOHs~. @FFI½f-5OQ*Sԡ):˧x?+SLkO1{~E)!0է+>%ggkRk8{Gn 63:8>F9c#?F3cc>fc|?cC>&c6cFh>fcF)?&j%גy5zIˬ'bG"?-#>Ba&GGM10wHGQ|Dۻ,XCr-e8'EoWދF5e^Dzi''\G{Uu\=:îzSu|,7_uM N:D_gubT׉U\g,)Ë!l q>_e5\cs kF]s5ïr _5p 5B1xh5hz.׈xyXz2'rxl'ʤ(⯢븫h28*W1_eȈ _U^ehU2*#\%pHD J*\J*UɟSrm);=]sK[MMX;7o7+b0Nӝ^m0Sw'F| kR黹0M| δBޛ-o-,R|Σx Sy|Ɯ?Oy't^ypdΓ8LYejYܻNX+m]ޙv=m7z]z8;r[GPmt~!mμv} KгD%,|7,L8K೤e,ӕg9,3:Yf!UÀr7ǵ}~Kn t2O24qK;vi4ISO:5zYSd :E,Gj>N#;!Ͻ'F*>G`wӉ}Xd{y`H,g9'Q9jIf=$xN=WIL'M8IcOb{1' <Ɉ𓄏8IdId$L8IIM'I:TϓN~n':Ir~v<hy(m ay@9:'O?״ r' p N`wacO0"#G`D8a'g=A\ & I>'2ӼN0]O0YU`ޠ,fkknLRu< !%}U+EPGs9>nq<ӏcL=)8>|sqN8NpqBc68lj ?ΘĄ'68'|I9N8{g8Ǚvqr>ҜVe|2b2>6081S|J8u1Bcc>ƨ=#1n1Ƈc AǘpdcL>F3 8Fٚcs=|c:Fqe|2A ;:(s28(by!ӏ3(~StaqG{G:JTQƆ%vQ%>(%)(S2(Ӈe(=5(sݏ>J( 56e|v<̪ނ_(An9nqS|S?#X2{G=cFalbÎ0!Ch9BS{t20[9#h0 TGX8YEV3? rःN:Ȉ ;Ȩq>HtAƍ:H\A&8ȤЃ$$eAR2 3}2{A ?ȼdA Y8Hu7e $kyp7A\v~VrŒ .8rs90>o`N;eBx p{cy Hq$`i MuDq,id2.rxȈǵh?nߏrcޏw~20c?Ac)>y?aL iLόd'{?3c?,rO~]S:plYEnY50Wv(ۇdnK^]><+w}G}gch>S}OGd>LGL>bc1a>"19|aH Gj>҇cy1w9}zc> t(r}QG$kJ.wT}C9{}YO^h뎾t# c-z+q)ۃk4{.ރǢ=`y{C@2`= {ѓq0~0i&G!yCZfX̀=dao"=,X=anV$moo)Lsj.k~h= @dUB|]/Żk.'w~swvaaw1b.§bT.&bl.bvQi#v1}.fZw1k.w1o>^(b],uEz˕d#Ev<$]m(Vv*mY'ڒNtK:m NL :߉N'9XfwIhz'aDtɘNb&v@t211$GvIjX'顝dw2s'9dN[dm':)WuRac6V,(y7o{v.]~GMOs8nbgZuEؚ-(:puEvQ܁gQƂ; `^AX3;L`FO`b:? ;H``Fv0cxB:ȴ}`^@y~{wP`ȳbJwP`k.T)lDŽ-wxw8>!snsj!s۝!{[ Xyk'$3sw w# L#uVӂbu;U+,o5vK1,ngȢv|Nvm'8팘NvFMkgtJ;I팛N\|;qLNRt;)ۙ6vۙ;yЧECYlhgYiB*e;*n\Ͽp諦;@_wCoV wd~T63pm.mPlý ݲ6RjC=5z ޽ z6)˙=r&;,+gQl9ǖ4rS1UY\Nrޯ >lRNrZ^NǔdKTB/!x] jJQ]BFUe%[ZB&.*aJHWBjv ӳJ93KȚ^Bvj RJK*aM,aq\ KǕ,Q%T*aUx #JVº-aC` KSBːJhӗ14%P>e O(Jhrm a*<8Pb㾫bo rxlٳp9P"4{.£"mExᷥ"6RW"QU"WE1ɋ_ĴEL)bFv@3ș^iEO)b"&Q_D""ETE&Eԅ`-1"]Dv":=ح-bEp)@=dyo9Xް{1p!' Q?Qf_!B(g[!-n.dB  )dB* [QȸB2qi! I*,$ea!yLWȌ*$kV!sg2oz!y,L)0ʼn,XȲBR1ʨBV*&u# Y? B6 -ds`!-l)dǐB: yL_Ȟ򄺐'Te^^r/d~\^ǡŸ)P' /co] ,߶Z Res! o(`d]j U0~EeL*)`rqɋ f/ c^dg0/3 O+`'Pg;!ӑ_[>ڒOps>63bC>\OTM>cW[O\E>34LYϴ|/gf^>rɚܬ|rg73)),MʧtR>'SOel>SϺ|ևaD>O|OO> gW><18V2g֥wt=lqOQӝ'ıGN<Apy>r<9`x"!rٝc9v0-m9 kasܐCT}rWC&aREIsH)!ui0sQ搕y9̛C^V ghf45Ҕ'P1)UsXC͸EPÆs<"a9l Ρmh9-SIYϢv|u1Y4Dg8:,e:<òhf,e;'YGGY< ,Ndqz/?⣀Xw78M^G'w74^FϪcЋ(_D|& >L 3d&>3ߗIL>IpG&2--ڜIԦLndLe2&ՙ$$"L/dLf-$0 3I޼Lͤ0+ų2Y:#e3)Oͤ"%UIN̤fb&2Y?. c3QdۈLچecC3>LdL2yZɱd:8fc=e[ 鐹d|62Pde{&ϣx=`Odx ݕA B3۞A "3ӔA b3.L yUSWf" fd0{Is2) wA r3(ɠhNKfgP23 Vfrj3ڄ MȠ>614ɠ92lˠ=4^sdoM#iTNM*95өN]|: itN5"t O3$]t?0'9c: < m:4t^Vy{$sOIۧ+i^N4НL4Ϧa:SiJ| iI#tWa;ӈؑF4lM#fKMiLؘ4H^FJuH_FFy1gi9KҘ_Ƃ4 Q4?%9i,Ʋig2=UiT694'qBMilIc4G#"ai McOp[8`NOqԔƳ4L.4^rKeU(8-G2Gm[sVG9W󩸾L*Oq*},#J%TS ٛݩLeT{*ݚʸToNeBc* L^ʔTI%*ZJfY*%+N%(E,O(/ydRʊYTH*-5SSɩ4$8!SiJkt*G>*ΑސT[Sy2(CKw*ǍLG*rFˮwI%Cs%}숣Q+wtX/>qԋ8:;ڝufۧ4~%)^LA*) y.gR:) =B) ۗˆ)?¨Rޖbk)mNa&mH!>u)LIafJavE YS[B@8/)MayV SX53SºR0)MSbk)lN-*Q)<))ONSxQY^Q2 iF@lkzL؞d"v%31;=حLhN&aS2InHfj]2kIN&*̕)O&gY2%,Xd &dA2%,I|N2+3H:=MM!9lJHyB2[c>6c̮d%xh2B9dI)s2Gy7LɜJd^%{2ݒJK2g=g\ Lͽs?|Fsvc1c>in42?^f0r7p}- WОKL0JD~&p4#IX'1$Ob$"v'13$b'15-ILjJbrcS>$fIb$2+"$&_DAQEI'Q:?$VI23ճX3#ڴ$OKaJhĖ$Z'=&$:G';"#?<'%qؚđ$$_'8eLgg<8MU$^sM e%{&sFcCЃ޼:ƠQ^JDz" ~%D /&2D|Ox"t" =Ȉ'/Q{z,kK$n["[IܜHҦDR6$>鵉̬Idvu"YɮHdD%pi"Y\҅,KdD*YHDjf&R;=lHIdSR"iȶD%16Ǣ3*}#ybD"C9C9qDI!hH>W'rAD.)ykfLc+?ֽ}vDZ0wԋ}ql|78pK>5x6ŕTo&t|90Nd%`~&J5žH "&0fW1;ݑ $lM`rsɛ1%0sm$0* ',$($Pʜ$@kg&.=6NM`Srؚ͓ M`gL$72x",x*81'\@'}8mJ%^L. \T'*+ 0 k;a.9C*^ 'uԊvG`bx xǣX#ewmqx<^p.x_T<' z6˱xB3P<#?{ϸxƷϤx&ogJS<IkgF]<k\OvU<*㙿",*8xJų>ǰq8'DQ;qq$n#%)㘶)☹>YȪc8r+ȫcayX4KXVG8*̍c8jX7+30=M<%8%Ʊcbqq<6.cx2<#xzXX8>4qNj>q+^q\8qY8 X歉%*XeqY,%R8b̏*/5b͎e}f, biXLuJ,'ҞKg|,Dzw\,cyrt,"b922ccy6$XNb@,g|cy;Cby&w\ce]"-WJ̽Gn?s(mbp;c_z C^\ ~gc|1/`}>acL O0p QcD bCc1L!-m1Lkazs 370{C Y1]CnM VǰpU 1,^Jư|q 1Z1ưnn Y1læ14OeZ RbhKcR ǰ;.}1<16Q11<3"bx Ccx10~1!1n>˃cx=kSp]ek!{(sjQ<Ѹj4|3ј.DJ4/Gc~) &hž&h4OE3P4cDx4D3qW4;IѤn&9MdnfNC49u_͂hVES2%є,fYI4KYYMhDv~4u94̉fcf42iNfkj4ۧF#9͞ <́Sٰh dp4/XyѼS4y3t\F[4﫢"wӴZr/e-4H;~lzۈ~C}3Q~QhG}' +Qx^FޯEw>sQz:SQ ?gu,Gs8'?Q$brgSڣ=(flbVSQdob(F&QUFQ"Ҳ(JXQEeQ XE(ϋbCvQ4͊bˌ(ZӢ>-)QtNbwB{?>'c8<V*gGFqbxB8mLP8kQagWA& F+;#HA2FMAn} EP65,deeE$%)`mADPƹlAsf[3"؞vN`Wr{#x˥)|/q$Ѿǻcp'p^ z.3 1‰8gÉ>N̑p '@83y_8Sv33pfNpi g~C8u,ZNњp) gpV,4pvQ8u41'pdӚNیp)IpĄs,:gGs""S#yqx8gB9g ՠp^ p.{sUC8z>-O\K8Dz=Wy'1A CYO|_ZCr0 aX_ c0FF az>a}&qOw8ODIHFcaLc0fm #%Ø) a,\FamkX:eaWQQF0V/ fqa_Ɔ06 c0Z6+3caI c_RO$0Dž00 a8"xƅan}x{H׼¸}&Oa| Wlcђ{*sV(so(i(EP~ǡ~{ t5߷B b(B >JˡJP"O2Pb %h( %`(BI~<Bm d2{{(sJnS( 6RPJѺP :U eey(B. ePR_4Ҝ9lJ{F(;Cm By<9L  噘PPNGRX(/r>8,\4r) |Cj ]c(ys]( P~ E(پl[{#Rqu\?AYOB0! ;!^ !Z!C~.gBx1ѧB>¸gC,#!L:'C?{CHŒfuBvk󶄐95.JքPVŠ*WPUšjC[BâC؜–y!fЖBǬ:g+-SC?%''phRGC86>gDžp":SCx1"3#C87m5 OX?n!ᘅG,L9daړ[¬]2;-d[B^-[PhBz eVPYešj,/Plbk[hͳ}l vͲwif G&[8`x-`t3-eH FV W,`ắ-|h_xX|/4~jk s5I{,Ñ}B o(gFͯ >13C3>{L53C6ǎxLf"_1uLfƝ2LzLfRI=hfff33{0f&o-fm6x,7|3T2SSafr3l\jfb3iYhf[\3s Q ?@bh{k$@.q!y9/B N\ |4Oz(d<H@ d@rw`{ [)ldɦ@J6RVHy] +R&5U]H]y el, dӒ@ Z d@v dOf gr =C<55Ɂ<s  46r>2 \ }VH W-k=@~G@> @{ U{U t  =h& HŶ\lcߝMws#B7P|˷~__~Aaǰ+~ G~D~D#OʏI'S1i׏~t1ݏ6?Qŏ&?JXNJ:?*kX]Gj?j+[Gr?Kh*cKh}9~cog ?qdGd?NLTq&Əs~k~~\U~07Z?v~|bCXWe]]1δwv](4aW>W> O|> C;> {ۇo0^!Uƾø>Ľ|I}H9C>L?'}Y0w!Ç;|(na&7PއU>ck>Ԯa}}ش̇K}hYöBv,#χgg,><ñ'$^Ëq>+c}x5ʇGpioa>>|`#>!>ˇ/>|5؇i|Fß>|7ȇ az={Jek_L(3 ?p oMxƄ _D&?7ayD5WMe"ȋ&\01ؗMLxDi'M$?gb3&ҎH̃&f01q9{M2`vEM,jDYM7j&VXDJWh*3\bbۋLعĮ\{sL<>ā&4Ti&jd'MN0/ǚ8?ą1&.Fn0WCM\ 6&>0񩯉_L|a4Oՙ?w 5k%\=dMc=Mg?q'#6x|m!6_ HЇF ywb$M#0qH#^42)'L}H1#38d$I#kd.#FuYfH#7Yhde:#kjԮ1RWeaF6/7HkF:7k6dCF0r,ȳSbd#/N2r&ȹF^ghțF4p#yj #Ͻz F0?j?灶S'Spjgj` (b@o  x}e_@~d 30⚁ l ꒁ}@9H|@ R|_<@z~k?x?vw=>H/7{L (o ›09ap'6qxq t՛3i(C:WtaFǐJ߯uJtcG:F|#=tDc[:]ΖWǤWt$ՑS:?cs:f?#is=#  X[t,Qڦcy6XIGuԯӱFǦ:6RuRKux}JVSIe6%kZnQRפQIc:%[jQVRI %+WdZH<;Oɉl%2PrfsiJ^)JޘIJ+ygwcJ>PJ>!J(:H|Jɨ JߵJM*?]@%̥N ȣ  (R C_xM(N (;֯ R_)Q*H o+H S^W0킂(yVd` r+;` +X|P',ۧ|TTzm ֵ(X߬`&6(h^em5 vVRc v+طLK\p*8x*x!K .LSo$) )>Nc|Q >W#|9LWVo|/CKctW R=H;@Jk"{n4ͺs͕X~k=Vmej{菬Dj{ļge5+qWĿme[Vߴp+S.ZzJy+Y񲕌>m%딕9[{jG谕V +_Z2o%Ƀqދ5~ UNmc=WޠΎEE-d-*fV[WR%bumfMMj6h[nͺFцx+ذvVRoƱ& 66Y/&֭d@-֮If%olgmTߦeUٺj%v*omz[~H=?&EH]p {ۑq,Bjdd ]!N 9Rv)z R',##s AEX/##kAwDd$6Jd~\_' `c/lCp{Ͱcƙ^pKқzz'^!^^qݯs#}.@wϻ1mn .FqJ#襐tvwb>)@w>1<1O鎛a9?b0y`ljc~~¦ HibV@l w{/+.-k~z#hlvguwhv222?@ꁼWH-cP/### Pȟh Mܳ $tf/9:]7d222 $222'ۑ yW$: =>/q}E*3z/G/H~?4Crخ]F0ܸddd~rH=?R_aw>|ҺY_g:G{o7 1I-lbzwQsk.g8浏ڜs tn;Nwݣ>Gzgn3jmݙOހ;kN8:qۏi6GA'F E_~gq=z{[_j|A NwTξ[ @~pG'0wGn9VtG8ݼ oڮtbGts)Tgy6YXsp.FlsԈǎzGi~(։b3bcq#;|j$2wxb]OڇMy]]b D=ҝ\5zIFכyto+6ijd+}\ +T1ɟUmIGgXK1"y\F.KX""b0bçF;m{>{wwy;v,gdy %Ke*AApݕ˧~rL ! i۹RԫRK  GvpsY&"JR@)V,X]{`$3JSMD$1F* C߯RVS3~z&ӟވI.p B*DD(p=X5 2J^q, b%W EbI*t 1,GC0c,2+ReiZw;WM} w<Ll2$~%=gY]*A$<5(ۜ]J=Q)GwUi霧\V,@srV]\(rxUpY!"XEGPAEy?D*GtEEgm(33+f k$c`,t !#D`&k3xW>eӤASpƄK1:<cLBbVup=*y*韼h4ģy׆vs)1o]D0(]_tGao$ql-G`TYj4i?|kѓu 0_ }!?_B+p~%(:o\Zk2BhB q3t;gkQcM+#rqr=ynשּׂHePyw7AlETeM͆ƴ4I$K,j P)㣣o:j6FI뿿z4Cԭy2_Gƣ{4 6V M,Bj>{_\8_ۧRAƄGP13V ˵N90Q HA1h'8Xu+4, I[&4t34_|y3?):Tv@>{uvӰ h(= 8yO/^axzu5PJqef!Ga*Ae WE A&ϚD16QCr|t h8 'u4,A 2*ADdxck7'OqVCCf:8~u/L"cAD"bhѣ}8UQ)p$A] 9V 4ELgDI^`Oޑ8W'gf#52N1&Mze0bBHQ9+Xޢ#8 =51!_17TbA?FQQ_^OWV m 346 V ӫ|QWPBs@'L2 ( 2BN|11z37 !2%T/yeB=fqiH9V:c{Y62<$'4\J2Dsgp& 8A"1RJrxN2)SH'˺A9Ly c/ݔ*}ߎEMh*3rP*٪AZ4K7(-g,4^2" ѫn.}dbްqg5I ;HؙA.|)^>k}<_v/Vb_uULPYl](ߪ񃍆l2*T4Nbf;;hY:w n[  a+̑κȔ0mwd P ޥ e)+l;,u.W8"*<zY U]ٚ\ZʞWF/hW"7#^8>@B$m j>q ӰʲTA(CzJr͖cE`;@gJc6#p͒h)JdKi-Տ!OS 'T<!+tmRf!A?nMpw4oCGPk{?R[W^ЭzuְKj#Ly S\"N6F^ Ir7IW)+HMlB먦?2,dʫAC*,ˏ,2QjXb^! E=._)3!unp &<̫4Zu4< ]8DyAU',nmb8>YTs2hvZ'&;AUGdB+<, X}Vba)ذWTZQj3&_7Dk`F3YJk5O{U?s6ǿh,KV<;]õtdUW T XN`}t-~Pن~x]fNEjy)fi]ZAqV)< l7+qrQJdJkX]"r4oV&8#*$`fT C̊:ɑ72۷2{Y)V @J)XMhr*iSkJ18E$` 0 s}O|Y Th3ԅH:Pat[Uj t(3^mzl룣8MNϮǡA㌊Vɵ8ɍ`hL 8M:W#Yɣ"$%fphc1?Duo09Gu9f"f08;oooOOp;6쬽}P<3n4)Ƙ0{( #A*P]B0(/?.hXkoo_{gHPviEB" 80NzVjws+aQb뛛5:+qh.iR^4G_IIA$QkŃZ]eR^Z"NQ$I|Jqr[3(5ɯqޭpyAf+Ș)(m6&Z8Urs4N9 >O(/xYl ܑW~h9wu+B.X1[(;sCڋ˂Ot*G(rc,Gqhjp\([SU"Gj׻E#Bcf.ǁxcp $dD: u0̺wkKr!+$X%SL7*j_ pۓ(>:;f܊9 +^ܙY9)op'U=b(:n: 7t,,i͖4;݋? +P)a|IENDB`weston-1.9.0/data/wayland.png0000664000175000017500000001360712456345006013055 00000000000000PNG  IHDR>abKGD|IwlC20sy;H)'OGBWYE6u\:?Ӌ` ?qQUK)KD1!6 L9l!!P.ln@M`˺3DgJ j8RV\$8 1(Nm\ :K zm 3GRU@O= !n2@x0IEIx0\Aj{m/ 䋜q/`iB;ϘVD$o~w&b\/媸cL !^B״"NE{KCD- Fw\;ZYs{0_=I2$e" }8bfA2xb2ϷԠBQf#0p6L<4mqZݦ e!~oZArKV]p@Fk.ڿg"kF6XoL&?F|{M{-: WN"TAFW}mh<3d@զ|zmZSz]d4@@.fՋ7ȰJ =eZr閴lݑ/2 כ7]{= [&smq \Bo팧3\[Aɐ$LRS;,x#̳@1͆O<poD |0𨅔<-W0Y1}q0i!LyM5{نV $)RJ]aNKD)oC/z{ vN#j>z7l0$yM |-`~c nʷZ%nϛ k`q}er8zv?^.M&x(R0Ϙ=Wy~}NS P.`3Ӏ,ds7\ܛ~77|Pr^9-?҇g` ra~g7pAdBAxS,P|^ 8O.V#@_N-'۔2v(~uP|v^YKh R Pׄc~7Pb5o"h9Y jw{ɥb:z[ddA OIViA<`i3|]zI(5ZMzrU_!@gEeܦSfsAl;qD[$"Ά|ð Eo>}ſr%-Fq4w_a|&hPJ(!L_!>[&eaϑ0ae8kmu ¦[AjQ.g@ W 8bl|w}N].8Q_<N\l>Ril$pM#@\uKy+Lx2g0][ 3r6__M?6|] *hqU[=Nv' 蟐Ҙ3(e{TN:D9pƙc䊻 +(fm-"{7<}z(/}jVׯj?ԿH Ylh3V- &ٵ EpE4MSi&2?T(/H{!PrRިMEgLTJL[tP|7e;A8P{`. GrE\Kid$ %J^y*xî?۪Tƒ lbpᚕѥ`۬Nk^ Yj'g0 8W/jUEL~19X04#uuÊdZhj^mU*v}!P>S:5&Hީ҂B7aj,z>s[~"7wP>cԟW(_ , V @' 9Ӿ"F+=?tEz=73sO&h p3r2Vvc#KNԌm i,w\G`p%&~IW ڈS<$c47Ze|qA`ݴkHo'-;;|@VpX[ &z־ #@v 2uAUnVa Yq7q+@2 WO6HBܐ/m4 (ӷub8J2}?wNЯ{줢$LK\\8 #B9z cT:XyRbM,9%P%: &| [ڵH@A2Je|loԏ\wl;תI6o/9qzYTf _ҫ4<4dZ;.^wF_r傮L^"7pq+l:zZte3M\c֞]8QD@ cR ^=ТkzPw bj_Ƅw5?Sʍ]s;%ףg׉+HfaEi2z (r*r&(JASz_F`s^tIel0?8%w5ga6q-=a9W"Р1,8zmIbW6/BO'f-Usq,C:l/yf ;4Fw%z/uX=Ȇ#5s4#fE}q^D\_3+N7i*Ƌ)>G{-;&aj>Ҕ!w] 0Ly{--cM}ҫY(WOwҙ2_ƿD8xuj_ۓTpE9"zJTH]!JunWM_f~@KʩД)3.۾)m$=-= Q6s?!Kft~"zP ,[LN0 T#O8dՑP99m!nxIyV * l!5`Ն!BLg4=g%VټEeQƪ4|<iy00o,=M- m:Cjm$藓 @ȴD[e ON־}tz>mDC_*xXuhXz+LɯSƒz$“ ◣s[TD퀳ď( VʩÞ?zɤ2ngÛ;dَ ^fFIXPyIM!Ջԉ[yu B*6f"4cS t^ơ3slIF&wodC$S ɇ`ǫ6Ai`ʭe"ÃhEMC?`,%';A#4e_+ 9Eh_ R0|5KStx~#6" 딷<ߦk?kEW^<˭LJ*ڻG3LxZvYX}Gb:) h (g1ª+5I[X1;- d[=?d*lu\;)_}kCXuq=li׿[h9T)s{yKLw/eE-iҳh[}JT7j`UGuipuGHݿ~iXuTN@gQGVwN5ǩV;/qfj5թH#="\)#L 4C ǒ&> ,&(G{X:}Γw~yuŮ8o.lMVZ P3&l1z6A7YcIy<7Á]J+f$"o<@ulܩhI&4FRѴ~@ߧ?}PgpCdz $|p uf)~ٹlG[vˇ`,uۥkE$4‰@L ؆ost@tҪ!hq}\-V֎b:ۀ<&6%;Xj ew>lz<+>I(97q=퉶{0"`}E§Z/yڶ"/&f~.WvJXY6^@a-7%պ\{;!"y@"r;Hu`.T/MDM#Љ\~GSfcuFQD."$CQMǿxz RD6?Friޞ谢(F:&lˀ{{o#r='uЉ\ B܀`64`X.幞SkRUKO6 Xd.<^|'^b˘H/i%I14CJ: %.fгЎ `!yc{"% GRF2g$@!*D<8-x!10B2 Jf6{&T"YO3;">|, r!ΤO&J+ ǩs0} Ւ}IENDB`weston-1.9.0/data/background.png0000664000175000017500000073751312456345006013546 00000000000000PNG  IHDR sRGBgAMA a pHYsodIDATx^˖nѭ$1K @ 15EUQU:WdX-w!w7#rؙy=kOo(((w_b]EQEQEQ7%EQEQ7m3nQs_M9Q_~1- {u+=^<{~fg's3=bd=Y%yfoY|#9l=s-Ym=;BC8 =yWspqe/UBϜ/j{glÝ{^r۳u^uνd3?v__ɧ IzYsޞ=r>e~+?Wi)#fhp;sYdq^0gɴ2#:<]gY3.aj#>H͑֏{ ,-Mug[UOz\h=x;OLWhp;sןGyYŸlƈ}u352h;3=29L+z:˨rZճ.ʏj7=z|N"#C岬9pVlV,Ce[τ\E,s 2 ~ >e4 ൲sWW@ᜃ=dy 3ˍOc_5]kL™՝1y\5, εj\.F{g=-o9kG@Bc2?Av֣.eiah gưϴ<=VF<hy^;F9]W{Z]_޾qye]5\cZh-g6UV ױ#eWg~Nsr=3_qf49:?7mj-F9R.=F W̓usCk\,tF(YӴ:!ǺҪs,kEQEQEe(#{]ߕg>kfO+_i7# =}'H9{bF3͡Žz|zۺWQg׻ȭz \7~wr7xg=TO˵L7#tֽ=f,gdO|ܫt_hMo>Cdٛ՚h\-?􀎫2#ANW{\ϓekk}ϜW]ǻU\o/#jYԺh-ős0g{<#{euطz.ZWgڮw{^}M+޽>-5?}/:/L/8z(W^#g1btzQLq3\ex.õ)<[Ⱥf[,uy>Xs>2e9<Ӏfv:{f[Y&29SqN54U?[x9,94 FAS/\uU:8dyѹdֵp¾s#p=3dy tŨ>4YSewNǜ54ѵkiekա^kbT8Ygu|SO}g .}h.YE}U8˴1W78_3Y栻l#4ue_ulK:G.;G/g!5;Z^=7r?hH}@X4灖8U髴z`~o8Se;Ldu~{΂y=#dg{zDȞ:szgd]Mo=>Y߽GZw>Gzed=sv#|hGj[hU^wQUAVkzkh@p/O?@QEQEQEQߎ˟3㼢DZ{GWSϩxh3ܳEw;OWHggzDmq܎!(\#{8RsWohvkw#sYgW]GU>1+{49;{f{9SԾsxj)h1x˟w/8 7oi g2\V5d9u RPCkxj.7Z !w:h9n>nըߣUys/XS@+{q֑e{V68Y ,>^#(Wet]3ZZfO6U.Ҙ<}z>u=F[yQ/k+qQuF3W2SיrᲬ1-d=Gj3ZߡY^g,/V?wg8p!+t{~묽}=,וl y9zgު}7<̯=^qWw_3rΜ=w߯w9fc \ϧ݋J|F9S#z?r9{+pveF?}LF^.Bk\#}ӧU,;Ѻ^qF,1W5 cO=g:Ӏ=؛Iq=ܙnp#5W{E_0ѵ~#5Wr;(b?_?EQEQEQ'~/i\pg=={dܘݧ`#e΍c^U0GOoWo{΃}/tͺˌh^:oSzg\'Ѻ>xuTX2Jzّ^訄xr5 .sgjY6֙5cd945k:y-qvz+<a59Ѽblճu2Q]xs:w=duf+q6WszG^˵p9#YOx8yu˅֌+,ՠk;G jpkUF7gZ.k<:\Lk9<Ձfz̳w}\_hrdYuFkZz/WF}VO]oQŧߏoLrgS˃߇cy^~@ +p>[3?{OGjuO7:hwޗWY9ǧ:[<3E<#=^yݟU绢+ճ];Og^k'>|赾k@QEQEQEQߓ~((((oMPEQEQEQ?_?EQEQEQ7?3+wyYs|ǽq{ǰ<?9[;S9*,{·kVO Zg y|7okgh#uY {Զzj;+rY9:+]dzz/s+Y9_Vwϼ3g]3YF9 ?4~o4kÝH9Wq9ٙl+yg\S׬|V]1hNw;F+(G/kuԽ,z?|zOߟd+qʞ|=Oo;WYg'k龾gU<=&Gk#tZ;w߄VCAK?H. ^Wі̦.h5<}7bϺuWos''mFYff- Z/}t=Hww޲xM3\31^}7Lrܹn,=F9o,>ήPL5Q~׵*.ao{Mng\Ut:ϜKj#߫!s=g/=WʭoYg:{VcfR}zBӃgମꌾYA{q=fVy{k߻xߡ&a(Lf}i.̛.oF!>皉9GzhIfdB5Z=iyqݔz-~şŻK 妬%+Ԑ2gcZgo:m>|ZVuڒ,z8ȡycbHR{暥R 57C 7ժғX=13hsk? s~y)3{zjc͙۸@.FYiWgp>zo gLv3Ϲn1#s 8AS}dqn:{nL5Jd Smoid}֖L0̜Y0rY^wcTOV{,{^̴a>@v7{gzC&tӋDfQ}0N:Y!#yc.zlj}x='mї`S=A'Ǿ|9j\g}0׬8εj}c5:YΡU~zS6攟j1`N>ȭ?cGtS&VޔWg}C\Z-Dgl9cr8{~^s{/ٛjL?sfTTwv?ٳ~7ϸڳǫW3«rd=5W_O{W ;;tϾ?Ǚs|g噌ܗ#U~z7gxuoO$~=٫Ǖ=>W_+l+\Η7+Ui=e=9{M=>3gjJϯZ8sw^7{q>Z8 p:kU_ӻH(>]pFxL ,Ӫ .epM~o_gd:{8粙l=5õkNѼzN˵ݫkՇ|u9WڬfSHef/rhVAǑ3y3H==Wygz#j֚鱧&:ϴw=5Sϵ{53R3΁~}{gR 0qV5=m*[t:료昨sg0szuC@k*42px/D_`Os\2(53Z33=\ Soy,sTWO3UO3N3qm4}d2\Nq N>9 eMqӜYStyXsg5zV5 .r#[ss@=γtZ= 7:暻=p/M?$J\pz=U:YVA_f{^jz`48uX;=ˮ 5@Wt4y\q΂VMO9ù%g㪏ݳLod>zaFs{3Y6ӝVMV^+c'^+G̝ ,{ к ;rj+co˨kh.>ϑs ˌd2lm_rFzJyȽOY^51 Կjz{h> e^Nsw/Z-# oMC띗Yo-zU~֏E>Gpf/[^}qٟʫ~#L0sVqHͧפ,@F뎠}Akw^Ϟp~OݧӺwg=;YF23+W l.ZCsqf/GoZ=ZZ\}K,((({Bpy{3FZdZpuAZh[g[zV(ZZLwl1.2#ٽ>z*QFreu Up{]kxVϺzqNw ;\eQMת2q^{WZ9xʡ/p'ۢף׿Wόr:3#XZz(.rY/֝lZlLgǾjfZ=V uufz>' Fr qO5%si4G=/V h*쏠5{zqkV?\ r>BԞ3㜴e;rYZлO}Y潋#'\O.}n^t}O/| yLIgY=CytϿ+}Im?knp%97_[ox 5O X0Y_4ӻ˴ XC~<2gpƔ.-RPkSM]6lH gZܻV^@u]>Ϣwxsףݺ#m/N{1[L99}{Y536swѵj 2.;Ǚx~ھ-Fwnf,eӿOufެy} +Zs;6.?F<śU֬WІkSCʓya_Q8As@:sw{e{g=ͳqLc|~ӹlksu@k4TZ_s{י4ϋgemXi#>gc塧ge}泶z9q9\VȲN zN>*K}i_tLj\T^荹co\wxm4;X֦߹Νmҥǔix^g,o="yh\06g!WKΥnZRZϻ z@un-\ݼ@={Ng2yN bޓ]Yyt-5GƦ\:K2:63\Ǐ',ah|df0gy@ИEQmQ_WSϵ(R^LxԹ20Z=YRiȹf?m3y3-*Z4^gg ^8Zj߻V\Ռe=-^5=:{.wtQ_ϢjNpzƸZhyX|^E;F@eYlhHYZLٽU}5}{9{v?֫}FcOgdFjF=g#w`~ܓ[uzgzl~e{W^[xFOᓮO]gݏOX.z>1<]wz~=+mS~/?!(((~fey9ZkE<:Zt_g^xi V֭[9穯>׸ιs֬;x8]l8hEG{^Nc=˲ g0^,.khg8s5\kg4Ys^#>p~VQ=f-P#2t@z+2ӇsBn:|^쫇9{YNsy3ڧ4e;(.t\:kέnrtȣ}ms$ڤ?{v sa~>wMArb:1ސ~ `o] F{m~vۓ9cϜE!oz|5oǽ`4ji-{x =e/x{DI6o= ~Ꮭ)ュ|?ngsoLqc:<~Cߞe{i g{osy\{kޛ1o*N1`zlf悹ͼa]Fޏ9ד{vkz^7XgzeSae|OqZ&a,y1MsgfgӸT?#=z5-jC_̻}}D^7 kz߼ǔ?67X>ljY E#pŏ1{V빟f9}sk^לe>_@Wm[t=Zi33:~rm{d{-@{M5\6Yj5i{ hnko㴆ޞ ο˾LFt2˨u;G^jZ,@Vދ9":1'VĒ15N̢'3)kteُƅy JڍeKPCYǟEu仺 ֢G`UA{>+g}gyLygp7s4t:2hQ:Oh3ZzCGݲGO3ӜGw=f=\=:a_{O@ k3a,p&n¬=ӆ{NDOeskMpn`5;in9̣Fr{u X,>͗u hĵM.C31Z=˸.~Z0 kjZ^=x m6ؓuhn輾O& 7:SdXW/?|f:g&}{3 s~8?smԧg嚤K?kkFw9]?Xω躇s0FՇcTuǛ3LCehoUwk5x[7iWX7v Ԃ}x'Y99߽ Z{9:oy rH}d%t;p$=v={02u֪0qc (r:͜o\[|dYqq=xt5r҃6uzRzt}|<1^\ќ=Zܻ9POa?e{4Wuc]H?0gm_3/Fuu ];͍y^[kk3-˷XcdzЪQk[}{2{bΚ?ϛzU]GFs tz&2Z{<{hqZ֌jpVh_{ZsZ<_Gg{:{3`'}ddh`Ov/Mdi.Z{z`{֬?gdϖ߫HfF{"ޚ{1:1oN{tY[}|k3\ۋ?s=rY^s9[{w\1= מ88~??1Wpg{]g=kh]轞gs0.>?_q=΢iAV8=o?DPqE.dW4gqFr#::]ixZ?EQEQEQEթ(((P?EQEQ0ZQEQ<wCk9Oľ_=W=*>_ߑ3 _ybtMv b =8MHz5}U=14 ȉ/Fbه@]Dz ŽLV}n`oK6j1s{1Sk&ozĪ똣nqA~zZ& Χ1G)+ou`W9\\rX.lzSXϠ72PmQo@>zѹAiZu}1gZ^.ǰZV|0sgz^ %F|ɵ#=zh+ 2<׫ȄrgÑ:grGcδreZ=Z+hl1}S sGZ퉵hhz곗\kh<*=ՠL}g{(gzY?lgx֙G*>\N 5wGj&;spEO]EW܇lW\ѳ?4zk-Z|<\ϙK}28sx]ٙBg<='+2ӏˮgEQ|i((( a@Dx=j3gk^o7kNܫa>t׽s= /~)Wv+ٯy_/=$wpɵ4oؓ p|UWy>=pD}G+sv0r\3^}˛9|\J[ϭ7v??pKq>sOϲl=s~ #kݏ)V?ē/efˈ t3bW;y[ל_|Gxȣk{4.̹P]-,S9|oΙKdMKi BwY̅ML嚥72YYk/-(KZ#{׊=chFG'=j~e-2@X ɡtx%GZ֙UZ|ok;玲f=mzfn34؛R kmyΙ<Vҟ{6-Jex;n+p敎<.?L6CkՃV7:Xeol4jŵe6y_YYg^k['gm^2t_}4Ӥqy=Tss|fu%s;}DX49asft\q7/썰΋ss 47ý1\3GnjOUw ̤κp?2qz+K-Ȯi&=Nβaދ{*NTD;J֛,x[y+/pvk3|0pUep zLj/-\1yo9߂{0ʻ)^siUӸLd=w5!45КaoaOn,zgA=qU6=ٙy;݁֨2yBM??Iq7'yg|ǞW櫟:|sș~k]\#qݏw_oEQEQEQE((((5+@QEQEQEQ|oo[((((APEQEQEQ?x!?5IQJ/EQEQ~(0~u/z?)~:(8ߎygww>>Ϻ~{_|+t?׊s9=|?v+{1>W}'k88yy}{?z}8{z?{_ϧlOwOs\|szFΥXz1wk?C}}5 f{[#-FE=_ȼq1~~GNz{k]3_V}}q59t /h(5gЋ{qD.Ϟ9{~_y=cu#{n9s\sƫC׳=m1w^~?ygs;)Gźs5=.p%g\{?%7rȴ-?Oߛ]w y7=#J OGeD :gabϑ}57JI>pQ/Frp<‘Zj\N}dl^+;ʞe:pk+z9?-t^3\jlDݍȸ,q~@vuv׿KVźi5֝׃k0~f0:op=h^Zn X{z[}˫2L/}\V# szd9koW <ͨ,,e:]әǾf+ӝưYeGj8?J=̳5҃zkTfXSz*Z{CGFqYzY穖l/ՠ/r崇k#p,n/0ϲvꋚV-L-\]vUY&[~ۓ̑Z8Fiz5J|dx:{Xg^+;hdte{Yje]}v5-zy\Fٓ,:r#pߙGq}2z= 4g5YqOoh1=lV#g ͏=hFL+<2 or>#sz؃q՘V-|lVD|^+Z,4F}Z-Qam}ѵz-\]^Kh/5jA+۪cF,4ЀTc2djepVieW#KXt#k>c3u kmkgsb<,Us8sOtgε@6q:P/h9F.9=C˲=6N?/(((6EQEQEQE:n: gzp \]Osٜj];=ճckg\\054{)Uiŏ֬[d=θh.GyA=Zy8tG+(.,tehG3 g4gy[LM3x%qes_-gܳ}8r/xyF~FKcI<981н{k|N\w|O+`bƞq?.{W߫rQL>SBD݃۷^giݳYP9u~5G^.x3r |#<f,:|#`;YY^k?aOAɽx9)~l֬+ΛֱG&CUͭVי:<uz&#:b֌( ju/zǜ5LOS'1|͵ɀ>>LsXLӧ9zL{.̊Y,U5=LS"è֜LOS/ttrrz\B܋772`;jȻPL)#@sY~ zq-1qgPh&ss8;2QqVhqlT=9kg8i֨y\jմZk׫>jYVhjVY+Nl>B3|kz d.Ck>keh .p~/GKdkksHfPתm˹L^}&˶zQ_a_sgO5X((((A|(((3v*FyY*Wux{= g=h=GG oFp~vo^Ŝu`t<ˏ{hGF,糹Ckx> zjMo=BCF0zg+#uGnUUa/c{:ggε<Ӳ}BԺ잺?֌us֠;dhSZVYg#=,Z{wgEQEQEQE={?̢((((@QEQEQEQ(((EQEQߜeyEs|s^Ow'? / ܓ5#za=gڃ3>{`O 4bkzz{=-y_leιu^ozgS{׫}fWsγ.ZKg/˹9]ѾٹxZkYyZu-\{zxosY~pfQEQEQEQ߃((((~u gQ qӱVqs8\)-z Fj[p}G/wF2rJgi[nOeZ92\MփYz-/P{J뭡e2q>9 4ke39Ӫs9tQNskEV,r.:e$Zs[ܾzp =Z).õgОf}W;Wy 2\jz>ѕgzƺex2B󼆖Yw COg/\6.?1Ƒ{EQ?;QEQE }8կ=\O3u溳z?z vGEN7!o~1Vi{z @̬spYhyZsq#q>תuTg;MZ.u5j?a܍4G F}q֭YcY8JV#rk7wޯx}u3 t>{:C۾~xYʈ8:f}y8so[Kf_`\پ9֌Tga |qݺCT#u9>c3neqc,kuCkzyumZǰޚc9 Ȩ-Zϣxgyy_0oiV5w^k7>{}Gߚ3C3efS@yq {c:u+CkwwVcdw}>GkO{:κϠ>{=Xj~~|@xkkzښu]ﵗ{:GXcΚʴ~1@gp7c:4GȲsrml&G{fZ9^udz<౮1^cqS31~2X+Nsy.>\̃k7q~\e|=d2F2rzXߵG:˴k0:8kk ]3'kZpG㺘m/[ω ~܇zy=|s{ѻ#=־e1\9|\zyky!׆$`4'wZVsCkӽop(\p5`O(#{{ssܙ#wdQFz]_A羭I-;߂^؇,q݋Εջ`[>;XPÜ-gŞ{meG{(=™ZE\Yk ^`t?uOgӾ5MWWwn?=\0rNC잚g1r^IMz{C[o/Y1gj===9y&֠G@1UcPʱhWm$ [dyֹbOVݛdzr}G=zuGp{ٸͱ:h;((((/EPEQEQΜcO=2\3jS}{?zߴ`q%ˎkkAshn#:ru'ّ{3rOG\Чg@OwΩUC, p59fϫ1gu-&άGdb/ߞa8/{pkk@|հv3s~^=<(qj=k$PӜ{AsLuez-Fl.؇q=^Zk5z\,`WH y@GGc]#pݑz>Y7bzb/tb4`{q^{zZunZez]],<׵0oi|x=_ףp]}YW9ԸZ^^_Yͳ眫幢Y:9Σ@,t2{8Ȟ\Ӫ糌4Nl~58(ӊqFhjNΜL᳷aӺ\[p~[5i#5]gݗs˾gՓzGjs99{>?+r5_o7eX'LN{7gt\ ((((/APawO8çQy~Yϫ1p~m{|U+}g6ZQʹV]~nͺcϭQ|ՠ5 k-qV׬a峦9fNGͰ8@ ܜqe0fUgYjG0圛sFGg9d纖4qaθ,t^3-ϡ1wCX{{8ڋAѺ{=3 _;UɳyWw"w~=U/ٻ׳vupoPstpg^=LW3?޽((((߿}r?Fkq$CL(՜:~s;<5|WW\Ogt};=ϼOOz;Sv< 6+8Zz7Jޫ=޻fuV z>::^YA,pkPoO_t4U>欣7'p^}σ9zdnNo1:a_n 5h{ok&;WL߇^p亸H=Wsݣ?AL??"`e:Ӫgy -,}pVt]]h쿂{e=˲p9)˜ud{ [^;Z~AYkVPe7Cqٷ2He2Fuϰwoyմ2^Q虢dHpOW@녶Zp~V:Ù8w\ۻ=]w?Rt%~(I(3ǹ(3|z\~̅}M8qb~;Fk{̻i~;tWv/k{7}흥uMϾ7ϳ{sw3z~pߌy,r}9X;g6ϧ#d樂|yb_7^+:wxcf&(%Ͻ:;S'n0gYQcԓ׽}27O ]5~uYۜ%ѧYݼ.=Rvw=c_۸c>?-,=I"mo>0KF#݁}V{hm=i>Ƚs=[}wnzN46rgi[s^G/<.Ahgg>z ȡƭYh>y1WYygydS"4FoZϙ6Y| |֬/27V2snsRZ>e^o\d?HjBƚi_fxf^sF_G>`}WpƁ,E}C+9cO^,>wiN{^7r3|bJpn7g5&\v=N-9\xәb9w3Xz3K nUf]OPL?u̦V;i^y1tg7p~ִdYɏZd.݃&Faﴖ.:VAk:ck}L .>=1wPm9?$ 9"2_j}zֲ~ #˘tۜ O\!gms[/׆,̪G m+H~cͰ|u9??qKk&6܃h=xOiY9$ܳy^fyguS}W{zq ]>`?8KY~q^җ%{cu ӣ۳j|v e\Șlspf$|}EK .{Τ&;sOއ?jR {3mjZiZ/=՛a}C.-6Кsw ޹'psr_uF֟:GqMOʕuվo8|=krw}>9]ͳY|s_xo?GSϩ"EsQEQ¿~ߛ{O3|_ZU3 }"ϯꯩ~wq}z̴QU߫|%{' )hWyz9 3Z ggZYzdYɌ4ð51y,NeÚG` [9E Z9|Wa=Gw# t19h 򠗃ξz똷֬ieT,9ŨY7¾30k kVf1Z(.^ps˪|ᬮ3wiN=g u=ZYpY<2}d^'Uc[hWQq5xlͳui[ξ5M=^pu@-F4kiZU=ՀzY34X+'wAA};-2Wu>ssL~&wLΰ=cL`t쾷=kmKjN==@?J~kGM6F5 #h^u;4kjQP3Gq|3{ګ|5rftVѾepK^7o>ߵsup{}ٽy=,?g^G8s3._׊3,dׯP3FArW]d?>K4tWkk{~⽼LW^׳U}?1,~qcU#|S3)V|O5EQEQEQEQ|&@QEQEQEQ(((~ ZM3:w٘t2f-냜ff]=|eiF5uGqp^5XkָF53aj5x#{zw @FqY~V2{@?3w{8PO(z_G'?R׭|g\F#uނkzzf${[>2v; \sgx)7?yx:F\wgx4\w0w4շz]CqV{A#=Z.}?[8ܞnޟ2gF{sxZںfk#{ 3z#D;nerg9^l=u Vnuu-dhX.Z#m1ӝןbk}g{V2{\g{Eݞ+ {_3go>hf 8۾=:9y<ӼF:Ngu/ :2x{=2k= 8ǃNJ5_VZ^unݻXk#Yd^Nu^;\HVN5\k3<{ ?̽G::opy~2Vpskg]gn^{ZN|n~$ɏrek}li#U{l\#gD&FαnϢ\qt[Zh#}d쳷.g>{{uDږ:aomgU#{BW7ҷ9yc\3pl#hL{ƙ9^\#,ú\}+/2WstWOٷo|?Wy||k+W9eYӵˍ.ǠqgkYZghdˍh?̙yn&|8MAf$׏l/dz+zne+zf;}#8)*pe/'^0WO}:o/WBu3#+ٳΖzj93ȸ<4|K֢.?s 9ʙ~yg}^n22)2tlL\e9pޤI6b5e~ӱkiќոLȹyd6}sNPyU8r׫;'dj&Ρ5|QsÜ=G^֟=ʒ%msM*cZFIYe=X= Ǵf|Ω7n^/g' {z0Euu+ub>:[nc/;M5 Z6_e}[uthe\ζ9f&owOwcvīiU?7ߏ^@_0x}ltuΌdFܞ}Fadό9塏s̋ќc4Hh\~\j[5=z\o:殦leur ́,#gtdP^Un/h:rO_x֣7c$eX<ƑO׭zjVyhO{=2X-+>{|փ̇=k~:f8Tk`qs(ksVh`o>c m^Z#EQEQEQEQ|/(((L?((((5Q?EQEQEQŷ&EQEQEQEY?uZ{{݋'[=os<ޢgG=d :Z{'29^q#="s^3z_sX3GjFxVgsGouUz3.<_垼✺{F+<:?8:ÙV68M2LwhZuG)0jիdSz3QZ;`\> gk~ѺVzkB˞S=>h{iYyFgkK^?yZW9s{9Hwܣ+|Ƶλ:~t>Eqr5=~((((c,?Ilgq<ǵ/B?wC_eQo=.?K#^@E |fO(+y\uo?_;Wɞox.~UzEj4%˄d^𜮴r2.bt}3Ncs58kYWY}dk1ܞZkT:yh:}P6CZiy rZsSNs誁s1{@57GǞ.zatZ qsu+>x^ :gT:c$Ǚ^ez>-PU:9^^U >5欵2Y=j={}hyawZ[_+vd#{W51g9pkgZ3[ٚ5E.s3`5J毵AzgG5]G`־Y |+ǏݳV-=4=Xhsϸ\'8kkyd\n5udZdkk\f/ι/?idXыf}[|p%so }z7?0gsskp-'@hY~jGNVccƨLKif;@P^߻fxt=gkk}-GU*tkk.sLS{\s-Mi54WM 0Ҡ yac~鿖1/?HmԜ>{^q+p8g?{uGκ7?53_o休s9r#YFǟ-g{Ï٧/edܘ/=wbqs``O^{uG+> p&n߈m8k;fX,~V53q]^xuOf2&/:wmkjx?Yq~>]CSxϋ[{9z\CϦq@YS{q58N7o |ƜsU;,ٜ ƙ;z=p'c;e}ֵ>zhZYځŚ=-ySϝ{U_=|v+{=|'^F. pb/ N%;ʹ=6㵛3o͍J3dz^ @W_5h 8ߛPgw.ú@Sϭ1gQkx岌 WלÇ{ unN5`}tFu֬49M}>gF4\u9\:;N5sӵ. s_J"kYCvG2au^d5#׬kf'ΰ rsy;#9M&>wsӌjYWkh(gGEӘ#ޒϣkꚏaOa_3's׫<8g>kLc=Z~o㌛c:֨qz=?`LdkՏ=hqhV,Ìhέ[Z>V=>n9UgЃն@k{hhszМG6[s>:ǚqc{났.k2=0WMAk^*T_Id<&˨8S?|W;uڣy Fehx\6fW ͹Q e[u2-Zy#`WXheϸ\׋zY8oPM-5o[#th#ier1\FV&[CkTE~֏#H_ͳz׈d;S,z) \|3 @\Q p=pYWZ^ވp( sGhe_/:mfb_3 9dӵf֑}kiU8?״˲^^H5X`x -˱`=yͺz9/`/˅X1Ck΍u54upKux^@QEQPĽEq-@QEQPý?E9 klY{׵fY ~5Gƣո#yd8\ac =FCfzyt@s>̝BZ28׫\zF5^ɯmKԏ߯} ~XQgJ?ŕqM>;g^;g?s+v灇?ϵ9~}dhg?y3ﮭzis{mֽ~ϣq/\s{=uw,nOșſsEub -[#<g9s4yr#=txk V#k}ysGz{A'ƴ<^32\Vy{`ͻ, g4t#Y8O5e]MC9k\ZA5k<`~|Pq^{͹:ͷ@34,,pdYLky){uǏ9y4zpi<׬jjn͸ pY4jS4 2ZF{rq٠>2&(s5Мk9 z>sk:# <<>{52g5{~ړ-fܜsW:Z3zd:<2s-Lg^򪱧#4y<@Ї|c4hηo u]Mk<<:bZ(\py=n ~Y{9cY܇V~3W1Y{c#9亼GG5){u0{xlWi칏yL<#gkćW^3pZH׏ҚV<[YzLߨ}ֹኳ~}:+{d#=jO}o]ɜ{h=|&j: {Q瞾{jZ{{Gj>S׳ ot{>h^}ζ@>BV{s03ڏϪs94kWϽNWNc\KV'G݋{=3[ڋ,Vx}01;Ks^^WuGj]M|euTޫ4jXf\ hyeFzc~EOӟb>-GU 9hֽ}^+:<Z+hyG@?G<zG4x/!tgj_A|xO?z,ZG}M<9R""/j gkxǽyƞxo2|~)pWrt?(kͳ71+A{t9]+:Qzf-aN9֬W쫮49 ב3NW_Y9 Fvyx-Fz8 :P]}8?[unޫwzxtα+=߁[\yurGZk֚ȏpNqYLRk.z zjz]~oCu7u+Qk>k>{u>2 \V-jx:2΋9GgՑQ- lkd3<)ski:* 2 ў:V?|ъC}c?w_wө{xk 8䳁wïpoͻߍs>?%gR?1yn3_kxs\} >υ{`}ųۣK_zjOsγ+>w܋7W/xFw ܏T?ʉl9cd]qowc}>28e% s߈q!&רa}?c6E[#zJ-{<}[yxϰ҈iSfLԗ+}fy-qFXzeƴk&M{μ9;@j6Pnoל31NfoUS~.X f^ -yM%>#U-3aW3h1R gkfmTKU.4afߴ'{sk]ǚXs{N'9d/yx̽W͗=YU}yys,8*G`L9hgV=:,^G^ugP3aĈ3P~;̴o\ o%:cx53sOx{Ջ֬)5c=߂5ڟk}0g6ܼۚsȬye)qgĚ@b=k\KffC)zk0˹LEQEt_q(Z["{xd҃|#W}gH/m ~((кu"^DK EQEQ}xZG+_;#-{du?Igy6ϸ֟t^M1?y׾ŚzGz?z-?֞0A+NoqfnZ׌ޯ#WX{Gc}ߎ~Ik>͎x}^?_ȏʷz9֕߂kGz`ָx״2~f5d~ Wdk{m 0.sEyf8 ֺߝL}e>wek}c~usNq5 <UuLg ns}-sg{~P=`1ՂX?eLu'Gكc*PoFu\}~+-EnO`]>a92t9Z4t3]H^x7zg_vE %O6k|]2N}ߋ;-dG9sϹd3cyzC;d x|sfίs1?Y֙Yx:{}&b۵r-3Y?1\7!y= ^w:Hp6|>kgwxnk ?g}Ak>3[gqEe:ycu-6?fV8FKck9[3g6{w|۽:{=#o5wў؟#-4j>{ 5hrZ3W:Ҁ:kŚu=z_Ino/W{#9חG{=1o:4Z̙^}%@ks\a9WO}ukαeu-r8]kw֮=9:5 8s1o9|sY[k5.˨#.r\ySOsYg]&:ӝp\&Ȳn֦~27gA^븺Sc1F=^I>O=3xu~><|0:U}M={g磿g'ghPEQEf%0bΰ<]f=\Fu􁧙yvuJ+zGC^WҸnGgZC}ԻLu8ڿf\V>rYᲡq/Z=Y+zw~MǶ((((n((})(b??(X((S?EQEѸ0EQEQg@^֭nJ i6co_=y-}z9\m맚ݚG7EkuHq˨^P;e>9x< w_~?EQWo6EQ1EQEQc[Eq׻(SEQ~jPSpo:W*(O]3 ezN?B =FxyAg9k+gWsVnow;z:t{l=|]~?ąP(No<kz(v(8@a7Ykͱf}s^<ĿHs{|苗pZduXQ}]K:/n];ڽ/<_EcLQ3LW4f\>ڬf8_9y:<4y̲|fXS?րuxf kc94ҜӬCF2Xs>{Ӛ^ :.TGkhֹ[Lg3kY}F2ʑ5 r7hfsNoX5!swבQpyZ9{3/%ۇy x},8 ?S4s{̮h/}{Z\^ s^hW\z揠u{z!;Bogwk.Mkz@9[Ɲi3gj{`L'mvF.GeHn+Y7k^/̪6T G/+Y|呾3߰ky/׋FY&_b>KAVU:Y69s RAu=bT/弌d-z<{tybj_tSnu?fmޯ 1בE/|]݀92 Ysbs.WCrh3\=)\:\3>mDͱJgGV\6@ _t}ڑ%Ѭ sw{M{|ԒϬt<ժce=ۈ^Bdȟzk-|9^L|=Yǚ<&ӣvu={6~Ѓ5kd\yWL+v{_}fׯGCoճ71^@,{S%5xYrZ{)[猹]Kgq? 0{-\+lӗ7HepqOVwŹUת(qg_uG;87zp=.^+=@r?EQ3(q_XQ|)x7lT$5EQ|oh7~?!AX+ъE=Ɨo6EQ|5ɸ yHўG^~vk3 d;8W:^5Fؓ=;7(:NF:Is7GN d<'3= K.QG^[z{YN{` +Wv>?4FуV\ 3g}գ1j=uYr`43ӵ>~49m]&CkeM92:绌z}(zm@NȲ6#2FqXcNqeAp?F9|UKjZ\GѺ##x^9d]=ZGLh3u#uGjF9қk\]#s_?\ě 7!]|&{u#큼-8s^h|>w:Y6hQOV-h5qJ4k&E}_0/{WݳŇ?)?c;z7gΛkOݧzg(~&} 3;ݡ^pU]AȾ̑G pχ{_K_ekϣ\ <Ӟ{6ӯU}΀Q\v7v5Jœ^>8'hxW>Nr%b<|^/?/WMte~<| p䇁5^3?]uO4uu]aW h;Ocևuet>Jlۣ9s*.5qhМZ5cu0 RG/ t(.LƛώZn}q_FjVD\?qZ> /H]nΦ9eqm~Y,ڏ8L汾wkW"=XLJ爉{9#=P{ |Qg`5-]Of?p/1_+ށ:ӗn@SƏڴ06e tܼts=+#/Js۟5)pc?Ѹ` oZ*3&nk~Zy~GY3M3aҠEkW3z ׇ.pUz%>O)9(_: bQ7@!}cU#n.@a=&dklV/ր#{[V W`|SsxT8Bڣ,z16|:|+ #k͎h l t qu:͸/^MnGZ.Q=t MGZsn'˸Wk5=\ܜרU2eY)8oIo>`eGkg8vd/ݚGEy|bO}+3WdSEq;q5d( w㾬W=^Eqٸ&G몱ǰyTӵ2y uUWGՐc cmO}Qs`ݚgy#>N׊f Pkqs@K|]3NOKcpudyιF|vBJI(B\u]YWAW=z}3R~VOh<EQ?>y5c~jܗ(r눙^svp-]n/q?2YG=Y54^?}Yc$@ZxgoWm$3H_e_ 8u<93Tr988rO(a(}@ozhkpęʎ}gK t {.pl 컼z-Fkg\sk548N<^2i[c4հ9~}7ͧIz#+|=ՇhYG^|θu6u< c>`#Ús \۪iy|Xe>ggXӌje>F4gYsͩ1w#|+p tp9U5k {չ]N:}SK(e(΂EQA|HɸC=Ծ|P-(^@|ivʃxsvzVz=H*qȿ<5juV;,P>Wz'?MhG<&+bh}eCgbxʩz=yLU< Yg]m;Ñ3|Ŝu7W^ec\^\~vkA?iniˑ~j9>L~glOSy1x{8Z =:zp^oc2wn4$˿2R8g}:{K'~ۃ׹fFZ1wv=FG|pxov3p#r.P8OoՇ֌2Z>{of?=KK.s~ GzqMQyJd?dĵ؋>W{}>k{sjXϐ>K'9iWWe伜Ǩu8UWqUg]suX?-}.ױ|PaT?Ĭhy ث6 /&\~<׌z #2#h42[Gy\w0ky Ǿ[^7@Ae,>F5q屶/!Kh+:3H43)Kyd\ie՛=Z3-F2{,Q߂*_ ^9u YuxVuV]cz>藑e9]eFz0ձ7>ۃ@_;\:<{hಌ ;ZwG{yZk~wk@?ṯv5tK&>p:n͚p}Y;J{z{AM ιZkh:BW;=}zs? {~g?rwZP=}=KpgX}:^ >\EQ|w[p_⾨Eq= 7r9˟ݷUod^fG{f5NVob8|GoaS*Fz##H߳dqfCr5Yh=1<2 zNpwUܙ{e o{xsw(>{ kNo}?=Y]t#guϼKLy#dG}@{=ޙF8Ck6~zv{P 1}504omjD|_egkf'6]O_v5Ws_^w:g:lgccϥXEOdJ}WWknG]gg_+|ܗvծ}xe(k/I}!+>=dsj%8,~ Cc/-E0[ |]`bWIg!9ő{/A}Y |!KLQq_~ר^ͧCyֹtܧ;Kt'3B >gqOGp}EQ{>(q_j߂s# ݪϼm/ >{xF2h͑Wj2\=z9wWǣ.c}֟ غgZ3{/B;Oٓo3#=D{o,: {_}=Z٫+^{o3q_l}=x5iճwK죯ϵ)Yu3񨰯hNuXezsd=pݞ~=jܹ2;cv >Nݹ_kጵ< /qp&ú54uA[51zk^3Xk筬fFVmsYEQ|z~Pܗy^<Ⱦ$/nyd=\g]Zcd4:=/Ukiy`GgA5ܡY3Vk`_ tdA~p:tΣq=h^\_WgAj?;y5TŗsbC~]_c2KC/s/{<β3ӿoMGIǗ`wÏ:]nvmf{qy`s鱾x(xc>@f5%׭ыq9}UMuϰ߫Sݭ9gulF@׫9ܭԇ]qF}ՑwZym,|UKNQψUy|&0~G=w{ܺ?^ WWփ=gzK?GåG8h"T!_ nsp}1稽?3ܗ3/{fZ,#߬ } G?Eq>Kі3_l[W}aƗWբwQ\g{W{M{MgiY.ڳyŞ=$I A%$x b  kZS31uu^fUudKڥvDdveg)~~ďjs}k~i;E{dOyGfg~ qӾ$u|2ec^iw)5>Q:^{?O/ȿ.Z_G=G0罅Ovgue]~uy4%UJϹPO=]?dg}wRJ,y=k~P=eyRe2+ʑY2gh:Ij^N(ݺU|%󲜦y8׼ʫv m+}L&_&w'MNޑQVd;KXɝiջR>ڻz*Sa}H̋]~U]lSek}tQwc G}}HS?h|kqUŠ[ow/Q#dϏ=}!#u+|g~3˿=lI7V; ٗ3d_x:!0:(>]Y=SGjs-u-Lݐ_sևGG{#m{]=|.>'IgU!]vo2{GjV?xc~lxy}[?<|=4qgޟG;[}`ϿDzmdk g]Cnk#rȝRd{53ɒSVY:{lezu3me?!!KYgYdy93dUo#/eVr(790LnYȼ2#K|փ~歟9blU3zgZ~h2*JYl%ǴLNweR&) ?QV[~a[wMf4y&!:[FM,3m>g_HY-mޜN2i>Ϸ- du1:D揕WqQ|K S?3uY}W|tUoE;DYY.>WPQ[~h߫\={87o$|#ϋU[m=DJsA~S @v#!?gݙ(ֲ[^b,ff3~ճiocu0eL_j~ɷXmtgC揩?>V~}&8ׇ"{~0v{R44Ϫ Iٜg\Kn9!}0e>@aUϓro7EY?+:y'lo:Wi0M~3XpYC0dzX~[(z_~[ yXNg&WQ~ŷ~}Q{G?ou9||Wϻ9>ȶT)5Kocҏw|ﵾCWUȜ5Y?P}^p楴Ͳ=羅o${X}՟3Fy/@RgC{}Qכ}S]}vX?g{ڽ[2iKLG"n ߃m>=G]\ׁXon?%K*2NQP}ko4*u\/6ay^qiwyڧr}3u _m6R-,&כֿHc.379qlDhMk+AV(L[[^1bN'96|6eg[uj Kur[l dMN ̤9Yȴ:f{WGζ渴);ٮV٧%~K@s/ ~`Sc-Wd}weȐ2:-O:`L?Y߲@*uL [ķ&sj+:llA}/)7ž?i\e) >Vo`/74!GJCٜ?zg]qw]u8"T}ugBt9FYmCe^>AkRؘHݪO[quF.8Yu|KS,Y ˮ4iʳN }\&DW>8[LE~3zv[2!es]k29{g.8,L3rܟ|'Ify䙌<%fyeʞ|ͻbcWWvLvXsEq&]?3[ԍ"[$sI]3/ zK=#}uVvzrW21 ({:Y=̫M_d%>V2gy|,(Lc7뚼?[U;L!Kjʌm*Yn9WG[-?zD kz*w8\ŜkFY=g陏4?x>aQ&e?,V6cgGL~|4MsKL q/(sTiϰ*`ux;i|ϟJiD"MϘX_Ggܘ;4ev|UGv?K 4o拞g:s]g~~'y|=K;+[az%3VWem5팹gi黒<Ϳ> f\U}gyx'5MYkY6Wr9_YyYVUN3\1|˳2Z?YTiy,y,*ydNjzίHs%9\Luiz~滦+Y{,]`ӞwmQ h>ƺolgz4ȑ|Ⱦ聦6i|wdGzxR2#}{ESgʑʿ;L%LW#|*OY:M6ϒ9c^J69 '==")w%sXߛl|O+Vj_\]Y+j_rG;mC|w%ȳ2dʛ4y\AmcL?#YFvFcY};x&rUY:xrȷ*3ȷx;rYFŻm1JW4ٺ}/?wU:,Tg}~fVr62cJl)둮eT|Se;ڒ3,UcQ~5xGe] m|NBfg}UZKZol't3UVӫ+):iLw<#e2ov!g~zgZTfj44Ki4YVkyHO2ː9O\iʟ2yJ\fNr$UJFe43jWLJn:3ȳ:_=K7'52L*I7dNS7Լ):5J'|=ws޸M*ɴ̜0_?gn)[8ϲY<>ejޙYW4U^ΧLe4OeN;Sg^w=Kb%i,ɴgY;̌ψ?[2˜\~(2OLcYx49 Q:(g9H_$7锿((s)tʋ=udsڙL&ee::W9gGygyg:ϞϤˆ]iyx^>yY)1]ߕ'@|A\Kb.tig$ӗ|cԍ=s~?wBJnwu}NKK2Wq|؎uT19guFُ{qoǣ2ѷūUy?~):/6x?f1}7e;1U=l]>o?MQ%m|Vu~ |n~.]}:?F2Yrv@>KxmW^?2Y}MO-s^3=UYFd̻LQfG :VlNSI:z)wa_*7ӊ4S#Yid.KY}>S>SZ?Ck+Yle|]9ɔ˭x723}'<3Gu-wUwҮHyeNeΘe:NiQY,턥M7Nl~V9WV-M-Ml%?@8Djʫrq s\ؔJ_(SYAC|<)s)3ٜTT|9U&fe6;m:YWq9/y]_Urll:q}rmc\~p Lrm+s:6,yC~[ϻҏLdR*c>o-oӫR'y')iȏEWykz^Rgƥֵ4Qfy}q@L}gMD^őMJ}S>QO,N2RS2sm;O}9}ȗmk QUy%чTy=uLYd=l+u0](O>Per`v.rd?8yC2eUUxF]&|VI}W,8=o "mʳ dg2jF'5 g+Qb%[_ɌY~{춧hrTNȵq[훝!Tmջeoʍ_St:f>YvUm/,2Ic]Ǿ_a^)g~<}JZӿʑhc}k=?ʍ6fjiz鍹Qô1}I:+O,i8=]z"}N(OFK8r{+Sxl#mqTCs>ރl<|E?W=Lz'W}+-!Urي.Z~=mLM>>Efų+qNw!drykZY811.ϐu\(*#LkG0y9W:sNS2-dhܕUg}o_1-cڕ]gg֓gs٪JwM;+{%L{UYg2wxVw\iU~Gn,ϻe+YuVUWU"ng')2W"meʝWyL4Y^eΨ2ZL75ųvV9אַ:G<s|~d#m{%+Yy{md_*wKhY>z?|ݑIySY~YVcrJ~q,8𬍫v3u}TYYӯVӺSNW2wumҧ+lNe>+|TRz.xhLmj~{|L|ū:8cf]Ҋ3Ov>1;OjڭhFe򪎳*-Se*U̫H?WrL#(:]8Pf\|пjiϼLM}^[κ>-lg]X<H8ʷ.7.ُFQF9&+]Uvn2`Ov`In&F*;P~wܬki~wEOmywgs0ףfymcSUiչzVm4zp|:"dA+9%dVr*4M?#ehzݑ')˒YYWhZ,y&sT9}T|r~*OIteUbgM3U6隯eWy$кҴY̲9=bϞd]9UYUU%+9LN3UNr]eg*/,n>gԲU,*My'nYW< ór||RerZg٫r`:Ȝ2Θe-de0?{2ϲU~._Tvg2kz%_S(U?`; \|UU>rd]Y_/2%kX~zQmϖ{Fz3-Z,=3UWy}cXcm^|:RL~=cTni*,:$k-`_v.~9t+2^{.19?' 9]߫JF~2; z1k#9#iygo)W^˺0U=3O<[z{Bgd^w)S)O~Ӷb)/vzwƣgu҄W>j{YM5!3Pb;2чyUg29[V80nru ̕lYWsQ[w7^nH#-Snw;!)HJbUG?AVduV!wCm駲ۗ^2ڦ2u:O5/}yOQ~SWHg^~;30IM\#wG_aU=*sŪLϼʿ*__ɿ-mdG^+Sϣh~f%^)s}WV2`Sޑ+ xVLVr|Q}l#SeQ=U[++F^}PVr`%Yzg+Gi)Y^\J|lvY.wUrw*Y*W+Ȁ9?W2w\||}?UwX{k] fVU3ٻl3êɫvr|#UbUbU.e:rL~M$7|7Mr[|^QexK9eR:Ξ zxV|GSUNy'_Y(UϹ3팕Yy4Kuzjmy3}Si:߷4MWғ 2_ɴu4dF܎ߟ2gz39L׼2sz<C%IqJA:Mf\n]n}d)d;92w˦zg e|=Y^?ڙRecƴ14%y?;50=_5]3 ƥ,eS}ʜ|Ni*b,Z嘆;%j={㨿{,s!G^NddmߺoޟordSXc)lu>;䪺{2*rB,f,_m2'c2W[]32s*NUerg'T-*Oy&7ogO|;L[#γ6uաUYnO;njX;)sGi^=$ʝǼig<};ΨYӘ+Rg3Y=Gu=Ι|NG+a{ޣzvV_UVӫ|Wiʜʫ<-eJxWeȕiz%^tY:x~Q2}]J>={]:4M?s^,&TVӔU1=Ӳ|K?UyY#.֡ϕܣt>kz~>SjzOR믞]X[!H^I٪S3ee_ /1&xo=o+Ox?;?_;7__=nK&>M/w׆d̯g?k/$2$==dReHyZGt>s92&9df$>W?^_UDZ=ۡNzXyl'q<;ff1oo\rCwJߣ㽪i7>s5G3fwHYi[??Kfd։.9zzDjAo|S2?̐u=9!SIڪk1UFeѷ?ڭbYʄ\ίO } w:miIZK};Ʉ ?)n=yZƢy|g.>MG^w? lY1Qf1LOdzS'gHcA?=+g9eYn脒=o}Dztrl3r<;dYwKHur>ӘƟUW|!;ǢHm#U{ sST2j')7ڞiq?yt~M͏I7ew22Lc~GBWFNM/eWL;ef]'O.3>34Oyy]σ=)g:<i郣=>G}NiCnaQrsϋd&sZLxZi?[ i+>9?-1JHӧxOUrlm?㳿Kʴg`捴.?<'|I#?dGn2"?3S d"=Ohz2o.gx 4HΑzr<r+3,9ޙ9}߈?'EL;tfggO(rL8)s"G#OYO=mpc~"HM26'9rswRv>0 ]]|q#i{${jJSϐ~l#y˟-,׈!.AzW^#cw|",33 Ly|'S=ԓȶgG6L}ꟳ)maUW#R~+SԻ[dm.}~vƩ<#~Hxz@W?Hc!|ԗ?3*TEZHe9ٜ$zpKkQi™F913VBnO9xH>]w᳘ef}|E-U ˁ>}vW@VWJb?uRv^06yP|T>dfJ"?ӧJ k2v{<Y}mln~?q9bşC*Nsc57w~=};g3䓳T_[e&^fZP]jimE^uRnp=')2ʃZfֱʜyN/i.+-,f#wOd'x6Q>JI\Fӟ:3̻dWRs_'56syS>eB= 2fOOͷ߽*#yxQ3.@bq %39ENznF9?E=6'2OsmsX~q^ݝ]y)8ds>`,<'-n6m--F`/hC_l2`{\294iֶwՙ\{Glmym~@m]Л'!yw|ʨl#2Y7qC{,slq"ĸuƾ[)ͪomY̺dd6RJf97p6ORR>SR^TiUYK}<;c?M׼,SYI>X]VO;G|d̹ψUY O`sH87}|f|g}K-eW7)@r3]o)LH,w)ڤ67"mQ' ib$o-sA8}7Q5/r57WGeWr~SYwASU+It%}E2ޟ!Ϛ4%y2 D .`lIk>ã e7L_Stoc'rl9@ ٟRvʛ}_2>̹溱`L YWpL#M",s6}pՙq˨%fv3mml-Zw7QQ^Pe*9M2|Hh]ЎI 6Pm7HxGv׻O{<RGzK!lŲvwH+Vvp*&^^3k7Dž 2s,n'v|_}__wQ>_\e{y&@:57M7_qaqm ^H<^dm1z W\,pw8}S%Ӹ#(wym\t~GM_~11WLuBW3 dVvj>ξwop7FZ |-md;9tB}/7]B_r~l)zr2 nƝӞY>W1w[`_3nGaKSFkZA9ĥ}n8o:XuPYQO7+jLM UG{۹d>Ns.Ә}><7x̓->k Gz^Wژ'V|x@-wdT=G\|s+6ȓݦaod6YN?{~,WQ5=y_DUL2ϻ[ef9S^e7::pGʜկݜwFuVg'dF*gnv16rϩJbr,Љ)/C> jk s FfV~ϛ}~>?ɤMύyt_<Ώrn^p&5c^zwfߨ V6 gߊQtt^s6u_۾b{}jhi}ǣwp<[䌔;Wfۻ>k[ F3m]lϺ6qݚr#m绔o+?*RNyG&EoS=g}[_2b1ͥw;6өTs =-K9_QuXhG4YrY1\i67|_s|^ʹ mg#0V}o4s,x"˝yCP}4}m~s`0_dMbA ܘdbpVpgdNO)zT9{nvgثدF +|DŽƾO'u}-]x1zYsz-=>Xu6?g נ߁yhs YՇKb:ogUy b'l R>j: BMK-ޟEq<}f82$;8فcirt9sU=턽M-l}dO*LiT]f}sJ[k,hf^ DKVx~1ʞH7[9G1O:Ӗyegªxژ~]v%L{f\nd4cUNjR9'yޔ̣-~WѸB1Wecn휍/:)c;p|u}8Vz\z}M}jI>Uloym݉z6f>m2^5=wv&YY1i53ޫ)E}'t+X_21Rc@b\?pW}{s#693ѧ;Q0b{z꼂Km`_5gQɺGlr[u1pS=l~wN8:N gd{W䐛eSedL֑"yaӼQ8Gcީ-9jќ30Lk!; mKYbc\/{1뀱}J7l=Se9yy&S6uyν?JUd7^qYIJ_8c&ery>ưl[.d>kjjn8;\Ƽf)G>3xwTL}d=R,êG,YGlwD:U?*{o*AC_/տZ mdiWUo?wDZ5Sv9unjXV'(ޗ,q?Xwl.ˣنsN;Fo%9}nqv.\t6S!o07ֈC..+lCq e9:V_wٷm1bB[LJƃ^UY9T2UJK?E,Wz PQo^nZ6h}Bs;9n)OZ1cہxjA ^v3j\2=#΋ >:|}9m]4]lݷM1'T;Z\A4RqŜZGdֱsd3?k/>{< 2oP N+`%<ʲCt|:.2&ϵb|lկ5?G_xֿ6XU蓖`l0;c2N}2պrE{f*oVnZ*cZıeCR&gTK~=]St寪gҧjDq{v?ukJ#ʏW[9ż|4z>ơعA]tbse'\A'blm>iٝASY3z`鄣F@ƪ'=NPQ뻢!3Gžx4癎#s8E)z\ >W]棍U_1/Kssڼ.}\ @8Z泽O=w?ut u2dYzGݴ) Ʊ1h`Y׵xTd`~wMc3w$us;vJT}*(g|ɪLI{m\>p}o\V2ֈ3빶)}]zZ1q ĎS1}l+FM<>VĶ(&5q.?Pp'cFr>TQew0ƫ7[bUFɶ{ʖzhsܪ {里9O98k\3r.W)86&Q_h<>mduK/K_/}~/Ŧ`cOuoqE{ D [pgfrG`ՆCuvߔaӔYD˞]gnG]}j^ѐwFa44tK.l}9H36L9tr÷(pSiQ-$ʑjJPX BޗeH[dw7;w#9_ nc\cD?}ļ<\t>5>}"bفscs%v7m om7u5.rwO"|/P_O%~VQ2̺Q}uSXyt.\+]Ӷ5/e󒭿ZƲgiפ#ȇc (VE㊑RKp}w \#H)+eM1+A5PYݏ(هˇ@ԽᒩaiKkƖq \k{+~FFξ_Iހ/]7T-mLОZY>N_㐱Ś[-uHz{9ƷYׂNX?ȹ޴<]{s:5vϸ67<9h}Xdߪ\sŌ3*wwQFly Ҿwfⱞ=?,|pz> Pgg{:%O `4pff mT*AQT"yEwB, U[F틂*+5Pe&~A㎍N; )ٝ<\\r7s]d~.s{[S'wUmavꦏ}ca_xdvj2QLn m{f?9_tIlF+9d1悶dr)Ǧy!>i9\.+U_'uu#ϓY~+?"e7 bK^,{%WS ҷWz$~םjZb78םXCهpÃs|\_u\6fȈrXt?21߃bJڋH8d<}+Aw&ר5ʇOȺH :?ᴅdfi gz6wF3n#*! !)3ҵz~b\kAIy5?lhW#I#~sx2:1r7X"xj^?%XxpƂs]sű}*z<s6_170^g. WQOgcR׃2IgZ% W6Ƌ^r٤R({"/`+sHS{Z5Ʃæ#g`\w5hŸzkZQVuKrrr/g[\*t&=EΑ?2!Om5~͏*?(7-}O-[O{"p &p8c[t$ݪ 2ty,K\v=35F c^+gg~hQnst%P&Rc1#.7$}w |;I<( s;Ce%aj|oinasҶ([۠tј"hH:T's(AOpIbb94ރro# Lc1}=X!MfvԘK:=7WLv2Ԇ`lWkcQuch}s'L?/z砶[@ ZAYPkd_=(>yjbbh\i籁>*}L9yR4-7E,yy[|Ȓ'kŜv~+^-'e/2Xf&ךXd~t*[폾s?P=˶f?Fߧ t`G|@ٵ6uGd PsƍH'î*,lm8r:5#*Gvɲʭ2u2< 1*]+u~H曤u#3|t)Wu(F>¯ÿW'Y%ͯFGSCO5j]2'H;=VXm6C#/ú_lΘxcU:M^u iߙcr>GX*r񏩆^K?ݞ޸^krE :>ufj}o>ܱ^Gy^14~U@p#!V =7N,$`:94@_=!Bbx ǪT,rn\)u.7V;mt㿢⊛MRQlm6:sjh=823Hc6CS>)jg1Φ>yco˝2*v:''1 6SQcc5igq{]+1̲ٙۗ>md z 31Zc5_2x݈8k,[x'B۷rW![*+Vug/T/2E27cP ~^#+Wߩ΃T|!jYPma}z.p6@\{LP$tL=w]+VA7vF\=:0a#$ƒƦcH U\#̨}l}縳^*8lkl# m=pF0sOarfeJ("Co%'Qr+V߀[qQ_;><jdfHiզe%e3MU}D{i'/$ As3mT?컎QC/|ۖ䂹jy%S9վTy9Ձ??c1+Hu3ƷHg0}n}[}phFB2aa]8|:>:TfX41 Fn$ #nˊQy{^a#4ƈ1O'j:E}B?&[@M&@;]y7&gC=HGTGs,Y+u T7#7΍>];TFfMb܃S^ة~^2H@?gKmT/ҎiP.3JYn+ &w՘?u.2ugy΄Md;О.c oF/Ł#c48ٹI#lsQ>>o}A>8fڏ\|sW%o?ȵ<,ս\ױ?<ϒEqaoZgHALYy%kmx_} ]=)`;Wԃ4sU߁o}gq:T2)M=KJԶO:l˝#uaۤڞ>'*& @.X#xp0-wMyZ)Өp9z8;ى u,Mݫac38_yH7 j͗6'C'kl[!.X\ڴn\~+Izte`WWPɹЍqnh-N9=!m2N8l2eUG&?i̾_C'k'a|!z‘>3aǫԕWvR}}/YרjC#<'y>\p!F.=rMߍ:nꨊ7ʸYbEs!q_Ur߃19-/_E27de&1g6Hc\.b) x7vNi[*OI]g:UnrI1Ws.ieFV;?6nqV -4V`:2|XO_Ƈ# /;qb.\UO=Pw cƻ~6_ ~u:~ʸo5&qmhq,>\9Bбۗ\K^W7޸d/` j@1&D'\ SX-=|ؗ>a?&,<Qt4e 5&=5ɑvIWHļ\]AC aYl ߝ}#<lklf9nh$ 6XpXOE/93\ s>9riGc$m|܂NFc]g DZǨcl m">lZxv2m8T ;;ԣ+OPFmdSi-B!amtN21(>cs~~r.u}2pw6E{[lϧ#Ve>ߴ%ڦ>RBRg';}vnz0g{\ 20~[8 l'$%8h3}yD59YQΞ'|32 [sN艬2̬:Zv|^z畦eΘvO$wZ0k}jzN{;73-31䚶S(k`ep^p[wGqa8NϹ oyڦ^^M4նCk]ssӛ̧>9cb4ybbRo(`Ā2Xlm_)\Gr0)Sn޴9J7NF[]rAc_,cc:͋>";7yC^Q7?)e#mnxlkKnN:۩:l:t88sn7CJXb?l:87Jn&So!mtEuľ Z w_ht;lbi?-:hCפ3e@黦/6yl 2:Tfή]2.wfdp*)l>]A1|yrZ67(6zQK^c~*2_m*5O;bF؃K>_E0)mָ֘8wN/85FJ8PrOkb#3r l9ڒn=Zh'1s5~|ݧ>)͐8!1)_FĜptyv'#Ⱥ)1c 3A/4#s2h&cn*M%I6 €y(xq7uvx@@u7R44T BsGzQ.t}aޔV4kG=M)}dfO T`(L#mvlT|3[Տj|%/2I,HX5NٟϮikc^m i]1ݿ__xWh[[~>WVLPBDC'Q :챲\"4^m]䐝ȸO;*a=K{loTY6fr,mEd|NMŪ9nPD~ƻ' Fe͉ ۇs<̏n nߧOwfo~Gc3FCwT_>tH;gi|2mr ^36 )zW{oTȃƁ}mxfWK?J%S]Uo:nl#GY]X7@8i }P {aj="αs{˫ڜ>3~O_>ǮS1gilo;b+1c2P DD,gdpB2T r6ho & up<i8cr8Q1ɱF rcuPX׃@{A~FMC"=4҈0 O6)A 찧dKK}?9yQq8<3Uu\0A>*S? B֧mv ༁+aBv1|@RD`[}ѯpi c㣞ݯǧ˿>x峧8/~eOYp0V+zsj^\Y$ď- ۠IH(ܨhok D ZFTҤΨgLcAs 걠8LKG1?9v.VLS'fetsìÊ3.9 .هѧl5j,l|Q/\юP׾+/7G{_Y͗s"yؠ]t1cg~=X̿ۚ}T!D0.͘6ҞaA1}xuaF!rQ^d} j}}ܷ8kwHu;~~*cou:siqMKOAu2vHQ%3%fR/Q[I}λ>硻8KΖ)^BTn\72|sS=R"8㷌آӨ :0 ƀro32ƢEjA/#mw*܉_}/O/@zC߂1ơ C7 ׍E !BtP dYjp8 _/.d^ !]0w_mgOqXLᛜWp`U:5IF{ (ۙ\¶ړn=7D1GKVAOUs?\KHز?>lСα4nF|%֪&kXU羖k H6yO-+vzۣ}Ϡ~㬶0q Z}{5\e =sł7+O9d>?xd0%c?cSEuhp=rN( @#DqbBcàаF2*3 X IDhhT OcPVF1M~!h+VUj}2?o̿%Yeez~Ij_V} \\yAyN7p7(ȇ#u#ne=20.Ls%a[+%rSMFl&D#rmĎy~[[M.~MPؘ?! ୾S+'E}>915_XQKo_^Dz1}]kiCC?UiܸTJϜ!9LsIFWMqysH~E@pΥr=d=^'Tc bLZzx3t̘/n~񣰏`o1vmG]uE&1V521έC07z##Zÿjc/}jfw9:1l?H0\'+j>;Y~Em= { 8Zr%1kop#=d[o5{Q b]1UT9%׸Ѧ{j/%t*眿R=K'/c2d>mN1ixηoօs[ُQ0&-/ 09بqt < &oZ]ng>Fp6|~ʿyH'c t@Mc? M]C/u\,'_F Ш6tf:C_uWpa@cb5B#8s@n?́m2fwkvM<\CțަqUxJI_bUDݺlm}C3!sɺ浴/q'by==#ZUdʟQYy)oV ₩s[|ꘪ3u>BR1e} .@ɛ)g)3Z}ڞt=}cu\y^uU^uŹ/5*bKX7⛮G\'P2u̸ި*1xvkjT_=QuYߵ5g_C^u"e\mFӵu. }{z0Ma's1 7DH$E7۔|%Ms`b@"q+.G? ;Hm1oGG@`03SPF6H`d40 uom|!Pt+sIκ| DH{zb0L聺 063Җw׍rCg RҶ!AE DcӜ 7q vGFзxZ_{s ƌ3h & sR? ?3+MR:g)e\vE" ?B2uo$cN=#&t꽐裌%. qvsLۃ]V`?3K桥tPBXG{6GП߃7^A*n۾Xe%{+ TV0ix107y,h28ɇi|0<8!B148QA5ip؀>"XЍ tP5ءV?^&7Ģ ^O`=ؑ=4rg1?ǎTc⡓6CA'mlvuY#cf/Gdǚ s탶7}UrJqRv};Y⧿o=げ(NM+bb~GܜV}iFɟrZ^8>>2=n3˘a ;7=&AmەTOl=QuPǟcX~%h c N,Ҿfa3d#d>6$`J576rܧ<~ȃȡj*=qD 'wݳ=6}h)?H}?yZςL}>~^m|~}]OV1/] Q>O}Ko>DM|bYb#ʗy[jL_2bާI9- j>1+g?{>-?+2qOlqHtxo>+\G៿uc^Zuk ~\OzlAˈ״֍-N6i=b{'>$|t2UZOYJt 8 br5 s`0L\uCm#ŷ46J6<0μ9nrW@}FdYc]}q0Aw81Ί[EIqIW @uS,N}7 Gޔg[/*OqO/Ѓ<@{.0oBe&,u6ȸ ډeLj&EA Y{[vMtpdqǮ?rblb՝CGd~|&䴞)D߿iis]ld#g\Ęw_9~>A%F+9sG_9}Xt9:w2RWqWl3p㞱 ~;w#}=}_Ua|1fc<ضWS5RX}~*/g؛EpA6;M56#OZk=`A96<:XGr @rWkoz$}IYek=4H}jA7j F?o 6ACO:a#1zlkmv[ŧ-c5>Uy6k+/=x ;G^dɞ1! @+e Ԉ Ź ;pV81P1àC ,( d]pnHf3 Dtd8prp{ǻy9/瀃5]?9D?@d^XrN37k9b`2b_ \9zī9}A_1#yc;16ʾ`_0 1Rے;*>\Ŷ#us6g_u,;tas9*8֚3ꕺy`;삱.b\Tfg9}v [|s?bIfĎu~cc'sI쥐/>A{÷+&}~Lm]Pؖ \#rmo17օ(P/A G c\85csq qJ+/ν1}pyU3?g{O JxT2+}qLL֤L&7W :}ŏ :owdp:.Ҧglnp8M;pnԍ=huî6=i.gD_*? :وq"c DZG΁x19{~2s'uxdl4"d_} m`jFsnm|+1ϰCж.Xݞļc }~e3Yx' "pZ0p%cd2}?G*+Vm >Xxe,1nӶ1a삶KU\#?)@Ŧ77s[S}F當jYS$ȸXb tMbK73GƝs\hẂ8u2#9 KX#401,#nr[z 1!˫.UO]?Ћy8XuQ^2~s<˲=FX\sqdKO=D7=^-W~B-&U7۷AvQJX`c; (C뀀~ss2OcgLqqgaS/q ł- >;H]}MrL=4:sL2y,{CIY=Fc^*29u0iS_?_ǯ䌔up<݈Q3>=ƨkvdq"cYƶɖ>\FzUoN%n>@]n:8`sxD]8cD עIbѨO4A~vgbᨻq.']Qp}1ո20]7J?:Q:nݙqOg?܇Ӓ?.2N2.ѠF4q 7hg 7lz7D&}GA_41]d՜7o\Aw;ij`, j?3EVo16T3[>?K=hOƽeM} ~c}5sq6Ҏ p@ۀ/M8żzz_UۓW%ƔEc褟Z?tuk:}ǰ1P&q1cs|)"YʂC!ǎa9vdz T9c4c7w`~c6s]m NtRO3t::œ>-џM6N{mKW?&ԾYp,sUkύn҇qc* sחi= Ǿ:웶vK]^NUe;u˒џwA ;9ҕ{= fkFX-gxf?ٯC{az|j&1c9*S#]4r//>lqXyb]IKM FOΨ}ln E'1&xMr$r .!iwPutIǟΟ6sC(uןO=gxH)`X~ @q󬇠JvEWfPmļm9 tK}gnA_ڽnڮ,1F 6vq 7}m7㲋}q Øi2 92Vzrl=`5F.D_@CWPu##\`cWr(+W#Ե\ :$5{XKz&6:_\cf 8cc?:f-UfKo??R7$ᛯ PMO+~"Uw ~ؿNKevijaǃ#Icq˾rCuNKn1DOù/Dhl@ >6/H 8XuqȖqjLRg V]҇0{hՏ}/H=?|fqdᚄLifWӟU_r9X_[vZB~3C1?>aRcb91j7S L1'.:2 F9Nv0S6 0>;%gΨJ%y VY{Ư*:bX8Р:9Ӧw[;v=yT1\6u,91~:&淺 l; ,K['>Dh'aj-P_9;m q)X@J[o8s:/T֗)u4Žz{˾ЏXVN/@`f1䅷ǘƼ_]57/܈ MhpU63J>GmSMzslu=rIbθ Bֈ,u-Z`I3~紿ΰ?`CP6 n?KKsؘ#[ᛱVrJ*Vr#qg=AǠ1銔r+&+s[hWLǤ_K?oK؜<c_#n8c0}Q0ļo0#.>.6>l6 0tl{FcݣS~.dNjg"|j i-/<?f66?6@\VIEq`;[,lzL/Ecmc<{$uI>F|闾C06{ϦC o?e 9kr~ɿVXx˜BrQl3mh [x{˦GV^4F@t(&%:|8t52& mɉ 2hU`+sj?mN4'x$a8Qpb0! dt(oLh0Ht,HrgAqOe,>G[ e1&϶7G?ؿ8c0w{,ϊ7{j|hI9ggɪ:PutŬϥR3'by@չxcvj*7/  ,Xq~vӘLuiU}5 TdՔz-9T+*cIY0c Ÿcl<MX#u$e 33`3=:n{h ;:T'`u~ξ WVN-#Öp1bϔ9tL2>p_>j]}\l\[}lz)1|w.N jyygkso; ߙq>/ F<zk_5c{4pzʾؿw~BW>gcLs0V{6Dp8O}~Ga<҃{=ݤư><"S@A+9)d۟<1fj#;I7w&]'ɉrƘ\L,':q2hMƚL.CaH;ёz.OMg|ֲKۉD5`C30tg!#Bt跳LJ{~6a£3 h?ґ&`[rݸq˶Hs@ڤ}m^VS?y_76 Ŷu#ͱȆh2c`>9K iWQ3^!TzՃ2C?_O}'O$_es ydE j!qVb-mfo 2b<$;@B_XG{+ӼQܹ.ȼ6{ w]e[c#ҘTQc *o5=xwμO"N}ac}̵Xb`+1xan|a#62} /v'W >V$}kN׻AWbўeE_N6=jMB}ag~wPKCMG0g505jEUx֘E[Yuqkmc?_Eky>9tP@V49CH,:&ʋƶ0m 5aQ &X8Xd!I\ǀ'Hja w<橃I}Ah\hlO-i7ֱ9z}۴I0D¹UAuI}ۨ곋=\Ԥ`}6}+?[υ0o1_3c 2B)d_tY1 lqh)x8׃zɶH9c*}cpE7[,ww9 S"^V^+sg<`qa sm[G/*jžm3'L}1 7cZ }6!\sq9Ţn"~cN Οd^Fbyt8 ' 9@cWǁιAXmq8u,mϛI~;sEȐhĜuv;G_@,66I$%+BԍHlF}8xane:LTAaNiww@mc9~ܱn/~moz.i<2ꆊux6rn̹^`]^f;(9vFO>KQ%1i_S@Esƴ3Gԝ}fl\l'ƾ*<ư=^fېm>@JfqWSЅF3tJϬ8Mx,p8dd7DN!FM!:}#Vn_ctqRc^l1rx2us?E 77ЍarkNmYf;<%lBJ7VkVŪ W'8J"~H-&`_ ^#~A_hGMZ{GZf='ݬ+|i{W &W,oSq@P43.  "80۽!(鷍*3׺N>*g(?qsa˺cB caw+2r_ M6/ _/gһ0|g[C'~q=GXcء#3 s m` l1c/EۚiO˖^p3̳s^j{>~ V탏~Kr>L:\_|1~mqgU% 6\H1hCG}9>Ug'nb+s3؃y FJן,'B#F0&b=1i*6 p60c!J65HⰠg=?>Xe6843p3`m 408)E'7Ry $^RʁG7:zxGbLg.p+<@}DPdWIc[S,{<(1ssqnA f }64}V-9} [ !QfA63>qim #`0wneyCw,ߌuWcaהF,NBs%oi,8"Jp!>!^lƉC32@9}g]kZPˢưsBfG}[߆O}y7q߅}V۰teJG+KE}&w~1lvv mя*? 5N&luD[nAWgk, qwm1c2pqikc!}tgk:l;U׭NC m^yBoUf\M#b>s5?~||,S״ Yj }s\zP?1/4&l}Gr=aӴXhsg [ގ6ǽ*"mnO-v5{ov&;Cǜqt#q vx_zsK>_12xD;4汞RPC#DB PVgjQR/INgeÔ  7;-͠{XA@؂e.E'$*z8E41A.zp:l,kliݡ-f6(s~k_!X7HN+2ZLuWf^o2_>.cG Td8Gs3`kyɱgi³C<Y/$?jg2EGdȮS jÁsE~[MbQA196kac_+!Cb5HkU.'ˠEy"%;XfnR} ?>+F #7$Vb^{ᄒxͯ>V1w0HM<*9^?<UK QcǾJ7yXvicir×ԟ}j>?U렮E5Q];idOZ֞lOcCկv0OGbN1w#}Om[egg="ln]銈K7^Mi;Q~^Q8i?ʵՃF:SR  s5n#͋mG3'rgQ? =~oS?m~7~07m1}{<ㆆqJ\c3>9MT߹FaF}4w6F%-&濳/6d0yo1L8lD|Y6mBڪlbke3^T8lFQMG5#.5>/ۇO`\ՌC?`m:_y{~p'tw=q̈́-_ ;}jl[g_lm9Ƚ&wx<vFzUN'=6s}51eBc{yr)lFwCfQo:Z#,j Pu?kuž`[1۴f͟OA}lKa^ Bço7q 5}OhdN`z wx k̃564m qt\@n6ו֜>ss>ǹƮyvKjAk9ǗۺmLL"l..AF{!Mo8}MligkK ]M{&Lev-mv8Ʀ?NuMu < bZc !N ogxM'Q󐟿4W`;gwĪN?' ^{h;MǴki!6]_mA+X_~֚y3֨k^t5&|=}=:W~flk]d rq|Vܣ}a/9Vd\|̰IGɶw ƻMȚ6-fۂ8 baӸub I$r8a1PEA`ݨA ʻuۍ--5ɜ9416ߞQ77A 53e@iyuyy~ӱG}9ag~(h 7.oy@r'C7Ü>o-ż-]쾇gŦ/8rePzT#( J$c!hR/\[S߽Mm ' 95>{>7A}]~a?>P|>. gTzmօ[69 9 ;[:ϼTfݷiKaK;`ߎgss\`s7fi%\W5T{ϓտA"bC(mVa߹50Su`14_@.lr.+9ldLt׺HsF ]1ǰfš#l_rҵJu:]mvcE7 l6.mTG=Re]}(-a[g!Zaqq \b^0zmA]"~Ψ =ws?w'EZ'J ˃ H[q`0g<ߘcKXx!AFPqNj }ї1~mŃ|hVB7\ҺsđZWHJ%`g<3.q'+Fci3JĠUŰǰml Fir?27cF("%7W`λ7_J֍M3o  ?);7_cXK{r5)Qw9)0/of[w8ΌqѹiA蛑ݚgnp皇<4A(0fc_y%CW dX8 pace_i_0bc \+B.6}3&ʹ5^tfߊ~ O[_1Syuich:OXcH}Dc?<`1&y;KXu`缌>&qAa}\clh}X5lGM9f J/FqŶd͏w~ֲ n6} ad|:NEh;~6=kZGM@$Ì|'r\ar_F_K78k3611Tݎ桟v戛m?XҮfa7?Q|\#81`x8ဍ{=Xgt跎g)XޫY6 "4潑yg1WxaƢb5H;TBKnLLfU]j={.sN7AϘ7_U_x1SYOW1~[pXj6엘6aD΍pe=aٺaL{ nGss=/}Uql_4jq:1?fsNMq\c9 Nq7(Np|gscUƦ:pDy֥;}t1^6/`7Ɗ3uboφO2^ч[<?l=t?rPҴ\fy$_Q/ⲠO*^+5FƁpEc¶OÞf{m-.0N%"Gc/#VOx >/ # {յ"gt.BOht1Mg bC0Rg( Fݝ)sUٕ< >Y?AX o;@rΪMem:(nj9pDЈCX  9=柎mxH-l`#s1m~b=GdV?ټE0]T/n̖/4"`se  s_Qb>AlLE:!6҈-&^bܴ lzEB9t!v_cS177V++{!+ysRA_7i8i34"F.[̸uh瘷19B?IuY+[`mk?Ž>gm] o>i[9m>d~qqe[y^kOՌ3>UoҷO n̽Fe{`;G.3q7b*M˜}b>C6 |;UcG-ȥC\: lh^%/|:9W[զ3N[;a~ik֩F Ӌ%7k6qK|Y;'D|ANumuui-w;;툳{ag xt=si&t>GcъM\_1>uM8ؽR?msܳaWǡM H?x8A_ۊ/"~"@ԁlgFmp/"w< 2|"~7}DFsEW3p Stz0 i\VVuǎacҧ@_;bP]C1=!eGvm XX‰~*'."$dݔa"4=~.4pOލgGН9BCB0$ c7s Q7P K"T,# m-PkqR {96Ѵ'Cx&y? O[:IxOx/}K}t,+tňmYl&?6]z Es871wZxguϞd9nrnK%lU ?8;aBI=Ǣ_4C=, D%ç_e"?~a.} 4|}kf`eԟ|k&i}e-e+Gr^ dcdzWM^zuơ_?;1^͂"+i=?ltuX 9qj;nk6hjðqKm.-}fy~[猱j#xPF|ߟ5>$ng"oI_WNJVxV򝭮c,h*G??HϲsLN~!"ƒz{'3o0vXzM&eXm}/[_O:t1`eAqP" BѼ=#aɔ MZb KLd͖7d蛣V'6t^ c}m}V~?<>o KRc(M#J ~scjܨvDۘy8P{;Ɵ>MdܗdǓ/*?9 .d_c^8_ZũA&/ZMz|d>sa,렠x,z"I}Aˋ^م D |g-ǯwr#FƁ-ȸN"{756?o`{MﺤZl l uxG;AX6/3H= (+n6qy(vbɃ<|^\,ǢŒ1!fi6{_@HEnn7rC}x(g >6 J=g|yG&wgYzc8H`szyJx$%B_ ycֱEUb^XI.e?Kֹ9bdjsء̯o>O6]Bܼc0/? /`ǰS~27[J3lzo_7HXџnϭبӆnxلqTٞN9a:'!я@{=D]\`0P| 6ybögo?r%O;>*; _V?yx~+=M]^U' W˳χ\4cA'||z&bA$Xܐg>Wd w u%Z`ϡI}c_xy_7=(p0c=G ZoW":3.B27=`>ԃK`'i1@ `kc7#@`~j9A2L`sj . cZFEdh# G?40HsC}3`@<.ƯOgF:tˉ9cM,~gtm |+.@̋Vq > +ס|?9#=彛wr{?wUGREhPsӷuM!>ݶhFkaXd.Xpursy3<=ߔ Dn\O#v~s#=K{𩌴8N葟WD~<ā/C%.`;z` 8xǘWŰP22=]r>x::ȇT f/ɵz`MtWOK~S8G{i`u{' ʣ.V.VUn39lg6x;ٟF#x.T"طx‹Gs}X;ӷK٫&z?7֍շx?AnYM<վog/SUt-tfuwOwۊ:a[N9*kxJo_|G]1} 2}}t!gqOy\l}8 Oy퇰'E?%7c/q5tX?ltÖU>E?硟c:9+^jߟ 1qEy*sl稇 \yI]Ck |sccs}+N?C¸ׁ1/28Hsԋ2槙?6VO\ex? 5@w3Է"7۲>n6R a}M !sƜkDžot4qFs\Ϯ-ӇGe? ڷ9:ӆçsHr6Ϝ#Tu?iL+:q[j_BP_N1砑Wd/~;mSw+Fv' / c;u 78XX8W8 o+npvKp 5>Bdȑ&J$;ЫpPdX zkl*K$/"PS| yS8@qoAoo7A;ΎnX; ;`O@or&kFvEr`v'39݀ 4",(z Y!g!ɦ ̿R$X'qL.M# <0}/K8[ٚؼ썊 .N?rXМ;B%`)˂o\PٯOaym .pj-B#8 gҚi\MGzkꝠ_߾l][bW.PPĺ8?ȹ. v0 1M:vmx =XԈ?m *$hy~gدߍo*@/0kѱ->la6oS-<8iz*47f{s Nz8-#5_v֚.!AtO ''c>ȃ1AD^MhRDAIkqMI8,?5cm1D$7hhgkQ`}::9WO| rMެf_wp77a;Wf%?w!>oމE I3&ezBbxI_gAW:WzJ.]-dP ތG2ڷd HbɜXE:#%j7?11?e%qFؾC;S3Pk D'4ϡsL~I'/u=G_[g?y7/ߋwpr wT߉`.D碑S{WӼIEv7f>s ? xh 8fpr^תn?\ۑ\p`<}"Gkdʌ5J3w'W汹l>pv=~hZX9=ٛu=wkd>5}}܁M"wC']K,|WϷx6>#_K{>p`̀V62 =N^@< hηRl\zC絷kNN5`uǾ&7agv){8EqaiAA`vq3M$ *iR O9n).A.~60*ĥ'EaN[AO Ekϸ R8%~~l>->||^'ރ3BC43vG$ pEBg"G_e6SQ6|%b撯N}v|N^Lj\Ob&Q8 } @BIbB ![$J{'^K5T1`ķ| ~7Ύ=Ў,Hu5{ZF_ Q6tO(< 3/__|l|Χ>++/vXrA{w(E+$Aˇ6x?|] .r]?m TlR{.]jkSh|#>3F9E+-lOΌL'F_ǘm6ϵw#u@k:zmt1h׶ |zXdϱO˵Mׁȍ%xq61:5ǝׯ9NLzs1h; kFN ѹԐ a^E:*敇2?qC:j``å> G㡜8!zrr>\y\M8so9hz0EU0=xȆ7$hoN|[{W{kc?|>s}8|g#{oGveoH{0@t{L|Q!{ lJOS?o9p=b$d` Y%̳(FF +<"҆Id hl&S::.>{By!@i> 6~5OD>"?Z"aX(n@'C$yq$T }yBu- 2{ pa:Iыb.z"=T ^lz=~p%yba@kP"' wVԟ&DR6ԙ8;wb(hToWgqa~wm0&Y_ KM uA?NSki_մ~W#9⿐_=@7HpyGѹ=uEYUQY3̧ rƉyhgY@jд=z#~?L]ÃFXs4Z34n4Y? + uBz`Ef1Aoqc<}0<>/ukqwZֱKu`o]w/O%W =~\]]rukO޻ɇo#aC 4Z<SWTFZ1rj5iۨrQ;OgnjNhk=7Wڸ!֥msl{19趆kV G̯qf@-u r7IhvTf:&~x5xķ}ގ~}ޏ;{ٶe`EC:_LLl1Z13 h,Hވf~=y$Af?*% {>e!L F,JAKsP(QtEB(:֯Ne{e۟{EPk$'6LB÷`FVn4>G\h n־ͫ mDIhŭ_OȦzܿwk/ux]ghOr}(`_x'ٯؓHヲ9҇ yI@o3ע&Σ/ =㝵a5bsGv &ftuMټN׋C?%|i4[x&g]p^ێ> ^g0VɝsuV^KuuAMšĥw3 CM˹8{#A"d&xyK3!⺉Hgqxg$bc@{0*A;k:q6hl;xn#};,?ZG:&̶? lG-OI^=aYkvѬ~t/77:2y׾Nь_5Yd ~sFuT{ KxuA<;ǎ 8y{5~;8>׆mGR,,O:ס3 S> dvf><'ڋfca?wz4Y@{x|vs S>{>Fwv?s QH;@}Tpxgh2qM}B(h@ b~pPfSA\]s}c_s<6/Iqy^6k{Y >]>Ac|C@ڀVS?~fp Kg} Z@I nw03ݰa@oh/ ѤQ\ͷ^k?J|ZqAtPܒz5-HB$M]w$YBۛ)iݬfܾi7ĵO<}Yðf'+eE*![X"r^|6iHN$aӒxz&ߟ>/ x|~~uLϚ=ƦOrʞ {vu-< dc m1F18CFlߕd{5Ksut& {'j J`qr}_2XPOOAC^|\]uP6[lT9?BllBr8$ ή8w2fQnyc\5sOkO{ma؈o4D3W1mr!T>YȕgS|zP{8)VӮmo[#/βs{2\}c7N{Y3@^1F/˟mgگf\s ^i-ڃ@"zcum_W2ƀ*FqOuf_ 1]X[e{lE8'㾬C$9 h/{vǂ-h!/Z`)8^<G hݧ_wp(nAݗ5 f޺zbG+z2DEw:\5ӯ;9Sڜs\$Sׯ m~`KcRrLd,8q8 WhDOw 8EFqQy%r*:UZ\3O͊ЍClhގ$PP}~-ߖu\*'EvۏXb=z`Ӈ-/A=l^v'֍ﺎe߈cxc±cq:p^ֵ}Z R[&اahCOi.u>=[#VCu6(H<8ދ/ߑ< m }::=ɬ=Èߩ+9&bA܇5%icsqA~ 'Y6D:kTǀ`zo4>8o?믏k_¾.lMy8[Kl:B\cFE ! tP(H$DS ; {82^7 1= ~ 0:0Y@t]0h]%l> :_}G4g{ڋZkc?׵c|!A3{Oİ4s5n (p>Ȣڱ{v78;`&u՛; n+>.?,v0= a[,{o; gF1Dc{qof൵zןall#8 Ckw rM5+rpێTT/r뀡sZz͈]ˬ/[Ң}83}s-oɹ?kk-M=kD7/.}=vz-{O^xh\`b09b[bGs:kQ; rM|zg;~Ϳu7yz {w7}~]wͰ>O] P CR26+bnW׈ЁX)AB= Rz=)rcQzA^"3^{M pO#ZuO"M _kqq^;^ ==]?89b].JC>DY;(a:{/:]#q.qKPlg` އh\ O:s8?Pv*?֍ ii,ZKf|O.$L&9
zH0=[R5Ga[fIp|gBphF[SwkX}<S_Ngs7l'65og;.Sp-uïӷs{"m y,B>|d|?6r/)9{濛 V.@;ٵɚfFeZVy ˨*o0 rZkDsx=f=qD23&zG=|Z̞՜j\&f[/#^Ulǿ'uzZw^Lе.ņ^yxuLǎ{^wb;`}R;y0X ~1V蹐|jMEPClG4cZ?a44'4A{E՞"tIIz>ciݼԧim]JՈeW<oXS[߬g= 4kҀ-#=Tw ǒ[k|#v*zlGҊ1`pյ5n0$<ߝct~a3f2{5ԃ_A@"b |_n9ǁ< $j @9~&N~I&SV Ĵ_u@,TIٓ.vgؿхp*~7A\^g(RlVBʇCs"8VÃb$b$6$Q0z%&n8>%apCB,`uob\}w3~foqǻ 8{G.n@ f =t>N!lp#!88K(`,A3^mAPYu,~%n{:Y3kg_Rr}?{rM.\q߹ahjel gzf f{ ?f'x\cE[.Ug*9w1~iC㜛y<MoYȜi`?ׁu{Кg}r|ھ ڼ!c0915gSءX^{c{|  pcܾ>k~#9 Z<5) 7. ܳ>Èw+:V~0`bFBW?|_!9f*bV~Fzi(ej=7*F́,.q hdj ٹڞ:$՞q=̕]p 4n‡T&5BЦC{ºXŞX ;o\?E'?g-P7O"{ Y-5֝=p+0(6ķ/@pݶK1z:5C|Z&Wd?< F"&Z;3O-?b7W|\q~E@k׮5]Pon԰/O&q~܎b3_'tJ&9 5hf<}Od nQxS ,HRDφ!FkM4bkv暴\=ĘuK?x ۽}y}Cl @c43e_?Ӟ8uL8py C'B E4_/8_1AQ~Nc /w6kk5\+ dp,U`)Y:>q:_p#ূc04F"nk5;Iu}ܵ&gװVuEYE<z"n?xFB׋]#B-Fgp_1hO뀟/O )f7m}n0C}fDn3_yC/z(1Lv=xâks%N#g6Q 3OețZ䜹4=`-[k5Fߴ< goQg\vYi,(ihgMk>:7WZtOM?A[pZkUP}(}\u]־֛ОG/_mmcMZ'7"nǯ`XpC$!ta֋z!Y/zp =^n~#~oǥ#F hVx_ C&0i[rŻ9s:=^w1ZcZ(c@=7}v~>!6;E9C`>][< ypºSBX[lR8k:I!= N8_Kgy OUkx:j_)OcoI5)M0_62iSD"5bC|gfq>o51N?.Dz!VVS9ҚuF{$Q C`%V0jGs𲇀~;ίW `}ڇi7߰V_n Ma2}_7Q~86i p>.9DAS!썼Ak0p;xC 5>u5r ;QCh`ovW tRo3[sq0 ᬩWX;O)vM #]m7۬wg{k k6> }a ^[~_P۾7EwvkX|l/}Rnq :5a&p'|?q{<ۃu]@ԝv_&pmiײVon-ĸoxoSHc6ws/]w#3aJ:?Q8^_z٩ր/54g ǟ XZ29}a m}}__9XA ҅u@"~E90xTT Mr4AMD&{7u$MިgV4SBo^KN:NC`ߏ߻-myj2l4>oP?;Ռt^ސG)E&ǙGuCCckf)PPf O|;OIo7?ە/sveh36_Ib"KMzݰqߛÝYkuC_.y4O~X9J |6֢hށti>xYE[ca~^<׃y3JcqyMC┸t"^Omqר'\a!@\ XdƃUkµ瀴Epo(Xڀ2HR{d5+O86&r Se@ۏL^N5^k1n—khӟ{oA_w\z46 Go;=84 7ͽq>ozg[ 4M@r{-o~n]?ϸ/nf^Z_ol\h`ݼvB@ F0q$387|f}vAT28&Tb2HBll/fgg{fwo%\CǍ;w#m1}?EZXt l388q< E0`K((:\xqk}-k ¶n{oO.Ӈ$I}87m 8 Q\TqE7 5i? \wQm^ɓ+=YM 0nE_~o_B佱 ޲z} "' PLDlTLx޹5xǾ?Űv_h>{LW#39~=W I<HU~c nYA5SkN{ӄMg;Q[=,W҃'g݁KqF~;N3ri^6ks6ʥZ/FOr)~J m0-6G'0ݎ𽎱u͸~缲=v6gmx58b$zmeh`ԘQ\+jN.oC IC8nqퟁG٧sÜX(bJ83oFB-c_ j![`tE"ֈぴgg O>N;&xS{i=\389dv*>v?><~~/[`i6Am4r2@Z47fch~ q/rB6=A?C^gǺ7_|Cf8%:[߿=r}^eOॠ@^#K {pt{@a-=@m{jai߰1hv[ 'D~`b9!~辈L߰Sv_dh?ll{,ZBa!W!GDL栒B  7e_vB,Hϊ" ua:Q_Ѡ]Bo0.ȝZ'kM5~s`nz\=\_7~l Q ^x>ޟ N1F41N*Hn<3$FEr|XcM &_A|'k}5 7/40kGG PBH?zڰ7+c(P151¸8@>C'< FN!8t~ tsy56@'!К8ra߇#ng4Jr;5SBiKg{}ױ74#oQ4zj]#m sn ޞu3?2V~ƅvp2}c2$V7qֻV"6gh>1GSVzmY;NsI5AkDqMMG=G[ :=V$`wco:|þ沑A bT oRСj6\ڇc{ k;j h_3{/kO1)ގC?Wuj _V]u+S'(w掆 Gd;K ucCu #'# :@G}Y;'ok$!$8v6lὺfT;uG`gvQvunރ{~/ ҉ᡊ>L6l`+=,a@g`|M=`v{{Vwlrm5 J8 ,ΖJp..\xY%~Q,4Qv XX #Ęb2A$^ lf?OPaLL5FF7Dѿc>8iъa}c?o0⒋,K'J'˜'sb D<~6y򹋺,z"9+_:O*I48}##Ѕ_}\bO|ܟ}bl9E7 >ooYßO }qv3~ _n^뎳m=ygwl{B؉B~!ots(yC m2R#ibxUqC[p.ox>WbWqa{ugY78qxMqK,~g"3'&D)py7#۳lzA]Ͼzsײ؏}:n;ф۪Ր̡hP:z5 >f77f'cMǬ3@kڠ7m>'#NO7t9zMu5cfhsjpjlElE\elac>X3~i}#؜~&[}K ?'4`4\E_?'&<} :gwk= 4,PCl;%ޘÀuPMtju:&WZ_Rq,d]RuH.Eb9:Ah6*". C\rc̋U #'j fo,hdNEꧯmo;/}>y Lm/Ci6+՟6V\5@׏{ T@ԞB<0>`o0ks:%ֵ`ގQV jAF`{N a;>0-s+|7,]gԻeg4Åk:a \/x5>/Ab7AFAفu-3zn.\Awѵ}Zz&q0786d| hI_wɤBaf ƿwOlzn6;rjDeO_)G_;ڍW.#fN oF ~&$>8Nys?&ayisvOnxk#098I@!A =6N藭Cec ~p zv޵"GkHKHmwlc/l=DL!H.<BgtR9}7/c9x;x\c v+^Y%Љvmc?s#ʖyI͚M-)_8V8F"I16,zqz l6ymݜޯ 0`CSgvh6\cІ_:bs)4dL+VLmmW?f]ԆdzLcK"1BCӞKpDެ x{k=G Stb/j>x5 ÃY^#4z|q-aKkX{y9vʹ'vn㺾s? _j9*!炏\3XGǥ5xoig[8Z1憵ƿ??v hmn/jvdI i L@$2$FcQ ga&ki ~q`i^Zs8}վXJތ~4(A|OyR6NN;!,8)LN`u=rO`v)AI.$B6P6H`SlKRd!.7ej- ^fs3m^nv>q2(׬-pBܗx]#6_0{˯>eX|!h_q7ݧ'+isuh ? 3;x5?ߟ.beQE ,Lukb>OENrڱqG[/38.s8׉1[@Akĸ BgOQ Bi#$Lo#(i,?+ga3ukv{LӼ7nog7}~SC0_}K`i7[ʶ{Ͽd`K! kgѳC?d:qʊ*֭S#kQ tn<JsșќWAoTd Fؠ6.|9zNzzZQq|"wZmvMz~n IhƷ[U3KXlܖ6KϠc#?_0h$rMus?ƃߝw\" ` ĪsDӉyQ+ {ĽcuN {eI}'-،sgp_ܖM?9MJ.17{3u⇃v}[0]/kx7 \z7ɺ̰)CxI`{?A7q1o4:8 9~ W`;9苍vx^Ǽ /9h x0FM0b 7I ܄ӀǦcWXpqB4:>H"<7A BACX_!` ={T6$F$)8A~V-v<"_Ûdavd:y&/lVv}@ڲI{k87%)dA6Bxg8n8% FܟlڂqAv;Rw8oM{܎"BQx$ZDj Ӳ!p~:{@<`1h`=QTKlkڱw6pE?)nf%]⣀J&دp/k "+Z BIP?O@;\e-KbŢs\Xdd#)/ P,詆5 MnxM;ƞ V-mH}^ 算IK%Nq8xLͥbM,o s~tFSڐ֖&(Ncщs|5^[o&wޏ\y1֑O?k<^jO`3M`SK|`y\c `b=Z# ՞.`#-Oe=(8r`m]UfӱFlkͨ+~ggř0L/eh-?.`L6^{3E5Ԛn;|O8pQi~=׽/9Zgc]/Mx5].QͿ0|xkmM;%{|~G#Q{`Gpؖh'qMLG}+0yx^h·n;ެD, KOu/Dqq e+羅%nxlc4"3&CsGr\!2m/dsh ~:_c(SơX2Ċ=FU' 5rH$b KbѼv$=7؜bF?kxG5hՃc7]7\U$z~$>l}n n/6#6NBp!kA=[`qDg珟 Ѻ)sü9KsOLӏ+g `B9$A|t%(O/ZF"? Oz#4W-@k׆yf1gBN@975(_kFQ=yaW1miy|@.W|4z?W`]/!Z60rD6n}+[E<8—}p:4i!F##ȇK3![a%c8;a~؁{v>{օ;wfj$ mf14ph^6T4.un6c{!];ýVfϺzCc1YkMzsq8 _X+K'#DWA! zn{ad!РDr`6Qp0~o>#sѾ@^@d0߫H`rb.Vb짌b)o)'=|F.Եu Tw#ڹ=n݊q8Ho#8/S'6 ҅JM? @Z7ܩo04l/ҝsnYWeȱmsO 2ŏ/qjʱ{ÎNtY1E_z"|ƒzl}χ>Fآ7lp9َx]b6b6|ّ1|ƞ|7c>,ZēcCpD^qݸO&:Q5>십G'W*}k7Ω؟di?f1Iw}hB>t4jР:$^F]U{{] m|y)j*887 *8pU9|oqL׼/l-{i\@n<4ȟט]l[um3 ~. J r5DхuA$$%Am@8H $WDF?C s hQSPs?'etMh}qƵzp_shŃ,r_{=B%V?룰%r:,g&쉭'4'=9=߻zփ_<;p!=d}O>Oa`Ĩ_.xK!#?=^|'`8f:Qd1#iHzPBUx'GH6Hu@Ț85:-.`"[woTc',ċ?v 59nwٵ+w<yL y=suWnnb|79Z<\\44 @S0ӻ*"Ńɕ3):tTF\S5{"{Ok >27s|9 > &r\9*Ϻ(QU}AqO,guuQh &aK}>| m4K3_R7<ٵ$Nk~Kj_g_@&?ԉ-y&u}akjHq 9g=|`ju`Ճہs}af/7M.;ęM-6 qIr vG>ݧMM-bSqߡC7SK,%kNsߥ,cslߤŹ[/q~>N ,Tb}}E>{\틀'#<[cw"8 Q1>7Wz2{3[ %Ok?|Y?vOuA$˶?'#|,B$T؄HWB>ټ7>4g#s|$/nk[(  h(UxGQ!O1]ߣ9,N|18 ]RHY a7z5P뮶ca։׉SO?îyU67D+u0Iz\#h䗕)PkHBӆ`Յ6|5h[4[;cI~V8졁zqNcîХ dQŝ C~ŷp؈boC\6`=ii?ܸoy]v[55I]rM/ -O+3r¨Dׇ} @~L^onðYlAXq x6 =OrBLy @L'~_Śzd@{Y|Vvfn{zj3xm~[|t<9qK˅k=hLɇnK\0j%fߵ:? wFSߝƵWy-]5u詐C `Tc: F_,`k~#s{yhă6r(O!56}u?y8v5=vb殲G c1 =-~جl0".7X3;rhv^FMمA pVd~~YLT\PDRE@r,Xw3ż w7l.ޫuG>}X'Iu` C~)l =3y<$<=LcN^$ziqϧ|6gX\K [!AH١Č %Qb"N~iDM )\E7[pdX3G/£1l" WG wNe6i\r3Le1" mdd!]&?..|&x<`mW ?MMsq7[Z!Y L=!%ٟ'Zb-B0tE#G!8kX"y nSo5@:^uil^?81~溽v7Zxt!F5$l.kM5&rͣ~Y5˵$PįxF*ݏBHĘ Ԑ;Ag9 3t?/=ً{r98{O[Ll\6 yɟ&x@|݅$`?a;lFlKѯ(4IMmpfs=7j<5°8pZ6XUAvmCVAirfǟ5kL;o \_1b&$bFUy,⭸B8 hZ[qdN3NΑ'5zG=_ž"9ץmF׵0ԇȁW"f16Ccjߣ7lM,c>cҵk`M֥=V,u ʾY{Mѵ -%kX#35z0jL:^,;wװwaW=]8+~%W5~7 u~?{k-~u>d5OTD5'O(,WҰ'w"7ϿLUVflr,$Q\ e !C&1<3BEjr $"8q^CAdJB:(2S4Fʚ E /j܃uE!LL"֙ 'zkg; 4Od3~l؍i=|O?c5@LM=IW񇝣Y-g1$q ` ՓzILEC ۛWIDATđ# +ƈ0x ?GU %1%Xg0MO6ɚGb~_QE;BXcP>(Sן/M͏;þec!}C7ͨ"DvD'v|^wћ]KWhiG.zX1x%e{ƞwxMZ<;~ G"puA.t1/C(gFL;)Tbcyu{? >f߹6H}i}:eι l ^>m44$A?Uq,V?̯o7x3p/nZ-y~| Ώ+2f.y}r Ϯ=t^޳=W!Sa Mv w?ēkxo:KvGtn7z5!>.Lm'&R#p qˆ0'L6BSeg{uO` ڃ{Oޯ||_'tm3[ZxFZs9\a0ykvc!&ܰuƁ@ 4sם[9gi@:3l#;G28~zޟ|5rȼ!yšZ'<nv޿J\9[z D~v|-O} '!76ܐ,)Fb U(0CC E:4NH{UйȤA$;8Q`ԩ~(\s͸ M z: f4 %$$h_!"-exHIcmz]bhD^`)}+EIbD/6ւT"X)x{r\۾9q!fKH3F⃢2 s⣚bqA\SXF/x>6c1 Ō.g:8-xϱIkr}X" Ꞹ._HVl'Xe@Ek*U%^]ec:vh@:Ы= F 0g3l/|%0 _CD@a~ CsAG_þz*Bk0UrXƁMl~  7f'&J+ν+s@_Kk {8Y %F1cX.m7m1;yk>u`=E#|~q#p/WJK2g]m+r``<\L=K糞#7Vޥ7nl8;5 s0u]ڷ9;=ofNƷYK3;4 #Դ#G(//zӿt CNoU8p }Ե{Z3:9;b0FşğlsCWz1ȗxf{xqqk}ݵϵU6!\WErT_@P>[z=wjaPGm:4\uHM/3 iY%lb{:u Z8ΫSåvQ ίn=ufk64QhJ(L;_}lpICArT:xEtB…EQ!pBGQ^"K HފЫl%רq,4(EfI&Au}XȂWYpjECkO"w@n4?/æНgNV|pobӸ9fD6Nq&a1AqSu8{?u{zn1*͘c`4F_܇!G <윧فpI/MU$r4KǓßc5LXeӉ,IfK7xtǹ.g(¬ 0ԍ+:sXRŀD׍j"cpZgtpU]}&/juàiqƝuZ(Vi6ܜ"MĚA}{Ž XZ {E&¡䞵K(jKh{Ğ[\ʮ-Zsc`1ca_3{ĠqL UMsL l-ǂQ3g<~Ÿf]i@dʓ9nMU5ϝbP_ sHߛ7[ m9(Ƚ]wLyGM3?_bj< U\ЈgsΓK+S=ls鞀u^Zu]m-VKB]joOeăt}ǴNk{ĪXohpEg"Obgl>U{񚼔d-?2{䞲>Fzp>8W̾9q?0 (mpU^յw)׎ۮgpPPOWoէsWG4~>J?}:hjj;H67U!` L;hbo.8;Xɵa(H T:E4U|S63,i?BѨ" ^Oh`/P(!ςDl#%%}W`HLhҞ$ޟޗ"iG! B/Z%e*:|Y>s 9ⵋm7u&7m7ע`;vsuk_OY1:ɹtf|A~yj!_yhxu4c66cguЂ7ч BG{ǞFBž lM\ƫ~(mc8zjγg}bC]kܟuX>[ch:^ bOk3vSyrqHt9dB/`SO&W*.ɉۃמ\9q|]>6ܟ86ֆ~íM~}^-ȉF O)}v?V!f% plh.;>¹2!Ŵr ^ Ǡ՗np`4nhY6u>?C'zϺ(x_B+v8`⺺;j>6pMP(pŶcbni ć.9>9F:gz^R;w\9 ܛ57fle9^{i6+mv~k%q փI?}gMf~q^M 3ضO,® kY`[7Q+`[ k\l[<86+]:22pkD|ĩ)h}&Zwr_|W#߹zħs1H8PpaT0;3^I,#+&BM$b[p9];$fS![>ED ]c8@$/[8N>^9 :>@ DŽucm.Iq e<43yj]rg/^dM?ȥ[Suޯzxln~T߀v']`{=3F=Ps3k`68ER5hҐ:],֢벞O2k ՗~z0"^hl5. ҸDhy?qS65.6(;Mb]9c3w 7}Wk43IM-9p\\M/ЄL]PlķzX{uRCoXnhj_1}2Zg &n\.!g-{zm;J CA3XkvxMMm?_ 14 fP[R6éxVK ^࣑u!XtqB9s86Xԑ8y xA9)tې]74Vٱ9qzx/~ruy[||)4O)zCYPw_Ƽ7O|8VG:N>|zTޝ) Gd)( Y?TA.'z`Q`7K1X"rb؎[C>aCfD8k0N-\ݚ'WVoW>>g;nWu.5 js;DssPpl]R#GÍOl:W2`a4: e~=XjyǏ1, 6C[9:Nr =h{,[𼸝ڭsGMA\~.<9Ա&_Ӽ]⡡7k\<<_D͸ yG~>M=Go?xnn<^7~NOe,$SY47Qh!"b B#brwmi&KEXO9h  -H({g2A v7o48ټN'hބ 8ܼ92fpMDњ9\vuu/~ _Y_2םCF5y'^<'}:ڵ< s+h=|@b%\ŬEŷ3𙏃7J8E-L\}hc8c%c,$ Aﯞ?<9]S)*Z_g/i-Myqr:x sy Z_:rGkC@|>Prmrpߨs-ǹy:B|죟'>G?(_u u } s}{ߺzKb}?Rpj8;4K;>&e[qx ~< qܦfhyϽωGhVC_4k׽kK;ԓ<<$f6yjpڼ6_7.ujQ{Bam]˾;_#zz^^,2rK?^25/A L/@4W"BL#@~UQ E|^d)}y y!܃"͓qOa*[X$u63?f@Q8).[Nvq#d}QVp]1IyL]ĝ|fԹ͵ƚ}yNw}iO'|?|'Bxu$6ZU "&6sЈybqA&2^K1QL@@XКzl*c䨊`ߎ%ugL=^y{rI4j}ut ?\l:^8hu>Wvi/:Kmz95RHs>em`7lL /(:>aބ^d xq175ބ?9oد =^fcҵcF j]?k#*wǰ@o>:+|py73FqX ^HڿkCӂzz9@}XԌf]&+aG6xY.h=u֨1D y~?6j@yԌJbɽW{Y񵿘k,H_oOoE&D8eCѓm$"|=-"?U֛xӱ9 ium;A4$`#+4I놂F Du⺑XF92&9}]pk4H =@AoiNw@0f6 E X,?}R#SP=_l9dN9 Hz(~O_hA@]S| P=?w7.p} mwq䄰R$k{1qk]<38(18xNBENb  dTcےYb=4f~4[!wѨ )xm=Q;}qOEpQ;vtޑd+c+}?ؙ|č#bfѱ^| =1>JaTLRT|uѽl2^<y;u,y:yMqǷL@䠀f뜵d^dlh|/lp سC dA"߼M<!YBC0w4c8z{po O) k9ƈIdmMY5n9c7\zG8_ e=,MdkQjuT[-DF X[&k5xC<ћ0h4W胇\s⃸qD ?}s'Ԫw/|Ҁ?K煽"ߌszƻ$EQӯxu-\573ޙRʡա=}k<ͳNޢoK^OQOOq@Ο\9WqNbMо؟s vyowZW-?u.}~CWyM;EwWQ^ƤiAԉ!$e\[C`bHUP2[d,HW3)ڵNtDKfw}# Bͅ&R6x};+D1 ~EAs)G'ק~w 8^7ܛ5$~BDu,7bd*[y@,P/HD"Ao#׹͇ǼEK^]E'OOh`,V˦Q2t]mO9$FB}@+u3 N_i_Eh-:֗&JAP=C|'b pWKLn7Ex_r|_J>~*mi ل 7_hEmc6@. j`kgIXj_<+hZG<9dTsލXUkP?@.Ԥ6t)u$7c䈲QrQ[ Ç_g|Vku Y#wG|ɮ0xƆ` É} VreK4Ylh:KY܀7F8q,\sO{ >}QAU[a Yf g`_@[(=_36\ 7k]wD ~o75z8/n.]Wc |ᚮg'5kaMxI=^[#ƛ-hl}>?7?v\|)!s |}5=Zʵ|y2 䒨r@8x\ߏ~1:Y+.p<aI }|dd36 MM[sd*1p.OY5Rvvدk߳tVC'䱴2(Q|)z$#gЏ /@'ṷ{EjAoI64I:=@?(|}::bB@A s !3Őj%pPQLoGQ/bRxhEK9v0E/ M<+L &O.́3BGpN6O;!W 3/(X>W_4fE&& B> X\ҌrhJhhV)~s[$PE;gu:\(tZgp2; ,>NJ!Ek %Dz`C<]W}7B|#@LolTQuA3TC$,?Hor^;cM엍]-gs3m3>{HLQ=d n?^{K>ٛHFɨxqII1v&?VTIq[1<$6M|ulcCp >҃ݧy6Ew\ =C08Mxeb +CY,hJ ưk1C8N<$ee=b*x<_񍑍9pz~]{=Fq< ǰP(uxڛZZ/jthޑJ{Ḁ ~;cq9 ~]_6u ~eo=i_єa;޴ ή7/u>aעKEpg_1apLXUZNOsii8G<äШǔo77ȣ\{' 'XS @p)%lIDNێX/tmog8%nv5#vVy%|b;qu^~hL+zxz FJ~(9tl94DF;Ȉ)Cơ^DzZ߲fQqyG=3'C@~wOsM胸CS 4d'+lW~ P?sU={}).݌ֆqꤵ&+s gh3P6Pl/g#{ j$pL+5}:mBOO=ia|Vhn&Ht> U26f?r>sDiߒWv$_:;g;k:yؗo9A|r Fq$L:{sm:zIq_0Z{V{$} v2cz7IbRMq^d3D,HDy(Z 9ڒ|ERQxO|X&CI 5 T (׈aAGa쿚΍ԓw=_Zz c(([; BE N@}(bPkQy:kDt=_hu1N\p(w߅>{AXI:F->8ssЏoܬu;GYg]K}kul΢9~5FN,։&ÛW5CXxELxc8C!Qc+W;Pwn$'_;]v)5`>8s7&!@b^!nwO< ΀A k5v, GŲ5Zplo^'Tp_zz^Q={캁ri߀|E x_|n] ܑd`5_ dN/81_0chk>쳉cY{}enДwL_LF>!0_N~ +.0Z9)cÀҍl0kCkcǵXkD>u-țu7ꢯ ^RZKl'4-?J_}\=S߹O}ߺO~O?o,Dҹ=y9 - N!kko׏ٰ0ֳ'J$Ⱦ?a D^֓NҞ 9%z.P 0f2IًדDJ^0E7T b4Ù= Zez<D~ⷺu:Xם@Obφר"rNpĺ;2 49oIbIEK4%xr/?s |2oθ4B- 889d 5TzĆ3;W3v^~?x˲6#A]Cܬ` ➘')MqG!pxoQdnp|tC ("f$%C(#sqGC,uLI9ϓE1Șa񓦍bg4n:?kzFaIÎc C2.#"7ŋ=W>o~o^u:g춍&'7y_iWE!|FVFaUE|]`=rӧxy8uf1NUڈ aNh&/=֦O_Zy^ uN-8lЋpkF vD/߇lMFZQʱcy.:\ <\, tCClp}kw{+8nO'!<1X5?Eډ7k;C# z覸1G.9QNN_\4<5ezv m,n:]O 'θ?!GdMYåCl?9H,#A2yJ<GuB ϨsyJ18'G)k׊KqA>g}YG|u |sgjO>Uy6j'#>Vk9&iOoǾqGhKa$ЧlGo<*\}0{g_Q6Q*`: =HAFѸ A!ȺXr#.F^.;Ir$}X`"db"S`?ȘiCޏ4T"q.@$/I;5IKZg~j 8 3tAޏ`xDG:<>׫DkXg 7vwӥK& 7. -$ݤ>K%WOfčcT܄ϦF/^9vF#;=nB֟L~oK7@%9;sR@ 5x! NFo JB[35H bh#%5R\-M4q{ |> xwR''׫t5LUj uIɏ?@b0X}0}#j # Z­)"g- 9癣Yw|RWuQcuӯcGt~euຬ` g >!˻F΀]K{hsF٧ (GNT tSX;o}h04j-sϩ+/c=bXCׇ5AjfٓӶeB xYrsaIg_#g)6]߸v#.=W}RTZ[q+Zgk Nԯ|<72h%~6gӟ?Mo{_>2?׫6ݍtD{?lv90Р ֐@iOI|B7gNX?ۋ}bpCT'H(" K̈́{> (M%BBs>p< >1A^]ks'("TѺhUZs$czN/a&4hfNŽ֎s^j?܋{=dGTx bIÝJ"*$Bg$\I' &_k̜b-ś;4g`c{Dl9OdqQ|b~b8;õѰ51g+Ap ^/n_DѶn'Dy{g9ZE+0'Dt`&7f8E3 7$Zb~{b} xSBq]X|>7g@׆Zv ^i7Q$6r1o8ɉA {fA>4komw>d8&_ћOFa5|1 9]3 h$SFs!O41zl ޹u^9sIpmaG;-ֹ9ҹK<s?@~s.8{E#zj 4Ĺ7@o3N]~w51>ʘKbLumb퉦bKlV󎓞K?q<:^a,6%uRhOlf=mx.&z}p>xnrKp9 XOk+C<CRB |ZÀ?@5 >$'d>m[#O~qv^>lpx@ M=X1M$B"Dsǿ~Eqp?KnIW 55U iOE85H>+9 <`4SE1q"̧w7ke;k4c!=!~pEs/]8B {\mlǽIСߡ5/ĵcDs{~ ia (-(> "u>Sԥ \2Ohq W?ea.WM\-pڃgJ&?P4U_4,Pjt=X~b+!xh(p%vG|Ulj섽6\vǃϥC#˗7k|( >DㄬMi/VIK~PdN M/řZA}9D9}\d˝GlبaC#m;?;w>ܼc)kp 1kk:Zı}u%n5vu8؋}=Eyr˫^og& `( o׹\0AcMxZX:3bQHCWn#Ck(Ltq B|Soٽ.!ibX&QI FNf ؛S[ڨ?Dx2P:t|=ym_lv3o@hq:y\φ1LVfayw ~=ND-w=D_窹u܍={9kϬ2sdUPEgρ<3o|tD`=5A g5%[uÜxz׋:pŇ,. B\gï}w]S‡ɫ9>&)Evbu]"˾ӫWz>|JVoW_A.%p-c8s8]!|P @ }7r001l0|c@`#_ ѵ9 TAUސ?F64_!{~>s&=}X0VQbͅZɒ\)DD`055G%9uαY4Zф]4 Z`3~. #E_B„@:bPhYF C C4#u/{濸|#OePf1J>׀>0|;cO*[o7LH?[{ؿ`Qѓd.hr v [\lk0>ɳ>>Z%+=o upL_p%MnwTzb j7-.h8={x NN*v&f Yg;ӇnS~{`oPpM=)(bR{Onl"g_4Rw)=ǜiV7 `:$P{#1),6NA\>t,`a:_"toC8۷yXpZÃԨۣϹ۵>3yM~,{U-q\!7' +\pN;ǠӺVt kϪN1ž~nKvfp{/دYˆa1}dT-P6:@zF'#{ 5&NP"7H؝&y>r}j /Ȝ vʾLR 2{O /ȍ'䫂W|`ȉg8;vAݳC^lalME@=[[4/#c7^%_Af/ x5xk bc9U"E]9bëk 7S|0%P> Hp0@p7.ւ( *?f6+`YSSE^rO~#["-LX" ~ 26IT p yD`vÁMYCxжN3\QbXhXUA4wQV$p!$YTaa3l- $v5XA$"0郝WB襕Hp>Jį!!*HnI|φ#{t'4E4\9L583(_k%V`쇘dNcp\cOdm>u8qCu(tܯ١Aw> Iw|q' ;p==_=|=9;hI]$:`)4gNy6iN߈@x5yz݄﹬#֕x~O: FT.a0T$6{hvĐVږ|J™r &&cH$B,R &? p~[?ՄcP TC@|_ bY8fmҋaM,^:NםW56@u}OS'&/>Ep#)D{6<3Y<ž{s_K ?]u+׹䉦W֬l2_W4pCvDB~pڱ2쩸ޣm61כT®25cG;`c;_ n^/=>W5dӮ^Cz t˃`j}j91?_!pj`˱Aw]к]_ 5FrPc9kt{덦|?4lͣ~/_\( _&v63w ]p^%k>m=m[uX9d?I> N(tޟ:(Q^{j"DDϗӟ+'??zn492~Z@Ch m 4?w*NogFo(lfろglUv9cHRfdFbk[(AƷm{_m:k{q'JGb$! QW 7M$`5@6A&[L՚ [ĕѹ Υ{;|~]kݯs.gY$Os,%۠*=bc4P@>a@OT)6idLJ&||r]3#z0 ̔=4%ޞ#+W1d=)BR6 30Xw@;<'ԚC47kAe(YZ*&a*&ԜވX&b48 MZ:` ϳX87goׁc^N=νlׇ@oU84" \MdPs^M.тM]eͶ:J,[F3]Ob^D+Eih&y($^s\ߣaϧ- \Ô+60ވ[ g'7]͵|վihf>M])|83WV8s|F 7Ԉ? #>gÀ='.B++шh!#JWy[5= j4'{4/0s뙮aegskĵY/ne6>U]u1{WyؗOZfg'O#~M}#a 9_ u}_ȩZvEo՟xW# #ʮΧ;>ͼͼ؛g~?A7x@Vh642޿c]ۚSk65 lWb}/x2')?H{_f 0=t νG†b.p=d to֑~a{_lnKD>:^ ~}ߘF/S(As6||NLY4W"椊RpQ~v!m[5&,iԛ*V|sp{ v1Mb;-S>>ύu3*rtĜWAlĠl J5 7>e wf !:&M0{ɓUecqSd`Bg܀׹:jD^]?ו!o~wa 5gmYx*ۆ]e37?Z MpP|%{z'V/LUr`Up>طOnۯ;.!l +|]v͆?y5 ]sVA֧l3\/~ 笂^3#e!;} f1"e!ئms@΅w$1zo[C<#qoHV$|9$ #DDq%(E?Id_ hVD/8}/A&9O{B -æp\7'k9j 0xqmx} y;?\oOkuG#?om]D|=4&*NTK(Mш{OhS )|)އ.*"f#ǜILL{bnNatu~2j/|f|Q)/)?&Į 1(S3ϢPܤ(b cD!x]uBۢXFֳ4h\ jF"^uEn]B ^puo2/amo9?fZb4lHfG)I. J nG?1ωFH_o4A4kG 7@~&h` ov؏\ m qx\Nb_R3 lw,66l@u 4!lԇ \'8ܗSPEa +^ipѼ.8]R:$Zgr+׾Mî7?+vZ3{`\ԬbR5 ݰ6yPp3yJuZZ| #ꁽkq4#/kPϥѯ<BJ]G#aUÏ4j_ָO_MZBNǯo h؅*Ds^8oOК/A7ͽ~kW1p Nz<] bdiĢ1op~~~O6`эh譁t^gpm|UlCd"x h_[tFKĹ$t={!*ۅq*!lhO$hw;L[Àl5nRHaI;"(]๰/k|4*?PBƷhĕ{JA)8PEZ]/Od%#B$_ ö7=g~8Pqbn~r?k5kOIӈ0Wi^e&09u(Л7(9C  r*JCǘh:7Hd]K*ڭiڍ]r{rz6w S(x;:3.bl MZЁEܲg`c hdwlO/ Z2e #nP#}5 4V@⾬!1DtCC˩ɓ#es$~Tto?BhqCM67m>$ t)p1ԋox){u4fD(p- {jMmGϒç4_gfv,GL8.Zu φZl/Rl1g/>`oiF:lT y!bÀGM/  $8fXyw ;r|7ss @14iynD5>8_zs>xWN|$9#{y7QU?^DĽv}}l=Cyu[]^lOL6@C> .K6ge/5w ~Z)_𩮏FDQz>yhz7{#>ل=_}_[סegD@Y$ҁF@ B[Q}Q\CB0$ *B@,1_|Ie b'bEB^%:)ه9%8ZC'g'h(,3ޱކk,~Z=h@F,]o tQ`Hx ,X` |>="5?CЇc9/?!J?=ũq`OQD fst ~>z`9t΍L|+qZx[k ݉}EAkQ4UFq4 SQdXe>@GETz>wqRou IpMj0/Eav~քFd@"yj HPA&:d,͍p3"kՀl3b:,qY8; E3=^`쟆L631lȞ9H;colo?P0Յ_-|}~ ujW' igpf?$GφaA*9i&վ쳉_|e[;Ͼ9W +;2}7< ~3x }g Vcs @(5 j>6Ġh/Z|xJioHH1Z %e>9{+OExOIKtm 'i77|7g+~gx~xO#~߰#=k!2,h C_mN{o3FE4u3߄?O9>?O}$.s,੏E1o ~P^ҡu ( 5:S"Јȟ+ak|9yI:q=gҙ>3v3$șxV1CȎgG%ޫ1>y(\-u_f7^$oA ɂ7ntL4&Bs 4%nD׈%@Ӹf?D`  ?p}q q̍ų@ͮ0\Nqس{b8>Iq?ce7:Z"CθMaiOn56W"EC:l8Kn 9٧,1}H{ɗpz<xth/k?vlv ;5(|@wc䴏 p=$HO{Qu(Zڷ4U<2z!> v =fknvPݡ~'r9FS`ﻝ:)7׽a#};tעȯ1AAXyDs.=駵{.l|3>UL%^h#j4#IMC ;*qM Gs"/4)1r}ԋyתҨ!yuvECwkf@N±/ޏ\Fq^N(5m  AF݉:ݩ!4]b{mc-`|fFt7t^CݐݘOw9GRBmK#p4;G{/<ҧЦaMC:Z-| ׽o7@À5 77~al_1, ;gSχF])aA rhb́{M6aC'>ſs0e0Gi+EJ 聆R DA^D1 ^RǾ9F JlQxvTi|QHa&{qO:f~ES{Jͽ}'?,Z_uZxO~u]V?uopO_^5g>4 4Z\CWWsvMUV6@Y#ASQ~Y>YhWAkbv&hb@$]X<ՅEsH$Q&)+.E2`J A рnـ-;}ǓaÆ(8׽_k)uDzk\hX>'ito 0܎۷qʹtg~<רrxߟy}_}h =mr @_H"_܏x'(@y S@=] g+| +H_`}" ޻$w);)\DAށfa9khaT(x c$ k% +{d)`3α-/aSɲS7~}l;5gӫkO޺a-!(1>@Epˮ4$6.IE KA4m|~󸆛xa R&L^ZW%4JĝL5Tmfv4 4Q`(8H;x?P9Cp_wQ }pڣ1D^ǀ'|?&|)!O']6ѼJO~0s'O"N\out5x('/ױvö~+g [a|P}m5fmɺ ഉ>?ݞ)[==`l-^luUG댩W[=((2ںP# kG-a ~_ w[)ZElOClj] $4ԁ1#"ȧ#̟Cɟ~OS{zн! zF?5( Ƶ{9_s6^s_{Zl#xbklɛ4QcDz#ʟ3./$ťHG V <|"Xd5!V!hׁՈ>{( G)` fkg}>@fZXϣ1|a] W $@%9,ճ$ #}>$Pa:/*T__\T$ z+O~%WuHc9/6`~ZD & &$MӺ@$3II uV$kt!6?xb4u]{mk=m}/dt{c#l6^/>+nGy G3hi`s 8<9Ѵ+6@^܌uk 97>[Аh큽t~G5`BCgq l`Fnr5'J4?"NAt=3%K/o^}vMx5pؾF~~}uxo^^/ G[VVZƫ0_M?uݳ7y30dx΀€! {d~_y. B'aC z690ͺ"aMt /۳h4ߴ=l&ٹzww`, W Ejh7qԀ 5v7w)X9_cAc wx~_֔{X;M,m}{4W(+hiՌڟ9W~wx ?@s  5h޹.^ܗ[a}{C4ѠW~lOUfӤֲ]fc^zV:1X!ci|ƽb L(]P1\0 Sϱ.fb GwTQ< КO?{b8*/{(WnI#?.@?|?')DsM^oFlrܐfL6E?UјliҌGm9f-M;Cq< B 7<T'ndܡ@ HIu/qo 4'4.p8վF =shNO':{CΓ]_.r )-n1HPMD5)4+4-  Ǭl Ӌn#ܨlׄ>?0pcsԘ2 KdGtF8&|ϵA`T=!(~<=ѸM}AƼ/WCɁA6w~Bw<,@k?o9M깷^]}~=?s~A@ {uϷVo^vg`>g {bm[RKTssL'QqL A\;旸5ERa ソ-(uP:5++_ےȱir7 MlrsBіq<<$d%$ ɀӹ뻪ٵɾsX󆽟PϪj z\6\gQ {\<.A3tQu:.5c\z:Zs?5צ">0IX`f.g{>C >c߫C@pܥ n` t7+p5O:J"ܢ{oͦ4jl湫5CJ[K$%<^|uqqt!C"ۃ쿠9x@NRl3RHVОha17Bț?̯ k N=C^([m jN5RdG7o3Sa!#?}(c!ⅅDVGίkƯ &#:*Gj?SV슽}&'Γs.ͯ_?p O}Wn}gKTԆ\d zP)ԯy^[Hu_.fOby] ka.S$ k"f'8.ȣ8/}YdUqIVgETPRC§p;z '븏1$˜Duq&!B4 L,"2 &.]M~<̻\ K5f@g)6\mCh V\ Ȧl\p˧~3`-yxzcO~Gw)Ň^8?﹎빏 15b ^27"&= R~+ͷCk.Xc5H;5!m w; j!2qcOWuYfEԫl寜1b 9q^>^\ n,P̓n^|5|FK9X4ţyz-=اy -xQMǒ_::DgL@=1@9P1s i 7A7c]1~p,86_,xþsk3M\tf_≛H1bg#A!c}5Zܛ!B*.F$G񋪛W_ɿN7PR[d.݌h1K<a"0 BB}}Cz=>hccEPtlq$r~\$ }\#Yq)OhwOi=c3G5\ !Ÿ§;{gh.g˝|>./ݰM*IܻQt@"~5nq6 C?7 =<}*$ps@cة)pй^f@4֚n sFcb|>U iS巉$'*ɩ {銻P"QSEb6S*"u!!P4q/c0=&%O1GZ{pRY1H炘yϫv>G"ݢ}!7>K`Wk?Oskb; [ !lE <_gYy‘1xx gYW{`?c aoshMZu䜅<k{tlA8$>Ͻ0XM!H=81x-(Q֛?%} $~"_yơWp x }9rS>K^ /^'!J{ʣpkl#bR$OXyQZ'+Hpv9^ºjyw؋}~Gvf ~Tv #V!Oҳ(&E~r)u5%(``w/I>Y65[t>[-Ȇ=Uſ/GcJ08k]8GXM͠b\{`/s')/!9``j M\0lL3bOu2cj|]mwfcϜwAbcp6smo?8{x*t ʬSi>-ƅB럷k!8DRG&8O")?}ӦA&~DU>a!zQ`?x>|8y-EspS:n}zjzS ⤹MXW2 O=nx)3s+c7h|VIF3k ?ps ዂr_i?7p>S&wfZZdP7 g('7|MB摠c$n~S\]5Z4=e=saMq%§dOGLaYEf|\gq`'uǼ!_vpE΁ SOd5F$U] A8Q 1T?0E!(1X0~bceo$)n`0RX(`%wzB9'.:B>j4~Nw +9129ytd )g;z Uli]4`G_:shߍ $Δh[xs17C 1m. %?6%> 6 \2DфB  hk@C`$g"&oR ~۟GhN1pq >qBЇh׭5híkI{}/`Gv "|#l+|@gTgX׿LƙKmQ%XKTyKhѬ8lo!Z< zloWCg"ރJ)>UbE@+i٤i#U%k9qOJ%Y xTQ<"  b0V_쑦`π&E3PRi{l>5!$?ה_1n;'G%>wW&vy6Tiq|}zk^cub >>/sh^'N UGa'ĂUn#~wʜ`x[`ۿPfՏ}páO6#;.s}*2@gbkDl듈8ٕbi Ge[hD,PLT⡊۲P<ĿWF69bY zŐlY$,E$BC]taO *@aYtgQPQ%{a,)({hTq4u%b`4Κ3¢ ^ Gg\oo4c3#k4GWPa_p0Ϝ7! eI&8<1k h=n\TDVѨh_n|q1ll̹xh.6fs+)ܫ/y/ +sKg؊!FT#@|n sxhi@*V`@`Ľrvg7@lvH{w< ih|3w'=Kƺ1ঀրyMB?Y%xָl>ʞ__fE>w F[SgF.Dq">UO BxlWV?倞vhT,/;b ޾)9|8d[ٰjcv˳Kc;u 㫑ag{ GXCٳw:|ukWN] ^y4-W_NP5u8m1&(HX0ao}_@X队@{ k"K/U"E|^9UF\W84'?,}>+y_F#{tChφpc5i963 _,Ѕ!jln_-7>{g.ԙƞط' :@*NnaG  *V|ad8ykJ#ƹQģƱ%Tܫy6$yyg5n_Q5AX~X_@սnr,voU1f!~ h`_?) I7|y Sc3M Z֎=Pq&ΤΙ30Й~Ds4sΜ4 yql9OΒ9Śl'C7AAXi`_D{ Qaܚv&S+\dand a*:@Ua-o BɞX.2]hIa̋Qi ?zRzBxQL9DFADc _ 4Bt. .Xh/Oi_O4-ia[ωk%fl#{-q3Y ;w8yޓcּ'u<=#$`4  +\G 5jmݟn|j %Dg`ωePcPc3E(} +̀'D`}[@S >.K[. |+`.o8 gt_s_~IN %^ ~$筓X558@6Z _K`rk⑧%Sţ*і<_ D5"ҿ:C :tp#uK4N$BO, T3pu>dn7 P`"  |M㡚¼ n@l@g-sn}Q~̑mJ>JP!tGIa 3J|;[Wq >ĉ'(rE4 8wH4!Ŕ z!^xn )0-GG'aѬBvdDR³i!H-s--!8͵ޒo ]^ZOq_.zk6< Js~!~_u;37tGU\}/yVS =>@Ù;jCέZC D )9U(n)>*lBn;> ϣi'wligNnUlfelxY{l.g?sXO]j   Y`X]] ؄cC z߄?nn Y` D㧍v!߈(`h#>":m *h+"b*̖X_CL'1o׾v.X+5Y\k_xY*F Y78\,ˎ<낿D ;O'ߊ)=gsL$_g9&cm,7(4AMhHT ~.^>A An)V|q ?,kgB̷× HylK_q TOE,"ڍ" " )}k&u]B5vP `bnHstQƌkf}<=>^ Bs]J؏!'vSr~FZ7%f [M'{Nŕ{`/͉Ӷ5v.[X'm\7&^gZgV2A } BSn~?fQߜEśyjlCnpEgk bISpMs* yg^{ki]Ć1R^n* ̉$@tjE&0ܧqӚ7桹X8uer|=}a`.c۴{Gu-3̿+wdb$(Blvl:OGOkL~۱.;<~ӿژ9WͿ@'uxĤKۢ}݇ނ[϶h]K4(:Ǧì^q-3ſSX}i̗\'?p@ 0u\OFyM02?kqs|f|~ݭ(r)z)V|_-l i7BG# y!Cwc ߚ́ s\6Ns#;T A6Mj 7Ņ1@a!縨>~1 icAA!%7wAɩc4s"'a֝Z"5Me'!P,N7,~_6)\;C4Iz!q3C Grc$mZnæiOl[j?;aG_(S{Bi%g%>)Qr|R kQRN͚{ZX^pe>] 8<+ -Td&נXqRm/NbpKZx9&j?])_JS%F)$u> H[x58%s?G$WS4VaoKwpkq?cG;VhO11_VSo4~䆀 9\pR3bO>ΡOP6P^]{yڼYAB酇A6C|(#Jx(QMZ GGqC PDQUsb(~=Ԛ,py՜U|SƷ&:P3y@*b:6x' ɿr;qsB8{z!Iq9/[񪱪8O •@skkI9 ebxxJ&;-eA?+~㼫yBU1dY4zr{xOnv!9sO)^fO/Jo?l ˄fa œΑ#^]1ECq@M:yYW gUpNc 2'/>|c1_~'G|{&x3;92'ϕ}susG8E='S#nWCfv#Fc_9 \|(>!Vg|(@*:4Q bȈ%_#FƳΊmze}  -؟s̆bSǜ3}Op_Of9_x?ͳ3ǜbaK qO#(R*fUvkTЅ~ CH}4,>X;?H1kW(FŬIq`6h6i7k  eLQBq2"Uf+_DQ?+/6|H(Hg3{WZm5pS xgiO;+~\,`C‚XU` #DQ0ћGUnJnQʦH?Y&^) X RŚgCGwSՆ@\(s=ܟ.|WX`dR7HY,jϓH|1\sAB: IpԵ=y` g] /0&ep1/̅uF?9c72!Ξ4>j"_08{HGO='֕k +dcs0ym>3SIA/e\-V xٛΌ(=~|Ĉ}t(lU,-C-L*g#kQPJLM݉o7bz_ŭQTK W i&)? G*',6Q@z5f}l!@#/NK[6 0k`L!,(\%%"%˕":D j܊@8ndY>āC * PDOxO{G%$!t-f5-@Da 2?`= eWnIK("Ӿf@ -Dw =1^9\@f1Y"Mk 49f7C{.B}VY.!vq`i֙v){Tr+UxP6QUdq[yY܂ )fbB ^!aԘ1>s oxb \]Y=:~s[dÀ1ؠm7܏AW Kĉd[{ps~39MA5+?b=Ay4rvp<m:h ~M64dX}}jM~:Gxu{|&&& V,พ+156>ߺo 9뽋@ֱ"./!^C`ӣtbQ4EA4YR=_wɮ|S?)ۅ7O~WuD6}1cn|hX?'!ȞhFǧgbYvFخMqNXS5E}C-)FsG^`@X|L7s̅ϑb&@BB GSqlFHv57e2')g}c ?+rc$O5Þ}%w_ƷWS.͉!pLAerx30?ub&9' /: NQs2Ts:xê#{Y!`W3kw^nMd l7_:%(B)|U?G? Ph)GC H &XPkp 6~ P߶?0 Qt@V܅9PXPZ4.C0eu=H"rRL[ !" B. (yz B*(WnLdzLA]OClܯ Ƙк]&U(х=rdy>= uqLzG۽+ ?YC XǰR6_G(G[V9E=PN%Op=e沝%͕9kJK`텫hLM /^)wM9Sa5Ь&Jn@`ij;⻚Pn%:GD4c*m8ĵ>/1>Иΐ5ާ%Z_oGh I4>x/g}{8$}x/7}U`oZ{[ {Qc!={3tm `#_c6`-kڣytgͳMj(lƠo[V p0K\@ݍlgrȭwȿm9fl.s鿇Cnsa@]͸;bl.^k 37l_K8s o4i~;:7;ߓ潊=M2M#oa\B|21M}&_P?a(1(h!&|$űR7Se!%<.;<^-/ oy 9fuG)j%m@qfS!l \V MQqaq!qq>~QZܻKD$DQ], k qaWbp[6`{1ڸq|)&B ax>3¨z">vÆL9O$B?7q&PCOvG4N;g .l+9/.ƊpwsmI) Knh}I\==M}K;9-m0ū'g_A!ư]{&3؆mGe*amA֞K8[~n57a*.-Q+T<+lĽhF(̾}^z s3 πC]ʥO=Q7苃2@Q$!ID %s>,z>  7*.(8x_ | |~AM#~;?3=o?2V ˢl>8Ec UD)](s!j,t+]"g|xrrY@]%'\-()u׋(Nѷb) ;) R N֣ |^E=11*̘;zY;{a_{ )iBkZ5vg 8 ڮ ^ʖ.F@>\X") e{ٷE찂 #rW 3X۽;Ygw)Y| w(Yn7.t= iaa{BP0oܯu1s`c Mq?`(ǙESw^bJ'1œ1 +nWN˺Y?ǰY(x2Ƃef\8Wm)M3M\70c $5tβξ̀w|[O|JEg^9smv wbifaxiݢI`ɧhM98T|@qyPqejGN|Qb\9Tqn+F.;Bd|;wżoz#aϠA>tNܦ-U,Ɩ%Ú)UQNKLNf:mcV* Xtn <~{  g <;oG0E~Rkc**Zؓ uN_! YwfWE6 nUjUv|-OQuu_qk.cКX]Zk-5(l)p- B<( B0Hxb]M)15)t,8tnF| Ϊ=u~Ok<ƵxgX'f/??o&ȶ—Vm: 7$ %Bĥh9n@h}Zɚ988!rcwoma[ I 2&)x3묽D3${+ Œ?b>K~o!?ę?5jxmkQp3p;xD'ZC 58u>'|,_Fls~S{>ё`z,?yϧ~gˊMC|߃;sWu#o Gs0MXT|#A\w{ <#Ts֕q b{L1-6rSQU= 'ݫyM~+AަUA0" ]xK]"\n](WDbG-@F*3ZJ ^?7 Z2OL<{t5QDaf&Shjy&0)Bb ܧ  Q %)<@l̀AR?&B[H99œJ~9y5KEN~HNA仏"=y`NE+{`/hɍM6۾u5c+ec [p/oׂS;}Oy"B} |ZϋsA`~DVw =gn2ϋok+>7d*ıf!߆+OODŽ]9T+M','8 .K\@'񺡮>c9ބs i*ޣ~K i 1kE4(R% hxg0n*sv p\<]tq3@<PqYMFŅ4О,s9wnTcFfSo'Y+=P|^ًnf.9p&w=[ȷV )/@"Ś~{\ 4%ZkkԞFc ؅Dc3lP"p+v Dh9[yg{:c Hn'[ke}Ct#r Əi?*Я1|6׉ >/|u. }C_>IO3alY`؉u/ ~ Ey o鐌⟢RqRPOs 4 ()Z<*\-2PaK"Q;VR~$y3O)ȉfEMw󠊬wv˂dwÜ%]ȁ*BxJZ{گƒxds@N= ~Inq%b)\VOcy }ړj#kԘBÜe Xܷ8qP ,!n$JHBܨHWRSS!)uŽpp6 Kku{XМw)0?|FliwENsc_{-^ce^/K^[-60穹:?)Fj^Tϒ;<~uSuuΜ1\G(đ^0gOA42c+6KӓZ{8PBkz ?Ƶ) F1QC><;{a8hb:o|{V t[GxOƎCJ>+ =o"qD:`_q\dxL YZCAr<~y_`ėg)ك8T> O+f]7ljkغxO /78 &8مMWydpgJ\_X(?ǓKk܌sP\ gPy9׬^y 3t-gYǟ[)7_ӯ*m4ӷn\y,>%Ǻ/ p./_V@DƮB6)6auDE5J8#KU~6~%]@ +ug>kZw3=V"ij()7o$38`b u5DjGt+eDmӯl~=Oro_wBy1x\ G~k={5nike=X 4b߂?D?H#KliБ1n h끩)Sc!IlzOHgw9yq%XJ,xQ`T>w)V焹p,AT*Րo7>{<[5jqɿ _a򣺦1G- 6H;m00Fy5wٯ07GϹ~q ?t'x1N=G] ~PFt.UF NJd(q=zp {vwHf$n5^Rb\J$_( 0AX {TP}esrQPdAI"_c+䌶{i&ُEH=<)x/3QEp yŬ[aT^#>LB 1iod͛+\[-P#v [Rm]i =qVBRke~ۼ _$C1az=z1sCsu{(0< QMsՠ:]D$_XDi &N4?Ž5<47E,껺.RHaZuNl7@:OW)dXkYfۺ6P뙸8w5Ytlpӳ8ǖ6h;{yۅB7 iT.7WXʡrx?rnh/j'x 4n|6?-{ ưR1w<ėDwimfM Lv"\z`;Rf Ϧ !~瘍a;]ffaGM;k~L/T _w:hL įF Œ#' mh;묆e@~]piA~)% gCw?߷XK5zz;5@5da{Wq.ΐsaƔbSw)FԷ_&b q{]!QųGK5h"ݯ&u>î9ӆ5;SOlPo͏gS?8 ,aP2>Kk'}F3W5O:,zkYԹD=B^@zs^C}OS#C)NoCdMLtr7OS{X[ڐ /q=-ߙ FߤEo]MUo+Db0`"E $aY! @QH!3kh\/Pu\u:]Phi/%iϾoUǖa7m UPEQ{ .k۞ucG r1gvCN3ZiM7s"L+" aj9|o:"nϋ:h`W |wpί>KM/|NYn$?}bn0.x}eחCw' kmROB\XsB%-Q4F)eq?{#g[ crO4iƓ|%:pιMpeN9'FY<+Λn[}{q1ꦨ~pBN'g(y},e!7𢅁7"%ec@F6ƿX?#.s\o9`qP;dv͸kw\[`w %,;-C(Z1熋 &Հ zϓ q>/}?4tk\LSq||>>jg{S h.)1'D'Ge'&ˣ{h.ܩ8D  RD)T@+ ,^Cڂvź!z $-HÊ4Yh<>qj7)أ;[{󝭏6P2h>븧Fih.Ü8 ^:Y/xRZ ͈^b &zͭwQHwC]BHH2-:D%QvA%t׊W $%?mmIiťH'?WHWpe (x5!sT zZ:D]gѢyIY@DEaqrlpH]~ū:d*zY ~H15*5qq&np~q M{i*yE#&t~4Ybzv~ k0=Q}Ε/4jf{ok{׳5L8-$9P 7DX6 q+.||;a~i-Jng ["MM%&DZ;ĭE #b"61.㓇aOS L(r JȕZs*2L.T!Tlb!#V9Fߗ/<`#\;ẏ4gŖH$2~_-Qr&rU%VLͧܙbĻ·z`?Y;+,pW \r5^$17{/Zێ \^1~q)F9g:B4uR$0緮ߙgsqaQ^;d5Ez.6]l'' {|t |W`1>Y?=5 fbss L򼖢&nDqX!= #}a69V農=}LykpbMp5 Hkb„A(&-IVk7pmg};jP4 plͯpj{|q6^ݺ_1֍l(Ï&6B\1aOߐ`Gؗqc)S.xV"hDB~;J$(~ZQH:}W \íKuEK"E@䉂뻑XD@8 Β7C ZThRѱ* \!&X{{-URPsVl(pTɰ~9 : [E)GS6%;^΢Br?1ų_/ۺ歭{P^ρ4#[^3&s=<Qx\+ZxbE*&.Tמ} m5BO FkMVpK, ^N 1c8\r49U?Fk1 ɋ7vM@37d P4G  7OS',:w Q*;D=O!98㡹9xrs,(!yAsQO'aޢ~S/E> ߲Jp?W&OyƗ0csM= @ _6=>Lܙ<"XB_mY v P63D$Q~h(XW>ī^ˏkc8w\˚6İZY-{EnR|#&J k2į^dj EXoc{®l^74Q<[[J_(_IW^Guƒ?| _ōUN(YppKwuWB*{I\7^%trcA(ub IW!v)X+hETT!qk'eܶ\i أfM6U,!q_Z{- Hp3   BR37{E{½7㚍ףpzS&*(U\m]͗nr*̫́,*yYy@G ݳ1!vX;͑v)ѝ-ΜTqR;hcx]h0v k)J !Ni%f/{Ox kXnة5C֮]I;47_㌅]ˀE6g]q &G Q"q! W9Nq~Pw 'D^`-O\w5{Gq=̟%gO˿6},gs4_z(aM+ MɜhCqp#rģ3~YbVE*lLo!\̓p& ~5((ގr)n W^&]ȷe~E=u4䧣JZ^˜2o/ߵq|(t'%x|?=0 a"طAs_ߺȎAoSo}OBN~YL 5y=1ľ{ XlqSH1_lXa.- TZ!;wu*5 ,êgo>VOD,:$߭O,bx1V>5Oc̜ !D%Pa .ed4#&4o+)"l?n&7*Apb$ƿu2TůBW /B"(8vĿm\b^Akڿ~ a}q68ƀl 'W4>ϷI'gǙq=q6>鿻h!os_&.](ϖ/=QNvCp"P#.d4}]UC̬1аDE1 1d`{UIˉ+ FN=BI b5k`=.r泵 ;dd7Ys]CFP_BzF 9rDE\Pr;OBw *N3-\X*px1&cyuQY׍*dniT\q +(I)N..̀Y 8:k3+Dyw&6b +g+|b*;x\XymX<5L\MID)lV৖@B]"DCkZD= i_I{1w XC{AyГ 5!&z E^?d7v t|DxZq"!O߈}x|@X󁥠p//,}췸:b%afg%ݗgM%pENXn4 mܵ5LX482|IJg/ :/̕/'&:*~P_y. ʕ?\䜩"C/)o"Uߡu'3hgCg+8ϜxC&'"o|k/kX'8BP$_myQ |~5/(~"=0/|u"KRu~Ut \#^áwB3h ?y.71=aok]O l'@vs_(91|rx]M.Yż{{Kc#%/J#]Ch!>99Oe!{? '{GK>PBE$UϹ!Dj$Api%mEh.$K̮ wf!cO/zY7WyB5<̀y̛l=SeKL}\Qa`:b]~_Uqšj܈U >Ws }\'/x.ɝ5KvΥg|?YNtb} 'Q4^fas΍蹟r gr x`.eC{{3m-;/+s⟊Ll2H;)I4$-`υDLK^ HT"%rrC+ ePc\1EN úX4fmh|Ϩ-Qמ=ǚ]i @&A_bAdYE!6 w4wH7Tn}woѿ(LC/vc`#e Go{\7?^(lޮrS+4.}~>3S 6~ز~ٹr*ZP4?z=3XGƒmqɉ~:/.m0Gmvah쩃}־m~eX=lg g细m>Og,`x-!Xu*x*P)LO*8|aPaC4/B\%F Pbl] Ka3.򆸛^jd{̀i;zD5(? 3 E w1k9 yZ9g iy07{b)W>㴱sQh0iޘ˦\4_-!nE:_7~䫈N&Y+XK|S《 DqN 6[9'OݕOw*Oy3_lݫ= qK&WG5.[^M4/y:X ߋ8k8h,|={4HP;\G{{$o-3vq}%qf8nq*T@r T:O~qxl bNk`-7i]{ ?_f|[G qh"Ml\E9Q. ɆHH$&6uIMDIԆM$U%eO_' ozJ5 7 fhXA:2@2u{Ʃ}Dѐ{BC*DI&|~5\={Hc0eכf5Mfa<+}mwٺ~v5ضaGLWVPJ ܀#vqJ_,gSC հb !mBKN[k-%]4Q@ xpSuH^.XH^.:6KoN >mϷ{2jY6O3o^]o(PwY]Yr9m7,((+R.R@="*)i&,Md 66Y] :cU$gaLL1^.8ڥbх>]SCٵv͵yc;C9ܪә> a]_ sՙ 㧑qK; 6BXFAC@|0ll]C7Լ ڗ{!8J_@EӠ%7DY83 Θ3' sb.~_‡# Ća\trq{*7A1̯VGc `CFpk˫έ6b~xr#d7 :ס=!+ L-m:+u_n.~]>4)s p\ N] cg#c <B{B<{U-j<0"⨿_~1/d9P`OQ#kphFJoS]gpxσ򾶇sXwPtw7~uCR2h\̎9mh[ w.;7S9뭵ZY_S亴&5/gPW *fDDnx٥tїvx4" :%gF7b YcQs0滘'#¿qu^~ b=}";`9G>f%H>8p\|y 5Y6x_BL&7]..k_{7t)mͿWVVE~aUؖ{yā/(Eѩ@G9.±r!$SL&(XX7fO}B͝5u5 ssgS)YZ9|۶CS_$>g>oG3M_7RBgDM*ys_ٻvb%Fy4vp{sAx08aykٜ3hg& ǾGy<gT;_7 (Tqp"G@#*_cc Й䭘bd q|R—S4XG7̡4+/ho䳌3<5{gAqxԵS|GW㞵=bxˏߗߣYN3#YѱO0"vl_噹)6lE+|7g<5 #Mu”&Ma@2o}Ⱦǖ%Md<؀ (g\+q;_i۞' Pq.[OU^.Q>q~!AZK}ߣ{7~0 kΎF}O\k R(qoCL~q*/hL͈֎Z_ 4E8xId1sE&~f¥'} 5l6hd k~Cl3NvsîYqNѰyGggχ987Fq -ϧyN8c})GHw=Z B#iѷozg,ܤ|zm t5JhUDC`=.85ƵZMk7!M cq۫!U(q}_{Ad/ 7rM.Cb ƹa4-b|l krsg88z…bxg_aVlf}O"ϗR %0#~D|r"$$@8_- z99 Fq]W)P _=Dnh}4.!Q +_-g9ۍ/lsC͛7~a:|-[4&{1|^rktbf_i@FgFCBB\v1fvdaD϶SaEAE!lǾ,g-}~Fm%{Ұ"+M-h~ vKB Yn)}1f!VEF(0i&\tV>ߜ p7>mm W#N%!;9]/mcAu}nP\S2/Mh:4+"!~KesG7#{7u!DE`<_ݭZ-<j}F?ۺ jM6{_c0g3pXZ&VNCD@w@Ƹ\Ʊ]O(WAbQGv w{aB&3 (T5%kدTa 8?(:p#H &Ϋ1W٩lźXkfN@{c@% ZgSlP#)ǬK[N= cxiLƯ"yDs8gpY &G6nא's* vZ|E4uݒ3b2+2?v4~0lʺi%3G 7to^dB;ٶ6&i3u _G_2VNQp1xb|l' + ڷyMإ&y _밍𵮰|^uW˗¯ϲ_7a_ύll-竍ʹ1.W8OЁ8u^) :5zzc^JbEƇS\gP:>TjƎ~n6c3ی_q./xVVyl٘\V~\l;y}{p݄єH~:#Kq 7iePG0}?(ir;Mb)-N_Uy/Xk=xu  =! ퟆMʑ4LnnMWݢ) ᮚ>~ {7aT (XSp H+RН% m`HpCh&sc6ic9\C׀W{wg]!s.#dl7Nc&t8A_g148F `meoۖi؀%QD.$7#'u P-Z $jo4J ,Wd,k0gh8883Y6gŗjN:RM W0X~?~=Dp3ńq4%&خSLF\Bs2vhJnFl?,|oWcs&Rb|oCq32Fm6y&{h^x%Jű}Jfϑȴ-^u'z0ϝ _Aeóx${ jxgѲg`+ d}ey\y&ۖ g -/`߽@q1T(S8SDSXS`=Ak㜉)̺AS4 _3}2N'/IDATw4ƫ9s*Q|5R|6rGrTXܰ͂aNh̳ +m 3BŗCwd`&gb;ݗy5h}`4 ( jKl^Xey!(2YTjoXsi,ZgK[L1X<4q!?bGd\}85bQbl/4+Ve񊼜9xdb)4UUS"Ge˳/.g ʧC ـ_U`X8\:wlԹq'W5g_.+/i |F4-rcؾWT[UWd>J {-hۢ]?vbWlU{,۳iaO!iAo]7NYn=L=A$u+9˵ Qp0 Ɓ5bRP7P)U;[ޟ 7PQE zŘh|{@BN}91 ,D'\l"BI3 l1WN[j'NA )0 .xEETal$v||߃}ъ :cval%Μ$MPũŃrIP|E8/ pZ:5|nw90\(*6U|gk]g%p4m&ZUsqHF*/:91h hJ& _¯XW5E mGlI2&)NؙIIQ+`wlꘔq \p[ U(D1l|W\P,2 d\qR'~[nCoh=w:Z'yV1"VC@pVWai?=sŻǣMWUE N$Hٔ2 h@s4u4ϙf@,t>s]3ySgpt>8 <7>پPH_tz"Q~RÙűfqG:7QȱWq|Sl837;_fљ<8!@㿃%q4?w? kL_sż˵X'띄T"縞Pvyt=s5,kjcXC1Vg̰c|9s=c^۰O̶u*YWφLyT#FMbY@ o9D"I@4![k( ހ ԙb  c곊`xNnZXut]%덀Y#֭Ĺݧ]ƙ'qZd{p>08Ȟ]4߲6/őyKynp_L\kꬎ8^TgkҸp=-[*b_Dۓ#9Aa?(Eoه@p+CXD,WŠqu rM'6X0"#$Rf.^joWqN)46^?o[z_Kׅ1_#bӺkN!mb~L蜰@KYfq #U0A0ڌy>r$.Wb-t,Uкn Q|Qy{ىn#wQU faS4|4}bXGg4~Stt_Z{0YiLn+86bJ `SpsucIy@SMg BKsx1zVSzÈ]=nA<-u`/bΟ^vw >+P\E8b蜪8یYp|:<bR* kTd^ÿAEύ*RA,|wWETxr?\Bi9XkG g9|Бu sF9n i2i2>8bb '5M$z݄o/8qo6ORm<3r }) rFvafnw#ϹwA5| 8SG:fIeg$/O?In…$A!6Kߖ(( *7>*ysJck<>żrpljy Ɏ3pLw y*P0鼜H9mvl y>viEg{"ӞX 1Edܿ2::W|O 8;Y^톀⚄s&9BL 'zomu~p#qx6;^cՐJI|% ⥛?pӹw-U!-V|x4CNx殊BupVq`4Xq>UGCh~&48{Pg17pc6e=^SJ̣q=wi%~ bkg8Sr O%Y8 IHV`.$²a ]6EmiYWa_{b<{a3:F/Qr@`~5"΃bu3LJqݾc#Ųp¼7vZt^]4~7u:_^IP k%s(lXYʌ'y^:C.ɨxp"^[!W2sf]22[I,G\VfԜ__d6t`5ձ~M{Agjepf ]5Yw{nWN\\+pN|&RqhH)".ElF˛c|1ظ'%j=n  '[7tGAQLAJyhKD6#Pd^u*"PqȲ_d)OFE&b !q6D3%6|3DPZ8 k#{g`̆\6L N" f$BGQbys<3:'vgxatϜ) p9*g@w~ ƨ iAE@.1sm^N2U |W#kTYD^u\WIl<}Ik`C7@65`9 hj7й:q "Υ!¯l>[ xΖ_l9S[ꊴӁSU/"2v9ǹvX"qWs\9C_K4$$~Hxu>%t;>q̣g֕ >w>c bx)6Ϸ̫4ö#)?5~7ᖛsz7cFlqyꍩ8xL걊=Seb;Yپ:& ǙLg7dlkpo ~#AS\fS?Q\Ѽ]63GZ"7t֙΍$'_nTgw\|.(TJEh@Κk v;*Xb0g)"*ƃ\~ ?p]2|EߊkMy DfNtx%>cn  ~M4K;.Aڳ {< U|1tn÷h؂HJ^D1@DQMQAQ"Z T^kh`P+2yygTᠢy]8B,%*dNCBv] ‰  x^닽W(vr79Ezg,Wׂ/<";f:-$ UuWP<_.ƽ$`еW>į+5G9p1+]C*B^ z ߳_εocynŜתXYų3OcaG%/(J\SRP?.l'@t.M2l 'xmw~S y|_dN/+s>فs_O3p.v^Gt_81b%c8.q_=ʶK{b[ "cDK>χgbNO *ZcMǰmvbMc.k{=naP1e4O:y.xX4⃛D:kSS.5uZ=>+إl#p]?%h]p_spOw83q>켞s[;(P\[Di4ҋQ\&v?.SB:`<.Tm1B~BM86Zˇ,AHQѸ,ୢu'R}M܃! ]x/zG9fi|kuuUmڊUpNW?q{֡qaNʑzx_= 2;w(_\G>!P0ιNf^ր`mh#<*~7/w2ğc|̇BC!t`/c;Y|Vs^[fnaGs4r-[G"\ ^,+SP CA! \!R]BR;z"!E*VA<33$JO{*)OuA b'7o!'h#x-p|Ay@@($[tr^瓡 =@̑{8S8X'gv{bW Ej XK >(`)) uWS`Rl/_vq u  <>{8d8C!˽(E@6]d $+$嚯yMbG:_ރ ly^fO5/I84(WXfO4Uk{ؐaǥ )i)*FIg4w96՜=5y? ;s _,4kdMg+a쩄A/o͓Thɯ, jx?FqOG^ߎV!?u|N [QtJܟe(1o#7.qyf{'S k*g7A|M^UL_33esϷtwu%Lޙ1'@ :t~.:GO./GbO*nXBgdk9P 9_Ͻڧ'γγαX1kbߊSfH?ن-֗eYKm{O]_5?sa8q/ؾ^l,?g|>V457?a7#Sɚc DI'y6XƋzè9ԈknG^d dQhO)>])jמO 5A=C~.D=׬Ցslq? mŽ t].eQtg]g|Dr רy!s羶^cpx9xsmQ3%>uث]H[E}?u|A#bN8?:c?P̫z~_sgb(M:XS]1{̵ hpHk4w73ėjbҌ';Wf`}}DD = U ٱ:*I"Al9g~ŭoFvDۑICE"@Ȅӵjv}-^' M&;bSk"sHb, US9|eBx?BgȣȔxR؃ " %* &E"f&f@ zSRKgk`<p%&EXD:=PjN>sZ`:кNaXAY^ HP81 ۋ Z7+ c Uyyv䏝|4(>e%HN=N>i3GǨ曣?U)Q> gV煰yfI]4v#Uo_WqXϸ"Ai?߬m?@cT9k_uOGkN?yyO0 |H03)Tl|E!~g8Q}KSg9\Ոe e8Kq-w?q؆-ϰqL闌[l::teX49a.9LA{Y1D48O h.>^sM ;|g786a943k.3K |HElsm3Vi̚%ZcZyrc9qX@ @+=fWm3|Usf|U<َQGl fS>9Օ\ups MM BtnGvܱb͵ƴ!Ig:pN |̼Blq&ί: 獗#+ȟF ՝Wg;ybb%O1%ֱ8Bl3OGe׹~/Qݗss.}mrɻ+YĦ-&M\!:4 W\C8g|~_:2H$P%DsD6iȁߥ *'+AE(ȟ b- E#I!0R]D2H A0S `zB%ι&ΚמLl}tI.$, ESGeE)ƥ_ 8b@Jc@]_K4 X\k~?B1Ь9Z!^]5pﴆH!p :![keLwbW3- tD0 {ϗc$i- r_L,[b}.εn':}.Z5@.au~ڏm}>%D6r Yb!w+2$V"?Oaw1+`3X'{aO+#BgbƎ;q) o\HR hYpp>^F@ 9% %;_Ey0Ē@0oZ>@ETQ%Zi|JizZ+/Ek g?}܈O x ]'}F(WJ÷ۇ:3*Y 4_ќ  }J6Ѳ?!o;(,Lv߰&ƴ-8jk^Fσl(򤽁}L`_4Q W]JxlϹhjK5S##M!E6ͭ(.] M 5{.ْqÍ2~ěY;*JDu_#V<޼?"yY[kj ~D-(aP1:{6#g1xQy썚hEbo)˙s4wko48cڬ~j:]ͩW\Xk~ wGMOuZqHLunY&G29?9]r{kj,xs4Vx'{H/es#1o3;e -AMg ^:g!G##kZ|Ô:ƛg6vq|>qب'bo9.ūSKƋ|qY3+ސ;I7Mp>.{^t,Lݸ[d8]d8MIT z'`(B B/oB)$_f(Y@sȓ" #V7i<:k4IszzK^1mYN$D8$KbvN Y*` @:s$>xq xrg.$1)I],B] sꏀ}x}OB 3@SbdaP@ۇpXpb{ )P#U_AP{]kfchmA!UL!ḻ-6 Ҕ9 JK>KgEC'ܯF3|udȱ*E՜'yYFE a.`Mi_66 Ov25++>mb{޳^Ə/F{swdiA!qŁz/<ec GfU5g[{_?HWx{g}Jq#_L,~8r2HѸz=OxRߣbsO$-EĖA։ookZ5uKi]s66(x,i.gex\/EEF3-hkr l1Jas4|}ֱ5ڗ l(WqG$p2-D Gw1c BŪBF_!@_y:#UCsM`|Va{ bMĮK~9r Z( ox#9[٨ȵ #&-ш3UFњ5@Ǩ[:ZͰ6ks-~D_sBS79cy& 'O&!{,rG2WIS>"śFh ᕈ_su#]pz%D87=SOO 9qtՊ,1G\H:*.dInq׆u?o< #Ϲ)PO(\w6h]e[Fcu3_GŅϓ/[,OhB9(UtCZ4}ޜs;׵Z Fl%,C_֥YB_mkυ)fh4:D7Z kC0Ś9kC)xZd|w^'z.߰󕜱.g)!X vA!FZcTTq3 &W: ~vb`e,wHtO_'+!gR\(^hPHQPmu.m=S\J*)|eO\17f1},bRظ}dۤ8//17hY^7 m=v;M3᳸|x:kmu{t>7e&Ux8ODP  ;6P߱O K?$b 'qVqJᬽ-b7Oس|z7 c?'fdl ػEdgu\s P٘GS`7svx W@:2ޯ_Eh>/+_3xD?},sک̸m9;Y/8C 7uG< O6(9/dakfGZMzzbEx8+^W o`O8kDmwHj=+awɑ5j `m>g'6aڣE99K$'F,G}sM"qSO ;8))p!Ĭ bMWclivjbKśɤIF)tUw~HMWCkX}za4<}f_󮸦)~6^u#xؠ&f{ 8BMHKuL…">}'Ry8|vz=w}:vk<&$q4ˀg'`It]8)&8IĤ$=$̀())b~'[Fc*( bZK\ʿm]"b^#}-bS Q:U<(ЉUDDE(@,bȈ&3G`*D)(˜5S(d:YRD|˄V{1ǧ*(3clk7"qO9 7G{cž' /0Ι1+'SS9k}y޿",Ō1^B/gޱ;wĀG+N 6_ '7{97 ?w РMxZ<vxZ15m6*[7ޒ#u+E54n\|FNM33Yˑbgl`4&vdg7>dgT9O:Wp~7o+nV:9frc u<>525sժ ?_qsΊǜ#_TՠkDc+ +Fw 6^]g2B:I > ];"b,70Fä:d zjnS>#8 G%tNչsn2E^IUih"<= |\[g(8T8M^Dgk#VWvfX%EC  B|2tv@ivqƚ#!&@$k3mOM%FIxxCFq{9΃83g3ݫ81~^sΣ#!9pVrƒ3lqq%>Ѯ{%`+О?|#"۽$tYF}om_o\Zx'k#T00v&a[H[p. _T PQ=|Ĉĭ_@63Gę Y@!ub,χPkyv5 *EfmXoϾ~<\ؑF,D27U?F\"hߦpDU~>Xg'6YFfc湊e#- 9ףB^'#O4"8}/|Eġ9|1Mq&-P9G}/oGĵýhX44^q5 m*ns_b1 B}ƶqXq}]˦'>b6/bF,LJJPwLyB]QTs\3 q_|n^#_D_K;aoF!|~Y@* iba&9'>g3t8}Sa>_\1hGzf4K9<]Mή|]Z7k̼oK)?dbɹ+rBm1}:z ?g;-46k(!0K ~@(Q$TN`"\P9H+6H]=[xaYTҒ`$+jN%P2 N7O+ 3,TDśs,($z1D3I\$!sD>H9擊*~Dͅ=*!Avp:AQip*"I^RӰ DP^`Oa)CH KP,pā]>`[?+? @)aV>QH6Fb$ד<0H=>;lm,d?li'XHUl%:Y3Cd( $H. \s(L󂸷#~4E4@7~.O\H+c|2|} qï<0͙k& >~/Wmm ȱ\8v |~+ _Sn׆@~VBY _279?e$G'!#_ieJB/6)7岎]yeߴtyFuf'. e|$܌71-D6e7 _]q4)[rӠ ߻O/6t? X\_ƀgm_J- yk-q0j q,_ĪOPN~N!.q^S\VHQ "9I@4bOŜY9k*8,-!~ѡ Qe@sb|cm+uGߪ&@郳<@39_QD'cFY4UOL~}.>-_g!yX|TrhոuƧ97ZjZrXׯΗʯ/ɑG<sy9mRc6qN9vƪk\s#F.J ᇉgM~U>e? _"D3dC+|a(DnlɈ$D+/*x]sϩ"rk}F_DRp@-ⷴka [7'YQ- U$Bivkt>D]n }ws0lVK,Fa$sQD yGUfAIDԑX ڹɵ $ %n* OS>G,3uϙ*Pfƃ}x<'Kܟx"CSL! I_+~W (\,- L x)(6*0Gη\< NTswM!xiP47/HU$/1N .6`5OY>B rU0_G~uZHpSX3H4̐(F+Jb⟘ccCE<Ҥ| ^`Uhx s |+]CAO)=ȿOQH}\EY~U>⦲lh?c41Y (nF];|cj 183 }6r;򳆏|V VYc^_I|-_=Uxc) ;M*uGTRo#}:/cQkT]|乹,!C4%hXLÿgdq1>SCGV r ׵DœMfɿʍ͍yV#/݉'KN5]6fk Vcp#_B{cۡl@< |3E)owoh~nxnR~;[W|[G'Ҟ'Rs0)w+&""wwt>? pN:ᷴˡYZ6 ͌) ^52d5kEŻE)X7w;`Y1Q&u1ltN$ PEOF'<!A`#p X+ 0 0J{+pkv7__*HOTP8F '[ hqo\j@>}/ΓwKԘQۺX#I=`c0d3րFK&@p O"QDP8EŮs% t!d`h"D9fk'y“Jb>߫AAXc۫|>t~Ų||b3~q>^E> 4kϓ>GY*.Q}ؗ˙s?efHsW54v4>{NB T)g{$Xz?f.| *wT8Ky' sFAqo/”KZ>q]%f Ob ;>['uVh^;6ypVQ{d6ωUuϓ+q55pqb.q~̥nF܋q4 ]l6koحbslұ2"Q&4h""lQ8{#3KczXևFÀ k W7h@O5c[T 4OU!ĈGSUhK9bgT3t6&7gZh%V'Tmƫ>;?[1wie af٨04>rEN|!ۨ_書|/qfM ,gǂK־ۀ%_;g3o+DD!}#'3_?3?[vClpľ"\ADwn+Qg+`&B"2ORwA/.Dh.b_ {E׊M%ohFg~qqy؍\f[GoC P4Zz 6X{ey8/vuƐR DM(whHB$j!`S~%|wgEE4OyOUp?NҸHWi60XM!pM qdls$XM b n@{\Bk7z r´+IJ:Q @|L@gWT<ũ_~qT%mb*fϹ^D-P"$ ̙<8aml?N>fn (]?|'B"DHD;GE=.d]c>i.,(UC/n9=~"Zag Fa46(  Y?cW&P`5GE!4=s[%ka[tUq{$g`$7п_߷;]k| ʃS*/VnEyM ٪iVYƢdEbC '5kK6r1(Jr9E[`?fz  !g 8j $/ֹt葢fơrM%`}lfeqt%mw!a#Zcyȸ'E)OOW=Ɣ< OA (QxHφc0$8O h+xd>k>Y%~Ba ym{0Ϩ<5(B2Jz3 \cs vPoؕ8]:R D/[k7EŜf@1pCCMv}7m[v==lmxs}G 4 { PǾ(8(v's)V8g]w ee ؜Y]wo_}VbbF~֮qRqAc>\+.|[aֻ$m\C5>;dpb/* Qk2U<ı{l]{kXȖ(.\`h{vsuo콠]η HOG \F\BiQσ)BpHD~tVr$9*_9WҐ Xµĕ{s]ϊQicB 9)[Żi.@V3G.%g爞d !~ Hqq}C6aIAyc~VbhD*܀#V3J𘓣F8OA#E7quG&!Fm1fvN3i$řqrex@Ft%ӽD H46*2 Dij|R`_s|w*ɞ"Av=$Z?$W=NNPbXC $cɜk@=…Ȓ=M{` M{-ۍԙ49=e!0Wyg`->DWׯ43^@u^יk~/@ɛg6{s'b^W׬9nm=ck}]=5n ^ߜ^B_NE+͓%O![E ?G(( f7b'6jGT<[G]al0%װSg{>#s^W\ƀrXW=0^o KA:k>M%,O!?>y:0֚\}i56A ȏ-.Nez#y3 y0gKragkH t ͧʋ )o@s.\AM1fy_{$_% )FЬ$N8!Rd(E;oy8rsr+x#}scԘaW!þıjOX{3Hz{>5}##f:dIf*zX1(]pP|*NmՀx=%^r_ԔTS/}0db'C='pqpnI~5}=9_ %{} ?OGo/ IHn5@}A,(?D|a6.̷/$3h: G~ؠWTS>͉DܯpU>v8tw>P|j >Դ^呙ЏN ᦭dGl7h}K䁳Us@>im^iqc418Z8ZasHZ܇(* :>* `p@~H;v H adg ``ߎ ۡY^?_Řgi+{b ;lK²u28S`y+ga:*=0'BDDd 6BBu0|[<]<]A{w^`>U) |N+谆$,GKJ*,^:jOqxi =4Z,$m(]8Ʉ$ Gxr{1J X~MvvρZƘ1Gan u]a6Ns9/um1y}cܚyF0g7{[T<pRA)|6$Փ'H(O<mqqGT9&?v*Z8wl%Z|H߀}81P x|gz'm"ސ3E̡.噣ވ;ړKqGv ¯2+ބ*/_^9g̘`~lX'{ybcs?::(&;N+~;ΫpO@6BR`)rSR8w!Ļ87>n^P뵘?;x5#_yx=|g=TlG 8vb#+NOa]bs{bnq !DObxwM: ѻ|G"~#[[?ʁZQ{wQk퇆8{x f!9nFU hL[#@߀r~b@4#k4\[oĥ _R /"|uVǸF)C6=:|C^=C3!3~Z+6cu7gkU{_C8$?_㏹ũdSpE9Eb3lX'pd,BD@$@g⼉M|M>78C1>oyG]*yDV$Qvk|}OX6Q W "S8chnP$Q~D1QL?pEy *sP\_\K<~:Nܥu.>^C9f !p2"ؿM0 <1"{Mwl'ufGY3j^q>: Y k^?)sv}x^Ge}*X=qC->C =Ck'W`2UkOĒ/i>\nN6{z{(ړ|5k$ 5XJU}o?̽>~4/17>T~S>K:9;qA8_Wg&vMz=DFzVqfMT#8R7_b=v~I7>on'Pgk'bb/Wݿl~Hvp-}Μx>Ŷ2QSdLv'P'u -h3X!֎F? cBAEt*~S$Z B@=EYC1 j>O6X/{ hdqdbQ$@AR!|31I8;Α1gKH:ă +zv44u$P:O@cA﹖{O8xYsc럓[Jk52h'/~J;5@r08f@?D@9oM.f;Q YGu ?G.+jeo {x)kZ־K{7gqM^7kBD]?;2ľ@ R+xpʱ\3\<#LZ`Obâ?b֘ed)^$%{g\+nzny:=3.-*+sƩQ | Qox!9_rk["k-n\;1qP֡8N]_ȭc/za/짠q5>{\ @'99Əam]q/aw!akjxSCp*Q1=j9Q6)8?O{ڨjMq8 6#|f ˆcq^a 5>=1Pm8n4XH^<1'?gp\=Sh<'u|ɬvWĬk ` އr~zï~|Xĺ}ahsmkCwFuPY McC˄c傎ꁙiuMFY'nA ݐ^Yk(b+CBضs&^8A[y~9$Z#`̌3y_N#?<@}8#w RSYg9g>쐶({+QLX*{eĆ3dlCAuӁYI" bxEW2+fY+ P#WjVOLws*;Q9hÑ΂ z] pЁVbgr3/G6DeQ6sLŖw{k>&Yc= jiu8f `k7P1@\2QsFMl\Ld#fTHJsƅ]C"#gT1.:u,[U%i8&eǢ%j6F L|œ #>}Cc1^>scU!@0X[4g ˾Qvt@: eG ߷ ڬ^+(HU"Blr_1)?u[zjo/VƂ9a48{, 7جZgOc9Ps@g\Mt ht?Y9 -nUvA!:`$$:|i .=XMΜ6s!w h7fPgQkl@6.K, j :ز' $=׋H'UavS~Tv&0Lkn+&O;(JJ9XIȎRqeOɓȌŇbS1j%~,SO| ޿s,џ6 kaDXd)~o&@)|=bSE%.!/d1eq/+qќuCq W4{M{Oũ*^G lð]{ɵ uR=)3ֻh͂uؗS#qXUZ$s1 QcP :%< :󩆉:f@g6'kROSx}s{ Q BgW?nn3n ]έd7]Ʊ sv>t~TO) t\O섽aGmg{kVMsz~APSXXc6 lk%=@NVΫw;m jWu4`e k?kܜhk9k]S1հq6oP/TV-3RSֶD1eܳ }$zبW'#]QPF\UL)B*]:|Mwu~kqu?1-bg沈mX85@ⳬ _H ҈LJSP H!94G6"qXd7}Xw|BiI 皗@d'DrI+i85+!]IDn@ j@I7x"k"صؒh5xx&yG!IN2[!ȃW,FC076B;0)&ÖHꙨss$|bih ĎӆnA7ed (s@T&DtCd4}q[M"EZ"`- ŸcsMd i{"8VMDxAvzR `Ĩ !`Ϊ#v <߁!'D~o j̛k똛y>&Mi;gax˜Η (A7En [6,)311L,rhFeݣyDP&Br kH¶$7U!bN̸jAn]?.N`P ֝SKglf|V#85;9fo~fX$3nKWqvfz s$'+R!a<Ҽ[wG)'3 _oo6bĆQ#O-0OwoW~782ntC*ͧmhlj[zY?66K:&`퐱1ZvW~pD4 M.c3g966)Ym3jҵ[֕iyls=M8 7 |KtUWtg@ŻP~漈>Ǽ0O;~d`'pAN $}w .lY\@5%KtOHsp~f4젮7 07ټ֨yn A :7j%]a%O%HZ s$BHBk)JDx,$JLOr'Y%Ob"AMNU|NPsJ|~Qs6d%m?߹| p wItȲBi]ÞزY~a/X64f @[P['#yGMh`_m x5O\an M8l.42rk?+O9]d< Ek>;&Qn7 3ܩiH[ks\&Aks@DwcxuIɟ}mLÉGj#y4 j@Tɱx`@T;'c:6yM0q|dWxҟ-5oؿql>i#^=cj@kW֨ɛL(nDXv|)@Nawٙ}|$ ,{ 2x3PIAT͗iQC%X6|GO LXLn̓wݽ{gHp "A찃Iٵ;PMu PH9$ۉҨQgz1V]W75JT ؽ|`'~=.ޚ;}ݛ ] O;K :j]܍O \wrHK*VԤ-esǠ@iԚTkymcU٨M\sBEX{SswuszT;'ϲck = Yd;7ߘ 6F'/3wVp6ǞW~|~D 9NǼk18u.m/@m6LT?Us. ?s3~5Q9(?R I)2tPT [a%3Y7b yn@s!b*r2j[y3vB*(NF-@GwPpns&͐-wU"Hqf+EBc!p!X+y\Y@e9Be!|_8E{*^>z(hY6DsiZv)ΊW5' :bvūc[?eXUe3fB6oϻ1x9jլ߽7Vc54/SyoB7|.Ak^䠹^󪱉KevrԻ~JE5>'UȋŹVG5n*|T 9s眣!;D/⚹rZ5p kb߰u5iC;oWgCZYg9`G5sԨ1E5mߵ1Qݟz zgMExi?:^sT_I_8P16}*z̚;b Ʃe|o(WK11c?mE5:hF63nl|jy.1Sq-ɛ֥\ɚ$ڦUg:ģخCUTW >Gk9UAwæcGpka`QO-s:|%VCaG!tv,0ώg\WsqaSBQcCnN6?{a M~\8><=wjˆ Օ_^ܬAʯ`iGrP~UW}MXX?͂=O.o@IwSӍǃu Dc\}*)ly`8c@P? rJĚLMHȆp'.E_x9pwAŹ'c @> E S#x;P+q]© AC`A8I$NV'ٕm˾ޭ'JL ]#~]Ծm7}A6]nYZ?6*7+*̆j6UX zM}lOx`lQ* .kK#.;p;AAY$6⋼prd ?7J\1/ MlvZg>6c=7VK9ȱBGwHDy:׿Oyxk ڄRZg`rQ\$w8fևPѓ&v7mh>Enf6 >?\Z  sф4G=i~rMM~|NmzӼyq>\_4J|PԌ{;)i`Oʥ䭅lqMN<qݙC3>i?)9}n ª9]?1XM a;qbm<<{3(?s6(]~KT򖗕jZ8XsY0/n H/5@\y37> +*yrzRFW -mSiИG?98ȜŽ3.~sCGY2'>Z9(RO>8cgha43m.4N<sADfp6{.k~h?x!'q1It= 4(vx;u8!)e`$_r^{ΡZz ݜj: 7VZ돵n9HCk l\8bmZsy}gWUw6?dyRYbs*AQE_p;kޛ `fM"q6d].O>cSkTpt޵2}c[ܳCb{/E[Zg}5g3уYh fl~ȗCh=`t>[t=Fyk}~ꨄ$ᄆ^):c5t혋5+Eln)F洉^^ӯ͓ M9pyFR`OZMy;yԓ,8s8"9nwUO+Xޘ eW5_F1-mހZ&ncX6Jp=q/)8G^9G+~*_l3ٝSߣ{wn^vƘq hpZ1وF<k^q7AiN_]&7zp\?y~uNi]DK=B?*+C+?c0򾗾[`1e$>oQmPde0kp2 _C$2 {Eq³ȷ`Ls-ܒmIwפ[DaXuL PWtA`Tfؠp<%k tZT 0J@91IN (cWڜrPqp$3%5us`ND \:!6Eb% ElHDKDAW ~]a",ŧc4mUv ;Fm &m"N]Ϳ^-aRq8R:5(\#5/yU9[-W4y'IƹګɱOb8|5Ps\HH}qo_.3l/e|_S"F7/jN7KL4%|kDa-vGnq,>Q՜iB5C6A".~ D A7[M.z$Nn6܌둛nTyUcI68Gx<8Uk]o|O!䓰3/{'c_l]]-eql 1^8(nE9kt\F] 3ga~>b_q;U{^5ǻn- L;dU.jmZSk*)}S3e+o7ؗ~L64WFd 8̘l2.t$ߔO/sqJGl:fOt<㼬t9pl*+Z^)_O7_'4당 ߾I_d})GSc_o7::kCMTq _ttvI;g~;NY+_mm o^~o&S׵*24_ 5rh V۾r3{gj8v#W^4qB.b^qc͚T xe|9ƱZ"1W6_Jq1IG<q#ִ!RzG~Mc>5EWgF>$ lK"!CU0"Yl (XGPFlc2 Bxױ磂 rE8i {d6^GK\& *PZd"p\lvߤ;O-@Ųr9&*{ҵݝh$DbAh48)"[t ]y IP)]`b!/CV-"Ph$lbൊt|OS)l(fMV!]vhk`mFK֗巴?lwږa;ͰW_ۊyL\:FZ:ձD|Yp)n_+x%AspEKhOPm.+-rpy4q? =ZCH;)îj~O)+w[dnuұq-A<"=:]q#M];~CTq|1JmҎF7yp@Ϲ+\z.vfg줝88KD}S ܔ\uI4?xlȞę)i1oih9#B],.*tDsAVs7_8{q^fEk5yj5o3}`>Ʒ_[nu5|/\P,5;v#6b3(ұ "MIʳޤ&;098߹Sq h^&Yi<"w؀|k_qKu'pZO\7\[d]]BofW*nӌW+7-ub/Ǭcu ߧ>Fx$~.b{/(`j-; .muϭEhp*(Q \Q Qn!Uw9Lzӡ'' kDm'%́xq.;I`$EEIA!@UD.dGI`r g ~gGב\/ɧ˿k/-W\\\LnQpt8|._߅_K%&$ Xkf}f*:QwogAS<'4Vp~lc=- >mծwjdKòZtb.ZiA|\1(ϝۙ3+ʵ̽?^o2v`$֩75GZC@\V#Yyt{ivq//m^Z;xuv;ԃ酎C_? Ŧ Pei# <+.RLhQ8O%7U*栎;@y^}[ :&q0c΃K7saNu\F<iBvr?b8W5#*^fPuҚzqxq{sVbrdzcԦBhbycz݊W*1h\e/:_x1>V8qb`6IٱTp׮3Q B킚"Sp]$B3ε.LdGŒ9.P+!,rbO,c,|:&pMjP?@:%$kDi)>CA,i0I& XpB|֭HufmZ!D 0 /m4%zLI|e6+@56`H̛"qwHwB-o7EBk $KŰD7授3Nv (xČqv\j{b\?-bNq@1UcxEUb+#iTK nͲ\5kBߙQ7Pls6Wvx`b, _C?3Z߷8& |F #ۣU r:9"]Hp&~Oś!T~%'spT#o0}fmp?$G O0608dr|p1֟W1y UWd6k W4]ª pGĩ^ķr:*^8 s_^KKQG-ܩōi@]9y ݰw `3re#˔cw>F1-s~kyj[A̝O[iSlhԢ Όs}ע0Mg`#vXM@ϕ'79{ W ?*1`[-zL7r۵A`-m]/#NOŨbqk+OԧuWY@̑ktcjsj,85?' Tffh{:XpuЋ/==ݝ|`_1g*>vx"Ƅ9b[~zjO9zƺֵ|qoɇ/dLl&I_G)(D%G& jYY &f(bj|1SX_ bf+3 a8xMpM$!7Bp.^ʱ:> obDDO(akR$ %Cؤ: 3 ,DI7m)`Q6@DLr+b@xYrU@wur!aD#%zAs &aV P Z-ϊ=^a4}1v<)F#X$o T˷at_6oye7*R81TKct1FauK1 m5}mw]S1J ]Y j(w>!OPN!>!f *WC`k}u!kx=f'c󽍀xYͿX[3p#R3Ƹ's>=_alN6?E\SU׈zF\FvI:5L4ml*j-rZ5~ZAMxn>ox@|\.>0HxWCꧪExq򾾏G9ܫ{ly͒y(mAց&?lsSd%4Al%:{ϙj ^/k f Lliq(ܙ6(Me;ޒUSnuy}􎛇ȇN?y9497lxo̵ w<5'#N \m7sHYom\z\^djh[=_z}ڤܪ6KVK5Msa11 hc㊫Z|85]%8yoM|ؚ? vpW91jgtԞ>Z19NX5b/j<ע59߀!ڮjA׶i,۵-)t<?F8|;?^h~7^lӞ}s=gOŸ/l^gO\Ȇ23#8T%+@VE"IA&E$ +EAqWQ֣[Q)3 -WU$/r6)f2"ȋ9);+h[N֙#{vNjBוNѓ, z![[sZk:(XlN~ķQ"xL ^,yKNR ?ْXulssSMW Vj3lWbi̝D7_}N 0ia q63֎psӿ!DYb7l A#D/J.Q;6;vc,6p='r.5 ]zN勽/QƟŏV#ݼ6m‚Ưc9c5?ͷkn Tհ856B4"i\ ~v~f19U nk*f ~Tsvz`~U f֓ZQYĞ^;1IӋA S, 6}zTq;r~ |o\B ;@~,|6k1>X4%$zJGF[r-pg;x&Cp)_[b$bV'y1gYw {y4{\iMN_QX_>)y1%%q&'ȭF6370cTp 8ng"_g#A~=^]||vujj7S}-NsYį5 kBqE;bSMɵqǘxῺ3X }P]eQ j{Ssu8 7~}19qdЊ-_ +sqxn4Gub~OxP=btikjw17X/xrc|˵XW&N0j7or\yg_g 8g)~owh1I9ywsZuM|m >~ȧ9+'\[b~4IՕTF_?eIùiu嚗}kk]oħ63ɻOn![\5S'~ Í~6K6곿qĺ{ Fp984ǫi?oo>pyEMT`e3`];bE|6bQ#y qH. U 1#T!]=Ṛ|{!^,ĊHdŌN7Z&+@tEv/y6Hb5nKB"|]Ucқ'mԆNX%}'o4a 3Л&3N@Ac Io H<a ?qq# آP`\HEP ,(h=6M)1czt~c>5MMMF*-4b׹苩FQ0YkLIb@:ވvKNߨ<ͳzyO?ǚR,r8 {3[4Gٔ[ bM&V7)暅ׯ{}5o^\霫bq}̳6Rl=A-"AlxTLw @D Jc|ƹb| rlg{Vi89VMA\|6sNv*Xsk}5Gx`0Q/еkݖ`n(Jnw /6 xqӜs9*I֚R&¹>>s?7j3h['_Z5{m.pc5 Eɰ밽{߻έpޣRk KGms&jSGܞ.aJӉ\aH^^r"9J~ڪburNrUՆUoh `n$Sh+rpUo>s=<1?H4o8~z9=اPǿ!Mn$c{DO>ObצyB '(i9,uN@gU\% i@]GFty'|/c:aٍXcm&l+$z !l/O'Sk~%W޽@awl ]\f?$$o $j_h"(Ax ITGrTב$<82BK~>|:'ƐxpDS_s M8nQxDd.n]$8 &0$͘ 8Eƺ[Rd3fC8f[x(fkc5D~dj_)Q1a__KL;|TM 6ŚB⩢L ͂joXqNPp ]v=C Ȟ*ێ:usK?7ݍAL'68^ \ϱ^mSvzX1Di%`Z<\YVxuB9<6kFcdcw#qfsi{5ڛnKl܇/_8'#gw4@\̟*şO1=E(+> ّԹ;Qh"cl]qҚb~ס/rfȗBFs|`b\1~17'a17k.yε^_MVD܄d܏M2}%Y QR+iKXcHPآHdc\= 8ƢV[%jhw0-"N"ÿc@{D)908!α ]Vj-[ & <n4,$hE7h$&N,)Tp(nDlDM"% oLD"F|+خ()*݈ w!*c}߅BC(^J \^",ơcɗ*hs\Oq HY# 5 7æAGmθW.n7m!.oT JEI3lqŷqQL+o3wuQs@L\!:}Sob|֩5?s3jnf;;|U<{l$o&y<^7\:Pcv-'؀z\A5<wQ}ZknBmq9=[5Mu!#o/ B4 YǶG}׬ZY.w>pycs“y~^a']#, S@oMbBq_jFLѨ4uSRD^t8x )=7:{5ט|}q߫׌q:^7)pQXv4\ο`4%B 3T<TlXɷ-BwB# M0p%s$7: ;){.}p&`6jb Hq:gqj+q JX1_+qw;)Ou/{v!,0` +x4jdl0k"7%U)-$ܦ.$穩4T⬂v%H"q=uPHA0 Rf|?*N^AjT"{֥Q@{10"تbJD~AEFq> MN9~f-a<".\sPGm3>?Žm_*,qSPDd@ )ՙ3&%jXp׾;񣸎XStҡqM5Ͻ O[/;Yj4lh,n>Fƽv;59'?XűƥɋŃ? \F_kC5{뱁~C_Gpvi 6YW!{|Sмj~H1zk(uE*~vX.͡c1XX f뭷q}v u^gsGK|!>tjU U;ajTkg-IwC4:KPT)yh.NBvKxoNd$1,B# jifPӵINĚk*:!g q#{f.l !eˀl:7QMoI6OLhs}"qWXXcm *.Ix1瘏f"Cbnn  ʇ |9׹8NǮ)hkBMFA_G0A{ ́wÖė$xb C\[,箷b'T2~|MOyqa0EI!'R"%!|*() ƺ/GCy9>l*sDgЬM^2 X؏f;`E{Cх\5ïc=F@wF a5[xs> cI jnAՂqׇ!ȩ)-sy>T{̙ērsg/..~Klvj5N]S`n"ӰM0[[k1+SҦ,ꉸ,1Q_:\b]\O~"~;G"祥_%$4OkE1~= D?rQۥ/b|.4>·uʜ+-qܼkȼUyUOs' /&jnrőkofLYcŹp;c7ߊk89oKNfŝcOM Cડư-zbTPmM}ys3:XO|=|nTQ[q|!H?~7 &}l%6&ݰ 1$ɘLOo\˨kEi1f`]M{#b.1*?`]qO~:[cs(qZG$ݍ?gKK|??sb0o<wts99 pϭuX?? 酷DQ|'>hهFXo=|G!}[yobO~w|w}+??wkyw{?G+H,}qx'=1>;Hݟku%|wwX3WOccX;C6?S{ !NtQ$c̴jO>Ɏ-)>@@_&E6{s/ZW_1@,DLM[!bbj3bs/c `NnřqFTKQ/Dn{V>x{#N xۇݱ6bI6\lߏǸzbNKoMQ7 O=wE{'$~ Q^$ o'~> ~&g]b~cļ~MAo?кY ᇶ؞Tܓp_;v?<8są{3w+*V|%/ot ;q؟>3YoL!;{a&|~s=jH]{ 8cݹZr3le~rր8Gھ!ns:Ĺp㱶\SkaׇDoJJ#UԺ5ʯsc0x*lLa$waY]D΋rroqBĂ91tⓉ~-`a~? uX3/Qյ@j?z'!^M"=IENDB`weston-1.9.0/data/wayland.svg0000664000175000017500000002251012537627702013067 00000000000000 image/svg+xml weston-1.9.0/data/sign_close.png0000664000175000017500000000035312456345006013535 00000000000000PNG  IHDRasRGBbKGD pHYs  tIME;0qV<tEXtCommentCreated with GIMPWFIDAT8; 0C_z;ۥ8p ⌵[э CUU&V5L#F *6U_IENDB`weston-1.9.0/data/icon_ivi_simple-shm.png0000664000175000017500000021272012456345006015350 00000000000000PNG  IHDR\rfsRGBgAMA a pHYsodIDATx^t^G5޵{opb'1%Kfffff-ٖ%A,Y3B I3LϾ{+:(IGgZqS0ozo}WVU^oյoz?1ժ|wݯoӿU5oڧ}~O}jSkj'ڧ ?}~O}jSkj'ڧ ?}~O}jSkj'ڧ ?}~O}jSkj'ڧ ?}~O}jSkj'Ԩ/ŨB*G8|W_/oKۂ폅%SQ )~<@ [--E^Y)KQPQ2~T?l!~COl#TRgyk=.}Ny-JGY=f{xxS~?P>o>agg/O'dO͟?#3 g?QOI _ + > u/ԉNuۯ ~/Ÿ?~RjQ+qo +V;=qppz wA7l5ٶQ~*: {݆^~#A#w(9j4;M&Քh?c &`蒉|9k`Xeog`8zh Sqx8΅<_ rg!r<g1*YbVlڭز{B>RK'qL \/^MziQևh~.%O3~sL WXů`_c~O~}=~{}pz폸֟_?/i_Hnkd۬EQWCVsO8aG]0ӶvXXp#v qg]p]qnzw!DT^Hl-u_óImKA0~1x^>&ㆣh?m$~Fcآ1l,c p4M®]qp<4MSzn:|g e&> I7g#u,laclP~ YqW1~A,l\,^Uc|lߑ{ pF  רgbMxd|944k'Fg` ǿΎ8 G\p?DHݿ^Bb_#*:OUjZ=k $m#<=NڶpI#jVpaZTsSrx<a dG܎o{Iǰa?6K5O:9CpcDG\iK-pѪYmjڴƙN=qy7&>?mpp"qsP;\mWm׶v]k\3'gվ8#T qc@mVpZԶ@ө5nuFy\ܗZkj1#&ܮq?<km>][/\tW'Zy~`ώpTj[m e}&|j6}kʜ}[׶f}bB Bf>?D~4\fA蘎fH`Ujol4'A.$^H5fF ?nt{dmV۾MȚ0kv"RR,Z4͙:= FAamm6S` FդZ`8nLIQ4-ڠbLmmߡEŤn37ni;wܦ@٤vxmmm5צwMkw^[? 5~bҔvlJVj7GAj @u?<Exf~fV۾_l[ Tέ5/>hP`lߚs:"~N{$ֶ}2k?kwiWf@aAtm:,;Zfszŝ˥k[mVƫWNxBGG ěNu&;Ƣh֜پhd/[=3o4V}/5F]lvC/}hF:,:O5Z-@crX9_q|0A fcjA1&/¸")lB (Ā~;zWۉC}O=>N.3cjlJplAzU O5XAZ}Orm4 {jXo[煕eOG0)&?}G#tLyIaP tb[.ܺǔs}>WosL=3˜Xrt00ZV,ث_uE}6ԔL[7tͦn{?t?Ǡ0 ?1*=DGNlRv SwK#>@ʿ}qɻz}w}>ԗTj15v7 X>ĨF:##n48;W^뎶Gfk}}I'#eP?,끞[c0>1NqAYeƫK@r.RR*Tbܡ"V!n Z]GK>œ#>.~wUK}ʱsL=0ԕ s]8LLn nQVGYIZ] ~;/V셁ۻ6 0..HI>e}T0) O[B&Qo Z>B\#1rx*'su<G|8? {]ӻFߪc9=cNKcj{Axm#I澄@\܄(g>jio{ I>5g!ޡF{ڈS1BL Xuڸ30!=E-f`:Bwѡ]v hمs$v@Îl7wѷ>շX?F4FM0n"ĺ4y (\i2I{fi43,}R< 폮9,,:٨zƆ}l,>#nNd̋sÄ2 >C} y[zٷ Qx9 5ĜL\؜n<鎕)&_BRX.%CT}sHt#`1چ:!x"_[q 4j+J_xG[< 14Vı`8m(aT v \p?!Ľ4!-xt>8S2S08ȄCaI",@,ӹfyX ˓dیW-3 {$zT6apk*`=vD@ԕ#]?C(_0x opu.snY3 ѷC}O1!crwB0QNAD11@8 WMV QAiw*qQiu4EC04-ec2i8ً' fE;ֽplw_;+|0+'ó9ĔcBH).қѫI }M㐊5K`n"&LǠqc0`=LLf]8<nScC**Po\N%8c̟%y`_;vŹc[m*rƏooP_S};ߢ!ء! ` 50[a+qD\ĭ3qH\|.&-(ڈFU%B8XҴ i;,ze/6,ÎC]].˱YOz 덣 inn9K06}2a|\9ƄO19#^`6QOlHv+%a,=*[5۩0 S A~7C_xTv_OO̦a{߁ݳ;X6>oaf-L-)nbbML(|G}>ԗT4 ^-d0šF{*q.QC %݉ q D ;d]IФa]*g"iy4Kڎ#EK8-Ah6hzAzJ&Y ^8{?pKt3|*gEQ_e|V42D*o3ZYZPg4 vBà6MUo̷C}O14ϱ"aDXyR'n{o!W! Ziɑ4L8Ciw4C4}|Eо+y ^, ]=bpt =p \hWRdXEx`hfƞ̅Ǿ,\ܚk{n&[ u? ('چf#/{㲽Ne2w>t?&F@k!O}.e uFp' uU%4wDW_G.14ح`LM0N!Yo>q\^48 ׄAiP!Mړ6]H#mDRD0' 5_raK9Co.iߟAOƿװ M냻=&+i9.Ҝh,eh[A^H< \  Y[0t\-~NTqg)w7¿Ry{c"郝ywx*T<;92OBcp$ܨlשt|R= sXp?Ϝyfڇ3bⴽT=9iMvM}>ԗT9Ҙ0a,as)`N%!ⶋ8 W܁ȹh7[!4,+-BѝNCk'wɛ,Yx׃t\Ğ?CUP ZQvR)J)߻~gqɹ{P83 QvQ6SVS {#1pn̻s.z˝8l'ف6voѷ]O=ch,0)J8VQ\aN؅pNM8> {s0M^F{B4G{h1ZqO0? 4 dZ`MZeh?yZX<oo lB`oa/r\ȁ}jeҲ v qQ?v?c SݓbaD2Q~am|fۜn֦uE FwѶC8!닫86}膥O`] ޖ qO9{Ly8;<#F6,? OJ݅#w2G ;&oGѰ6X؆ݶme-;|s;zW[ԧKcjaAL%Ls(B8 LvÄ]8MBF7x>4GIҢ=iMHH#J4~ꁫކhIZwhnhmXM<onbJ/ xI.(5<Mn+<B+ipuG\{"g4fZQ4Ŧ4X^Db\l6(ԺtûG"& MN b;.\cP}W(aou.a?BOukCeH<}̶{;۷ɿWR3V(>f Fk7tZB݆>=b(u`-q3݌6pz[oDIˍ(l7 d57wM>/ٛ}k ՗cحC[ҍ`MyYs As'711jEA˓Aiq4#Dv" w =1q滁nlh?[$::_ ވG7pxYU"JGXje޲Ƣ4jW{!8пdx` FQ@V"o6bnyTkKn>6atHx0UY'a=}qG=(`nfrk\Mcut 'pDrg|prh}ǪC boQcT0-lUmH%Eo=fلlHkM#[uȪ%EkWg-rZ70jrZcѻFf[{ ֙>w*Xs!I5ajN1YO#pN܄pu%O'Z$&INMZi QK|H{!/2{8B<oģK Ļ9^zay+כWzzK?c4ud >/k" W` c}s/Be}_yess͞bq0cZ"^oo\ĝC#Ca.S^u .08)x:m;T )Ǫ4m/M؍S[za]` Mp&؀&O}@e_w 2XV#ľ䀨Ac8;rU*Q#}$/5*;0itF*{/ \pۈ,ܵ ( i|4i5r=3W2T4 7 ɋIFg,&N Z2ps&OMJ#/̫VF)xx)Si?>ұC\K{;+M?afz8 DQ`nPSjڄҍՊ9w !pw<퉛 Y׍CO qGK6.;8b)J*TAw7Mua=VvT0 K-<ոBCWs* \[WH;8;b._sy+p&vlkp}/CnHy4%0 6_¸ fޕ84 G(gTsQizWb@h4 \*}z\18 =*wYcN'˗h2,Y%K뽥Rld 6}Fozg+o>XjP_S};yvfLFb޵DJ!#ӏ|XFC/ҶVp%̒hD v eՈ4muH'|G1nARy~ E|c&ǡhqۆï%˱^8;߻)71aj+&T~z ![RSb*۔۷P͜z=hVx9xr)ؽ7V:88+*g˰R~c{,‚Nj0B(_e7wѷC}a[chSc_AG@`y4}C\'&p֤h #4mPϝAixM ؒDHx/EFGm ĻNjjx@^}LYh"^z:Zgփm`G~xx||:?sĨ"0߫Q-ʯWU*?~ Rz0<`I{%b[}sF%ܟy7eVy}>ԗTcҘ?ftAc Xc ӆ+ 9 ֠\ⶁ86#ي&<6I#mGVZ3 qa9C֊4ao|rNby腠H'6 Fy6{gUFayoJFYYR.OT';#u;ɭCVsO AO᭏'Z{ 2*`{)Ws*$S 0DB'ѻ pOlOncLEetcIԗTc4ǚ15G ,I$)nn;0M QE8 D\]4-z&HsX v58vд9=Iх)h`y!\HW ea{R<ՖmMFAyʫB #=߻d|4 NťO+55~w?OB'ZObty=GzDc_ ® t.\de#7%䏭Gβ C=:K B憅QU 9r 7vɍGMm*=&:0mn[_9>!zܧԤZTs^[#pe{Mh>lg><rcdzњۄ z&ED>f`lt A1kMoc7}mcQ}4 6Ҙh"F'cex77_58 C66h@;AgRV4~} :# d{n8 IHkhakFq9ΞL#)}KLH6Fg燧fk,OSh)?ap|9v5kK@*X4%])@7۞Uߔ?\\/ ŲG!c89L3M{eB>=m6!3OV՚?m%.ejKK?b!W)=[OS)D>caTL )HHtwq淓هRBc hα4nGKJc g1U̫ p8T #V掕%QV"F"-DѦ5iI1% =l uDY2 i>0၌PV|(t6 cې84ajD%T<2s{)~yԋ2ZYg5? ӟ}Di~?EYI*]H)\y7~nS:/M6{Umc!HhB?oStƽi PݹH<ͺ-ǰ!ؙ:\i8~u+N݌ #Z{v8`9Qi/Y̽GG]hmpxbfGo={4 w*$ܞ}]+Qwѻ&[Mǘͱ4fhIt<IF]8m09tFF.="49Mthh@|Ôi}u9\sd Rm2Fl_ē1<oD=sm8md!N)m00ߤ쬨VMz%F 2] Z0m|Oͼ? ;<o.DFQDa~po@NcݕIݡfW*rUIA]af ݉s{u܂֛tJ~WUpP?w9(B*fDRisLhߐ֌ ׍כyTxS! e'ir.N@H9;sbO}wUK} ݦQ, X&$:a6R!.Xr3GJ J]|iԛD;L!-5y=EѤyY}ɋ&F`D 8@X,jG#@3g&BN9HLlDW`dI>F^U+[&~SA? yi.mYޙ`E)F|sn¹46C8 @sv}FOoQX;no^qK{wn3ï4ט>{HOKjձͽ+qb} >T447{.?-[ӷ )T(* ߻E~m"L@xRcNccvt aԗgCciL04`a`n? \pUKg2-8uG6dzq4L4z7OkGlh縡QȓFvo1;?uSBHa_Bsɠ; o0;?S(F(3ӳK0}jeݤWү~j916K!G f9٧"Ry=,(|;poMtҧwN zN6{Uqg_9 jr4־<=\k<믂~;}l{o fV,f9Nz-EcO_0 iS㏮M2z*xcG*׍J|k(\9 .GqH<7}wUK}zoAgx">1J愽 AK1$܄r~r8GU6h%ݱ݌&LZhV GiNt'o#cȳ%ݞ$w\午WPP7Y=yi=SYKG֦? 7 q¿c10&,-VMz%F !Lyu>l?MhybLB'U`wd)dGf9٧"qh4uDBk*AnLƁw,tFz̈́)`*AC/SnJ;|t6elB)ڂ7Nę2}՟X+lnEŷwR*LFCb*Zo p쩱T184FpJyOmcطzv9 UC5oL_S}kF15v8a!,I GOC'&5L gV镆FU>iVd2%d3B#Ei</ 7Cȣw-N<<ӽEVX5Ҕn65K_|)CYOi3Ř~U+k&~S?fS>毿iq3dg#h6=[:CsjLGumX?M:G<`OQ՞`}(Xt N' Ιc6Fb{j7Zo&b_Z Vpx90mfsF9~LX:*~$JTJe*v OO/K驈NF̦8ޢ;b_6 El`,Y0 TѻF߮^2>շ8nǾF` #lQf^p{2<`qR#k,ܧfDN'zbH3\gBZv&M3{X7:;P<;zuὪ6Π4W9wL\B157ߨVQMz%F @1,s_Okڭl0 M+H'_/@\w} I@1.ֶ Gh`$r'VC=LANqLz/J+iֺQmq3.ވ\ n68܇);/Z5Z/OwZSo7 #Ofv2z|)&C\>o2w❢"q(:*=uAX0o @̘5Sf i1vj'1rrz~6wѷC}O14ͱ"n6o(XvPN\b68v"Ykuc|61 m/Y;eJYoA^up!M{Icm#J#0__iTTF @9MEBYu9:VMz%F @ȉK_Ok\DŽoh)o"~~k3 7Ef@ŅfW6:_`'PT%CuxnRN- ֛YNĐ?mv/|CK3k$A{̤VaSqc;OD&fCѸuKXuPvҋ赥gi0j|B C}md_te2/: þ7wѷC}d{LAИ{aLM0** ̂]8d'>ۉklp' D 0b[]p:}n]Y0P+#M]H^qo%1cFJ mҜ@,y|A yJL+na6 D_~e@uy!LEF%3!&oU+s&~S T64\ Sk0R8'28{#xN#a#CǼ?yaWe.ѡpgy]DsH] 1(!)sZTSFkn3$/ŷx0CAFSGHE*gGzq!ZN%nا'uzzyإ;u7w[Fߪ>շX?V $*(Xq.p:>XH\jR& @YhOhPʹJp+pËFRIrֶؗ=^XXD# ިvcgXG4t1ƒ\syi|}$R6iP;edDLk;$D"E8g =CW -3d8! ѷ.kTV>lܩ\:oE&IݰSKG[6T~0kQF%y~iȻ=.OB {b|1| nV/E^5xB?(^ATzzwߥbv éTq.(ouƣIg^n=.nEgYj"}8#q$vcvl3½Q|r_4˼nAsAvmE@M(k5Hrl_LɞxUt𚊌[Q2lѦmq1Lif}!f}&<^/oߛf1<ݵ;vmպ rZuFV(kbQG :^Gow@^ȭ9u6MoP_3FAcqshA F*p.e?(\pO% D,icMMZ8hՒOa3izo#5(kADB*gU]k3|S;B㪟~a9ƫ5њGz t^K%ʯ 0n4n~hҭ:vۮi7(.'%2FһdFTmp5ݬq + '?я[l;ݓ6ߪgOk\QC&cjT X `cjئ+:t78k$܄D*H48inTmx@9vMi@EKSIc)=2\ CH#{S\D<$ozGV䕎b0^ /)#%(xp}b(csZTt,\Me`"W^IjQPv=c? GEW LqOWD(-z -{Λ_e^y[(v>gk#\XzڈeO 7 =栮Vd lx)>\ais͚v=OnN6體_.Q&w-F^=NX:guRtT>)a/mY7S5 *ZoZcZa筰ӖɷkzW[ԧv ƍAm15v8a,U0*5S+t3h?p4I btb+hIh;4V-f% $C.ÎCw)};@^~¨L\.Qy?覹T'6"Qf!8)mG*Q8mc9F<}KЊ27+8Z٬&~SP q@L{ 1 ]#p˭mιd~2;aNK܍ХTIVL5s2h %#5nv23A5hEٰ ;dSHC\U/A0? " B7߬_o:rnHmϙcWdf5) 🷅hf8{?nl5g߮]}oNjAch,ImX&Sc^gYRL#vE8 7ؑ ]4Xt(Tmy͊H&S mƪTbHDV*mn7S i{I$ZMw=pǵވnz8&]{[,g92R2H eeo]xd&JUOgC6|5R)0)C \|`jcN SEWwk6ws z Zv?ay,<\zhz]ҩ :/8fO-ߔn;d'z1ՒLMqPW1'ܴo|F2`Zز".,U8$j]Rwd2ZMz%F a9CW~mwHg?dhX^ȸtq|CjȄX4Ӻpd4FƮrwsOb?!iSoFM4eTږdN-ګ"-ǓcC?lфUsbkkg40ð C^`>qx]־;2ϐaQ_jpi+H?U?lʛP9SQ>iaFESL2Oxc`Tac +hoP_S}kKcjC©p!U0+bp"n;wC4Yg |d5i4nfa]i "Mޝi6 i>@_OYcV+ģDjAhKu'' AK'LV|?yߋQ$ B+p20ei?˾a2,RFchCdu&~SpLX"*bttK)72 w6{߱*\mD4ztĹVH>8 9?]zՖv_k57_/zM J⻫5jg>vɘQL5*ę8w5T]Zz~ (?_ EBgRASQ6hW!_=Y`OS٤t~(qr>LM0 FR7FF 3!e6D׿ѻFߪ>61ch,7}rMjpgqsaGPAoV]Fqn"#P 褡h#%B̝ sHK(9IcѺ3S~Et)UH +/KiBpȄfoUĊ#2 hGYYӳ[Qz2w&޷ ?]S*^&bVorZMz%F x4yYӾw1! -#SKDzqns:V/IIqHjWqs#-- 5tqNG Ϟ6!V/9IUk'ن6# Z1>+/d4ۻ3;oOB&h H^7_2_ORyTTr*v%*[x3V1 +sT:S a㦘VccxA# ȵ(qR3BNV2MozG}>ԗȌ4^J`CD6S=9oGy|⺏8 &Lړ CO@4s6P,t&4n@Z~RҠxc[{sb{m"?u#Kq˽-EuO|^wq*o"/.ĺWY'=u7<`z yA] FuVc*L`/Đ6yܛ iqƛ>ט`Q~Uؙ6s (+~ P@POɢhV=m ̵ƙ+u+dc˄o:pB =4!1iT K[&GӸzhS٢^ԻxWߪ72 bq 1s*C  Ie f`"8 b⼞œO:Z<Ԕ" U0xS{m2lI`E&fW,z$2 ȳHnh-xzX6zYn2 \BW?H\ IzSI>- B?sҾh=9vf -1/3 .βߴ–ZO+; 77 8_n#Ja[PPP߹.ޢ^ /}s;zW[ԧ#=02d? ֩\+0p#.AIiBSF8 u;u7Dn0h:i%.DKT}|mBIfy0% K8%!eo@y7of!9Feeɘ&%s7oYta.*fu2[Mz%F sHd߈̙v0: ?d_/#HlJ78UE(nM5c Jo[5sZ/G]>gֆwfXƶCvb$YJTYRzEfJ[}[D΄4|:T^v uGN@/ҏE۫u]6 wBtb ̗C񚗗P3 |B?mn&䔏k?Q*_c]z:J)m4 zlگ7V}wg#14%"!hd`L˛`s ,g$"'U8}mݍAP%"J4> -ES("?3~КQ7TZ(xr\]*ŒcK;ME䱎 *!r( V̑-np9E⇜8OYjN>!vӔ5\s>|JT`GZD^IjQp6 -mD9k6>.~T<=L( )T.\Z!n T'1yzNH`xNC#*+5}B۱suwK0Te?nL7E/4rt{rse)Ib"}]{Pnߪ 5u;7{J**STU77Krʚbl1}}whЕ9=CFT7_ }6o] G:(e+qfo P_um ҘJ "6(XWf8b:@# B pѶ MD+֤vF.]0ؔ>-rd,RIc }k@Ё!U\Jaf^v1Ű Pe'̤ $^=e&rRp#œE42tu)](2wvei;W>+ ح$F)M1hg>1XWY?iZDirHugR!fK{h]~k2Z4sT x[Q!TM*1H@U. ^ w>M84;G]:[4Lc4`eQDŽGӤWү~j۫6뾗6n4FU:Ku%aG- kBm!.9{bc+&_Egx?v, ibH}E܎ ]pz˾v%QIkYKGOD4weHeغqPuܔ&V߻'l^Rx9a˶nj+I+*N @R` \-0Կ0mlQқT,M~fQng7oկ5Mocm=cɱ4n@$470N"5%dZNeXfkx71 A4(#-I-Jzb*@iĆCp4m5!yxEwDVhE`n4"!Oێ~cvjsmGdEtldʊd'vCn 8QPʘRM+ZZ EYJ(79^eum^IjQp*, VoA뿗6)5 s20E[~t7CwfȖNxN?`Y%D:sgc҃V=a&6ZWû*MX-gϛۤh9ws&2Pݢ*hK{:2=fͨ{=QoniyW)SR()V76єQCiu>?b]y%-5.}o=}o_4ۛcLXScJK$ؔ4]8X"V hVɛygW*qRԺVs\X쥉_}'|4b(+/Q-iJb1t2NKkSͶLA0%=u6T+&~S\DZm؊69Vx+w p6kWaѰ3 5cK(|_;Sqkeoɂ9il.[ڲSƮX bٜyg zRT[[XELL59S:SkK G5Uڕ?Q,).=+TרCJ[ȕ7^\^\L如:"«7wѷC}Ϗh4s1Gp +ӋF@0Z mVe=;=lGH=zUEd򡆶ZT!mV(hFȣϗHrܚ䡖͠f&|9Mʀ%_=5t..FVT'b#w6t2e4SL]*se tD™\.ěɞ06%I_5Ԩpڍ5lw!vwO]u)h3Ga`ļTY y9"YzJ|bHwn4e?fD7`&)XF#zVDi̿Dzq3]`|UKKj~8զ+Tj+/J/8#l?چ!rR`zH: caV=l4RRX_AonzGcd ؗ1[ch_s̻{axYF0 66I#݄2`eqnXyk찆qW ACi$Z5Y天 'L`9,:t$oģN)졒m1ZlM۔wU@T{ӑ2lREU V^fpsj9U{"ޔEdԇ]{r]r]JUO(tݾn('̹J hnaImniO.v']ŎPgwHtĤiMOٌx\ %3mji渪;:+_[^ovaf޲XQKso`&22۾WH?^O額_KR1^Aԉ~5oP_9S}k I8vW!,&V06a$@v \X }\5n14-* <%NVota~% ! KE dx4lT x]dy:&4 IUU;,e@ OLدY]s=ٔ)gVcʘN._Ӕ#9L@lP %~j65WusͶm1?7#󟘺|J )7Sv2%XܿW% ٷ. 'sc돘2ߚV= ]+7gġfOM,n6Z@'L(wh .mxC̦>gm;0eсh{l𸕙סIbX~cƛ=*'R?J>T^KRèAG^oѷTF[ch,MAX&2a|;]I.A &>hbpۈ뱧Vp9^Ue+ǤMҪ-EN!(ZjsVʑ;hXAxL yҔZ{o1e-͹L6f1,LLd:۫K$4EO`c_h}9%$3WΧOn4~7߁ Fܯae&u^Әߛ1qBP IuuP,Y0i;>QԪ+7LOב=-n-϶ƾ,ѓ8&&|~t=5x*JW."V):=uuw%x%wMu@chFC Xdf6*@{+PЗ$NM8S@Z2EmO6Hjiy:,$j)Zw hٵ<3F<ҥ /2s Ch?䑧I7bVkU U7PeuX@2zg]܇;\ lޔ1T~)PX_BQ_S]?izG^7/5FJ4%/@2̚1+Ik&iU 罟B+ܴoc6Q9iuu#EXi3,:)D_h.VmGވGUݑpq/;:đdzky|f:̋gFBYюq72t'"zAmk0|b9y%b z 1e;65)1}z^mf:Ęf%ʿE?7ɘbѨOڄ!@5XUrǬ K#i)[xZe+ZܭkVb_2xaޛqg9}r OLiK4?󕇓o8*iK-޿:kBbo$y0E:J\,/EBJ1}{2];~N#s`R}o7V}/5ƋF בF [ a\@XW pP*Й8ihRc& 8(4Q-dž5xiVtH_CŤh{FyP@^D'CiLRmɻ}pu"v@yj#mG( *BȽq.c# n`%e蔳"n Xa( e qjCBg2W ( SFvy^IjQgbI*TM3A!F<1,lwYfF1}řVfҧ18:]VK&SO @#i Ro0b8e[K*l:=b0|!BУcqu(33m2'+tUPV!B*.zʏUxWv#zsʃa?5s7~ _s}Ozkynyp*YJ}zEɏow^_}od n!PUр@܀ƔH`b*W(2!(- V$Fig\l/W\ZW!LtxG!TyD|, v~ N9vk\6}V .Rƴ٬X’CkRKY̿t)^hJEYu(-¼{ФWү~jb>,=ZB춺3'Gk$ @ݔyuLl̚}6kÓmF ];䎛>YjZb>^ 'hDk?Qwiߗh։l)Cڼ: _nT %ZkN 2>E[f'E4kZO;*ϼ/(?&s_ }JY{VUw}o#-$Xë51)Z A'68 9Ĺj.سpc FE+LWH;Pime :cpS5H(%9=f*a6Ìbi],x=Mj?@<er?dd#E`Y};DK#kG0ڝX9id2ֽVŅXzqo2JUOXlpj]ڋ%fvݻe Ξ,$L0:]$IYozY=u#b!)\za!*>3T6݄xZ+Zjk_Y& eYƜ3xc6h;B#꾧[MltGܼ i̬hff{K%=xz:Xn6hY.+f^KwRLyi_z*/_CEgMeP}ͦwѷo4`L.:O5$():֬q钵)D'ݹv -ESV*r@ț<5ke'"} :OGX A]3<MeT^K͡NHvg2iSO݋,+w6"_E^r~+q0qL2x>:A{31bnOO@ U1R志#sX岅X}0ǽ\4s^S%_WH?Mi¬6cNޅhղW9裵~ڳnfNDߩM}xEw;P+vM7w=>,FM:Ҙ~i`lQs9\pNUU8똳h§?Cm3@U~F]<iicX-Cu]BbɛQ@N&/+)ވݶ1u OR&$i l%Ngl7wpX Gc ˓[x-bqZ.Mz%F @xw=C7X;xГ?K!}S0e8z(nA p'=PÑ'޾\ W+wف]aG6pEv؛ K-6{5؋B7vOl=~d;{@ lا~޹;YwEEc˥4lpy/?g9f?9Ɵig 6&EeÏN:[vߢGҝ[]RTMv?˫oM]}oPCciL-V&&`N#ӈ×iqSm RmY]4FZ{5\hJHKV]Nр4mNghf[0yJ^hOFIwg2 Xt,Õv'ouhy#P2G( -̴URW\8㉈󠬵edr& d2:><:wV+ߥI_5ԨH-H98嶯 otz{<aIOǍµ6ay'G=P| ,K/!=bBJ7`XV7GM5Yf6g\oN|}WMq̱_mmZ2 ^! | -OZ_~uǕ'yf'Gﭼ~R|)7^oMozG}>ԗTTQ (`/F(@ F* q.Ui qԞY%D7?Lxihc夝i;D i@Z e@W'Oɛh@ sfC׈O)*OyK!!f9\L&~S 8kWS$ @ j\vKuݲ@L~̎=UBI2n4+=y_ [ fُ_es[efU)QfZ8S噫_7V._P_UjBPNj@0)5Uj pZyJ+@>m g@42*KhGjy[fRm[ @ȾU([UeNuPWbdu6GҤWү~j&3Xt3-& 09|p6ؑN-0f$4e_?NGSȪ3Z2[޽n[RL&~S, zƚw$1plT2G;=󚐉}/!r2q:DHBg U7-Vmֲ d_koxom1~/C6gDxT 7* k-x/zyU+Q7wW- `bWM,AQ8cQ'3ghn|#x4mI^ @`K~/nH{} FN{K|>H}+u,7Ywi+WM?5j+y"X {{@[4S1b62 k@B$a6~< 1u$Zx$}3 =V5P= u\X0h ʤ muyȷ1:Է݀4| 0+QǫҤWү~jRc-*渙5d4 {Z.Mz%F 'HK<5N`^5?20''ҤWү~j|,yirZf ̿0@U9s9ꔽe, N20 -d2]JUOOK(N?^c $Gpʲ {=Q]Z; d}m`Gg1V*-U W@KZA 2UۀY PeTpC5 @mA}q*Z27 ,ثVSvgB\"*ijVt ^Vn\* xD^Z:lVi}mp> @e*0~csg}a`V@]d~m'}[-䡫bՀ/g+W4tLM0~Λa ir wTō@S@1Q#fê}+@2}<N@}7)k* "S.+*ăwi+WM?5j~Q*>,<OX{/4 Nˁ%ȹj&:T;Z @FNS=@v&9[cMfȾ^ 44>[y45]2;[.B_HuQ:6p`9xŜ`PZV2 *F]}oՇRj'T ,IÛݗ8 #.$$GOaL 4@^+\UcpxPhX ~@8pXlupPZu`@ߺ`J?;aJ@ԈI{;dpݵ;vd dx"о3k9 4XiNű5`*Rw/4[w5ٳ(?G6VZ: `9wMžu|\եy(@=qUpbG~:zuQ:P]ozGVZWx15 `Ka(Xs&a_N7#5G z:N D7;ER>@D_Wȃ#c O7>S10rm0\B^:!9I^/Ŝ-A:r2s")g r2s$*)P⊳<9\0QF's):vm**)‡5 +WM?5jJ>MCPy[vˊ%!^)BD̅nZQj=(,z6<Յ GC g6GA`=n5'Ċ^o9$K=eӈG95d~lC0g DSǾQ^E8oxSlqeox ;>oU[0Dm1EM6BǴ}U, +7ۥ`x|QҰJS^RfnyzÜvig.ęMG1a^tSoE&[WV8+_ln>g[4ܙ yuh4J3b;j`zlY(z#_]A!?e"Pry푷J<& 6|B?s}(gͽ&T U*NU_՗TCciLE U_0 6(XsaĭW *=řp_UC=Jey𦤩h;4ֽ+ !NZ 7=ɣf*K],xqFL#U B2BOQ&$i""RfTKB5%6QYPTb,eo , vԬP Ŕwi+WM?5j* w?{v<=ɏ-hiLE 4~H4|;Eq0t'i/l ;D:cEDJ@4" =a&7XWm*K, 2ɋt!HUE ]r(V^stR`ܮJ@7TTy$ؤ?:8ZR93_VP~J :WUWG{Xc1U)AuՀԪ7S}WU ^H0겐< ҈8iCsˊ@48 6a gE3h5EM̪%@U_Ve`T'0u2W½4x)` עn{V 9MC=q7vi+n_C]/GsdnAoM^\k5hNZTMYsB<XUTTi2Jw& Lk [uAEKM@]+EAcVeЇ*0]m90!t[znU-@[v<=fUC )żB%U~#={+N[LϾUEAmAQf0UgT=(_ Yk37Zjiw4 &E[Y+¶PDsX y=;OU&}@^ 1#qq'92K5l6 U_עUM}Rן_VK^Ijh%O w>`T4.="d_̃Ǿ, l*I$#cи{$6Ap?Oݱm˾\IWSv:\r+tl|c | |4B3&y6H3ۜzn<=8mi&άl\~x9] Ҹ߶-'fϛcfŒ!/ 2ՅOs7Gw,( z{"=. 1`kN! z;s68bu9pZlLkv҃6[x&޻pIu>u`*޿^ ~4s/e>æ*%zozG*W&,VuCA&&= hzn9Xԛ-GOg I;VlI_X&G",DG)B{a)p8* R6>p3U]ۥ\0g]D:|7S|؅q=&3GL|e5po>ʒd&59xeh|,#o iY9Z 6E}e P|f p"S5rݛJUO/2ݻT SK'Dn2.v=!{7ycg;fBkhM^wyar>wev3s f `=ΧV0s6r&}d^J17UQ U3 hr0m7շXR~-=Nsm!E˜M8ocha 2`cߜh_՞ yQxLt Hx哥L/V9 4![׽ٳ, D鈦"p8!6S*V!2U*L-)Fhj75 } m愹 #}xbJF&h-Bfǘ2fo孺N.UE(`|F_†Q*jE`P. 4@ FWo8j]NNi}ښ}ߌtoශojCmM>ԗ_}k.~ĩ/q7hBD# EeEhI+-őh_nW:0kx9<oMO^0W T,e>emZ#k\\(L3otX@K Ҝjh#uċ5O0WoשcZuEL]Ljjn Wu+W}?XVCAnVvrO913`~vLbnce5xX)KasCORhP3!mOG{j[كͮ# wCm#T&68}u)*~v3q1h*LAӀ:GaX89wl~w"lJ fXፏ-wΩnbn^lI[N - o8myst$r!m[w_m-=PC}eapnoGm_~E6E:?oV׆P;S0ExSBm?y&ry*YVUHW\ i@l$#-?PE@V!N)n^sAN2b-s/_Da3*>>L>kZ!7.&3Xꚏ ?audW~ǜW0'f7vǴRtϺ7N0ņ&'k74:E#Z/;*%r]"z ⏝v~sbxK0&4,Fv^ck,ytca,t 0)42~@'aNizLZ5 1 h?gj[liU̙x- Zmj /olf{K&דw>uy8_E+rGOՄ 9{ܫ ѻFߪgՇRNq.IJ{g]64%IJխ༣5H{yȌ͹U`x(^ O5ǾuʉqL&"2:Dddn./GDו(zs5R)I\HМPub9#=+Ta?$"ԩmԭԱSS:[-7Q[P'u^eSMdW~rD^%wsB[ _]z5sMj>2 V=bqy$_ P!,%U6<2~$Q$k? ?ϔn5a~P4 0EG=  ђ`uȰꎚƺ/R-X[_Ʒclk;5Sl>@ԓnցK$ԜG(7pےܿl9Wp{DpDh-I ZsR[CUΆ'YrsxЇGYFc?`Ad)hn> mL0nOtpCp} inHsD 5Zx"kQǔktOA7ncNT9R= }S X!V{֯|7YE)*|1Y!(ǑQ|; aց8yWΘ~gq) ZfE;ѼVL כ㠞+a۞X%#KcQ>ŬC(`seV.!>q ƠhѣVp.(|rg`LŹְԲEJ!nֵ8w͝cZ[h&1?N}O<-:%jڮ[F.#o{_3jCmM}} `_S}JW<Ѳ4 mgi"v;^'HL #f6ayjy|cMIʠL ?kg,G`ߕ[2S:4g}N|{I>p1. K]Yy'2|<YoUloL2γ C]lXEA]uuٕ쫾zu1' +XwkdcʵjZӡ7z5f1:n0mi9`4 YiC?;V0a1fekVyS*,Q@+8]D) pqȲ$xQ2 ao;Y~k/ص큊fݘ N ; vpgbp^pEW$Z꭮k+%ЬK;(|1o Fo:{,Ej ozoFRv'ԧFA|pIh񟎷6zYWUaDQ-TKӵ: #1}OF7b짬\W 2trebvShޜ}as,+O.s@SFwꈮTenNP.R['> o1Mi程j!pS]ɾWpۛc;n 49A%U7*pɽ itטerOh G aHLR.bEyd]7A΂,ps߁"FT4ZWV Τ-æǖ*AiXE@SrTg~A4Ym~vJPm;D]]]NgU vp,"4aE]rG ˼ھΑX3s΍8J|\/Ǒu8|A]moAфmM>ԗTߪ#\z'68 g#h8ƟlשmHO&iw?"b y"ިg/jy&錅xy<oi׷8j 4WpS-322,'PG{U\T0:Q:rf8-6#[WXN&,R= ntN;Av%^@ -Sk8,GdוOR_;12޸Q3<ۧUd]OЭF{O/_t/^o9QPٕ쫾zuWq'6F\L̽* ,g]5Z ! ^ffw+>LpA(>O8|6QZ\}Q@7LZf1q}9t\BTT\tF!-Wkweð`sTxh7/v뉅#EWT|ٜAGI׏"pQt`}YNT ራ6]9HP\ƩwچMgKL~w7^z4mԧ"klp GcvL44Eiɏ4МFڗnxӓ85`l+lyK⥶7cڑ+dRA:ev j#zlAۙ"XtKt"e|K bfeleIԝRʖ)1-=GG*g R LM7թ+W}?{d+!#GeILvbLLgЕiL2 d,偑` qygO!d CLlm9`u܄ĦQ:Vpq\wa(`j'_0f]LBLEU-hRZmR:c2ZT8TG\ߦo6tA H>NAKslVt^tfo6ƨF&ˑXFٞƩxk+7WY_oM]}oՆB}6Ͼԧ@pnv]BK'-)FZNw;x"ތ2*IT-2촌?fY8()%wQmlQ@%Qv)ÖfZpA1b;]s:R)n5:YM4=?[Ȯd_ԫȻPqw +\Զ<@Ʋ0h\2c& 9! ^r2fbVB|Pp Yʅﶵl VP(j#_7WJb~o/dk(i6Z@ pLj}`}Ъ{hr] ѹ'tǽ,N0x-.n>V8)#aʧ)F\WfI g@N)<גF^7nB 3oM]}oՆRj[}PAhp.>ѤUx&Y]>Z kx2t68a0w˙?yܞn8IH9uFVףּ#eח;XHJƮ;} NgFTo\2/8! ;C%׎S;X~9?;Ay5(SW dW~97.Na LZ6+R]- MA: I8R_&m&xtCz91P-%A5Q6!y -NXh1fT-y4^,bXZ9Ŝp5ˎ8a$t\X{U^[ݨ% `1 !hd)P9J; 8ɇVk2Xr:lSa%W# W38jˈ5WUy5q@ozG-Ֆviv_}/"GVpk EhQ#'O&KIhoN6NT]?. WO{LZe锁~I&+Ҳ_&SvVFԌр-GQ[BΣ3uAk:73丩)9X,u-:2Nf4TVZ_ }SN)ɪF˘ y!LMM#{nKۍ(V7V#J?hh/ K SPrakU`,}!Zw'0 4!,AhT hp+e; o mp& }aB?4(2hl&hz7Vm-M=:'W{+q.L[{d[ f/izIx1j}O٪MM>>Z12qm@}6ԖTC}O}8n'ָҿ c,uG4T"J>!V,(CcoGxǼ?< ;yy+w"~П28 ޭlDHF7``h.Q3(u6RƙuXGE d)#p`YWEW :Թ&U]x#Kٕ쫾zuU0w'< 0Kf5\"nu,d.+3ii1:{{"e$ Ö5_iT1XG$Ci* ==&l~۔ { oDMuc )S8`[ B3ފӡqj$4mZԄִ x̜ܲljnCq~YBHpdع5dCOЇ.}'v&LM)t\%qx;rˇaɂ!M gf_:@dn׼+(}/#hCO£C8۷b:p7-D܎/[t׿ |ՆRj[}e|5<:CO[.qTM:^! HˤIU4䁖d⍌?*Ȼ (y6y*&'*? M-'S6Qnj6#)+2 ;*eP?eHPro\YŸAp}ZX g#@rcn>e:a׍.֥ +W}?"wd~/p!3+.v@=d‰Byh>+,߬'Ob( |F | E ?9AI:jv\fDT j˥ ;OG/,a*DTe¶RM \',|߳ اVT"\p$7>t imQQh^LUUV$ބGxO N^2OOk]zO[$SIe32jo/i!R~t;dBYOu2"uw@>|:)>`:)(q'mm&tMN@D[v 6cܺ[OLW8V1GztXᶎGDGШ-[2=Z)5p& 'CpoV]}oՆژ?hkQ _8 [ê& Eh@D{Eh#C7xAm$E$/gK%<^C^&/^wmMZVFlPF$;eN^u8+4ʺs NQ7#Gkx Ck-KqŻZjl /E:uAv%^c2TL  M̱Z<^r3Ơ0 gp8H" sj9#*1'7†0{^  mmGn[pZ{>X&f%/ k~^<ϲ? q6DiHvbljfI+XtGˆ3Ƹi[U NJ ?:K3g>]^csl_7kDrd3o>E\in[bMqi;jCmM>ԗTK%qngD*#HhQY/&'Es7<oģ4Zih>Ô`/=-/*#dZqv ,T403fδ_B@㕸ph9G[l&i{3a,8n,:Xv Ο;ˆ8E*.ڔdգ0>:#x@㫦j]9"kv%ܲ@W=ަchM@ozG}6ԖTC}O ?ĭq¹ð~QCaf_4v9C O4Gk_'PYbyr)]+&eMYMKFk8@٩޿d)zx(ʸe=2_B/S' >AtE:cMݑPSi1E;BKP>+N.@v%^o) Ѥ΄abA Z3Na|͙[[7gJ3kk{!U$ E OÖ^ u']ĐHrg-eoa*`sVefu؄QM'/6XO"1%ƫt+PSѳp[^6zuWkBcFp46̟Jߧ7 };ng4gzД΀!xr" 3Mx#i*x-%Ұ !wo[ԦږQ_S}_ T[/pYѲ4&mV0z:f $#]=y7P}n?o .? ;3M;e!9Pv*R)ө#Rs-w#{4?D1NdĆq9* 3/ŭ?VԧZRSNԩȮd_ԫC@98_M ^;օզ$[q8[t"ofoUMZN.1HlB8%'}#N &V]G&S بӂvBpT=,[x[ӏaǓ%Э*?:ggr=e)iBcmG#pX<܂q&Dqe0#Y*T ZwC~أ&]Lh~&LN'3;oxwkJti&mYՇO{3S|>q2'Sh-IF*EJT:O6J~9W:+٦ZeN|<.@(a_C{RrȪ$̝c9סttZ:S/S}8#ONhןuD:st]6.NW>5XRT _:u;ڕ쫾zun ~ ^!wvv\&DH9ZmIH3\ҶQH}?zw鏽y 1 :ct#|ϡDO0L=c%.9R?hc .و̤`i~ ; zq=Z2*怋*܄39~lH<90,cjNz\<r,eڎՁM)\$`COS$8JS"ʢ.NIԱyF dW~dda8ޚKK"+}ombN1\v*Aġ|SEU8TK;ES|1`*pr7Iqư p< s9>jsXYTփ]-8FE,nޜ@{^lpfS'`%8ز:-ÍcgaE )(WJpfbc9T:yc%-еc ̼f5Ϝv5܊iB3kcYH1 H;ѷjCmM>sWoB'G8 pm,wGB~Ҫ^=< 1Д=J<v0?SGl-b:7#y/H*&HFn{+e8lM~.C(?D 4:up˕ߺFˮl+G*V5z%:uٕ쫾zu%_&s:\ tz k#o"gknu9)en1S4? GJOb*ՕRy3g|Z 2:+|~L2i1puیTk ^[&tn.î-furG\SHU,؄̀4$Oa1ɄúhD39GCg&R!ks6hO:=GsD-1!yt V4=z+GwѷjCmM>ԗfAi' >U8h-F}(Z*rےVE ;y+lrF|B]601:r'iHqӔ^NYuw +W}?FTmHa?&B10=T<, n[i**kTa_Swqe?3,\zc.S 91E!O!8fHkGC܏ YghK' PQm`_J'@E։ |͟kjطOyMGTܸ4}f<3'<2ґGaECcZvj0k5ZЈ)ȠwѷjCmM>ԗԒ _8 W#Ch"M/LMɈ B(U[{)+2xx*ڀv4f4eܬΕvpآ~Ǒu]L u4CZ"o\G e u CqRȧ8]N /[kԽdW~@UQxsY]1*ݳ)ev mȁ 1[,ءAp Î;##AH9c#}PHʤbi.ܺ RN\('LNj#rjsJbU8b%Bss퀂y~hGF.P|~"2NO"C6bqᴖv؎0it[hVd0qCQBu@sDt7wUjkTC}O-pnp$p :iRQ!ӟ-& D{֑GJ\r2#Ow-exy`~)&)Í2EI)ݱu C QA4@{)اr_^e]nԥY]} }S>GmMFaXHFԠK-l`ؔxi뚩dU v0S F P0_lcYT֩W;a~l,It%؎m6Pzԥzm%׮¥p RV $Q31-x:"|)PY7Ɉ4N2:9~,FaCF5JkN)GWSwt4W۹lCTC}O}8hpҾ=ܫHh&M3I{?ˤA]<ŋways$ϒX7עkc3g6$ njl$#7s+ne%?TBYQ3t'u`nBPg6SwC#KÊnեsȮd_ԫpD1h&~yZx k8Tak@92.ZRicYP0}4#PS7`ZesEhv^PHErtΚ9: F{nDi(}{ 2~ kVD2hSa| dASFo r5'#*(IR1, <0̨0>v8ˇKrd C97Vm-Շrѫo(E8 7X{TDL,F8M4*y6 w'CȫJzKTM/Y%WʨC4Qv;# 02Ng1Ss?N3.R7g:`瀼L+؀:uٕ쫾zuNU-F0Tڷ1a*Pxج 8lef6}Q(gNR0zHVU[&5ۅ.1Q-+Tr]1܊:7rx(Ո-V!u9ZM  Bvi{c|ؙ@GHGPFGPaM0#l .dGg`hsqV4D_=X@}6ԖԵ\C}w"qJ\p58)47b8&&5ѧY~ѾU/Crx1<ij6&KTKqm_YE]%^dtjxH#S(녽ЃaK3LQp.c迓ᶎVyu +W}?\1w[p+Š02نDG)2!hV-VTc*Ejq06-PM:RNzC.@~a9şg.{oŮNQb$ fflے8 >!P 7CX& [qlEG09h:"}"s 9@9 I' 5nZJ̻&ᴤx96wUjKm2P_wS/#NIM8NT,ܭHhMM4稯HZe+JyULSQ y)tߢO^xr~s7eqߙz2]G+A(|' !Z2?5i >ԍ8Re-?ug\Dѥtٕ쫾zuWoax \$L˱m\E!7w麩2gGMJF 5-#v(һTK&v.pN KNI* h&ZNL?qvt;;o3-y{-^Ywl//ǡ|w9t8tЋe{O[Q 1q# -WLëq3pB fAjty bhZV aۀ7Vm- ؇їp \NqM8v!κIY4$TFM$,RDk,%LG^n3yrCKU]Nn'k9^9`eэ/Qf_kl]oz!gr WHL Ht^ f7Ѕi@Sn} }S3%`ĞId\ϰnkPmt.Avdn:KFǁ%#8Ã|k"-N/9i&'e(UY>rۨ:w[):D:)WqDZKVT2y`-6F'rrYlHe m P4ME\Z:M QD;kq J ]}oՆRj[}/h \:'&d:'DR?]ݤT2\Z\'?䨟ti y$^gp{۳x-ǛA?(,$F#x̜iѣ,])IcU5z>e*'t/6+2+0ѡtٕ쫾zuW1  G1Ntp1)CcPVˁٳ/mcDh86@{Kt x`"LHH 0xc|!_jgԼ&[2mk+qdhiM֣ynطl;Nnq#G`.g2H_˟ ]O9  "6vt!S@{L5KqǍ9Gm 7yVm-K#};p.Is 4|<"vWl|sL̘m9/L1M"1G,G'p2GeW45C>sǵyزmt,vn0VEEZqdk} [JF*U#AG a/fgK̥8曑U֝ȠEl3,~ZB㨙x9xUi$iHѻfm6ԖlAMHK}jC.IzF! h|϶AiYE#UmPZL!4<0+i#枎<2yEySx C j" Bn u~w-(X$\(EQ_*Nԇ(z@@\HF'@EDCœyp= Νb|{#f{ϝcv'VH@o^#וc8S vYpBk\#“3PП3wfAni2fὄYxQ4cfe9z5wUjKmmԧ d}wqK Χo-KG 6_2h-!ݖxQyrs>.:+3s\pY/GL2M82Ba8v6o*e2>!.Ƣ:u臄ŧUw0'a}&\:yUg\tB :~{O OfGTh A Gf%+x' ϣYgLtPٸZ%n.ԉ[I͈15]wך/rQf 6p_ELn,žG /1krZGQwO7oe5Ak.?@jRowUjKmmtY Nq+7 ZDS)i+&Ѥui~ Ӟ~ELxv O:y*ޞ%?q4׻T S{ir킌þMŴ8P4ݲO>|)k'SZ fP7թ;?$,= C_*0AoK] [rHz1+BaVNVEBRtPBxfj:)-NDF9D3LgH1G]u,B-\@9d:[nbتB6. g~;p.tdȫk؂;l%kM7W!=[^CWrMXcKq=9-CXid$FiӮ;r\]7Vm-Շ>շJ.i90kf-Kr4]!mHhmMEnc/!)RI*(} xz2^2'Tuafn%u#Hº3Xj?{L*+t1/pM-̛u 3+P2XrՄ@vѧ ݂qC|skb1-"1< -z#ڰvD#WZSmG[с1&Sg@ד5ZoAkNm!-mCgpr\]c)DXcMkQn~̸~6-aXXkqwѷjCmMڇq}o#'N-m[p.'Ñ#<$DcۙfY}@ЖkbOd%e}Ж<oǣK.anl ?{\(Qf֛?pt"p7O?QR:ܿs*ы:0=&lnԩ3? l5m8_N="s#v^.הv^N"L+МXSBJ\,(* \4h5 ;HHd~{;_l+X 0,m61Nt9pp$G˅`҂M}]_%GlCwslvrB3p$-{k h`W^VAmlՏa 8.9?:e8)[cW"klnozG(/5m-׀d;"[!q լ>q@ґ#h&{MJ,?Gx79;Ayw'2TZX@b\~>{8 Lj[ GϮ18*!`7Smv NbN Nv^p2 5թSZm7eştf_;MNxm6n-#:7Zwנ}u^EBS[D^V6laf6lKr\ [8R77w/o]+LjKmm-rاI Khu"ngD*{g ZDF|9;*:hx#W>#y(^+,k#j @8E+:j-7e)^BنPƋ*']Jku .`*?Ҏrstņ"[I|aW5oa26̈e$@)c~xT,Җa8:'tsP(y" pcJ-:8Y#s$ebsVȁf4s}(,ˆ `]ffhEhm w v˜:Qi‡Q::>&r^]mԫjqSUӉyQo~׻&f 6նP_S}se^ g.DhmQK;"</ē4Ɵ.lX0/MNAh7n< C^A?j}SOe1 mҝV1Msu*}3ȵ?e& C;am)> vcqK2ː̠3 D;Y[ظVM#|L pFrt.jV:yFA|ѷGFc6p^gK}o.I U8 w8BZDh54v H7ZRO^#>ᨿ<qBYL$U}:%UdGYND7v2eO*S yVT/GT2K τcJVa_N x@R+6"r|,- `y`4Vx<#ȣ{Yӱ @ yZM%1H52K0*\b);Opeٗ2ʑsY.ץ e#d}7ӏ| #8*lbgi%f ˫A* H=_lEbf/0Udðt7#N5gG |҂G£=9uwr:7:dF.ϟ6wh[ȁcĵTZFvشV/ُ444‰4FM g=BqCPXE a-;zW[ԦږQ_S}"E87O`Ug#Dh)!M-4^"+IhI×SO7 7}#>pP0YRgHֽ}uǡ SLP6G PӔ-R3)tW ҁ³t ݿc8Mpl|ȫ~.!2>8\r6USoaPM*Ca_) &T75=F%wxtͭt`J`o Ot̶ՙTv]Oi΁ (HY*GN&;Go=S4C44-454FK~\BqM(v٩oP[jSmK}opN^MuT[8wAZIh[F>Y{Gi'/7=A:Kok;0Fv!o{=SR U~Sf%#{je.O.,߄GV"rQQ9;u>CDqzF/8A|X[HL_3`sM|TP04QvLe!ҁcnh":þN1poÑ"_1R`Rm"">N١.SϠΜD>r!t>4K4>GiuL 7t W-vw5ioՆRj[}/upN­88A,y9+imHhV/gNQ|3'rZyvx* gJ)=L$'hxTS[Mm*evȶ.?/q ! ݯ_t6S} IJy!]%WTc*gxyB11} '6d[dI7euaA h=[E#iʙOGA|m@G0w+9DX,Fю#eHG 9s4`b"3tE4l]*/FJcTZ[wq@4-&P[jSm>շ8 xThy Z:&&D _

[URk5h\f7Sfve*d؛gΖ͜f YtACز&GJ~pÑ*lcD󪯘 ,F/GJmQQҷiH/E1|;KA; [WA#,>#!ܪY☃kbAE MtF[kg&J;q@܄qt\Y{و$ڴg+iN  'ɓxI^cxyx᥎񪤻x%ǔu2mj{e҄PV{(ʮ.>oP3J h?8k6cp#ڏ qfƈb*@gpDc^33_5J :K}㱭s Rܥrګ!#h?拽eXKxc::yr?E[9Qތs/iliti|ug_e؝~ ]QCE[wѷԦVˑ}vyjE8 7]7ଭѢA׉roCXC{.yɛ]} ĻR /Su"{Wʠ 3dx~ )U,(S#§p/a |Py= [TeTrݲ=Bn ƫ 8ekπ]>k8ViA&K7GKF h'amL[FGNR B8ʜx=/Dg/e;+p0| W!p !X@yiDīr̸̩#p?<oOsOxR7)/JV3|QX| u?^,z/B>ZTUhRUU17f-27v!7δ :r9͊a@$tL7C]cҎQAHD2/ֶגơnA :pY?_Ʈ2/lyeBUoϫɚxtqkNh/ٳ0fJ tp:;h0G!op4 C;4wC$͂8?sG>'}p4@oΏ˺awyG}6ԖTW?BϾSCv`\J}#U$9iMM4VS/7xB1C#/{j0<ݹWJ&?x*8vc __ ?[nalmZJ7b*5b&m$zv & Ut$:3`x܊~8=T%rm%6 GCR `sF ? Dȿ"_ )?\.<6%˻Fߪ"AmOD.R( !pDt>$iRѸzUChFTCdɫ狗#K9ߺmx3ZԗT*='&[Os]4ҔADc4i^76&yQix"'9D9>y% #úxc_'_npu9"H,tF 7?z Tc .:_Re,xޯp)AGS h8vye̦lY2mEY_5g5xY1b҇ML.GU ozg$UjKmmU_+=0q:Q\s>"8wѐIZIERXC%x1<V[V^g]]<m|@N56nP]{ÞTaGյ]Zkf\UU4{:79َ̑!r|̃߾kpߕK1au^h\S f3-%(wUjKmmѫ/{:"}8P{$T<HE9ҢwD[Jy4|`,y1<oģxcNW5c|9kd 5W?=#9bAwl-IQ#lNT%݄S@9~An%ȹXE4B,`Np` s5\ޙkV0\fлFߪ ꗙmԧ%E8 7+ѫ E4!95(Bh .^!t={S?s|ު?@%Ӂu`?]Ǡ?$ ~ ,ZL ŸZv\am&4fGP'q lt cUb J#o"d0ZH=^ģfN!#oF}6ԖT#}ű+H&qLTC8648w%adm6ӵw?39>|'nǁxu(qo)F&<:`j2C<׵jtκUh\w+jMt r#ۧ Wi) h1#Tp ]}oՆRjп Wg!E8u"nQ g>4sŔu#Cՠc E{㮃y3:&s?C@}8{N\0Ř*|A`˷0=B[IÑeZ,򺃹 /bm1)1֌ {֠{v F2~ C ozgP ׷jCmM=&}1wW[8,$.bΐp½.QaZ:Oѽ148zs;{OAfNJ>E  ^XԆoͿ[߾5X-0/2v dj0lݠ7VmLIO-E1wm}g^81B,}R7E w2A,} w}j[}:qxa)!-Ѣ]:7NvNXnVsYzM4ߠl~ A}8GǻƄ.X:6S-n`󻷱m/=3i]]`kmnc 4]ZWſK Nw δ="q] z~HcG6k8]rqM-[o}wpǻF78: 7c1p`P0u/[;~4x^!dTyƧ |0bXL^8sŶ'/]·Ӄho] p=įEƝ7+cdqB?lCȾ| ըip9&`ɺ828F!lMD^/C"z"GuHsB{l7NƭSpvaCHi4CʀO?!"F ]lpLm30¦G#il1>@Π!3)hpyw;wN]spv5Fꌫ(?o F>F]SK+y~go68cpNqi`7쐶8 3P>n^(12[_-[߯XخÊ51zߴSnĬ0f,ٻ+lC[6l? {Ooǡ;pN;.Ǖ=܃ߋ}H ݏȏ>X;L8I 4¼mL9_bZ¾U;Scgp-wK5/6n#·w|wq-<>n%>ݔ4dr>EBg\#cl| ̨|OK,V? >}k78~3_ֿ?o5"?# Fdoq3Y<_]yjiԫ͟GGO =<}_VW5 }-ww?ܽ>=!pn?|ZGqpӇOxC<$_ׄ?3_QG?5}gǟM]O_>W_~M}5~C~k 7>G鷂?׿ 5nj'!O'qO]6g|Fx??_ T_6_hM6?w{5ӯ<{4< Oz@Ohxip O? ix^4< 48y4ϏH?,wac8:G΃abij+vm _̂taFs#/n|?|ıuH- T}ݘ2k)%w'P'GݝG?Ov71y-zMWX!$  >B`w0ó'˫3:^xMnrjˇ !Z4k wĄW`, - ,?1&Hp1 Q [|m6u6RQ(,6Jo9wО ߏh ,Bă2ٟ ?}_l=|(8g_(Pו[=H H0ƇGv>/qV\xպ+1u0p,͋jbMd?W%Ayަt:'`gŋ{{{q'\ "RJ=KyܿwsF0̔"% kxrΐcp68s!$OWeT[ t6 추R{^hÎ7v$^u! Ybd98y J{d\b S+>0 PEo'Fɇ zq2hF2JgFu&RalR)C#3A|Pleƃ<|>?x?~::> d; :ywx16 7B ;}gy\#ZgNg@!T!e0+6& ?0 c׎TZ=ի$` nsKv/`.' /sJ ,6L; T.fc4,XԋvQh4ئR(1 ͢;9af!uP &M9=+; l#@<(ed73iQ )%I)IRaKhY"rՕdǜphcy7+DVZ`PA$Rjfp=aʹ J"i =ǏkDx2 NEDR÷kĭC`q]l` &%oL'߼vO~{s}ퟏGL׭r4Q/f6ۣA6Ž7l

     J5[ /?~|ffQdIY`w!/~Ha`rjX J\AH ѻwX µ=Ow%6u1\\ѢJ5HZ,0;/joo/"æY@k%U?oyxmmn60p˼pbͪPS$`:,h־b =/2BO6{Auٍb2M%2vF]׀tb|9iq+ $H) ߣ٬y[խ=( 'o/./8e5_ *:8=KrV0E^nu,`hxJm[qN̵OUϕYXa6}Hx؜o}T-Hi3% [ͼc|gϯf0ZAkƬbAPȫI;aS:Y0q|5ƧIs֮E 4`("2O ѪGHְ~T (+Gk\A Z:~j)m]K=m̹v/(XP @ /hڗZ:X{7C%ˏ܆@`UMžض" жHPeh'Xdm>*X̵n6w2lEpn;݃stqQֳDPX,F^v"$U׺mI[HJl W&QDs9aJ9 f`⦓J{SIRy9mʡMk\IǵDee1;k_^]!Fk?XLYQ/c:9zurj{fc}xړN61&aQ`(@fponumm pjKpDDZza1xѭN&cL86yK٦>(0nl|tt͹Bnf&cƢjorQa:DVeN0C?kQg:׾NZH|[d)5"aXj;T%ݙ:WT9Φ%v";<=U[ %֞Tb5|^<ǧә/pXXÿ#.6Umt#sm/V <9>;PG|I.Nf~&SǤ)Q-RE=1,)G ^Z,*$a.io4RBΣM4TRn#wkXm j Fqs|-ΧZ3hcLSsG>vĆB@PJ`fy4~::9X}[ac2Ŷpw݈AJONg* IENDB`weston-1.9.0/src/0000775000175000017500000000000012600133270010624 500000000000000weston-1.9.0/src/input.c0000664000175000017500000020350312575610240012062 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "compositor.h" static void empty_region(pixman_region32_t *region) { pixman_region32_fini(region); pixman_region32_init(region); } static void unbind_resource(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); } WL_EXPORT void weston_seat_repick(struct weston_seat *seat) { const struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (!pointer) return; pointer->grab->interface->focus(pointer->grab); } static void weston_compositor_idle_inhibit(struct weston_compositor *compositor) { weston_compositor_wake(compositor); compositor->idle_inhibit++; } static void weston_compositor_idle_release(struct weston_compositor *compositor) { compositor->idle_inhibit--; weston_compositor_wake(compositor); } static void pointer_focus_view_destroyed(struct wl_listener *listener, void *data) { struct weston_pointer *pointer = container_of(listener, struct weston_pointer, focus_view_listener); weston_pointer_clear_focus(pointer); } static void pointer_focus_resource_destroyed(struct wl_listener *listener, void *data) { struct weston_pointer *pointer = container_of(listener, struct weston_pointer, focus_resource_listener); weston_pointer_clear_focus(pointer); } static void keyboard_focus_resource_destroyed(struct wl_listener *listener, void *data) { struct weston_keyboard *keyboard = container_of(listener, struct weston_keyboard, focus_resource_listener); weston_keyboard_set_focus(keyboard, NULL); } static void touch_focus_view_destroyed(struct wl_listener *listener, void *data) { struct weston_touch *touch = container_of(listener, struct weston_touch, focus_view_listener); weston_touch_set_focus(touch, NULL); } static void touch_focus_resource_destroyed(struct wl_listener *listener, void *data) { struct weston_touch *touch = container_of(listener, struct weston_touch, focus_resource_listener); weston_touch_set_focus(touch, NULL); } static void move_resources(struct wl_list *destination, struct wl_list *source) { wl_list_insert_list(destination, source); wl_list_init(source); } static void move_resources_for_client(struct wl_list *destination, struct wl_list *source, struct wl_client *client) { struct wl_resource *resource, *tmp; wl_resource_for_each_safe(resource, tmp, source) { if (wl_resource_get_client(resource) == client) { wl_list_remove(wl_resource_get_link(resource)); wl_list_insert(destination, wl_resource_get_link(resource)); } } } static void default_grab_pointer_focus(struct weston_pointer_grab *grab) { struct weston_pointer *pointer = grab->pointer; struct weston_view *view; wl_fixed_t sx, sy; if (pointer->button_count > 0) return; view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (pointer->focus != view || pointer->sx != sx || pointer->sy != sy) weston_pointer_set_focus(pointer, view, sx, sy); } static void default_grab_pointer_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct weston_pointer *pointer = grab->pointer; struct wl_list *resource_list; struct wl_resource *resource; if (pointer->focus) weston_view_from_global_fixed(pointer->focus, x, y, &pointer->sx, &pointer->sy); weston_pointer_move(pointer, x, y); resource_list = &pointer->focus_resource_list; wl_resource_for_each(resource, resource_list) { wl_pointer_send_motion(resource, time, pointer->sx, pointer->sy); } } static void default_grab_pointer_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct weston_pointer *pointer = grab->pointer; struct weston_compositor *compositor = pointer->seat->compositor; struct weston_view *view; struct wl_resource *resource; uint32_t serial; enum wl_pointer_button_state state = state_w; struct wl_display *display = compositor->wl_display; wl_fixed_t sx, sy; struct wl_list *resource_list; resource_list = &pointer->focus_resource_list; if (!wl_list_empty(resource_list)) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, resource_list) wl_pointer_send_button(resource, serial, time, button, state_w); } if (pointer->button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { view = weston_compositor_pick_view(compositor, pointer->x, pointer->y, &sx, &sy); weston_pointer_set_focus(pointer, view, sx, sy); } } static void default_grab_pointer_cancel(struct weston_pointer_grab *grab) { } static const struct weston_pointer_grab_interface default_pointer_grab_interface = { default_grab_pointer_focus, default_grab_pointer_motion, default_grab_pointer_button, default_grab_pointer_cancel, }; static void default_grab_touch_down(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct weston_touch *touch = grab->touch; struct wl_display *display = touch->seat->compositor->wl_display; uint32_t serial; struct wl_resource *resource; struct wl_list *resource_list; wl_fixed_t sx, sy; weston_view_from_global_fixed(touch->focus, x, y, &sx, &sy); resource_list = &touch->focus_resource_list; if (!wl_list_empty(resource_list) && touch->focus) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, resource_list) wl_touch_send_down(resource, serial, time, touch->focus->surface->resource, touch_id, sx, sy); } } static void default_grab_touch_up(struct weston_touch_grab *grab, uint32_t time, int touch_id) { struct weston_touch *touch = grab->touch; struct wl_display *display = touch->seat->compositor->wl_display; uint32_t serial; struct wl_resource *resource; struct wl_list *resource_list; resource_list = &touch->focus_resource_list; if (!wl_list_empty(resource_list)) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, resource_list) wl_touch_send_up(resource, serial, time, touch_id); } } static void default_grab_touch_motion(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct weston_touch *touch = grab->touch; struct wl_resource *resource; struct wl_list *resource_list; wl_fixed_t sx, sy; weston_view_from_global_fixed(touch->focus, x, y, &sx, &sy); resource_list = &touch->focus_resource_list; wl_resource_for_each(resource, resource_list) { wl_touch_send_motion(resource, time, touch_id, sx, sy); } } static void default_grab_touch_frame(struct weston_touch_grab *grab) { struct wl_resource *resource; wl_resource_for_each(resource, &grab->touch->focus_resource_list) wl_touch_send_frame(resource); } static void default_grab_touch_cancel(struct weston_touch_grab *grab) { } static const struct weston_touch_grab_interface default_touch_grab_interface = { default_grab_touch_down, default_grab_touch_up, default_grab_touch_motion, default_grab_touch_frame, default_grab_touch_cancel, }; static void default_grab_keyboard_key(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state) { struct weston_keyboard *keyboard = grab->keyboard; struct wl_resource *resource; struct wl_display *display = keyboard->seat->compositor->wl_display; uint32_t serial; struct wl_list *resource_list; resource_list = &keyboard->focus_resource_list; if (!wl_list_empty(resource_list)) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, resource_list) wl_keyboard_send_key(resource, serial, time, key, state); } } static void send_modifiers_to_resource(struct weston_keyboard *keyboard, struct wl_resource *resource, uint32_t serial) { wl_keyboard_send_modifiers(resource, serial, keyboard->modifiers.mods_depressed, keyboard->modifiers.mods_latched, keyboard->modifiers.mods_locked, keyboard->modifiers.group); } static void send_modifiers_to_client_in_list(struct wl_client *client, struct wl_list *list, uint32_t serial, struct weston_keyboard *keyboard) { struct wl_resource *resource; wl_resource_for_each(resource, list) { if (wl_resource_get_client(resource) == client) send_modifiers_to_resource(keyboard, resource, serial); } } static struct wl_resource * find_resource_for_surface(struct wl_list *list, struct weston_surface *surface) { if (!surface) return NULL; if (!surface->resource) return NULL; return wl_resource_find_for_client(list, wl_resource_get_client(surface->resource)); } static struct wl_resource * find_resource_for_view(struct wl_list *list, struct weston_view *view) { if (!view) return NULL; return find_resource_for_surface(list, view->surface); } static void default_grab_keyboard_modifiers(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct weston_keyboard *keyboard = grab->keyboard; struct weston_pointer *pointer = weston_seat_get_pointer(grab->keyboard->seat); struct wl_resource *resource; struct wl_list *resource_list; resource_list = &keyboard->focus_resource_list; wl_resource_for_each(resource, resource_list) { wl_keyboard_send_modifiers(resource, serial, mods_depressed, mods_latched, mods_locked, group); } if (pointer && pointer->focus && pointer->focus->surface->resource && pointer->focus->surface != keyboard->focus) { struct wl_client *pointer_client = wl_resource_get_client(pointer->focus->surface->resource); send_modifiers_to_client_in_list(pointer_client, &keyboard->resource_list, serial, keyboard); } } static void default_grab_keyboard_cancel(struct weston_keyboard_grab *grab) { } static const struct weston_keyboard_grab_interface default_keyboard_grab_interface = { default_grab_keyboard_key, default_grab_keyboard_modifiers, default_grab_keyboard_cancel, }; static void pointer_unmap_sprite(struct weston_pointer *pointer) { struct weston_surface *surface = pointer->sprite->surface; if (weston_surface_is_mapped(surface)) weston_surface_unmap(surface); wl_list_remove(&pointer->sprite_destroy_listener.link); surface->configure = NULL; surface->configure_private = NULL; weston_surface_set_label_func(surface, NULL); weston_view_destroy(pointer->sprite); pointer->sprite = NULL; } static void pointer_handle_sprite_destroy(struct wl_listener *listener, void *data) { struct weston_pointer *pointer = container_of(listener, struct weston_pointer, sprite_destroy_listener); pointer->sprite = NULL; } static void weston_pointer_reset_state(struct weston_pointer *pointer) { pointer->button_count = 0; } static void weston_pointer_handle_output_destroy(struct wl_listener *listener, void *data); WL_EXPORT struct weston_pointer * weston_pointer_create(struct weston_seat *seat) { struct weston_pointer *pointer; pointer = zalloc(sizeof *pointer); if (pointer == NULL) return NULL; wl_list_init(&pointer->resource_list); wl_list_init(&pointer->focus_resource_list); weston_pointer_set_default_grab(pointer, seat->compositor->default_pointer_grab); wl_list_init(&pointer->focus_resource_listener.link); pointer->focus_resource_listener.notify = pointer_focus_resource_destroyed; pointer->default_grab.pointer = pointer; pointer->grab = &pointer->default_grab; wl_signal_init(&pointer->motion_signal); wl_signal_init(&pointer->focus_signal); wl_list_init(&pointer->focus_view_listener.link); pointer->sprite_destroy_listener.notify = pointer_handle_sprite_destroy; /* FIXME: Pick better co-ords. */ pointer->x = wl_fixed_from_int(100); pointer->y = wl_fixed_from_int(100); pointer->output_destroy_listener.notify = weston_pointer_handle_output_destroy; wl_signal_add(&seat->compositor->output_destroyed_signal, &pointer->output_destroy_listener); pointer->sx = wl_fixed_from_int(-1000000); pointer->sy = wl_fixed_from_int(-1000000); return pointer; } WL_EXPORT void weston_pointer_destroy(struct weston_pointer *pointer) { if (pointer->sprite) pointer_unmap_sprite(pointer); /* XXX: What about pointer->resource_list? */ wl_list_remove(&pointer->focus_resource_listener.link); wl_list_remove(&pointer->focus_view_listener.link); wl_list_remove(&pointer->output_destroy_listener.link); free(pointer); } void weston_pointer_set_default_grab(struct weston_pointer *pointer, const struct weston_pointer_grab_interface *interface) { if (interface) pointer->default_grab.interface = interface; else pointer->default_grab.interface = &default_pointer_grab_interface; } WL_EXPORT struct weston_keyboard * weston_keyboard_create(void) { struct weston_keyboard *keyboard; keyboard = zalloc(sizeof *keyboard); if (keyboard == NULL) return NULL; wl_list_init(&keyboard->resource_list); wl_list_init(&keyboard->focus_resource_list); wl_list_init(&keyboard->focus_resource_listener.link); keyboard->focus_resource_listener.notify = keyboard_focus_resource_destroyed; wl_array_init(&keyboard->keys); keyboard->default_grab.interface = &default_keyboard_grab_interface; keyboard->default_grab.keyboard = keyboard; keyboard->grab = &keyboard->default_grab; wl_signal_init(&keyboard->focus_signal); return keyboard; } static void weston_xkb_info_destroy(struct weston_xkb_info *xkb_info); WL_EXPORT void weston_keyboard_destroy(struct weston_keyboard *keyboard) { /* XXX: What about keyboard->resource_list? */ #ifdef ENABLE_XKBCOMMON if (keyboard->seat->compositor->use_xkbcommon) { xkb_state_unref(keyboard->xkb_state.state); if (keyboard->xkb_info) weston_xkb_info_destroy(keyboard->xkb_info); xkb_keymap_unref(keyboard->pending_keymap); } #endif wl_array_release(&keyboard->keys); wl_list_remove(&keyboard->focus_resource_listener.link); free(keyboard); } static void weston_touch_reset_state(struct weston_touch *touch) { touch->num_tp = 0; } WL_EXPORT struct weston_touch * weston_touch_create(void) { struct weston_touch *touch; touch = zalloc(sizeof *touch); if (touch == NULL) return NULL; wl_list_init(&touch->resource_list); wl_list_init(&touch->focus_resource_list); wl_list_init(&touch->focus_view_listener.link); touch->focus_view_listener.notify = touch_focus_view_destroyed; wl_list_init(&touch->focus_resource_listener.link); touch->focus_resource_listener.notify = touch_focus_resource_destroyed; touch->default_grab.interface = &default_touch_grab_interface; touch->default_grab.touch = touch; touch->grab = &touch->default_grab; wl_signal_init(&touch->focus_signal); return touch; } WL_EXPORT void weston_touch_destroy(struct weston_touch *touch) { /* XXX: What about touch->resource_list? */ wl_list_remove(&touch->focus_view_listener.link); wl_list_remove(&touch->focus_resource_listener.link); free(touch); } static void seat_send_updated_caps(struct weston_seat *seat) { enum wl_seat_capability caps = 0; struct wl_resource *resource; if (seat->pointer_device_count > 0) caps |= WL_SEAT_CAPABILITY_POINTER; if (seat->keyboard_device_count > 0) caps |= WL_SEAT_CAPABILITY_KEYBOARD; if (seat->touch_device_count > 0) caps |= WL_SEAT_CAPABILITY_TOUCH; wl_resource_for_each(resource, &seat->base_resource_list) { wl_seat_send_capabilities(resource, caps); } wl_signal_emit(&seat->updated_caps_signal, seat); } /** Clear the pointer focus * * \param pointer the pointer to clear focus for. * * This can be used to unset pointer focus and set the co-ordinates to the * arbitrary values we use for the no focus case. * * There's no requirement to use this function. For example, passing the * results of a weston_compositor_pick_view() directly to * weston_pointer_set_focus() will do the right thing when no view is found. */ WL_EXPORT void weston_pointer_clear_focus(struct weston_pointer *pointer) { weston_pointer_set_focus(pointer, NULL, wl_fixed_from_int(-1000000), wl_fixed_from_int(-1000000)); } WL_EXPORT void weston_pointer_set_focus(struct weston_pointer *pointer, struct weston_view *view, wl_fixed_t sx, wl_fixed_t sy) { struct weston_keyboard *kbd = weston_seat_get_keyboard(pointer->seat); struct wl_resource *resource; struct wl_display *display = pointer->seat->compositor->wl_display; uint32_t serial; struct wl_list *focus_resource_list; int refocus = 0; if ((!pointer->focus && view) || (pointer->focus && !view) || (pointer->focus && pointer->focus->surface != view->surface) || pointer->sx != sx || pointer->sy != sy) refocus = 1; focus_resource_list = &pointer->focus_resource_list; if (!wl_list_empty(focus_resource_list) && refocus) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, focus_resource_list) { wl_pointer_send_leave(resource, serial, pointer->focus->surface->resource); } move_resources(&pointer->resource_list, focus_resource_list); } if (find_resource_for_view(&pointer->resource_list, view) && refocus) { struct wl_client *surface_client = wl_resource_get_client(view->surface->resource); serial = wl_display_next_serial(display); if (kbd && kbd->focus != view->surface) send_modifiers_to_client_in_list(surface_client, &kbd->resource_list, serial, kbd); move_resources_for_client(focus_resource_list, &pointer->resource_list, surface_client); wl_resource_for_each(resource, focus_resource_list) { wl_pointer_send_enter(resource, serial, view->surface->resource, sx, sy); } pointer->focus_serial = serial; } wl_list_remove(&pointer->focus_view_listener.link); wl_list_init(&pointer->focus_view_listener.link); wl_list_remove(&pointer->focus_resource_listener.link); wl_list_init(&pointer->focus_resource_listener.link); if (view) wl_signal_add(&view->destroy_signal, &pointer->focus_view_listener); if (view && view->surface->resource) wl_resource_add_destroy_listener(view->surface->resource, &pointer->focus_resource_listener); pointer->focus = view; pointer->focus_view_listener.notify = pointer_focus_view_destroyed; pointer->sx = sx; pointer->sy = sy; assert(view || sx == wl_fixed_from_int(-1000000)); assert(view || sy == wl_fixed_from_int(-1000000)); wl_signal_emit(&pointer->focus_signal, pointer); } static void send_enter_to_resource_list(struct wl_list *list, struct weston_keyboard *keyboard, struct weston_surface *surface, uint32_t serial) { struct wl_resource *resource; wl_resource_for_each(resource, list) { send_modifiers_to_resource(keyboard, resource, serial); wl_keyboard_send_enter(resource, serial, surface->resource, &keyboard->keys); } } WL_EXPORT void weston_keyboard_set_focus(struct weston_keyboard *keyboard, struct weston_surface *surface) { struct wl_resource *resource; struct wl_display *display = keyboard->seat->compositor->wl_display; uint32_t serial; struct wl_list *focus_resource_list; focus_resource_list = &keyboard->focus_resource_list; if (!wl_list_empty(focus_resource_list) && keyboard->focus != surface) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, focus_resource_list) { wl_keyboard_send_leave(resource, serial, keyboard->focus->resource); } move_resources(&keyboard->resource_list, focus_resource_list); } if (find_resource_for_surface(&keyboard->resource_list, surface) && keyboard->focus != surface) { struct wl_client *surface_client = wl_resource_get_client(surface->resource); serial = wl_display_next_serial(display); move_resources_for_client(focus_resource_list, &keyboard->resource_list, surface_client); send_enter_to_resource_list(focus_resource_list, keyboard, surface, serial); keyboard->focus_serial = serial; } wl_list_remove(&keyboard->focus_resource_listener.link); wl_list_init(&keyboard->focus_resource_listener.link); if (surface && surface->resource) wl_resource_add_destroy_listener(surface->resource, &keyboard->focus_resource_listener); keyboard->focus = surface; wl_signal_emit(&keyboard->focus_signal, keyboard); } /* Users of this function must manually manage the keyboard focus */ WL_EXPORT void weston_keyboard_start_grab(struct weston_keyboard *keyboard, struct weston_keyboard_grab *grab) { keyboard->grab = grab; grab->keyboard = keyboard; } WL_EXPORT void weston_keyboard_end_grab(struct weston_keyboard *keyboard) { keyboard->grab = &keyboard->default_grab; } static void weston_keyboard_cancel_grab(struct weston_keyboard *keyboard) { keyboard->grab->interface->cancel(keyboard->grab); } WL_EXPORT void weston_pointer_start_grab(struct weston_pointer *pointer, struct weston_pointer_grab *grab) { pointer->grab = grab; grab->pointer = pointer; pointer->grab->interface->focus(pointer->grab); } WL_EXPORT void weston_pointer_end_grab(struct weston_pointer *pointer) { pointer->grab = &pointer->default_grab; pointer->grab->interface->focus(pointer->grab); } static void weston_pointer_cancel_grab(struct weston_pointer *pointer) { pointer->grab->interface->cancel(pointer->grab); } WL_EXPORT void weston_touch_start_grab(struct weston_touch *touch, struct weston_touch_grab *grab) { touch->grab = grab; grab->touch = touch; } WL_EXPORT void weston_touch_end_grab(struct weston_touch *touch) { touch->grab = &touch->default_grab; } static void weston_touch_cancel_grab(struct weston_touch *touch) { touch->grab->interface->cancel(touch->grab); } static void weston_pointer_clamp_for_output(struct weston_pointer *pointer, struct weston_output *output, wl_fixed_t *fx, wl_fixed_t *fy) { int x, y; x = wl_fixed_to_int(*fx); y = wl_fixed_to_int(*fy); if (x < output->x) *fx = wl_fixed_from_int(output->x); else if (x >= output->x + output->width) *fx = wl_fixed_from_int(output->x + output->width - 1); if (y < output->y) *fy = wl_fixed_from_int(output->y); else if (y >= output->y + output->height) *fy = wl_fixed_from_int(output->y + output->height - 1); } WL_EXPORT void weston_pointer_clamp(struct weston_pointer *pointer, wl_fixed_t *fx, wl_fixed_t *fy) { struct weston_compositor *ec = pointer->seat->compositor; struct weston_output *output, *prev = NULL; int x, y, old_x, old_y, valid = 0; x = wl_fixed_to_int(*fx); y = wl_fixed_to_int(*fy); old_x = wl_fixed_to_int(pointer->x); old_y = wl_fixed_to_int(pointer->y); wl_list_for_each(output, &ec->output_list, link) { if (pointer->seat->output && pointer->seat->output != output) continue; if (pixman_region32_contains_point(&output->region, x, y, NULL)) valid = 1; if (pixman_region32_contains_point(&output->region, old_x, old_y, NULL)) prev = output; } if (!prev) prev = pointer->seat->output; if (prev && !valid) weston_pointer_clamp_for_output(pointer, prev, fx, fy); } /* Takes absolute values */ WL_EXPORT void weston_pointer_move(struct weston_pointer *pointer, wl_fixed_t x, wl_fixed_t y) { int32_t ix, iy; weston_pointer_clamp (pointer, &x, &y); pointer->x = x; pointer->y = y; ix = wl_fixed_to_int(x); iy = wl_fixed_to_int(y); if (pointer->sprite) { weston_view_set_position(pointer->sprite, ix - pointer->hotspot_x, iy - pointer->hotspot_y); weston_view_schedule_repaint(pointer->sprite); } pointer->grab->interface->focus(pointer->grab); wl_signal_emit(&pointer->motion_signal, pointer); } /** Verify if the pointer is in a valid position and move it if it isn't. */ static void weston_pointer_handle_output_destroy(struct wl_listener *listener, void *data) { struct weston_pointer *pointer; struct weston_compositor *ec; struct weston_output *output, *closest = NULL; int x, y, distance, min = INT_MAX; wl_fixed_t fx, fy; pointer = container_of(listener, struct weston_pointer, output_destroy_listener); ec = pointer->seat->compositor; x = wl_fixed_to_int(pointer->x); y = wl_fixed_to_int(pointer->y); wl_list_for_each(output, &ec->output_list, link) { if (pixman_region32_contains_point(&output->region, x, y, NULL)) return; /* Aproximante the distance from the pointer to the center of * the output. */ distance = abs(output->x + output->width / 2 - x) + abs(output->y + output->height / 2 - y); if (distance < min) { min = distance; closest = output; } } /* Nothing to do if there's no output left. */ if (!closest) return; fx = pointer->x; fy = pointer->y; weston_pointer_clamp_for_output(pointer, closest, &fx, &fy); weston_pointer_move(pointer, fx, fy); } WL_EXPORT void notify_motion(struct weston_seat *seat, uint32_t time, wl_fixed_t dx, wl_fixed_t dy) { struct weston_compositor *ec = seat->compositor; struct weston_pointer *pointer = weston_seat_get_pointer(seat); weston_compositor_wake(ec); pointer->grab->interface->motion(pointer->grab, time, pointer->x + dx, pointer->y + dy); } static void run_modifier_bindings(struct weston_seat *seat, uint32_t old, uint32_t new) { struct weston_compositor *compositor = seat->compositor; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); uint32_t diff; unsigned int i; struct { uint32_t xkb; enum weston_keyboard_modifier weston; } mods[] = { { keyboard->xkb_info->ctrl_mod, MODIFIER_CTRL }, { keyboard->xkb_info->alt_mod, MODIFIER_ALT }, { keyboard->xkb_info->super_mod, MODIFIER_SUPER }, { keyboard->xkb_info->shift_mod, MODIFIER_SHIFT }, }; diff = new & ~old; for (i = 0; i < ARRAY_LENGTH(mods); i++) { if (diff & (1 << mods[i].xkb)) weston_compositor_run_modifier_binding(compositor, keyboard, mods[i].weston, WL_KEYBOARD_KEY_STATE_PRESSED); } diff = old & ~new; for (i = 0; i < ARRAY_LENGTH(mods); i++) { if (diff & (1 << mods[i].xkb)) weston_compositor_run_modifier_binding(compositor, keyboard, mods[i].weston, WL_KEYBOARD_KEY_STATE_RELEASED); } } WL_EXPORT void notify_motion_absolute(struct weston_seat *seat, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct weston_compositor *ec = seat->compositor; struct weston_pointer *pointer = weston_seat_get_pointer(seat); weston_compositor_wake(ec); pointer->grab->interface->motion(pointer->grab, time, x, y); } WL_EXPORT void weston_surface_activate(struct weston_surface *surface, struct weston_seat *seat) { struct weston_compositor *compositor = seat->compositor; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (keyboard) { weston_keyboard_set_focus(keyboard, surface); wl_data_device_set_keyboard_focus(seat); } wl_signal_emit(&compositor->activate_signal, surface); } WL_EXPORT void notify_button(struct weston_seat *seat, uint32_t time, int32_t button, enum wl_pointer_button_state state) { struct weston_compositor *compositor = seat->compositor; struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (state == WL_POINTER_BUTTON_STATE_PRESSED) { weston_compositor_idle_inhibit(compositor); if (pointer->button_count == 0) { pointer->grab_button = button; pointer->grab_time = time; pointer->grab_x = pointer->x; pointer->grab_y = pointer->y; } pointer->button_count++; } else { weston_compositor_idle_release(compositor); pointer->button_count--; } weston_compositor_run_button_binding(compositor, pointer, time, button, state); pointer->grab->interface->button(pointer->grab, time, button, state); if (pointer->button_count == 1) pointer->grab_serial = wl_display_get_serial(compositor->wl_display); } WL_EXPORT void notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis, wl_fixed_t value) { struct weston_compositor *compositor = seat->compositor; struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct wl_resource *resource; struct wl_list *resource_list; weston_compositor_wake(compositor); if (!value) return; if (weston_compositor_run_axis_binding(compositor, pointer, time, axis, value)) return; resource_list = &pointer->focus_resource_list; wl_resource_for_each(resource, resource_list) wl_pointer_send_axis(resource, time, axis, value); } WL_EXPORT int weston_keyboard_set_locks(struct weston_keyboard *keyboard, uint32_t mask, uint32_t value) { #ifdef ENABLE_XKBCOMMON uint32_t serial; xkb_mod_mask_t mods_depressed, mods_latched, mods_locked, group; xkb_mod_mask_t num, caps; /* We don't want the leds to go out of sync with the actual state * so if the backend has no way to change the leds don't try to * change the state */ if (!keyboard->seat->led_update) return -1; mods_depressed = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_DEPRESSED); mods_latched = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_LATCHED); mods_locked = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_LOCKED); group = xkb_state_serialize_group(keyboard->xkb_state.state, XKB_STATE_EFFECTIVE); num = (1 << keyboard->xkb_info->mod2_mod); caps = (1 << keyboard->xkb_info->caps_mod); if (mask & WESTON_NUM_LOCK) { if (value & WESTON_NUM_LOCK) mods_locked |= num; else mods_locked &= ~num; } if (mask & WESTON_CAPS_LOCK) { if (value & WESTON_CAPS_LOCK) mods_locked |= caps; else mods_locked &= ~caps; } xkb_state_update_mask(keyboard->xkb_state.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); serial = wl_display_next_serial( keyboard->seat->compositor->wl_display); notify_modifiers(keyboard->seat, serial); return 0; #else return -1; #endif } #ifdef ENABLE_XKBCOMMON WL_EXPORT void notify_modifiers(struct weston_seat *seat, uint32_t serial) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_keyboard_grab *grab = keyboard->grab; uint32_t mods_depressed, mods_latched, mods_locked, group; uint32_t mods_lookup; enum weston_led leds = 0; int changed = 0; /* Serialize and update our internal state, checking to see if it's * different to the previous state. */ mods_depressed = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_MODS_DEPRESSED); mods_latched = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_MODS_LATCHED); mods_locked = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_MODS_LOCKED); group = xkb_state_serialize_layout(keyboard->xkb_state.state, XKB_STATE_LAYOUT_EFFECTIVE); if (mods_depressed != keyboard->modifiers.mods_depressed || mods_latched != keyboard->modifiers.mods_latched || mods_locked != keyboard->modifiers.mods_locked || group != keyboard->modifiers.group) changed = 1; run_modifier_bindings(seat, keyboard->modifiers.mods_depressed, mods_depressed); keyboard->modifiers.mods_depressed = mods_depressed; keyboard->modifiers.mods_latched = mods_latched; keyboard->modifiers.mods_locked = mods_locked; keyboard->modifiers.group = group; /* And update the modifier_state for bindings. */ mods_lookup = mods_depressed | mods_latched; seat->modifier_state = 0; if (mods_lookup & (1 << keyboard->xkb_info->ctrl_mod)) seat->modifier_state |= MODIFIER_CTRL; if (mods_lookup & (1 << keyboard->xkb_info->alt_mod)) seat->modifier_state |= MODIFIER_ALT; if (mods_lookup & (1 << keyboard->xkb_info->super_mod)) seat->modifier_state |= MODIFIER_SUPER; if (mods_lookup & (1 << keyboard->xkb_info->shift_mod)) seat->modifier_state |= MODIFIER_SHIFT; /* Finally, notify the compositor that LEDs have changed. */ if (xkb_state_led_index_is_active(keyboard->xkb_state.state, keyboard->xkb_info->num_led)) leds |= LED_NUM_LOCK; if (xkb_state_led_index_is_active(keyboard->xkb_state.state, keyboard->xkb_info->caps_led)) leds |= LED_CAPS_LOCK; if (xkb_state_led_index_is_active(keyboard->xkb_state.state, keyboard->xkb_info->scroll_led)) leds |= LED_SCROLL_LOCK; if (leds != keyboard->xkb_state.leds && seat->led_update) seat->led_update(seat, leds); keyboard->xkb_state.leds = leds; if (changed) { grab->interface->modifiers(grab, serial, keyboard->modifiers.mods_depressed, keyboard->modifiers.mods_latched, keyboard->modifiers.mods_locked, keyboard->modifiers.group); } } static void update_modifier_state(struct weston_seat *seat, uint32_t serial, uint32_t key, enum wl_keyboard_key_state state) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); enum xkb_key_direction direction; /* Keyboard modifiers don't exist in raw keyboard mode */ if (!seat->compositor->use_xkbcommon) return; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) direction = XKB_KEY_DOWN; else direction = XKB_KEY_UP; /* Offset the keycode by 8, as the evdev XKB rules reflect X's * broken keycode system, which starts at 8. */ xkb_state_update_key(keyboard->xkb_state.state, key + 8, direction); notify_modifiers(seat, serial); } static void send_keymap(struct wl_resource *resource, struct weston_xkb_info *xkb_info) { wl_keyboard_send_keymap(resource, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, xkb_info->keymap_fd, xkb_info->keymap_size); } static void send_modifiers(struct wl_resource *resource, uint32_t serial, struct weston_keyboard *keyboard) { wl_keyboard_send_modifiers(resource, serial, keyboard->modifiers.mods_depressed, keyboard->modifiers.mods_latched, keyboard->modifiers.mods_locked, keyboard->modifiers.group); } static struct weston_xkb_info * weston_xkb_info_create(struct xkb_keymap *keymap); static void update_keymap(struct weston_seat *seat) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct wl_resource *resource; struct weston_xkb_info *xkb_info; struct xkb_state *state; xkb_mod_mask_t latched_mods; xkb_mod_mask_t locked_mods; xkb_info = weston_xkb_info_create(keyboard->pending_keymap); xkb_keymap_unref(keyboard->pending_keymap); keyboard->pending_keymap = NULL; if (!xkb_info) { weston_log("failed to create XKB info\n"); return; } state = xkb_state_new(xkb_info->keymap); if (!state) { weston_log("failed to initialise XKB state\n"); weston_xkb_info_destroy(xkb_info); return; } latched_mods = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_MODS_LATCHED); locked_mods = xkb_state_serialize_mods(keyboard->xkb_state.state, XKB_STATE_MODS_LOCKED); xkb_state_update_mask(state, 0, /* depressed */ latched_mods, locked_mods, 0, 0, 0); weston_xkb_info_destroy(keyboard->xkb_info); keyboard->xkb_info = xkb_info; xkb_state_unref(keyboard->xkb_state.state); keyboard->xkb_state.state = state; wl_resource_for_each(resource, &keyboard->resource_list) send_keymap(resource, xkb_info); wl_resource_for_each(resource, &keyboard->focus_resource_list) send_keymap(resource, xkb_info); notify_modifiers(seat, wl_display_next_serial(seat->compositor->wl_display)); if (!latched_mods && !locked_mods) return; wl_resource_for_each(resource, &keyboard->resource_list) send_modifiers(resource, wl_display_get_serial(seat->compositor->wl_display), keyboard); wl_resource_for_each(resource, &keyboard->focus_resource_list) send_modifiers(resource, wl_display_get_serial(seat->compositor->wl_display), keyboard); } #else WL_EXPORT void notify_modifiers(struct weston_seat *seat, uint32_t serial) { } static void update_modifier_state(struct weston_seat *seat, uint32_t serial, uint32_t key, enum wl_keyboard_key_state state) { } static void update_keymap(struct weston_seat *seat) { } #endif WL_EXPORT void notify_key(struct weston_seat *seat, uint32_t time, uint32_t key, enum wl_keyboard_key_state state, enum weston_key_state_update update_state) { struct weston_compositor *compositor = seat->compositor; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_keyboard_grab *grab = keyboard->grab; uint32_t *k, *end; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { weston_compositor_idle_inhibit(compositor); } else { weston_compositor_idle_release(compositor); } end = keyboard->keys.data + keyboard->keys.size; for (k = keyboard->keys.data; k < end; k++) { if (*k == key) { /* Ignore server-generated repeats. */ if (state == WL_KEYBOARD_KEY_STATE_PRESSED) return; *k = *--end; } } keyboard->keys.size = (void *) end - keyboard->keys.data; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { k = wl_array_add(&keyboard->keys, sizeof *k); *k = key; } if (grab == &keyboard->default_grab || grab == &keyboard->input_method_grab) { weston_compositor_run_key_binding(compositor, keyboard, time, key, state); grab = keyboard->grab; } grab->interface->key(grab, time, key, state); if (keyboard->pending_keymap && keyboard->keys.size == 0) update_keymap(seat); if (update_state == STATE_UPDATE_AUTOMATIC) { update_modifier_state(seat, wl_display_get_serial(compositor->wl_display), key, state); } if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { keyboard->grab_serial = wl_display_get_serial(compositor->wl_display); keyboard->grab_time = time; keyboard->grab_key = key; } } WL_EXPORT void notify_pointer_focus(struct weston_seat *seat, struct weston_output *output, wl_fixed_t x, wl_fixed_t y) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (output) { weston_pointer_move(pointer, x, y); } else { /* FIXME: We should call weston_pointer_set_focus(seat, * NULL) here, but somehow that breaks re-entry... */ } } static void destroy_device_saved_kbd_focus(struct wl_listener *listener, void *data) { struct weston_seat *ws; ws = container_of(listener, struct weston_seat, saved_kbd_focus_listener); ws->saved_kbd_focus = NULL; } WL_EXPORT void notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys, enum weston_key_state_update update_state) { struct weston_compositor *compositor = seat->compositor; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_surface *surface; uint32_t *k, serial; serial = wl_display_next_serial(compositor->wl_display); wl_array_copy(&keyboard->keys, keys); wl_array_for_each(k, &keyboard->keys) { weston_compositor_idle_inhibit(compositor); if (update_state == STATE_UPDATE_AUTOMATIC) update_modifier_state(seat, serial, *k, WL_KEYBOARD_KEY_STATE_PRESSED); } surface = seat->saved_kbd_focus; if (surface) { wl_list_remove(&seat->saved_kbd_focus_listener.link); weston_keyboard_set_focus(keyboard, surface); seat->saved_kbd_focus = NULL; } } WL_EXPORT void notify_keyboard_focus_out(struct weston_seat *seat) { struct weston_compositor *compositor = seat->compositor; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); uint32_t *k, serial; serial = wl_display_next_serial(compositor->wl_display); wl_array_for_each(k, &keyboard->keys) { weston_compositor_idle_release(compositor); update_modifier_state(seat, serial, *k, WL_KEYBOARD_KEY_STATE_RELEASED); } seat->modifier_state = 0; if (keyboard->focus) { seat->saved_kbd_focus = keyboard->focus; seat->saved_kbd_focus_listener.notify = destroy_device_saved_kbd_focus; wl_signal_add(&keyboard->focus->destroy_signal, &seat->saved_kbd_focus_listener); } weston_keyboard_set_focus(keyboard, NULL); weston_keyboard_cancel_grab(keyboard); if (pointer) weston_pointer_cancel_grab(pointer); } WL_EXPORT void weston_touch_set_focus(struct weston_touch *touch, struct weston_view *view) { struct wl_list *focus_resource_list; focus_resource_list = &touch->focus_resource_list; if (view && touch->focus && touch->focus->surface == view->surface) { touch->focus = view; return; } wl_list_remove(&touch->focus_resource_listener.link); wl_list_init(&touch->focus_resource_listener.link); wl_list_remove(&touch->focus_view_listener.link); wl_list_init(&touch->focus_view_listener.link); if (!wl_list_empty(focus_resource_list)) { move_resources(&touch->resource_list, focus_resource_list); } if (view) { struct wl_client *surface_client; if (!view->surface->resource) { touch->focus = NULL; return; } surface_client = wl_resource_get_client(view->surface->resource); move_resources_for_client(focus_resource_list, &touch->resource_list, surface_client); wl_resource_add_destroy_listener(view->surface->resource, &touch->focus_resource_listener); wl_signal_add(&view->destroy_signal, &touch->focus_view_listener); } touch->focus = view; } /** * notify_touch - emulates button touches and notifies surfaces accordingly. * * It assumes always the correct cycle sequence until it gets here: touch_down * → touch_update → ... → touch_update → touch_end. The driver is responsible * for sending along such order. * */ WL_EXPORT void notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y, int touch_type) { struct weston_compositor *ec = seat->compositor; struct weston_touch *touch = weston_seat_get_touch(seat); struct weston_touch_grab *grab = touch->grab; struct weston_view *ev; wl_fixed_t sx, sy; /* Update grab's global coordinates. */ if (touch_id == touch->grab_touch_id && touch_type != WL_TOUCH_UP) { touch->grab_x = x; touch->grab_y = y; } switch (touch_type) { case WL_TOUCH_DOWN: weston_compositor_idle_inhibit(ec); touch->num_tp++; /* the first finger down picks the view, and all further go * to that view for the remainder of the touch session i.e. * until all touch points are up again. */ if (touch->num_tp == 1) { ev = weston_compositor_pick_view(ec, x, y, &sx, &sy); weston_touch_set_focus(touch, ev); } else if (!touch->focus) { /* Unexpected condition: We have non-initial touch but * there is no focused surface. */ weston_log("touch event received with %d points down" "but no surface focused\n", touch->num_tp); return; } weston_compositor_run_touch_binding(ec, touch, time, touch_type); grab->interface->down(grab, time, touch_id, x, y); if (touch->num_tp == 1) { touch->grab_serial = wl_display_get_serial(ec->wl_display); touch->grab_touch_id = touch_id; touch->grab_time = time; touch->grab_x = x; touch->grab_y = y; } break; case WL_TOUCH_MOTION: ev = touch->focus; if (!ev) break; grab->interface->motion(grab, time, touch_id, x, y); break; case WL_TOUCH_UP: if (touch->num_tp == 0) { /* This can happen if we start out with one or * more fingers on the touch screen, in which * case we didn't get the corresponding down * event. */ weston_log("unmatched touch up event\n"); break; } weston_compositor_idle_release(ec); touch->num_tp--; grab->interface->up(grab, time, touch_id); if (touch->num_tp == 0) weston_touch_set_focus(touch, NULL); break; } } WL_EXPORT void notify_touch_frame(struct weston_seat *seat) { struct weston_touch *touch = weston_seat_get_touch(seat); struct weston_touch_grab *grab = touch->grab; grab->interface->frame(grab); } static int pointer_cursor_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "cursor"); } static void pointer_cursor_surface_configure(struct weston_surface *es, int32_t dx, int32_t dy) { struct weston_pointer *pointer = es->configure_private; int x, y; if (es->width == 0) return; assert(es == pointer->sprite->surface); pointer->hotspot_x -= dx; pointer->hotspot_y -= dy; x = wl_fixed_to_int(pointer->x) - pointer->hotspot_x; y = wl_fixed_to_int(pointer->y) - pointer->hotspot_y; weston_view_set_position(pointer->sprite, x, y); empty_region(&es->pending.input); empty_region(&es->input); if (!weston_surface_is_mapped(es)) { weston_layer_entry_insert(&es->compositor->cursor_layer.view_list, &pointer->sprite->layer_link); weston_view_update_transform(pointer->sprite); } } static void pointer_set_cursor(struct wl_client *client, struct wl_resource *resource, uint32_t serial, struct wl_resource *surface_resource, int32_t x, int32_t y) { struct weston_pointer *pointer = wl_resource_get_user_data(resource); struct weston_surface *surface = NULL; if (surface_resource) surface = wl_resource_get_user_data(surface_resource); if (pointer->focus == NULL) return; /* pointer->focus->surface->resource can be NULL. Surfaces like the black_surface used in shell.c for fullscreen don't have a resource, but can still have focus */ if (pointer->focus->surface->resource == NULL) return; if (wl_resource_get_client(pointer->focus->surface->resource) != client) return; if (pointer->focus_serial - serial > UINT32_MAX / 2) return; if (!surface) { if (pointer->sprite) pointer_unmap_sprite(pointer); return; } if (pointer->sprite && pointer->sprite->surface == surface && pointer->hotspot_x == x && pointer->hotspot_y == y) return; if (!pointer->sprite || pointer->sprite->surface != surface) { if (weston_surface_set_role(surface, "wl_pointer-cursor", resource, WL_POINTER_ERROR_ROLE) < 0) return; if (pointer->sprite) pointer_unmap_sprite(pointer); wl_signal_add(&surface->destroy_signal, &pointer->sprite_destroy_listener); surface->configure = pointer_cursor_surface_configure; surface->configure_private = pointer; weston_surface_set_label_func(surface, pointer_cursor_surface_get_label); pointer->sprite = weston_view_create(surface); } pointer->hotspot_x = x; pointer->hotspot_y = y; if (surface->buffer_ref.buffer) { pointer_cursor_surface_configure(surface, 0, 0); weston_view_schedule_repaint(pointer->sprite); } } static void pointer_release(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_pointer_interface pointer_interface = { pointer_set_cursor, pointer_release }; static void seat_get_pointer(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct weston_seat *seat = wl_resource_get_user_data(resource); /* We use the pointer_state directly, which means we'll * give a wl_pointer if the seat has ever had one - even though * the spec explicitly states that this request only takes effect * if the seat has the pointer capability. * * This prevents a race between the compositor sending new * capabilities and the client trying to use the old ones. */ struct weston_pointer *pointer = seat->pointer_state; struct wl_resource *cr; if (!pointer) return; cr = wl_resource_create(client, &wl_pointer_interface, wl_resource_get_version(resource), id); if (cr == NULL) { wl_client_post_no_memory(client); return; } /* May be moved to focused list later by either * weston_pointer_set_focus or directly if this client is already * focused */ wl_list_insert(&pointer->resource_list, wl_resource_get_link(cr)); wl_resource_set_implementation(cr, &pointer_interface, pointer, unbind_resource); if (pointer->focus && pointer->focus->surface->resource && wl_resource_get_client(pointer->focus->surface->resource) == client) { wl_fixed_t sx, sy; weston_view_from_global_fixed(pointer->focus, pointer->x, pointer->y, &sx, &sy); wl_list_remove(wl_resource_get_link(cr)); wl_list_insert(&pointer->focus_resource_list, wl_resource_get_link(cr)); wl_pointer_send_enter(cr, pointer->focus_serial, pointer->focus->surface->resource, sx, sy); } } static void keyboard_release(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_keyboard_interface keyboard_interface = { keyboard_release }; static bool should_send_modifiers_to_client(struct weston_seat *seat, struct wl_client *client) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (keyboard && keyboard->focus && keyboard->focus->resource && wl_resource_get_client(keyboard->focus->resource) == client) return true; if (pointer && pointer->focus && pointer->focus->surface->resource && wl_resource_get_client(pointer->focus->surface->resource) == client) return true; return false; } static void seat_get_keyboard(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct weston_seat *seat = wl_resource_get_user_data(resource); /* We use the keyboard_state directly, which means we'll * give a wl_keyboard if the seat has ever had one - even though * the spec explicitly states that this request only takes effect * if the seat has the keyboard capability. * * This prevents a race between the compositor sending new * capabilities and the client trying to use the old ones. */ struct weston_keyboard *keyboard = seat->keyboard_state; struct wl_resource *cr; if (!keyboard) return; cr = wl_resource_create(client, &wl_keyboard_interface, wl_resource_get_version(resource), id); if (cr == NULL) { wl_client_post_no_memory(client); return; } /* May be moved to focused list later by either * weston_keyboard_set_focus or directly if this client is already * focused */ wl_list_insert(&keyboard->resource_list, wl_resource_get_link(cr)); wl_resource_set_implementation(cr, &keyboard_interface, seat, unbind_resource); if (wl_resource_get_version(cr) >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) { wl_keyboard_send_repeat_info(cr, seat->compositor->kb_repeat_rate, seat->compositor->kb_repeat_delay); } if (seat->compositor->use_xkbcommon) { wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, keyboard->xkb_info->keymap_fd, keyboard->xkb_info->keymap_size); } else { int null_fd = open("/dev/null", O_RDONLY); wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP, null_fd, 0); close(null_fd); } if (should_send_modifiers_to_client(seat, client)) { send_modifiers_to_resource(keyboard, cr, keyboard->focus_serial); } if (keyboard->focus && keyboard->focus->resource && wl_resource_get_client(keyboard->focus->resource) == client) { struct weston_surface *surface = (struct weston_surface *)keyboard->focus; wl_list_remove(wl_resource_get_link(cr)); wl_list_insert(&keyboard->focus_resource_list, wl_resource_get_link(cr)); wl_keyboard_send_enter(cr, keyboard->focus_serial, surface->resource, &keyboard->keys); /* If this is the first keyboard resource for this * client... */ if (keyboard->focus_resource_list.prev == wl_resource_get_link(cr)) wl_data_device_set_keyboard_focus(seat); } } static void touch_release(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_touch_interface touch_interface = { touch_release }; static void seat_get_touch(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct weston_seat *seat = wl_resource_get_user_data(resource); /* We use the touch_state directly, which means we'll * give a wl_touch if the seat has ever had one - even though * the spec explicitly states that this request only takes effect * if the seat has the touch capability. * * This prevents a race between the compositor sending new * capabilities and the client trying to use the old ones. */ struct weston_touch *touch = seat->touch_state; struct wl_resource *cr; if (!touch) return; cr = wl_resource_create(client, &wl_touch_interface, wl_resource_get_version(resource), id); if (cr == NULL) { wl_client_post_no_memory(client); return; } if (touch->focus && wl_resource_get_client(touch->focus->surface->resource) == client) { wl_list_insert(&touch->resource_list, wl_resource_get_link(cr)); } else { wl_list_insert(&touch->focus_resource_list, wl_resource_get_link(cr)); } wl_resource_set_implementation(cr, &touch_interface, seat, unbind_resource); } static const struct wl_seat_interface seat_interface = { seat_get_pointer, seat_get_keyboard, seat_get_touch, }; static void bind_seat(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_seat *seat = data; struct wl_resource *resource; enum wl_seat_capability caps = 0; resource = wl_resource_create(client, &wl_seat_interface, MIN(version, 4), id); wl_list_insert(&seat->base_resource_list, wl_resource_get_link(resource)); wl_resource_set_implementation(resource, &seat_interface, data, unbind_resource); if (weston_seat_get_pointer(seat)) caps |= WL_SEAT_CAPABILITY_POINTER; if (weston_seat_get_keyboard(seat)) caps |= WL_SEAT_CAPABILITY_KEYBOARD; if (weston_seat_get_touch(seat)) caps |= WL_SEAT_CAPABILITY_TOUCH; wl_seat_send_capabilities(resource, caps); if (version >= WL_SEAT_NAME_SINCE_VERSION) wl_seat_send_name(resource, seat->seat_name); } #ifdef ENABLE_XKBCOMMON int weston_compositor_xkb_init(struct weston_compositor *ec, struct xkb_rule_names *names) { ec->use_xkbcommon = 1; if (ec->xkb_context == NULL) { ec->xkb_context = xkb_context_new(0); if (ec->xkb_context == NULL) { weston_log("failed to create XKB context\n"); return -1; } } if (names) ec->xkb_names = *names; if (!ec->xkb_names.rules) ec->xkb_names.rules = strdup("evdev"); if (!ec->xkb_names.model) ec->xkb_names.model = strdup("pc105"); if (!ec->xkb_names.layout) ec->xkb_names.layout = strdup("us"); return 0; } static void weston_xkb_info_destroy(struct weston_xkb_info *xkb_info) { if (--xkb_info->ref_count > 0) return; xkb_keymap_unref(xkb_info->keymap); if (xkb_info->keymap_area) munmap(xkb_info->keymap_area, xkb_info->keymap_size); if (xkb_info->keymap_fd >= 0) close(xkb_info->keymap_fd); free(xkb_info); } void weston_compositor_xkb_destroy(struct weston_compositor *ec) { /* * If we're operating in raw keyboard mode, we never initialized * libxkbcommon so there's no cleanup to do either. */ if (!ec->use_xkbcommon) return; free((char *) ec->xkb_names.rules); free((char *) ec->xkb_names.model); free((char *) ec->xkb_names.layout); free((char *) ec->xkb_names.variant); free((char *) ec->xkb_names.options); if (ec->xkb_info) weston_xkb_info_destroy(ec->xkb_info); xkb_context_unref(ec->xkb_context); } static struct weston_xkb_info * weston_xkb_info_create(struct xkb_keymap *keymap) { struct weston_xkb_info *xkb_info = zalloc(sizeof *xkb_info); if (xkb_info == NULL) return NULL; xkb_info->keymap = xkb_keymap_ref(keymap); xkb_info->ref_count = 1; char *keymap_str; xkb_info->shift_mod = xkb_keymap_mod_get_index(xkb_info->keymap, XKB_MOD_NAME_SHIFT); xkb_info->caps_mod = xkb_keymap_mod_get_index(xkb_info->keymap, XKB_MOD_NAME_CAPS); xkb_info->ctrl_mod = xkb_keymap_mod_get_index(xkb_info->keymap, XKB_MOD_NAME_CTRL); xkb_info->alt_mod = xkb_keymap_mod_get_index(xkb_info->keymap, XKB_MOD_NAME_ALT); xkb_info->mod2_mod = xkb_keymap_mod_get_index(xkb_info->keymap, "Mod2"); xkb_info->mod3_mod = xkb_keymap_mod_get_index(xkb_info->keymap, "Mod3"); xkb_info->super_mod = xkb_keymap_mod_get_index(xkb_info->keymap, XKB_MOD_NAME_LOGO); xkb_info->mod5_mod = xkb_keymap_mod_get_index(xkb_info->keymap, "Mod5"); xkb_info->num_led = xkb_keymap_led_get_index(xkb_info->keymap, XKB_LED_NAME_NUM); xkb_info->caps_led = xkb_keymap_led_get_index(xkb_info->keymap, XKB_LED_NAME_CAPS); xkb_info->scroll_led = xkb_keymap_led_get_index(xkb_info->keymap, XKB_LED_NAME_SCROLL); keymap_str = xkb_keymap_get_as_string(xkb_info->keymap, XKB_KEYMAP_FORMAT_TEXT_V1); if (keymap_str == NULL) { weston_log("failed to get string version of keymap\n"); goto err_keymap; } xkb_info->keymap_size = strlen(keymap_str) + 1; xkb_info->keymap_fd = os_create_anonymous_file(xkb_info->keymap_size); if (xkb_info->keymap_fd < 0) { weston_log("creating a keymap file for %lu bytes failed: %m\n", (unsigned long) xkb_info->keymap_size); goto err_keymap_str; } xkb_info->keymap_area = mmap(NULL, xkb_info->keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, xkb_info->keymap_fd, 0); if (xkb_info->keymap_area == MAP_FAILED) { weston_log("failed to mmap() %lu bytes\n", (unsigned long) xkb_info->keymap_size); goto err_dev_zero; } strcpy(xkb_info->keymap_area, keymap_str); free(keymap_str); return xkb_info; err_dev_zero: close(xkb_info->keymap_fd); err_keymap_str: free(keymap_str); err_keymap: xkb_keymap_unref(xkb_info->keymap); free(xkb_info); return NULL; } static int weston_compositor_build_global_keymap(struct weston_compositor *ec) { struct xkb_keymap *keymap; if (ec->xkb_info != NULL) return 0; keymap = xkb_keymap_new_from_names(ec->xkb_context, &ec->xkb_names, 0); if (keymap == NULL) { weston_log("failed to compile global XKB keymap\n"); weston_log(" tried rules %s, model %s, layout %s, variant %s, " "options %s\n", ec->xkb_names.rules, ec->xkb_names.model, ec->xkb_names.layout, ec->xkb_names.variant, ec->xkb_names.options); return -1; } ec->xkb_info = weston_xkb_info_create(keymap); xkb_keymap_unref(keymap); if (ec->xkb_info == NULL) return -1; return 0; } #else int weston_compositor_xkb_init(struct weston_compositor *ec, struct xkb_rule_names *names) { return 0; } void weston_compositor_xkb_destroy(struct weston_compositor *ec) { } #endif WL_EXPORT void weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard || !keymap) return; #ifdef ENABLE_XKBCOMMON if (!seat->compositor->use_xkbcommon) return; xkb_keymap_unref(keyboard->pending_keymap); keyboard->pending_keymap = xkb_keymap_ref(keymap); if (keyboard->keys.size == 0) update_keymap(seat); #endif } WL_EXPORT int weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap) { struct weston_keyboard *keyboard; if (seat->keyboard_state) { seat->keyboard_device_count += 1; if (seat->keyboard_device_count == 1) seat_send_updated_caps(seat); return 0; } keyboard = weston_keyboard_create(); if (keyboard == NULL) { weston_log("failed to allocate weston keyboard struct\n"); return -1; } #ifdef ENABLE_XKBCOMMON if (seat->compositor->use_xkbcommon) { if (keymap != NULL) { keyboard->xkb_info = weston_xkb_info_create(keymap); if (keyboard->xkb_info == NULL) goto err; } else { if (weston_compositor_build_global_keymap(seat->compositor) < 0) goto err; keyboard->xkb_info = seat->compositor->xkb_info; keyboard->xkb_info->ref_count++; } keyboard->xkb_state.state = xkb_state_new(keyboard->xkb_info->keymap); if (keyboard->xkb_state.state == NULL) { weston_log("failed to initialise XKB state\n"); goto err; } keyboard->xkb_state.leds = 0; } #endif seat->keyboard_state = keyboard; seat->keyboard_device_count = 1; keyboard->seat = seat; seat_send_updated_caps(seat); return 0; err: if (keyboard->xkb_info) weston_xkb_info_destroy(keyboard->xkb_info); free(keyboard); return -1; } static void weston_keyboard_reset_state(struct weston_keyboard *keyboard) { struct weston_seat *seat = keyboard->seat; struct xkb_state *state; #ifdef ENABLE_XKBCOMMON if (seat->compositor->use_xkbcommon) { state = xkb_state_new(keyboard->xkb_info->keymap); if (!state) { weston_log("failed to reset XKB state\n"); return; } xkb_state_unref(keyboard->xkb_state.state); keyboard->xkb_state.state = state; keyboard->xkb_state.leds = 0; } #endif seat->modifier_state = 0; } WL_EXPORT void weston_seat_release_keyboard(struct weston_seat *seat) { seat->keyboard_device_count--; assert(seat->keyboard_device_count >= 0); if (seat->keyboard_device_count == 0) { weston_keyboard_set_focus(seat->keyboard_state, NULL); weston_keyboard_cancel_grab(seat->keyboard_state); weston_keyboard_reset_state(seat->keyboard_state); seat_send_updated_caps(seat); } } WL_EXPORT void weston_seat_init_pointer(struct weston_seat *seat) { struct weston_pointer *pointer; if (seat->pointer_state) { seat->pointer_device_count += 1; if (seat->pointer_device_count == 1) seat_send_updated_caps(seat); return; } pointer = weston_pointer_create(seat); if (pointer == NULL) return; seat->pointer_state = pointer; seat->pointer_device_count = 1; pointer->seat = seat; seat_send_updated_caps(seat); } WL_EXPORT void weston_seat_release_pointer(struct weston_seat *seat) { struct weston_pointer *pointer = seat->pointer_state; seat->pointer_device_count--; if (seat->pointer_device_count == 0) { weston_pointer_clear_focus(pointer); weston_pointer_cancel_grab(pointer); if (pointer->sprite) pointer_unmap_sprite(pointer); weston_pointer_reset_state(pointer); seat_send_updated_caps(seat); /* seat->pointer is intentionally not destroyed so that * a newly attached pointer on this seat will retain * the previous cursor co-ordinates. */ } } WL_EXPORT void weston_seat_init_touch(struct weston_seat *seat) { struct weston_touch *touch; if (seat->touch_state) { seat->touch_device_count += 1; if (seat->touch_device_count == 1) seat_send_updated_caps(seat); return; } touch = weston_touch_create(); if (touch == NULL) return; seat->touch_state = touch; seat->touch_device_count = 1; touch->seat = seat; seat_send_updated_caps(seat); } WL_EXPORT void weston_seat_release_touch(struct weston_seat *seat) { seat->touch_device_count--; if (seat->touch_device_count == 0) { weston_touch_set_focus(seat->touch_state, NULL); weston_touch_cancel_grab(seat->touch_state); weston_touch_reset_state(seat->touch_state); seat_send_updated_caps(seat); } } WL_EXPORT void weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec, const char *seat_name) { memset(seat, 0, sizeof *seat); seat->selection_data_source = NULL; wl_list_init(&seat->base_resource_list); wl_signal_init(&seat->selection_signal); wl_list_init(&seat->drag_resource_list); wl_signal_init(&seat->destroy_signal); wl_signal_init(&seat->updated_caps_signal); seat->global = wl_global_create(ec->wl_display, &wl_seat_interface, 4, seat, bind_seat); seat->compositor = ec; seat->modifier_state = 0; seat->seat_name = strdup(seat_name); wl_list_insert(ec->seat_list.prev, &seat->link); clipboard_create(seat); wl_signal_emit(&ec->seat_created_signal, seat); } WL_EXPORT void weston_seat_release(struct weston_seat *seat) { wl_list_remove(&seat->link); if (seat->saved_kbd_focus) wl_list_remove(&seat->saved_kbd_focus_listener.link); if (seat->pointer_state) weston_pointer_destroy(seat->pointer_state); if (seat->keyboard_state) weston_keyboard_destroy(seat->keyboard_state); if (seat->touch_state) weston_touch_destroy(seat->touch_state); free (seat->seat_name); wl_global_destroy(seat->global); wl_signal_emit(&seat->destroy_signal, seat); } /** Get a seat's keyboard pointer * * \param seat The seat to query * \return The seat's keyboard pointer, or NULL if no keyboard is present * * The keyboard pointer for a seat isn't freed when all keyboards are removed, * so it should only be used when the seat's keyboard_device_count is greater * than zero. This function does that test and only returns a pointer * when a keyboard is present. */ WL_EXPORT struct weston_keyboard * weston_seat_get_keyboard(struct weston_seat *seat) { if (!seat) return NULL; if (seat->keyboard_device_count) return seat->keyboard_state; return NULL; } /** Get a seat's pointer pointer * * \param seat The seat to query * \return The seat's pointer pointer, or NULL if no pointer device is present * * The pointer pointer for a seat isn't freed when all mice are removed, * so it should only be used when the seat's pointer_device_count is greater * than zero. This function does that test and only returns a pointer * when a pointing device is present. */ WL_EXPORT struct weston_pointer * weston_seat_get_pointer(struct weston_seat *seat) { if (!seat) return NULL; if (seat->pointer_device_count) return seat->pointer_state; return NULL; } /** Get a seat's touch pointer * * \param seat The seat to query * \return The seat's touch pointer, or NULL if no touch device is present * * The touch pointer for a seat isn't freed when all touch devices are removed, * so it should only be used when the seat's touch_device_count is greater * than zero. This function does that test and only returns a pointer * when a touch device is present. */ WL_EXPORT struct weston_touch * weston_seat_get_touch(struct weston_seat *seat) { if (!seat) return NULL; if (seat->touch_device_count) return seat->touch_state; return NULL; } weston-1.9.0/src/compositor-x11.c0000664000175000017500000013403412563431500013527 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2010-2011 Intel Corporation * Copyright © 2013 Vasily Khoruzhick * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_XCB_XKB #include #endif #include #include #include #include "compositor.h" #include "gl-renderer.h" #include "pixman-renderer.h" #include "shared/config-parser.h" #include "shared/helpers.h" #include "shared/image-loader.h" #include "presentation_timing-server-protocol.h" #include "linux-dmabuf.h" #define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int(10) static int option_width; static int option_height; static int option_scale; static int option_count; struct x11_backend { struct weston_backend base; struct weston_compositor *compositor; Display *dpy; xcb_connection_t *conn; xcb_screen_t *screen; xcb_cursor_t null_cursor; struct wl_array keys; struct wl_event_source *xcb_source; struct xkb_keymap *xkb_keymap; unsigned int has_xkb; uint8_t xkb_event_base; int use_pixman; int has_net_wm_state_fullscreen; /* We could map multi-pointer X to multiple wayland seats, but * for now we only support core X input. */ struct weston_seat core_seat; wl_fixed_t prev_x; wl_fixed_t prev_y; struct { xcb_atom_t wm_protocols; xcb_atom_t wm_normal_hints; xcb_atom_t wm_size_hints; xcb_atom_t wm_delete_window; xcb_atom_t wm_class; xcb_atom_t net_wm_name; xcb_atom_t net_supporting_wm_check; xcb_atom_t net_supported; xcb_atom_t net_wm_icon; xcb_atom_t net_wm_state; xcb_atom_t net_wm_state_fullscreen; xcb_atom_t string; xcb_atom_t utf8_string; xcb_atom_t cardinal; xcb_atom_t xkb_names; } atom; }; struct x11_output { struct weston_output base; xcb_window_t window; struct weston_mode mode; struct wl_event_source *finish_frame_timer; xcb_gc_t gc; xcb_shm_seg_t segment; pixman_image_t *hw_surface; int shm_id; void *buf; uint8_t depth; int32_t scale; }; struct window_delete_data { struct x11_backend *backend; xcb_window_t window; }; struct gl_renderer_interface *gl_renderer; static struct xkb_keymap * x11_backend_get_keymap(struct x11_backend *b) { xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; struct xkb_rule_names names; struct xkb_keymap *ret; const char *value_all, *value_part; int length_all, length_part; memset(&names, 0, sizeof(names)); cookie = xcb_get_property(b->conn, 0, b->screen->root, b->atom.xkb_names, b->atom.string, 0, 1024); reply = xcb_get_property_reply(b->conn, cookie, NULL); if (reply == NULL) return NULL; value_all = xcb_get_property_value(reply); length_all = xcb_get_property_value_length(reply); value_part = value_all; #define copy_prop_value(to) \ length_part = strlen(value_part); \ if (value_part + length_part < (value_all + length_all) && \ length_part > 0) \ names.to = value_part; \ value_part += length_part + 1; copy_prop_value(rules); copy_prop_value(model); copy_prop_value(layout); copy_prop_value(variant); copy_prop_value(options); #undef copy_prop_value ret = xkb_keymap_new_from_names(b->compositor->xkb_context, &names, 0); free(reply); return ret; } static uint32_t get_xkb_mod_mask(struct x11_backend *b, uint32_t in) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(&b->core_seat); struct weston_xkb_info *info = keyboard->xkb_info; uint32_t ret = 0; if ((in & ShiftMask) && info->shift_mod != XKB_MOD_INVALID) ret |= (1 << info->shift_mod); if ((in & LockMask) && info->caps_mod != XKB_MOD_INVALID) ret |= (1 << info->caps_mod); if ((in & ControlMask) && info->ctrl_mod != XKB_MOD_INVALID) ret |= (1 << info->ctrl_mod); if ((in & Mod1Mask) && info->alt_mod != XKB_MOD_INVALID) ret |= (1 << info->alt_mod); if ((in & Mod2Mask) && info->mod2_mod != XKB_MOD_INVALID) ret |= (1 << info->mod2_mod); if ((in & Mod3Mask) && info->mod3_mod != XKB_MOD_INVALID) ret |= (1 << info->mod3_mod); if ((in & Mod4Mask) && info->super_mod != XKB_MOD_INVALID) ret |= (1 << info->super_mod); if ((in & Mod5Mask) && info->mod5_mod != XKB_MOD_INVALID) ret |= (1 << info->mod5_mod); return ret; } static void x11_backend_setup_xkb(struct x11_backend *b) { #ifndef HAVE_XCB_XKB weston_log("XCB-XKB not available during build\n"); b->has_xkb = 0; b->xkb_event_base = 0; return; #else struct weston_keyboard *keyboard; const xcb_query_extension_reply_t *ext; xcb_generic_error_t *error; xcb_void_cookie_t select; xcb_xkb_use_extension_cookie_t use_ext; xcb_xkb_use_extension_reply_t *use_ext_reply; xcb_xkb_per_client_flags_cookie_t pcf; xcb_xkb_per_client_flags_reply_t *pcf_reply; xcb_xkb_get_state_cookie_t state; xcb_xkb_get_state_reply_t *state_reply; uint32_t values[1] = { XCB_EVENT_MASK_PROPERTY_CHANGE }; b->has_xkb = 0; b->xkb_event_base = 0; ext = xcb_get_extension_data(b->conn, &xcb_xkb_id); if (!ext) { weston_log("XKB extension not available on host X11 server\n"); return; } b->xkb_event_base = ext->first_event; select = xcb_xkb_select_events_checked(b->conn, XCB_XKB_ID_USE_CORE_KBD, XCB_XKB_EVENT_TYPE_STATE_NOTIFY, 0, XCB_XKB_EVENT_TYPE_STATE_NOTIFY, 0, 0, NULL); error = xcb_request_check(b->conn, select); if (error) { weston_log("error: failed to select for XKB state events\n"); free(error); return; } use_ext = xcb_xkb_use_extension(b->conn, XCB_XKB_MAJOR_VERSION, XCB_XKB_MINOR_VERSION); use_ext_reply = xcb_xkb_use_extension_reply(b->conn, use_ext, NULL); if (!use_ext_reply) { weston_log("couldn't start using XKB extension\n"); return; } if (!use_ext_reply->supported) { weston_log("XKB extension version on the server is too old " "(want %d.%d, has %d.%d)\n", XCB_XKB_MAJOR_VERSION, XCB_XKB_MINOR_VERSION, use_ext_reply->serverMajor, use_ext_reply->serverMinor); free(use_ext_reply); return; } free(use_ext_reply); pcf = xcb_xkb_per_client_flags(b->conn, XCB_XKB_ID_USE_CORE_KBD, XCB_XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT, XCB_XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT, 0, 0, 0); pcf_reply = xcb_xkb_per_client_flags_reply(b->conn, pcf, NULL); if (!pcf_reply || !(pcf_reply->value & XCB_XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT)) { weston_log("failed to set XKB per-client flags, not using " "detectable repeat\n"); free(pcf_reply); return; } free(pcf_reply); state = xcb_xkb_get_state(b->conn, XCB_XKB_ID_USE_CORE_KBD); state_reply = xcb_xkb_get_state_reply(b->conn, state, NULL); if (!state_reply) { weston_log("failed to get initial XKB state\n"); return; } keyboard = weston_seat_get_keyboard(&b->core_seat); xkb_state_update_mask(keyboard->xkb_state.state, get_xkb_mod_mask(b, state_reply->baseMods), get_xkb_mod_mask(b, state_reply->latchedMods), get_xkb_mod_mask(b, state_reply->lockedMods), 0, 0, state_reply->group); free(state_reply); xcb_change_window_attributes(b->conn, b->screen->root, XCB_CW_EVENT_MASK, values); b->has_xkb = 1; #endif } #ifdef HAVE_XCB_XKB static void update_xkb_keymap(struct x11_backend *b) { struct xkb_keymap *keymap; keymap = x11_backend_get_keymap(b); if (!keymap) { weston_log("failed to get XKB keymap\n"); return; } weston_seat_update_keymap(&b->core_seat, keymap); xkb_keymap_unref(keymap); } #endif static int x11_input_create(struct x11_backend *b, int no_input) { struct xkb_keymap *keymap; weston_seat_init(&b->core_seat, b->compositor, "default"); if (no_input) return 0; weston_seat_init_pointer(&b->core_seat); keymap = x11_backend_get_keymap(b); if (weston_seat_init_keyboard(&b->core_seat, keymap) < 0) return -1; xkb_keymap_unref(keymap); x11_backend_setup_xkb(b); return 0; } static void x11_input_destroy(struct x11_backend *b) { weston_seat_release(&b->core_seat); } static void x11_output_start_repaint_loop(struct weston_output *output) { struct timespec ts; weston_compositor_read_presentation_clock(output->compositor, &ts); weston_output_finish_frame(output, &ts, PRESENTATION_FEEDBACK_INVALID); } static int x11_output_repaint_gl(struct weston_output *output_base, pixman_region32_t *damage) { struct x11_output *output = (struct x11_output *)output_base; struct weston_compositor *ec = output->base.compositor; ec->renderer->repaint_output(output_base, damage); pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); wl_event_source_timer_update(output->finish_frame_timer, 10); return 0; } static void set_clip_for_output(struct weston_output *output_base, pixman_region32_t *region) { struct x11_output *output = (struct x11_output *)output_base; struct weston_compositor *ec = output->base.compositor; struct x11_backend *b = (struct x11_backend *)ec->backend; pixman_region32_t transformed_region; pixman_box32_t *rects; xcb_rectangle_t *output_rects; xcb_void_cookie_t cookie; int nrects, i; xcb_generic_error_t *err; pixman_region32_init(&transformed_region); pixman_region32_copy(&transformed_region, region); pixman_region32_translate(&transformed_region, -output_base->x, -output_base->y); weston_transformed_region(output_base->width, output_base->height, output_base->transform, output_base->current_scale, &transformed_region, &transformed_region); rects = pixman_region32_rectangles(&transformed_region, &nrects); output_rects = calloc(nrects, sizeof(xcb_rectangle_t)); if (output_rects == NULL) { pixman_region32_fini(&transformed_region); return; } for (i = 0; i < nrects; i++) { output_rects[i].x = rects[i].x1; output_rects[i].y = rects[i].y1; output_rects[i].width = rects[i].x2 - rects[i].x1; output_rects[i].height = rects[i].y2 - rects[i].y1; } pixman_region32_fini(&transformed_region); cookie = xcb_set_clip_rectangles_checked(b->conn, XCB_CLIP_ORDERING_UNSORTED, output->gc, 0, 0, nrects, output_rects); err = xcb_request_check(b->conn, cookie); if (err != NULL) { weston_log("Failed to set clip rects, err: %d\n", err->error_code); free(err); } free(output_rects); } static int x11_output_repaint_shm(struct weston_output *output_base, pixman_region32_t *damage) { struct x11_output *output = (struct x11_output *)output_base; struct weston_compositor *ec = output->base.compositor; struct x11_backend *b = (struct x11_backend *)ec->backend; xcb_void_cookie_t cookie; xcb_generic_error_t *err; pixman_renderer_output_set_buffer(output_base, output->hw_surface); ec->renderer->repaint_output(output_base, damage); pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); set_clip_for_output(output_base, damage); cookie = xcb_shm_put_image_checked(b->conn, output->window, output->gc, pixman_image_get_width(output->hw_surface), pixman_image_get_height(output->hw_surface), 0, 0, pixman_image_get_width(output->hw_surface), pixman_image_get_height(output->hw_surface), 0, 0, output->depth, XCB_IMAGE_FORMAT_Z_PIXMAP, 0, output->segment, 0); err = xcb_request_check(b->conn, cookie); if (err != NULL) { weston_log("Failed to put shm image, err: %d\n", err->error_code); free(err); } wl_event_source_timer_update(output->finish_frame_timer, 10); return 0; } static int finish_frame_handler(void *data) { struct x11_output *output = data; struct timespec ts; weston_compositor_read_presentation_clock(output->base.compositor, &ts); weston_output_finish_frame(&output->base, &ts, 0); return 1; } static void x11_output_deinit_shm(struct x11_backend *b, struct x11_output *output) { xcb_void_cookie_t cookie; xcb_generic_error_t *err; xcb_free_gc(b->conn, output->gc); pixman_image_unref(output->hw_surface); output->hw_surface = NULL; cookie = xcb_shm_detach_checked(b->conn, output->segment); err = xcb_request_check(b->conn, cookie); if (err) { weston_log("xcb_shm_detach failed, error %d\n", err->error_code); free(err); } shmdt(output->buf); } static void x11_output_destroy(struct weston_output *output_base) { struct x11_output *output = (struct x11_output *)output_base; struct x11_backend *backend = (struct x11_backend *)output->base.compositor->backend; wl_event_source_remove(output->finish_frame_timer); if (backend->use_pixman) { pixman_renderer_output_destroy(output_base); x11_output_deinit_shm(backend, output); } else gl_renderer->output_destroy(output_base); xcb_destroy_window(backend->conn, output->window); weston_output_destroy(&output->base); free(output); } static void x11_output_set_wm_protocols(struct x11_backend *b, struct x11_output *output) { xcb_atom_t list[1]; list[0] = b->atom.wm_delete_window; xcb_change_property (b->conn, XCB_PROP_MODE_REPLACE, output->window, b->atom.wm_protocols, XCB_ATOM_ATOM, 32, ARRAY_LENGTH(list), list); } struct wm_normal_hints { uint32_t flags; uint32_t pad[4]; int32_t min_width, min_height; int32_t max_width, max_height; int32_t width_inc, height_inc; int32_t min_aspect_x, min_aspect_y; int32_t max_aspect_x, max_aspect_y; int32_t base_width, base_height; int32_t win_gravity; }; #define WM_NORMAL_HINTS_MIN_SIZE 16 #define WM_NORMAL_HINTS_MAX_SIZE 32 static void x11_output_set_icon(struct x11_backend *b, struct x11_output *output, const char *filename) { uint32_t *icon; int32_t width, height; pixman_image_t *image; image = load_image(filename); if (!image) return; width = pixman_image_get_width(image); height = pixman_image_get_height(image); icon = malloc(width * height * 4 + 8); if (!icon) { pixman_image_unref(image); return; } icon[0] = width; icon[1] = height; memcpy(icon + 2, pixman_image_get_data(image), width * height * 4); xcb_change_property(b->conn, XCB_PROP_MODE_REPLACE, output->window, b->atom.net_wm_icon, b->atom.cardinal, 32, width * height + 2, icon); free(icon); pixman_image_unref(image); } static void x11_output_wait_for_map(struct x11_backend *b, struct x11_output *output) { xcb_map_notify_event_t *map_notify; xcb_configure_notify_event_t *configure_notify; xcb_generic_event_t *event; int mapped = 0, configured = 0; uint8_t response_type; /* This isn't the nicest way to do this. Ideally, we could * just go back to the main loop and once we get the configure * notify, we add the output to the compositor. While we do * support output hotplug, we can't start up with no outputs. * We could add the output and then resize once we get the * configure notify, but we don't want to start up and * immediately resize the output. * * Also, some window managers don't give us our final * fullscreen size before map_notify, so if we don't get a * configure_notify before map_notify, we just wait for the * first one and hope that's our size. */ xcb_flush(b->conn); while (!mapped || !configured) { event = xcb_wait_for_event(b->conn); response_type = event->response_type & ~0x80; switch (response_type) { case XCB_MAP_NOTIFY: map_notify = (xcb_map_notify_event_t *) event; if (map_notify->window == output->window) mapped = 1; break; case XCB_CONFIGURE_NOTIFY: configure_notify = (xcb_configure_notify_event_t *) event; if (configure_notify->width % output->scale != 0 || configure_notify->height % output->scale != 0) weston_log("Resolution is not a multiple of screen size, rounding\n"); output->mode.width = configure_notify->width; output->mode.height = configure_notify->height; configured = 1; break; } } } static xcb_visualtype_t * find_visual_by_id(xcb_screen_t *screen, xcb_visualid_t id) { xcb_depth_iterator_t i; xcb_visualtype_iterator_t j; for (i = xcb_screen_allowed_depths_iterator(screen); i.rem; xcb_depth_next(&i)) { for (j = xcb_depth_visuals_iterator(i.data); j.rem; xcb_visualtype_next(&j)) { if (j.data->visual_id == id) return j.data; } } return 0; } static uint8_t get_depth_of_visual(xcb_screen_t *screen, xcb_visualid_t id) { xcb_depth_iterator_t i; xcb_visualtype_iterator_t j; for (i = xcb_screen_allowed_depths_iterator(screen); i.rem; xcb_depth_next(&i)) { for (j = xcb_depth_visuals_iterator(i.data); j.rem; xcb_visualtype_next(&j)) { if (j.data->visual_id == id) return i.data->depth; } } return 0; } static int x11_output_init_shm(struct x11_backend *b, struct x11_output *output, int width, int height) { xcb_screen_iterator_t iter; xcb_visualtype_t *visual_type; xcb_format_iterator_t fmt; xcb_void_cookie_t cookie; xcb_generic_error_t *err; const xcb_query_extension_reply_t *ext; int bitsperpixel = 0; pixman_format_code_t pixman_format; /* Check if SHM is available */ ext = xcb_get_extension_data(b->conn, &xcb_shm_id); if (ext == NULL || !ext->present) { /* SHM is missing */ weston_log("SHM extension is not available\n"); errno = ENOENT; return -1; } iter = xcb_setup_roots_iterator(xcb_get_setup(b->conn)); visual_type = find_visual_by_id(iter.data, iter.data->root_visual); if (!visual_type) { weston_log("Failed to lookup visual for root window\n"); errno = ENOENT; return -1; } weston_log("Found visual, bits per value: %d, red_mask: %.8x, green_mask: %.8x, blue_mask: %.8x\n", visual_type->bits_per_rgb_value, visual_type->red_mask, visual_type->green_mask, visual_type->blue_mask); output->depth = get_depth_of_visual(iter.data, iter.data->root_visual); weston_log("Visual depth is %d\n", output->depth); for (fmt = xcb_setup_pixmap_formats_iterator(xcb_get_setup(b->conn)); fmt.rem; xcb_format_next(&fmt)) { if (fmt.data->depth == output->depth) { bitsperpixel = fmt.data->bits_per_pixel; break; } } weston_log("Found format for depth %d, bpp: %d\n", output->depth, bitsperpixel); if (bitsperpixel == 32 && visual_type->red_mask == 0xff0000 && visual_type->green_mask == 0x00ff00 && visual_type->blue_mask == 0x0000ff) { weston_log("Will use x8r8g8b8 format for SHM surfaces\n"); pixman_format = PIXMAN_x8r8g8b8; } else if (bitsperpixel == 16 && visual_type->red_mask == 0x00f800 && visual_type->green_mask == 0x0007e0 && visual_type->blue_mask == 0x00001f) { weston_log("Will use r5g6b5 format for SHM surfaces\n"); pixman_format = PIXMAN_r5g6b5; } else { weston_log("Can't find appropriate format for SHM pixmap\n"); errno = ENOTSUP; return -1; } /* Create SHM segment and attach it */ output->shm_id = shmget(IPC_PRIVATE, width * height * (bitsperpixel / 8), IPC_CREAT | S_IRWXU); if (output->shm_id == -1) { weston_log("x11shm: failed to allocate SHM segment\n"); return -1; } output->buf = shmat(output->shm_id, NULL, 0 /* read/write */); if (-1 == (long)output->buf) { weston_log("x11shm: failed to attach SHM segment\n"); return -1; } output->segment = xcb_generate_id(b->conn); cookie = xcb_shm_attach_checked(b->conn, output->segment, output->shm_id, 1); err = xcb_request_check(b->conn, cookie); if (err) { weston_log("x11shm: xcb_shm_attach error %d, op code %d, resource id %d\n", err->error_code, err->major_code, err->minor_code); free(err); return -1; } shmctl(output->shm_id, IPC_RMID, NULL); /* Now create pixman image */ output->hw_surface = pixman_image_create_bits(pixman_format, width, height, output->buf, width * (bitsperpixel / 8)); output->gc = xcb_generate_id(b->conn); xcb_create_gc(b->conn, output->gc, output->window, 0, NULL); return 0; } static struct x11_output * x11_backend_create_output(struct x11_backend *b, int x, int y, int width, int height, int fullscreen, int no_input, char *configured_name, uint32_t transform, int32_t scale) { static const char name[] = "Weston Compositor"; static const char class[] = "weston-1\0Weston Compositor"; char title[32]; struct x11_output *output; xcb_screen_iterator_t iter; struct wm_normal_hints normal_hints; struct wl_event_loop *loop; int output_width, output_height, width_mm, height_mm; int ret; uint32_t mask = XCB_CW_EVENT_MASK | XCB_CW_CURSOR; xcb_atom_t atom_list[1]; uint32_t values[2] = { XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY, 0 }; output_width = width * scale; output_height = height * scale; if (configured_name) sprintf(title, "%s - %s", name, configured_name); else strcpy(title, name); if (!no_input) values[0] |= XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_KEYMAP_STATE | XCB_EVENT_MASK_FOCUS_CHANGE; output = zalloc(sizeof *output); if (output == NULL) { perror("zalloc"); return NULL; } output->mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; output->mode.width = output_width; output->mode.height = output_height; output->mode.refresh = 60000; output->scale = scale; wl_list_init(&output->base.mode_list); wl_list_insert(&output->base.mode_list, &output->mode.link); values[1] = b->null_cursor; output->window = xcb_generate_id(b->conn); iter = xcb_setup_roots_iterator(xcb_get_setup(b->conn)); xcb_create_window(b->conn, XCB_COPY_FROM_PARENT, output->window, iter.data->root, 0, 0, output_width, output_height, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, iter.data->root_visual, mask, values); if (fullscreen) { atom_list[0] = b->atom.net_wm_state_fullscreen; xcb_change_property(b->conn, XCB_PROP_MODE_REPLACE, output->window, b->atom.net_wm_state, XCB_ATOM_ATOM, 32, ARRAY_LENGTH(atom_list), atom_list); } else { /* Don't resize me. */ memset(&normal_hints, 0, sizeof normal_hints); normal_hints.flags = WM_NORMAL_HINTS_MAX_SIZE | WM_NORMAL_HINTS_MIN_SIZE; normal_hints.min_width = output_width; normal_hints.min_height = output_height; normal_hints.max_width = output_width; normal_hints.max_height = output_height; xcb_change_property(b->conn, XCB_PROP_MODE_REPLACE, output->window, b->atom.wm_normal_hints, b->atom.wm_size_hints, 32, sizeof normal_hints / 4, (uint8_t *) &normal_hints); } /* Set window name. Don't bother with non-EWMH WMs. */ xcb_change_property(b->conn, XCB_PROP_MODE_REPLACE, output->window, b->atom.net_wm_name, b->atom.utf8_string, 8, strlen(title), title); xcb_change_property(b->conn, XCB_PROP_MODE_REPLACE, output->window, b->atom.wm_class, b->atom.string, 8, sizeof class, class); x11_output_set_icon(b, output, DATADIR "/weston/wayland.png"); x11_output_set_wm_protocols(b, output); xcb_map_window(b->conn, output->window); if (fullscreen) x11_output_wait_for_map(b, output); output->base.start_repaint_loop = x11_output_start_repaint_loop; if (b->use_pixman) output->base.repaint = x11_output_repaint_shm; else output->base.repaint = x11_output_repaint_gl; output->base.destroy = x11_output_destroy; output->base.assign_planes = NULL; output->base.set_backlight = NULL; output->base.set_dpms = NULL; output->base.switch_mode = NULL; output->base.current_mode = &output->mode; output->base.make = "weston-X11"; output->base.model = "none"; if (configured_name) output->base.name = strdup(configured_name); width_mm = width * b->screen->width_in_millimeters / b->screen->width_in_pixels; height_mm = height * b->screen->height_in_millimeters / b->screen->height_in_pixels; weston_output_init(&output->base, b->compositor, x, y, width_mm, height_mm, transform, scale); if (b->use_pixman) { if (x11_output_init_shm(b, output, output->mode.width, output->mode.height) < 0) { weston_log("Failed to initialize SHM for the X11 output\n"); return NULL; } if (pixman_renderer_output_create(&output->base) < 0) { weston_log("Failed to create pixman renderer for output\n"); x11_output_deinit_shm(b, output); return NULL; } } else { /* eglCreatePlatformWindowSurfaceEXT takes a Window* * but eglCreateWindowSurface takes a Window. */ Window xid = (Window) output->window; ret = gl_renderer->output_create(&output->base, (EGLNativeWindowType) output->window, &xid, gl_renderer->opaque_attribs, NULL, 0); if (ret < 0) return NULL; } loop = wl_display_get_event_loop(b->compositor->wl_display); output->finish_frame_timer = wl_event_loop_add_timer(loop, finish_frame_handler, output); weston_compositor_add_output(b->compositor, &output->base); weston_log("x11 output %dx%d, window id %d\n", width, height, output->window); return output; } static struct x11_output * x11_backend_find_output(struct x11_backend *b, xcb_window_t window) { struct x11_output *output; wl_list_for_each(output, &b->compositor->output_list, base.link) { if (output->window == window) return output; } return NULL; } static void x11_backend_delete_window(struct x11_backend *b, xcb_window_t window) { struct x11_output *output; output = x11_backend_find_output(b, window); if (output) x11_output_destroy(&output->base); xcb_flush(b->conn); if (wl_list_empty(&b->compositor->output_list)) weston_compositor_exit(b->compositor); } static void delete_cb(void *data) { struct window_delete_data *wd = data; x11_backend_delete_window(wd->backend, wd->window); free(wd); } #ifdef HAVE_XCB_XKB static void update_xkb_state(struct x11_backend *b, xcb_xkb_state_notify_event_t *state) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(&b->core_seat); xkb_state_update_mask(keyboard->xkb_state.state, get_xkb_mod_mask(b, state->baseMods), get_xkb_mod_mask(b, state->latchedMods), get_xkb_mod_mask(b, state->lockedMods), 0, 0, state->group); notify_modifiers(&b->core_seat, wl_display_next_serial(b->compositor->wl_display)); } #endif /** * This is monumentally unpleasant. If we don't have XCB-XKB bindings, * the best we can do (given that XCB also lacks XI2 support), is to take * the state from the core key events. Unfortunately that only gives us * the effective (i.e. union of depressed/latched/locked) state, and we * need the granularity. * * So we still update the state with every key event we see, but also use * the state field from X11 events as a mask so we don't get any stuck * modifiers. */ static void update_xkb_state_from_core(struct x11_backend *b, uint16_t x11_mask) { uint32_t mask = get_xkb_mod_mask(b, x11_mask); struct weston_keyboard *keyboard = weston_seat_get_keyboard(&b->core_seat); xkb_state_update_mask(keyboard->xkb_state.state, keyboard->modifiers.mods_depressed & mask, keyboard->modifiers.mods_latched & mask, keyboard->modifiers.mods_locked & mask, 0, 0, (x11_mask >> 13) & 3); notify_modifiers(&b->core_seat, wl_display_next_serial(b->compositor->wl_display)); } static void x11_backend_deliver_button_event(struct x11_backend *b, xcb_generic_event_t *event, int state) { xcb_button_press_event_t *button_event = (xcb_button_press_event_t *) event; uint32_t button; struct x11_output *output; output = x11_backend_find_output(b, button_event->event); if (!output) return; if (state) xcb_grab_pointer(b->conn, 0, output->window, XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, output->window, XCB_CURSOR_NONE, button_event->time); else xcb_ungrab_pointer(b->conn, button_event->time); if (!b->has_xkb) update_xkb_state_from_core(b, button_event->state); switch (button_event->detail) { case 1: button = BTN_LEFT; break; case 2: button = BTN_MIDDLE; break; case 3: button = BTN_RIGHT; break; case 4: /* Axis are measured in pixels, but the xcb events are discrete * steps. Therefore move the axis by some pixels every step. */ if (state) notify_axis(&b->core_seat, weston_compositor_get_time(), WL_POINTER_AXIS_VERTICAL_SCROLL, -DEFAULT_AXIS_STEP_DISTANCE); return; case 5: if (state) notify_axis(&b->core_seat, weston_compositor_get_time(), WL_POINTER_AXIS_VERTICAL_SCROLL, DEFAULT_AXIS_STEP_DISTANCE); return; case 6: if (state) notify_axis(&b->core_seat, weston_compositor_get_time(), WL_POINTER_AXIS_HORIZONTAL_SCROLL, -DEFAULT_AXIS_STEP_DISTANCE); return; case 7: if (state) notify_axis(&b->core_seat, weston_compositor_get_time(), WL_POINTER_AXIS_HORIZONTAL_SCROLL, DEFAULT_AXIS_STEP_DISTANCE); return; default: button = button_event->detail + BTN_SIDE - 8; break; } notify_button(&b->core_seat, weston_compositor_get_time(), button, state ? WL_POINTER_BUTTON_STATE_PRESSED : WL_POINTER_BUTTON_STATE_RELEASED); } static void x11_backend_deliver_motion_event(struct x11_backend *b, xcb_generic_event_t *event) { struct x11_output *output; wl_fixed_t x, y; xcb_motion_notify_event_t *motion_notify = (xcb_motion_notify_event_t *) event; if (!b->has_xkb) update_xkb_state_from_core(b, motion_notify->state); output = x11_backend_find_output(b, motion_notify->event); if (!output) return; weston_output_transform_coordinate(&output->base, wl_fixed_from_int(motion_notify->event_x), wl_fixed_from_int(motion_notify->event_y), &x, &y); notify_motion(&b->core_seat, weston_compositor_get_time(), x - b->prev_x, y - b->prev_y); b->prev_x = x; b->prev_y = y; } static void x11_backend_deliver_enter_event(struct x11_backend *b, xcb_generic_event_t *event) { struct x11_output *output; wl_fixed_t x, y; xcb_enter_notify_event_t *enter_notify = (xcb_enter_notify_event_t *) event; if (enter_notify->state >= Button1Mask) return; if (!b->has_xkb) update_xkb_state_from_core(b, enter_notify->state); output = x11_backend_find_output(b, enter_notify->event); if (!output) return; weston_output_transform_coordinate(&output->base, wl_fixed_from_int(enter_notify->event_x), wl_fixed_from_int(enter_notify->event_y), &x, &y); notify_pointer_focus(&b->core_seat, &output->base, x, y); b->prev_x = x; b->prev_y = y; } static int x11_backend_next_event(struct x11_backend *b, xcb_generic_event_t **event, uint32_t mask) { if (mask & WL_EVENT_READABLE) { *event = xcb_poll_for_event(b->conn); } else { #ifdef HAVE_XCB_POLL_FOR_QUEUED_EVENT *event = xcb_poll_for_queued_event(b->conn); #else *event = xcb_poll_for_event(b->conn); #endif } return *event != NULL; } static int x11_backend_handle_event(int fd, uint32_t mask, void *data) { struct x11_backend *b = data; struct x11_output *output; xcb_generic_event_t *event, *prev; xcb_client_message_event_t *client_message; xcb_enter_notify_event_t *enter_notify; xcb_key_press_event_t *key_press, *key_release; xcb_keymap_notify_event_t *keymap_notify; xcb_focus_in_event_t *focus_in; xcb_expose_event_t *expose; xcb_atom_t atom; xcb_window_t window; uint32_t *k; uint32_t i, set; uint8_t response_type; int count; prev = NULL; count = 0; while (x11_backend_next_event(b, &event, mask)) { response_type = event->response_type & ~0x80; switch (prev ? prev->response_type & ~0x80 : 0x80) { case XCB_KEY_RELEASE: /* Suppress key repeat events; this is only used if we * don't have XCB XKB support. */ key_release = (xcb_key_press_event_t *) prev; key_press = (xcb_key_press_event_t *) event; if (response_type == XCB_KEY_PRESS && key_release->time == key_press->time && key_release->detail == key_press->detail) { /* Don't deliver the held key release * event or the new key press event. */ free(event); free(prev); prev = NULL; continue; } else { /* Deliver the held key release now * and fall through and handle the new * event below. */ update_xkb_state_from_core(b, key_release->state); notify_key(&b->core_seat, weston_compositor_get_time(), key_release->detail - 8, WL_KEYBOARD_KEY_STATE_RELEASED, STATE_UPDATE_AUTOMATIC); free(prev); prev = NULL; break; } case XCB_FOCUS_IN: assert(response_type == XCB_KEYMAP_NOTIFY); keymap_notify = (xcb_keymap_notify_event_t *) event; b->keys.size = 0; for (i = 0; i < ARRAY_LENGTH(keymap_notify->keys) * 8; i++) { set = keymap_notify->keys[i >> 3] & (1 << (i & 7)); if (set) { k = wl_array_add(&b->keys, sizeof *k); *k = i; } } /* Unfortunately the state only comes with the enter * event, rather than with the focus event. I'm not * sure of the exact semantics around it and whether * we can ensure that we get both? */ notify_keyboard_focus_in(&b->core_seat, &b->keys, STATE_UPDATE_AUTOMATIC); free(prev); prev = NULL; break; default: /* No previous event held */ break; } switch (response_type) { case XCB_KEY_PRESS: key_press = (xcb_key_press_event_t *) event; if (!b->has_xkb) update_xkb_state_from_core(b, key_press->state); notify_key(&b->core_seat, weston_compositor_get_time(), key_press->detail - 8, WL_KEYBOARD_KEY_STATE_PRESSED, b->has_xkb ? STATE_UPDATE_NONE : STATE_UPDATE_AUTOMATIC); break; case XCB_KEY_RELEASE: /* If we don't have XKB, we need to use the lame * autorepeat detection above. */ if (!b->has_xkb) { prev = event; break; } key_release = (xcb_key_press_event_t *) event; notify_key(&b->core_seat, weston_compositor_get_time(), key_release->detail - 8, WL_KEYBOARD_KEY_STATE_RELEASED, STATE_UPDATE_NONE); break; case XCB_BUTTON_PRESS: x11_backend_deliver_button_event(b, event, 1); break; case XCB_BUTTON_RELEASE: x11_backend_deliver_button_event(b, event, 0); break; case XCB_MOTION_NOTIFY: x11_backend_deliver_motion_event(b, event); break; case XCB_EXPOSE: expose = (xcb_expose_event_t *) event; output = x11_backend_find_output(b, expose->window); if (!output) break; weston_output_damage(&output->base); weston_output_schedule_repaint(&output->base); break; case XCB_ENTER_NOTIFY: x11_backend_deliver_enter_event(b, event); break; case XCB_LEAVE_NOTIFY: enter_notify = (xcb_enter_notify_event_t *) event; if (enter_notify->state >= Button1Mask) break; if (!b->has_xkb) update_xkb_state_from_core(b, enter_notify->state); notify_pointer_focus(&b->core_seat, NULL, 0, 0); break; case XCB_CLIENT_MESSAGE: client_message = (xcb_client_message_event_t *) event; atom = client_message->data.data32[0]; window = client_message->window; if (atom == b->atom.wm_delete_window) { struct wl_event_loop *loop; struct window_delete_data *data = malloc(sizeof *data); /* if malloc failed we should at least try to * delete the window, even if it may result in * a crash. */ if (!data) { x11_backend_delete_window(b, window); break; } data->backend = b; data->window = window; loop = wl_display_get_event_loop(b->compositor->wl_display); wl_event_loop_add_idle(loop, delete_cb, data); } break; case XCB_FOCUS_IN: focus_in = (xcb_focus_in_event_t *) event; if (focus_in->mode == XCB_NOTIFY_MODE_WHILE_GRABBED) break; prev = event; break; case XCB_FOCUS_OUT: focus_in = (xcb_focus_in_event_t *) event; if (focus_in->mode == XCB_NOTIFY_MODE_WHILE_GRABBED || focus_in->mode == XCB_NOTIFY_MODE_UNGRAB) break; notify_keyboard_focus_out(&b->core_seat); break; default: break; } #ifdef HAVE_XCB_XKB if (b->has_xkb) { if (response_type == b->xkb_event_base) { xcb_xkb_state_notify_event_t *state = (xcb_xkb_state_notify_event_t *) event; if (state->xkbType == XCB_XKB_STATE_NOTIFY) update_xkb_state(b, state); } else if (response_type == XCB_PROPERTY_NOTIFY) { xcb_property_notify_event_t *prop_notify = (xcb_property_notify_event_t *) event; if (prop_notify->window == b->screen->root && prop_notify->atom == b->atom.xkb_names && prop_notify->state == XCB_PROPERTY_NEW_VALUE) update_xkb_keymap(b); } } #endif count++; if (prev != event) free (event); } switch (prev ? prev->response_type & ~0x80 : 0x80) { case XCB_KEY_RELEASE: key_release = (xcb_key_press_event_t *) prev; update_xkb_state_from_core(b, key_release->state); notify_key(&b->core_seat, weston_compositor_get_time(), key_release->detail - 8, WL_KEYBOARD_KEY_STATE_RELEASED, STATE_UPDATE_AUTOMATIC); free(prev); prev = NULL; break; default: break; } return count; } #define F(field) offsetof(struct x11_backend, field) static void x11_backend_get_resources(struct x11_backend *b) { static const struct { const char *name; int offset; } atoms[] = { { "WM_PROTOCOLS", F(atom.wm_protocols) }, { "WM_NORMAL_HINTS", F(atom.wm_normal_hints) }, { "WM_SIZE_HINTS", F(atom.wm_size_hints) }, { "WM_DELETE_WINDOW", F(atom.wm_delete_window) }, { "WM_CLASS", F(atom.wm_class) }, { "_NET_WM_NAME", F(atom.net_wm_name) }, { "_NET_WM_ICON", F(atom.net_wm_icon) }, { "_NET_WM_STATE", F(atom.net_wm_state) }, { "_NET_WM_STATE_FULLSCREEN", F(atom.net_wm_state_fullscreen) }, { "_NET_SUPPORTING_WM_CHECK", F(atom.net_supporting_wm_check) }, { "_NET_SUPPORTED", F(atom.net_supported) }, { "STRING", F(atom.string) }, { "UTF8_STRING", F(atom.utf8_string) }, { "CARDINAL", F(atom.cardinal) }, { "_XKB_RULES_NAMES", F(atom.xkb_names) }, }; xcb_intern_atom_cookie_t cookies[ARRAY_LENGTH(atoms)]; xcb_intern_atom_reply_t *reply; xcb_pixmap_t pixmap; xcb_gc_t gc; unsigned int i; uint8_t data[] = { 0, 0, 0, 0 }; for (i = 0; i < ARRAY_LENGTH(atoms); i++) cookies[i] = xcb_intern_atom (b->conn, 0, strlen(atoms[i].name), atoms[i].name); for (i = 0; i < ARRAY_LENGTH(atoms); i++) { reply = xcb_intern_atom_reply (b->conn, cookies[i], NULL); *(xcb_atom_t *) ((char *) b + atoms[i].offset) = reply->atom; free(reply); } pixmap = xcb_generate_id(b->conn); gc = xcb_generate_id(b->conn); xcb_create_pixmap(b->conn, 1, pixmap, b->screen->root, 1, 1); xcb_create_gc(b->conn, gc, pixmap, 0, NULL); xcb_put_image(b->conn, XCB_IMAGE_FORMAT_XY_PIXMAP, pixmap, gc, 1, 1, 0, 0, 0, 32, sizeof data, data); b->null_cursor = xcb_generate_id(b->conn); xcb_create_cursor (b->conn, b->null_cursor, pixmap, pixmap, 0, 0, 0, 0, 0, 0, 1, 1); xcb_free_gc(b->conn, gc); xcb_free_pixmap(b->conn, pixmap); } static void x11_backend_get_wm_info(struct x11_backend *c) { xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; xcb_atom_t *atom; unsigned int i; cookie = xcb_get_property(c->conn, 0, c->screen->root, c->atom.net_supported, XCB_ATOM_ATOM, 0, 1024); reply = xcb_get_property_reply(c->conn, cookie, NULL); if (reply == NULL) return; atom = (xcb_atom_t *) xcb_get_property_value(reply); for (i = 0; i < reply->value_len; i++) { if (atom[i] == c->atom.net_wm_state_fullscreen) c->has_net_wm_state_fullscreen = 1; } free(reply); } static void x11_restore(struct weston_compositor *ec) { } static void x11_destroy(struct weston_compositor *ec) { struct x11_backend *backend = (struct x11_backend *)ec->backend; wl_event_source_remove(backend->xcb_source); x11_input_destroy(backend); weston_compositor_shutdown(ec); /* destroys outputs, too */ XCloseDisplay(backend->dpy); free(backend); } static int init_gl_renderer(struct x11_backend *b) { int ret; gl_renderer = weston_load_module("gl-renderer.so", "gl_renderer_interface"); if (!gl_renderer) return -1; ret = gl_renderer->create(b->compositor, EGL_PLATFORM_X11_KHR, (void *) b->dpy, gl_renderer->opaque_attribs, NULL, 0); return ret; } static struct x11_backend * x11_backend_create(struct weston_compositor *compositor, int fullscreen, int no_input, int use_pixman, int *argc, char *argv[], struct weston_config *config) { struct x11_backend *b; struct x11_output *output; struct weston_config_section *section; xcb_screen_iterator_t s; int i, x = 0, output_count = 0; int width, height, scale, count; const char *section_name; char *name, *t, *mode; uint32_t transform; weston_log("initializing x11 backend\n"); b = zalloc(sizeof *b); if (b == NULL) return NULL; b->compositor = compositor; if (weston_compositor_set_presentation_clock_software(compositor) < 0) goto err_free; b->dpy = XOpenDisplay(NULL); if (b->dpy == NULL) goto err_free; b->conn = XGetXCBConnection(b->dpy); XSetEventQueueOwner(b->dpy, XCBOwnsEventQueue); if (xcb_connection_has_error(b->conn)) goto err_xdisplay; s = xcb_setup_roots_iterator(xcb_get_setup(b->conn)); b->screen = s.data; wl_array_init(&b->keys); x11_backend_get_resources(b); x11_backend_get_wm_info(b); if (!b->has_net_wm_state_fullscreen && fullscreen) { weston_log("Can not fullscreen without window manager support" "(need _NET_WM_STATE_FULLSCREEN)\n"); fullscreen = 0; } b->use_pixman = use_pixman; if (b->use_pixman) { if (pixman_renderer_init(compositor) < 0) { weston_log("Failed to initialize pixman renderer for X11 backend\n"); goto err_xdisplay; } } else if (init_gl_renderer(b) < 0) { goto err_xdisplay; } weston_log("Using %s renderer\n", use_pixman ? "pixman" : "gl"); b->base.destroy = x11_destroy; b->base.restore = x11_restore; if (x11_input_create(b, no_input) < 0) { weston_log("Failed to create X11 input\n"); goto err_renderer; } width = option_width ? option_width : 1024; height = option_height ? option_height : 640; scale = option_scale ? option_scale : 1; count = option_count ? option_count : 1; section = NULL; while (weston_config_next_section(config, §ion, §ion_name)) { if (strcmp(section_name, "output") != 0) continue; weston_config_section_get_string(section, "name", &name, NULL); if (name == NULL || name[0] != 'X') { free(name); continue; } weston_config_section_get_string(section, "mode", &mode, "1024x600"); if (sscanf(mode, "%dx%d", &width, &height) != 2) { weston_log("Invalid mode \"%s\" for output %s\n", mode, name); width = 1024; height = 600; } free(mode); if (option_width) width = option_width; if (option_height) height = option_height; weston_config_section_get_int(section, "scale", &scale, 1); if (option_scale) scale = option_scale; weston_config_section_get_string(section, "transform", &t, "normal"); if (weston_parse_transform(t, &transform) < 0) weston_log("Invalid transform \"%s\" for output %s\n", t, name); free(t); output = x11_backend_create_output(b, x, 0, width, height, fullscreen, no_input, name, transform, scale); free(name); if (output == NULL) { weston_log("Failed to create configured x11 output\n"); goto err_x11_input; } x = pixman_region32_extents(&output->base.region)->x2; output_count++; if (option_count && output_count >= option_count) break; } for (i = output_count; i < count; i++) { output = x11_backend_create_output(b, x, 0, width, height, fullscreen, no_input, NULL, WL_OUTPUT_TRANSFORM_NORMAL, scale); if (output == NULL) { weston_log("Failed to create x11 output #%d\n", i); goto err_x11_input; } x = pixman_region32_extents(&output->base.region)->x2; } b->xcb_source = wl_event_loop_add_fd(compositor->input_loop, xcb_get_file_descriptor(b->conn), WL_EVENT_READABLE, x11_backend_handle_event, b); wl_event_source_check(b->xcb_source); if (compositor->renderer->import_dmabuf) { if (linux_dmabuf_setup(compositor) < 0) weston_log("Error: initializing dmabuf " "support failed.\n"); } compositor->backend = &b->base; return b; err_x11_input: x11_input_destroy(b); err_renderer: compositor->renderer->destroy(compositor); err_xdisplay: XCloseDisplay(b->dpy); err_free: free(b); return NULL; } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config) { struct x11_backend *b; int fullscreen = 0; int no_input = 0; int use_pixman = 0; const struct weston_option x11_options[] = { { WESTON_OPTION_INTEGER, "width", 0, &option_width }, { WESTON_OPTION_INTEGER, "height", 0, &option_height }, { WESTON_OPTION_INTEGER, "scale", 0, &option_scale }, { WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &fullscreen }, { WESTON_OPTION_INTEGER, "output-count", 0, &option_count }, { WESTON_OPTION_BOOLEAN, "no-input", 0, &no_input }, { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman }, }; parse_options(x11_options, ARRAY_LENGTH(x11_options), argc, argv); b = x11_backend_create(compositor, fullscreen, no_input, use_pixman, argc, argv, config); if (b == NULL) return -1; return 0; } weston-1.9.0/src/logind-util.h0000664000175000017500000000562112537627702013171 00000000000000/* * Copyright © 2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include "compositor.h" struct weston_logind; #if defined(HAVE_SYSTEMD_LOGIN) && defined(HAVE_DBUS) #include int weston_logind_open(struct weston_logind *wl, const char *path, int flags); void weston_logind_close(struct weston_logind *wl, int fd); void weston_logind_restore(struct weston_logind *wl); int weston_logind_activate_vt(struct weston_logind *wl, int vt); int weston_logind_connect(struct weston_logind **out, struct weston_compositor *compositor, const char *seat_id, int tty, bool sync_drm); void weston_logind_destroy(struct weston_logind *wl); static inline int weston_sd_session_get_vt(const char *sid, unsigned int *out) { #ifdef HAVE_SYSTEMD_LOGIN_209 return sd_session_get_vt(sid, out); #else int r; char *tty; r = sd_session_get_tty(sid, &tty); if (r < 0) return r; r = sscanf(tty, "tty%u", out); free(tty); if (r != 1) return -EINVAL; return 0; #endif } #else /* defined(HAVE_SYSTEMD_LOGIN) && defined(HAVE_DBUS) */ static inline int weston_logind_open(struct weston_logind *wl, const char *path, int flags) { return -ENOSYS; } static inline void weston_logind_close(struct weston_logind *wl, int fd) { } static inline void weston_logind_restore(struct weston_logind *wl) { } static inline int weston_logind_activate_vt(struct weston_logind *wl, int vt) { return -ENOSYS; } static inline int weston_logind_connect(struct weston_logind **out, struct weston_compositor *compositor, const char *seat_id, int tty, bool sync_drm) { return -ENOSYS; } static inline void weston_logind_destroy(struct weston_logind *wl) { } #endif /* defined(HAVE_SYSTEMD_LOGIN) && defined(HAVE_DBUS) */ weston-1.9.0/src/cms-static.c0000664000175000017500000000654112554240255012777 00000000000000/* * Copyright © 2013 Richard Hughes * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "compositor.h" #include "cms-helper.h" #include "shared/helpers.h" struct cms_static { struct weston_compositor *ec; struct wl_listener destroy_listener; struct wl_listener output_created_listener; }; static void cms_output_created(struct cms_static *cms, struct weston_output *o) { struct weston_color_profile *p; struct weston_config_section *s; char *profile; weston_log("cms-static: output %i [%s] created\n", o->id, o->name); if (o->name == NULL) return; s = weston_config_get_section(cms->ec->config, "output", "name", o->name); if (s == NULL) return; if (weston_config_section_get_string(s, "icc_profile", &profile, NULL) < 0) return; p = weston_cms_load_profile(profile); if (p == NULL && strlen(profile) > 0) { weston_log("cms-static: failed to load %s\n", profile); } else { weston_log("cms-static: loading %s for %s\n", (p != NULL) ? profile : "identity LUT", o->name); weston_cms_set_color_profile(o, p); } } static void cms_notifier_output_created(struct wl_listener *listener, void *data) { struct weston_output *o = (struct weston_output *) data; struct cms_static *cms = container_of(listener, struct cms_static, output_created_listener); cms_output_created(cms, o); } static void cms_module_destroy(struct cms_static *cms) { free(cms); } static void cms_notifier_destroy(struct wl_listener *listener, void *data) { struct cms_static *cms = container_of(listener, struct cms_static, destroy_listener); cms_module_destroy(cms); } WL_EXPORT int module_init(struct weston_compositor *ec, int *argc, char *argv[]) { struct cms_static *cms; struct weston_output *output; weston_log("cms-static: initialized\n"); /* create local state object */ cms = zalloc(sizeof *cms); if (cms == NULL) return -1; cms->ec = ec; cms->destroy_listener.notify = cms_notifier_destroy; wl_signal_add(&ec->destroy_signal, &cms->destroy_listener); cms->output_created_listener.notify = cms_notifier_output_created; wl_signal_add(&ec->output_created_signal, &cms->output_created_listener); /* discover outputs */ wl_list_for_each(output, &ec->output_list, link) cms_output_created(cms, output); return 0; } weston-1.9.0/src/screen-share.c0000664000175000017500000007002312560760452013306 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2014 Jason Ekstrand * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "fullscreen-shell-client-protocol.h" struct shared_output { struct weston_output *output; struct wl_listener output_destroyed; struct wl_list seat_list; struct { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shm *shm; uint32_t shm_formats; struct _wl_fullscreen_shell *fshell; struct wl_output *output; struct wl_surface *surface; struct wl_callback *frame_cb; struct _wl_fullscreen_shell_mode_feedback *mode_feedback; } parent; struct wl_event_source *event_source; struct wl_listener frame_listener; struct { int32_t width, height; struct wl_list buffers; struct wl_list free_buffers; } shm; int cache_dirty; pixman_image_t *cache_image; uint32_t *tmp_data; size_t tmp_data_size; }; struct ss_seat { struct weston_seat base; struct shared_output *output; struct wl_list link; struct { struct wl_seat *seat; struct wl_pointer *pointer; struct wl_keyboard *keyboard; } parent; enum weston_key_state_update keyboard_state_update; uint32_t key_serial; }; struct ss_shm_buffer { struct shared_output *output; struct wl_list link; struct wl_list free_link; struct wl_buffer *buffer; void *data; size_t size; pixman_region32_t damage; pixman_image_t *pm_image; }; struct screen_share { struct weston_compositor *compositor; char *command; }; static void ss_seat_handle_pointer_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y) { struct ss_seat *seat = data; /* No transformation of input position is required here because we are * always receiving the input in the same coordinates as the output. */ notify_pointer_focus(&seat->base, NULL, 0, 0); } static void ss_seat_handle_pointer_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) { struct ss_seat *seat = data; notify_pointer_focus(&seat->base, NULL, 0, 0); } static void ss_seat_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct ss_seat *seat = data; /* No transformation of input position is required here because we are * always receiving the input in the same coordinates as the output. */ notify_motion_absolute(&seat->base, time, x, y); } static void ss_seat_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { struct ss_seat *seat = data; notify_button(&seat->base, time, button, state); } static void ss_seat_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct ss_seat *seat = data; notify_axis(&seat->base, time, axis, value); } static const struct wl_pointer_listener ss_seat_pointer_listener = { ss_seat_handle_pointer_enter, ss_seat_handle_pointer_leave, ss_seat_handle_motion, ss_seat_handle_button, ss_seat_handle_axis, }; static void ss_seat_handle_keymap(void *data, struct wl_keyboard *wl_keyboard, uint32_t format, int fd, uint32_t size) { struct ss_seat *seat = data; struct xkb_keymap *keymap; char *map_str; if (!data) goto error; if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (map_str == MAP_FAILED) { weston_log("mmap failed: %m\n"); goto error; } keymap = xkb_keymap_new_from_string(seat->base.compositor->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(map_str, size); if (!keymap) { weston_log("failed to compile keymap\n"); goto error; } seat->keyboard_state_update = STATE_UPDATE_NONE; } else if (format == WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP) { weston_log("No keymap provided; falling back to default\n"); keymap = NULL; seat->keyboard_state_update = STATE_UPDATE_AUTOMATIC; } else { weston_log("Invalid keymap\n"); goto error; } close(fd); if (seat->base.keyboard_device_count) weston_seat_update_keymap(&seat->base, keymap); else weston_seat_init_keyboard(&seat->base, keymap); xkb_keymap_unref(keymap); return; error: wl_keyboard_release(seat->parent.keyboard); close(fd); } static void ss_seat_handle_keyboard_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { struct ss_seat *seat = data; /* XXX: If we get a modifier event immediately before the focus, * we should try to keep the same serial. */ notify_keyboard_focus_in(&seat->base, keys, STATE_UPDATE_AUTOMATIC); } static void ss_seat_handle_keyboard_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { struct ss_seat *seat = data; notify_keyboard_focus_out(&seat->base); } static void ss_seat_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { struct ss_seat *seat = data; seat->key_serial = serial; notify_key(&seat->base, time, key, state ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED, seat->keyboard_state_update); } static void ss_seat_handle_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial_in, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct ss_seat *seat = data; struct weston_compositor *c = seat->base.compositor; struct weston_keyboard *keyboard; uint32_t serial_out; /* If we get a key event followed by a modifier event with the * same serial number, then we try to preserve those semantics by * reusing the same serial number on the way out too. */ if (serial_in == seat->key_serial) serial_out = wl_display_get_serial(c->wl_display); else serial_out = wl_display_next_serial(c->wl_display); keyboard = weston_seat_get_keyboard(&seat->base); xkb_state_update_mask(keyboard->xkb_state.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); notify_modifiers(&seat->base, serial_out); } static const struct wl_keyboard_listener ss_seat_keyboard_listener = { ss_seat_handle_keymap, ss_seat_handle_keyboard_enter, ss_seat_handle_keyboard_leave, ss_seat_handle_key, ss_seat_handle_modifiers, }; static void ss_seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { struct ss_seat *ss_seat = data; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !ss_seat->parent.pointer) { ss_seat->parent.pointer = wl_seat_get_pointer(seat); wl_pointer_set_user_data(ss_seat->parent.pointer, ss_seat); wl_pointer_add_listener(ss_seat->parent.pointer, &ss_seat_pointer_listener, ss_seat); weston_seat_init_pointer(&ss_seat->base); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && ss_seat->parent.pointer) { wl_pointer_destroy(ss_seat->parent.pointer); ss_seat->parent.pointer = NULL; } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !ss_seat->parent.keyboard) { ss_seat->parent.keyboard = wl_seat_get_keyboard(seat); wl_keyboard_set_user_data(ss_seat->parent.keyboard, ss_seat); wl_keyboard_add_listener(ss_seat->parent.keyboard, &ss_seat_keyboard_listener, ss_seat); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && ss_seat->parent.keyboard) { wl_keyboard_destroy(ss_seat->parent.keyboard); ss_seat->parent.keyboard = NULL; } } static const struct wl_seat_listener ss_seat_listener = { ss_seat_handle_capabilities, }; static struct ss_seat * ss_seat_create(struct shared_output *so, uint32_t id) { struct ss_seat *seat; seat = zalloc(sizeof *seat); if (seat == NULL) return NULL; weston_seat_init(&seat->base, so->output->compositor, "default"); seat->output = so; seat->parent.seat = wl_registry_bind(so->parent.registry, id, &wl_seat_interface, 1); wl_list_insert(so->seat_list.prev, &seat->link); wl_seat_add_listener(seat->parent.seat, &ss_seat_listener, seat); wl_seat_set_user_data(seat->parent.seat, seat); return seat; } static void ss_seat_destroy(struct ss_seat *seat) { if (seat->parent.pointer) wl_pointer_release(seat->parent.pointer); if (seat->parent.keyboard) wl_keyboard_release(seat->parent.keyboard); wl_seat_destroy(seat->parent.seat); wl_list_remove(&seat->link); weston_seat_release(&seat->base); free(seat); } static void ss_shm_buffer_destroy(struct ss_shm_buffer *buffer) { pixman_image_unref(buffer->pm_image); wl_buffer_destroy(buffer->buffer); munmap(buffer->data, buffer->size); pixman_region32_fini(&buffer->damage); wl_list_remove(&buffer->link); wl_list_remove(&buffer->free_link); free(buffer); } static void buffer_release(void *data, struct wl_buffer *buffer) { struct ss_shm_buffer *sb = data; if (sb->output) { wl_list_insert(&sb->output->shm.free_buffers, &sb->free_link); } else { ss_shm_buffer_destroy(sb); } } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static struct ss_shm_buffer * shared_output_get_shm_buffer(struct shared_output *so) { struct ss_shm_buffer *sb, *bnext; struct wl_shm_pool *pool; int width, height, stride; int fd; unsigned char *data; width = so->output->width; height = so->output->height; stride = width * 4; /* If the size of the output changed, we free the old buffers and * make new ones. */ if (so->shm.width != width || so->shm.height != height) { /* Destroy free buffers */ wl_list_for_each_safe(sb, bnext, &so->shm.free_buffers, free_link) ss_shm_buffer_destroy(sb); /* Orphan in-use buffers so they get destroyed */ wl_list_for_each(sb, &so->shm.buffers, link) sb->output = NULL; so->shm.width = width; so->shm.height = height; } if (!wl_list_empty(&so->shm.free_buffers)) { sb = container_of(so->shm.free_buffers.next, struct ss_shm_buffer, free_link); wl_list_remove(&sb->free_link); wl_list_init(&sb->free_link); return sb; } fd = os_create_anonymous_file(height * stride); if (fd < 0) { weston_log("os_create_anonymous_file: %m"); return NULL; } data = mmap(NULL, height * stride, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { weston_log("mmap: %m"); goto out_close; } sb = zalloc(sizeof *sb); if (!sb) goto out_unmap; sb->output = so; wl_list_init(&sb->free_link); wl_list_insert(&so->shm.buffers, &sb->link); pixman_region32_init_rect(&sb->damage, 0, 0, width, height); sb->data = data; sb->size = height * stride; pool = wl_shm_create_pool(so->parent.shm, fd, sb->size); sb->buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_ARGB8888); wl_buffer_add_listener(sb->buffer, &buffer_listener, sb); wl_shm_pool_destroy(pool); close(fd); fd = -1; memset(data, 0, sb->size); sb->pm_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, width, height, (uint32_t *)data, stride); if (!sb->pm_image) goto out_pixman_error; return sb; out_pixman_error: pixman_region32_fini(&sb->damage); out_unmap: munmap(data, height * stride); out_close: if (fd != -1) close(fd); return NULL; } static void output_compute_transform(struct weston_output *output, pixman_transform_t *transform) { pixman_fixed_t fw, fh; pixman_transform_init_identity(transform); fw = pixman_int_to_fixed(output->width); fh = pixman_int_to_fixed(output->height); switch (output->transform) { case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_180: case WL_OUTPUT_TRANSFORM_FLIPPED_270: pixman_transform_scale(transform, NULL, pixman_int_to_fixed (-1), pixman_int_to_fixed (1)); pixman_transform_translate(transform, NULL, fw, 0); } switch (output->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_FLIPPED: break; case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_FLIPPED_90: pixman_transform_rotate(transform, NULL, 0, pixman_fixed_1); pixman_transform_translate(transform, NULL, fh, 0); break; case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED_180: pixman_transform_rotate(transform, NULL, -pixman_fixed_1, 0); pixman_transform_translate(transform, NULL, fw, fh); break; case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_270: pixman_transform_rotate(transform, NULL, 0, -pixman_fixed_1); pixman_transform_translate(transform, NULL, 0, fw); break; } pixman_transform_scale(transform, NULL, pixman_fixed_1 * output->current_scale, pixman_fixed_1 * output->current_scale); } static void shared_output_destroy(struct shared_output *so); static int shared_output_ensure_tmp_data(struct shared_output *so, pixman_region32_t *region) { pixman_box32_t *ext; size_t size; if (!pixman_region32_not_empty(region)) return 0; ext = pixman_region32_extents(region); /* Damage is in output coordinates. * * We are multiplying by 4 because the temporary data needs to be able * to store an 32 bit-per-pixel buffer. */ size = 4 * (ext->x2 - ext->x1) * (ext->y2 - ext->y1) * so->output->current_scale * so->output->current_scale; if (so->tmp_data != NULL && size <= so->tmp_data_size) return 0; free(so->tmp_data); so->tmp_data = malloc(size); if (so->tmp_data == NULL) { so->tmp_data_size = 0; errno = ENOMEM; return -1; } so->tmp_data_size = size; return 0; } static void shared_output_update(struct shared_output *so); static void shared_output_frame_callback(void *data, struct wl_callback *cb, uint32_t time) { struct shared_output *so = data; if (cb != so->parent.frame_cb) return; wl_callback_destroy(cb); so->parent.frame_cb = NULL; shared_output_update(so); } static const struct wl_callback_listener shared_output_frame_listener = { shared_output_frame_callback }; static void shared_output_update(struct shared_output *so) { struct ss_shm_buffer *sb; pixman_box32_t *r; int i, nrects; pixman_transform_t transform; /* Only update if we need to */ if (!so->cache_dirty || so->parent.frame_cb) return; sb = shared_output_get_shm_buffer(so); if (sb == NULL) { shared_output_destroy(so); return; } output_compute_transform(so->output, &transform); pixman_image_set_transform(so->cache_image, &transform); pixman_image_set_clip_region32(sb->pm_image, &sb->damage); if (so->output->current_scale == 1) { pixman_image_set_filter(so->cache_image, PIXMAN_FILTER_NEAREST, NULL, 0); } else { pixman_image_set_filter(so->cache_image, PIXMAN_FILTER_BILINEAR, NULL, 0); } pixman_image_composite32(PIXMAN_OP_SRC, so->cache_image, /* src */ NULL, /* mask */ sb->pm_image, /* dest */ 0, 0, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ so->output->width, /* width */ so->output->height /* height */); pixman_image_set_transform(sb->pm_image, NULL); pixman_image_set_clip_region32(sb->pm_image, NULL); r = pixman_region32_rectangles(&sb->damage, &nrects); for (i = 0; i < nrects; ++i) wl_surface_damage(so->parent.surface, r[i].x1, r[i].y1, r[i].x2 - r[i].x1, r[i].y2 - r[i].y1); wl_surface_attach(so->parent.surface, sb->buffer, 0, 0); so->parent.frame_cb = wl_surface_frame(so->parent.surface); wl_callback_add_listener(so->parent.frame_cb, &shared_output_frame_listener, so); wl_surface_commit(so->parent.surface); wl_callback_destroy(wl_display_sync(so->parent.display)); wl_display_flush(so->parent.display); /* Clear the buffer damage */ pixman_region32_fini(&sb->damage); pixman_region32_init(&sb->damage); } static void shm_handle_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct shared_output *so = data; so->parent.shm_formats |= (1 << format); } struct wl_shm_listener shm_listener = { shm_handle_format }; static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct shared_output *so = data; if (strcmp(interface, "wl_compositor") == 0) { so->parent.compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_output") == 0 && !so->parent.output) { so->parent.output = wl_registry_bind(registry, id, &wl_output_interface, 1); } else if (strcmp(interface, "wl_seat") == 0) { ss_seat_create(so, id); } else if (strcmp(interface, "wl_shm") == 0) { so->parent.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(so->parent.shm, &shm_listener, so); } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) { so->parent.fshell = wl_registry_bind(registry, id, &_wl_fullscreen_shell_interface, 1); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static int shared_output_handle_event(int fd, uint32_t mask, void *data) { struct shared_output *so = data; int count = 0; if ((mask & WL_EVENT_HANGUP) || (mask & WL_EVENT_ERROR)) { shared_output_destroy(so); return 0; } if (mask & WL_EVENT_READABLE) count = wl_display_dispatch(so->parent.display); if (mask & WL_EVENT_WRITABLE) wl_display_flush(so->parent.display); if (mask == 0) { count = wl_display_dispatch_pending(so->parent.display); wl_display_flush(so->parent.display); } return count; } static void output_destroyed(struct wl_listener *l, void *data) { struct shared_output *so; so = container_of(l, struct shared_output, output_destroyed); shared_output_destroy(so); } static void mode_feedback_ok(void *data, struct _wl_fullscreen_shell_mode_feedback *fb) { struct shared_output *so = data; _wl_fullscreen_shell_mode_feedback_destroy(so->parent.mode_feedback); } static void mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb) { struct shared_output *so = data; _wl_fullscreen_shell_mode_feedback_destroy(so->parent.mode_feedback); weston_log("Screen share failed: present_surface_for_mode failed\n"); shared_output_destroy(so); } struct _wl_fullscreen_shell_mode_feedback_listener mode_feedback_listener = { mode_feedback_ok, mode_feedback_failed, mode_feedback_ok, }; static void shared_output_repainted(struct wl_listener *listener, void *data) { struct shared_output *so = container_of(listener, struct shared_output, frame_listener); pixman_region32_t damage; struct ss_shm_buffer *sb; int32_t x, y, width, height, stride; int i, nrects, do_yflip; pixman_box32_t *r; uint32_t *cache_data; /* Damage in output coordinates */ pixman_region32_init(&damage); pixman_region32_intersect(&damage, &so->output->region, &so->output->previous_damage); pixman_region32_translate(&damage, -so->output->x, -so->output->y); /* Apply damage to all buffers */ wl_list_for_each(sb, &so->shm.buffers, link) pixman_region32_union(&sb->damage, &sb->damage, &damage); /* Transform to buffer coordinates */ weston_transformed_region(so->output->width, so->output->height, so->output->transform, so->output->current_scale, &damage, &damage); width = so->output->current_mode->width; height = so->output->current_mode->height; stride = width; if (!so->cache_image || pixman_image_get_width(so->cache_image) != width || pixman_image_get_height(so->cache_image) != height) { if (so->cache_image) pixman_image_unref(so->cache_image); so->cache_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, width, height, NULL, stride); if (!so->cache_image) { shared_output_destroy(so); return; } pixman_region32_fini(&damage); pixman_region32_init_rect(&damage, 0, 0, width, height); } if (shared_output_ensure_tmp_data(so, &damage) < 0) { shared_output_destroy(so); return; } do_yflip = !!(so->output->compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP); cache_data = pixman_image_get_data(so->cache_image); r = pixman_region32_rectangles(&damage, &nrects); for (i = 0; i < nrects; ++i) { x = r[i].x1; y = r[i].y1; width = r[i].x2 - r[i].x1; height = r[i].y2 - r[i].y1; if (do_yflip) { so->output->compositor->renderer->read_pixels( so->output, PIXMAN_a8r8g8b8, so->tmp_data, x, so->output->current_mode->height - r[i].y2, width, height); pixman_blt(so->tmp_data, cache_data, -width, stride, 32, 32, 0, 1 - height, x, y, width, height); } else { so->output->compositor->renderer->read_pixels( so->output, PIXMAN_a8r8g8b8, so->tmp_data, x, y, width, height); pixman_blt(so->tmp_data, cache_data, width, stride, 32, 32, 0, 0, x, y, width, height); } } pixman_region32_fini(&damage); so->cache_dirty = 1; shared_output_update(so); } static struct shared_output * shared_output_create(struct weston_output *output, int parent_fd) { struct shared_output *so; struct wl_event_loop *loop; struct ss_seat *seat; int epoll_fd; so = zalloc(sizeof *so); if (so == NULL) goto err_close; wl_list_init(&so->seat_list); so->parent.display = wl_display_connect_to_fd(parent_fd); if (!so->parent.display) goto err_alloc; so->parent.registry = wl_display_get_registry(so->parent.display); if (!so->parent.registry) goto err_display; wl_registry_add_listener(so->parent.registry, ®istry_listener, so); wl_display_roundtrip(so->parent.display); if (so->parent.shm == NULL) { weston_log("Screen share failed: No wl_shm found\n"); goto err_display; } if (so->parent.fshell == NULL) { weston_log("Screen share failed: " "Parent does not support wl_fullscreen_shell\n"); goto err_display; } if (so->parent.compositor == NULL) { weston_log("Screen share failed: No wl_compositor found\n"); goto err_display; } /* Get SHM formats */ wl_display_roundtrip(so->parent.display); if (!(so->parent.shm_formats & (1 << WL_SHM_FORMAT_XRGB8888))) { weston_log("Screen share failed: " "WL_SHM_FORMAT_XRGB8888 not available\n"); goto err_display; } so->parent.surface = wl_compositor_create_surface(so->parent.compositor); if (!so->parent.surface) { weston_log("Screen share failed: %m"); goto err_display; } so->parent.mode_feedback = _wl_fullscreen_shell_present_surface_for_mode(so->parent.fshell, so->parent.surface, so->parent.output, output->current_mode->refresh); if (!so->parent.mode_feedback) { weston_log("Screen share failed: %m"); goto err_display; } _wl_fullscreen_shell_mode_feedback_add_listener(so->parent.mode_feedback, &mode_feedback_listener, so); loop = wl_display_get_event_loop(output->compositor->wl_display); epoll_fd = wl_display_get_fd(so->parent.display); so->event_source = wl_event_loop_add_fd(loop, epoll_fd, WL_EVENT_READABLE, shared_output_handle_event, so); if (!so->event_source) { weston_log("Screen share failed: %m"); goto err_display; } /* Ok, everything's created. We should be good to go */ wl_list_init(&so->shm.buffers); wl_list_init(&so->shm.free_buffers); so->output = output; so->output_destroyed.notify = output_destroyed; wl_signal_add(&so->output->destroy_signal, &so->output_destroyed); so->frame_listener.notify = shared_output_repainted; wl_signal_add(&output->frame_signal, &so->frame_listener); output->disable_planes++; weston_output_damage(output); return so; err_display: wl_list_for_each(seat, &so->seat_list, link) ss_seat_destroy(seat); wl_display_disconnect(so->parent.display); err_alloc: free(so); err_close: close(parent_fd); return NULL; } static void shared_output_destroy(struct shared_output *so) { struct ss_shm_buffer *buffer, *bnext; so->output->disable_planes--; wl_list_for_each_safe(buffer, bnext, &so->shm.buffers, link) ss_shm_buffer_destroy(buffer); wl_list_for_each_safe(buffer, bnext, &so->shm.free_buffers, free_link) ss_shm_buffer_destroy(buffer); wl_display_disconnect(so->parent.display); wl_event_source_remove(so->event_source); wl_list_remove(&so->output_destroyed.link); wl_list_remove(&so->frame_listener.link); pixman_image_unref(so->cache_image); free(so->tmp_data); free(so); } static struct shared_output * weston_output_share(struct weston_output *output, const char* command) { int sv[2]; char str[32]; pid_t pid; sigset_t allsigs; char *const argv[] = { "/bin/sh", "-c", (char*)command, NULL }; if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sv) < 0) { weston_log("weston_output_share: socketpair failed: %m\n"); return NULL; } pid = fork(); if (pid == -1) { close(sv[0]); close(sv[1]); weston_log("weston_output_share: fork failed: %m\n"); return NULL; } if (pid == 0) { /* do not give our signal mask to the new process */ sigfillset(&allsigs); sigprocmask(SIG_UNBLOCK, &allsigs, NULL); /* Launch clients as the user. Do not launch clients with * wrong euid. */ if (seteuid(getuid()) == -1) { weston_log("weston_output_share: setuid failed: %m\n"); abort(); } sv[1] = dup(sv[1]); if (sv[1] == -1) { weston_log("weston_output_share: dup failed: %m\n"); abort(); } snprintf(str, sizeof str, "%d", sv[1]); setenv("WAYLAND_SERVER_SOCKET", str, 1); execv(argv[0], argv); weston_log("weston_output_share: exec failed: %m\n"); abort(); } else { close(sv[1]); return shared_output_create(output, sv[0]); } return NULL; } static struct weston_output * weston_output_find(struct weston_compositor *c, int32_t x, int32_t y) { struct weston_output *output; wl_list_for_each(output, &c->output_list, link) { if (x >= output->x && y >= output->y && x < output->x + output->width && y < output->y + output->height) return output; } return NULL; } static void share_output_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_output *output; struct weston_pointer *pointer; struct screen_share *ss = data; pointer = weston_seat_get_pointer(keyboard->seat); if (!pointer) { weston_log("Cannot pick output: Seat does not have pointer\n"); return; } output = weston_output_find(pointer->seat->compositor, wl_fixed_to_int(pointer->x), wl_fixed_to_int(pointer->y)); if (!output) { weston_log("Cannot pick output: Pointer not on any output\n"); return; } weston_output_share(output, ss->command); } WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct screen_share *ss; struct weston_config_section *section; ss = zalloc(sizeof *ss); if (ss == NULL) return -1; ss->compositor = compositor; section = weston_config_get_section(compositor->config, "screen-share", NULL, NULL); weston_config_section_get_string(section, "command", &ss->command, ""); weston_compositor_add_key_binding(compositor, KEY_S, MODIFIER_CTRL | MODIFIER_ALT, share_output_binding, ss); return 0; } weston-1.9.0/src/git-version.h0000664000175000017500000000017612600133056013171 00000000000000#define BUILD_ID "1.8.93-2-gb05cdb8 configure.ac: bump to version 1.9.0 for the official release (2015-09-21 18:11:26 -0700)" weston-1.9.0/src/vertex-clipping.c0000664000175000017500000002076412575610240014051 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include "vertex-clipping.h" float float_difference(float a, float b) { /* http://www.altdevblogaday.com/2012/02/22/comparing-floating-point-numbers-2012-edition/ */ static const float max_diff = 4.0f * FLT_MIN; static const float max_rel_diff = 4.0e-5; float diff = a - b; float adiff = fabsf(diff); if (adiff <= max_diff) return 0.0f; a = fabsf(a); b = fabsf(b); if (adiff <= (a > b ? a : b) * max_rel_diff) return 0.0f; return diff; } /* A line segment (p1x, p1y)-(p2x, p2y) intersects the line x = x_arg. * Compute the y coordinate of the intersection. */ static float clip_intersect_y(float p1x, float p1y, float p2x, float p2y, float x_arg) { float a; float diff = float_difference(p1x, p2x); /* Practically vertical line segment, yet the end points have already * been determined to be on different sides of the line. Therefore * the line segment is part of the line and intersects everywhere. * Return the end point, so we use the whole line segment. */ if (diff == 0.0f) return p2y; a = (x_arg - p2x) / diff; return p2y + (p1y - p2y) * a; } /* A line segment (p1x, p1y)-(p2x, p2y) intersects the line y = y_arg. * Compute the x coordinate of the intersection. */ static float clip_intersect_x(float p1x, float p1y, float p2x, float p2y, float y_arg) { float a; float diff = float_difference(p1y, p2y); /* Practically horizontal line segment, yet the end points have already * been determined to be on different sides of the line. Therefore * the line segment is part of the line and intersects everywhere. * Return the end point, so we use the whole line segment. */ if (diff == 0.0f) return p2x; a = (y_arg - p2y) / diff; return p2x + (p1x - p2x) * a; } enum path_transition { PATH_TRANSITION_OUT_TO_OUT = 0, PATH_TRANSITION_OUT_TO_IN = 1, PATH_TRANSITION_IN_TO_OUT = 2, PATH_TRANSITION_IN_TO_IN = 3, }; static void clip_append_vertex(struct clip_context *ctx, float x, float y) { *ctx->vertices.x++ = x; *ctx->vertices.y++ = y; } static enum path_transition path_transition_left_edge(struct clip_context *ctx, float x, float y) { return ((ctx->prev.x >= ctx->clip.x1) << 1) | (x >= ctx->clip.x1); } static enum path_transition path_transition_right_edge(struct clip_context *ctx, float x, float y) { return ((ctx->prev.x < ctx->clip.x2) << 1) | (x < ctx->clip.x2); } static enum path_transition path_transition_top_edge(struct clip_context *ctx, float x, float y) { return ((ctx->prev.y >= ctx->clip.y1) << 1) | (y >= ctx->clip.y1); } static enum path_transition path_transition_bottom_edge(struct clip_context *ctx, float x, float y) { return ((ctx->prev.y < ctx->clip.y2) << 1) | (y < ctx->clip.y2); } static void clip_polygon_leftright(struct clip_context *ctx, enum path_transition transition, float x, float y, float clip_x) { float yi; switch (transition) { case PATH_TRANSITION_IN_TO_IN: clip_append_vertex(ctx, x, y); break; case PATH_TRANSITION_IN_TO_OUT: yi = clip_intersect_y(ctx->prev.x, ctx->prev.y, x, y, clip_x); clip_append_vertex(ctx, clip_x, yi); break; case PATH_TRANSITION_OUT_TO_IN: yi = clip_intersect_y(ctx->prev.x, ctx->prev.y, x, y, clip_x); clip_append_vertex(ctx, clip_x, yi); clip_append_vertex(ctx, x, y); break; case PATH_TRANSITION_OUT_TO_OUT: /* nothing */ break; default: assert(0 && "bad enum path_transition"); } ctx->prev.x = x; ctx->prev.y = y; } static void clip_polygon_topbottom(struct clip_context *ctx, enum path_transition transition, float x, float y, float clip_y) { float xi; switch (transition) { case PATH_TRANSITION_IN_TO_IN: clip_append_vertex(ctx, x, y); break; case PATH_TRANSITION_IN_TO_OUT: xi = clip_intersect_x(ctx->prev.x, ctx->prev.y, x, y, clip_y); clip_append_vertex(ctx, xi, clip_y); break; case PATH_TRANSITION_OUT_TO_IN: xi = clip_intersect_x(ctx->prev.x, ctx->prev.y, x, y, clip_y); clip_append_vertex(ctx, xi, clip_y); clip_append_vertex(ctx, x, y); break; case PATH_TRANSITION_OUT_TO_OUT: /* nothing */ break; default: assert(0 && "bad enum path_transition"); } ctx->prev.x = x; ctx->prev.y = y; } static void clip_context_prepare(struct clip_context *ctx, const struct polygon8 *src, float *dst_x, float *dst_y) { ctx->prev.x = src->x[src->n - 1]; ctx->prev.y = src->y[src->n - 1]; ctx->vertices.x = dst_x; ctx->vertices.y = dst_y; } static int clip_polygon_left(struct clip_context *ctx, const struct polygon8 *src, float *dst_x, float *dst_y) { enum path_transition trans; int i; if (src->n < 2) return 0; clip_context_prepare(ctx, src, dst_x, dst_y); for (i = 0; i < src->n; i++) { trans = path_transition_left_edge(ctx, src->x[i], src->y[i]); clip_polygon_leftright(ctx, trans, src->x[i], src->y[i], ctx->clip.x1); } return ctx->vertices.x - dst_x; } static int clip_polygon_right(struct clip_context *ctx, const struct polygon8 *src, float *dst_x, float *dst_y) { enum path_transition trans; int i; if (src->n < 2) return 0; clip_context_prepare(ctx, src, dst_x, dst_y); for (i = 0; i < src->n; i++) { trans = path_transition_right_edge(ctx, src->x[i], src->y[i]); clip_polygon_leftright(ctx, trans, src->x[i], src->y[i], ctx->clip.x2); } return ctx->vertices.x - dst_x; } static int clip_polygon_top(struct clip_context *ctx, const struct polygon8 *src, float *dst_x, float *dst_y) { enum path_transition trans; int i; if (src->n < 2) return 0; clip_context_prepare(ctx, src, dst_x, dst_y); for (i = 0; i < src->n; i++) { trans = path_transition_top_edge(ctx, src->x[i], src->y[i]); clip_polygon_topbottom(ctx, trans, src->x[i], src->y[i], ctx->clip.y1); } return ctx->vertices.x - dst_x; } static int clip_polygon_bottom(struct clip_context *ctx, const struct polygon8 *src, float *dst_x, float *dst_y) { enum path_transition trans; int i; if (src->n < 2) return 0; clip_context_prepare(ctx, src, dst_x, dst_y); for (i = 0; i < src->n; i++) { trans = path_transition_bottom_edge(ctx, src->x[i], src->y[i]); clip_polygon_topbottom(ctx, trans, src->x[i], src->y[i], ctx->clip.y2); } return ctx->vertices.x - dst_x; } #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) > (b)) ? (b) : (a)) #define clip(x, a, b) min(max(x, a), b) int clip_simple(struct clip_context *ctx, struct polygon8 *surf, float *ex, float *ey) { int i; for (i = 0; i < surf->n; i++) { ex[i] = clip(surf->x[i], ctx->clip.x1, ctx->clip.x2); ey[i] = clip(surf->y[i], ctx->clip.y1, ctx->clip.y2); } return surf->n; } int clip_transformed(struct clip_context *ctx, struct polygon8 *surf, float *ex, float *ey) { struct polygon8 polygon; int i, n; polygon.n = clip_polygon_left(ctx, surf, polygon.x, polygon.y); surf->n = clip_polygon_right(ctx, &polygon, surf->x, surf->y); polygon.n = clip_polygon_top(ctx, surf, polygon.x, polygon.y); surf->n = clip_polygon_bottom(ctx, &polygon, surf->x, surf->y); /* Get rid of duplicate vertices */ ex[0] = surf->x[0]; ey[0] = surf->y[0]; n = 1; for (i = 1; i < surf->n; i++) { if (float_difference(ex[n - 1], surf->x[i]) == 0.0f && float_difference(ey[n - 1], surf->y[i]) == 0.0f) continue; ex[n] = surf->x[i]; ey[n] = surf->y[i]; n++; } if (float_difference(ex[n - 1], surf->x[0]) == 0.0f && float_difference(ey[n - 1], surf->y[0]) == 0.0f) n--; return n; } weston-1.9.0/src/compositor-drm.c0000664000175000017500000024406312575610243013712 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "shared/timespec-util.h" #include "libbacklight.h" #include "compositor.h" #include "gl-renderer.h" #include "pixman-renderer.h" #include "libinput-seat.h" #include "launcher-util.h" #include "vaapi-recorder.h" #include "presentation_timing-server-protocol.h" #include "linux-dmabuf.h" #ifndef DRM_CAP_TIMESTAMP_MONOTONIC #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 #endif #ifndef DRM_CAP_CURSOR_WIDTH #define DRM_CAP_CURSOR_WIDTH 0x8 #endif #ifndef DRM_CAP_CURSOR_HEIGHT #define DRM_CAP_CURSOR_HEIGHT 0x9 #endif #ifndef GBM_BO_USE_CURSOR #define GBM_BO_USE_CURSOR GBM_BO_USE_CURSOR_64X64 #endif static int option_current_mode = 0; enum output_config { OUTPUT_CONFIG_INVALID = 0, OUTPUT_CONFIG_OFF, OUTPUT_CONFIG_PREFERRED, OUTPUT_CONFIG_CURRENT, OUTPUT_CONFIG_MODE, OUTPUT_CONFIG_MODELINE }; struct drm_backend { struct weston_backend base; struct weston_compositor *compositor; struct udev *udev; struct wl_event_source *drm_source; struct udev_monitor *udev_monitor; struct wl_event_source *udev_drm_source; struct { int id; int fd; char *filename; } drm; struct gbm_device *gbm; uint32_t *crtcs; int num_crtcs; uint32_t crtc_allocator; uint32_t connector_allocator; struct wl_listener session_listener; uint32_t format; /* we need these parameters in order to not fail drmModeAddFB2() * due to out of bounds dimensions, and then mistakenly set * sprites_are_broken: */ uint32_t min_width, max_width; uint32_t min_height, max_height; int no_addfb2; struct wl_list sprite_list; int sprites_are_broken; int sprites_hidden; int cursors_are_broken; int use_pixman; uint32_t prev_state; struct udev_input input; int32_t cursor_width; int32_t cursor_height; }; struct drm_mode { struct weston_mode base; drmModeModeInfo mode_info; }; struct drm_output; struct drm_fb { struct drm_output *output; uint32_t fb_id, stride, handle, size; int fd; int is_client_buffer; struct weston_buffer_reference buffer_ref; /* Used by gbm fbs */ struct gbm_bo *bo; /* Used by dumb fbs */ void *map; }; struct drm_edid { char eisa_id[13]; char monitor_name[13]; char pnp_id[5]; char serial_number[13]; }; struct drm_output { struct weston_output base; uint32_t crtc_id; int pipe; uint32_t connector_id; drmModeCrtcPtr original_crtc; struct drm_edid edid; drmModePropertyPtr dpms_prop; uint32_t format; enum dpms_enum dpms; int vblank_pending; int page_flip_pending; int destroy_pending; struct gbm_surface *surface; struct gbm_bo *cursor_bo[2]; struct weston_plane cursor_plane; struct weston_plane fb_plane; struct weston_view *cursor_view; int current_cursor; struct drm_fb *current, *next; struct backlight *backlight; struct drm_fb *dumb[2]; pixman_image_t *image[2]; int current_image; pixman_region32_t previous_damage; struct vaapi_recorder *recorder; struct wl_listener recorder_frame_listener; }; /* * An output has a primary display plane plus zero or more sprites for * blending display contents. */ struct drm_sprite { struct wl_list link; struct weston_plane plane; struct drm_fb *current, *next; struct drm_output *output; struct drm_backend *backend; uint32_t possible_crtcs; uint32_t plane_id; uint32_t count_formats; int32_t src_x, src_y; uint32_t src_w, src_h; uint32_t dest_x, dest_y; uint32_t dest_w, dest_h; uint32_t formats[]; }; struct drm_parameters { int connector; int tty; int use_pixman; const char *seat_id; }; static struct gl_renderer_interface *gl_renderer; static const char default_seat[] = "seat0"; static void drm_output_set_cursor(struct drm_output *output); static void drm_output_update_msc(struct drm_output *output, unsigned int seq); static int drm_sprite_crtc_supported(struct drm_output *output, uint32_t supported) { struct weston_compositor *ec = output->base.compositor; struct drm_backend *b =(struct drm_backend *)ec->backend; int crtc; for (crtc = 0; crtc < b->num_crtcs; crtc++) { if (b->crtcs[crtc] != output->crtc_id) continue; if (supported & (1 << crtc)) return -1; } return 0; } static void drm_fb_destroy_callback(struct gbm_bo *bo, void *data) { struct drm_fb *fb = data; struct gbm_device *gbm = gbm_bo_get_device(bo); if (fb->fb_id) drmModeRmFB(gbm_device_get_fd(gbm), fb->fb_id); weston_buffer_reference(&fb->buffer_ref, NULL); free(data); } static struct drm_fb * drm_fb_create_dumb(struct drm_backend *b, unsigned width, unsigned height) { struct drm_fb *fb; int ret; struct drm_mode_create_dumb create_arg; struct drm_mode_destroy_dumb destroy_arg; struct drm_mode_map_dumb map_arg; fb = zalloc(sizeof *fb); if (!fb) return NULL; memset(&create_arg, 0, sizeof create_arg); create_arg.bpp = 32; create_arg.width = width; create_arg.height = height; ret = drmIoctl(b->drm.fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_arg); if (ret) goto err_fb; fb->handle = create_arg.handle; fb->stride = create_arg.pitch; fb->size = create_arg.size; fb->fd = b->drm.fd; ret = drmModeAddFB(b->drm.fd, width, height, 24, 32, fb->stride, fb->handle, &fb->fb_id); if (ret) goto err_bo; memset(&map_arg, 0, sizeof map_arg); map_arg.handle = fb->handle; ret = drmIoctl(fb->fd, DRM_IOCTL_MODE_MAP_DUMB, &map_arg); if (ret) goto err_add_fb; fb->map = mmap(0, fb->size, PROT_WRITE, MAP_SHARED, b->drm.fd, map_arg.offset); if (fb->map == MAP_FAILED) goto err_add_fb; return fb; err_add_fb: drmModeRmFB(b->drm.fd, fb->fb_id); err_bo: memset(&destroy_arg, 0, sizeof(destroy_arg)); destroy_arg.handle = create_arg.handle; drmIoctl(b->drm.fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_arg); err_fb: free(fb); return NULL; } static void drm_fb_destroy_dumb(struct drm_fb *fb) { struct drm_mode_destroy_dumb destroy_arg; if (!fb->map) return; if (fb->fb_id) drmModeRmFB(fb->fd, fb->fb_id); weston_buffer_reference(&fb->buffer_ref, NULL); munmap(fb->map, fb->size); memset(&destroy_arg, 0, sizeof(destroy_arg)); destroy_arg.handle = fb->handle; drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_arg); free(fb); } static struct drm_fb * drm_fb_get_from_bo(struct gbm_bo *bo, struct drm_backend *backend, uint32_t format) { struct drm_fb *fb = gbm_bo_get_user_data(bo); uint32_t width, height; uint32_t handles[4], pitches[4], offsets[4]; int ret; if (fb) return fb; fb = zalloc(sizeof *fb); if (fb == NULL) return NULL; fb->bo = bo; width = gbm_bo_get_width(bo); height = gbm_bo_get_height(bo); fb->stride = gbm_bo_get_stride(bo); fb->handle = gbm_bo_get_handle(bo).u32; fb->size = fb->stride * height; fb->fd = backend->drm.fd; if (backend->min_width > width || width > backend->max_width || backend->min_height > height || height > backend->max_height) { weston_log("bo geometry out of bounds\n"); goto err_free; } ret = -1; if (format && !backend->no_addfb2) { handles[0] = fb->handle; pitches[0] = fb->stride; offsets[0] = 0; ret = drmModeAddFB2(backend->drm.fd, width, height, format, handles, pitches, offsets, &fb->fb_id, 0); if (ret) { weston_log("addfb2 failed: %m\n"); backend->no_addfb2 = 1; backend->sprites_are_broken = 1; } } if (ret) ret = drmModeAddFB(backend->drm.fd, width, height, 24, 32, fb->stride, fb->handle, &fb->fb_id); if (ret) { weston_log("failed to create kms fb: %m\n"); goto err_free; } gbm_bo_set_user_data(bo, fb, drm_fb_destroy_callback); return fb; err_free: free(fb); return NULL; } static void drm_fb_set_buffer(struct drm_fb *fb, struct weston_buffer *buffer) { assert(fb->buffer_ref.buffer == NULL); fb->is_client_buffer = 1; weston_buffer_reference(&fb->buffer_ref, buffer); } static void drm_output_release_fb(struct drm_output *output, struct drm_fb *fb) { if (!fb) return; if (fb->map && (fb != output->dumb[0] && fb != output->dumb[1])) { drm_fb_destroy_dumb(fb); } else if (fb->bo) { if (fb->is_client_buffer) gbm_bo_destroy(fb->bo); else gbm_surface_release_buffer(output->surface, fb->bo); } } static uint32_t drm_output_check_scanout_format(struct drm_output *output, struct weston_surface *es, struct gbm_bo *bo) { uint32_t format; pixman_region32_t r; format = gbm_bo_get_format(bo); if (format == GBM_FORMAT_ARGB8888) { /* We can scanout an ARGB buffer if the surface's * opaque region covers the whole output, but we have * to use XRGB as the KMS format code. */ pixman_region32_init_rect(&r, 0, 0, output->base.width, output->base.height); pixman_region32_subtract(&r, &r, &es->opaque); if (!pixman_region32_not_empty(&r)) format = GBM_FORMAT_XRGB8888; pixman_region32_fini(&r); } if (output->format == format) return format; return 0; } static struct weston_plane * drm_output_prepare_scanout_view(struct drm_output *output, struct weston_view *ev) { struct drm_backend *b = (struct drm_backend *)output->base.compositor->backend; struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; struct weston_buffer_viewport *viewport = &ev->surface->buffer_viewport; struct gbm_bo *bo; uint32_t format; if (ev->geometry.x != output->base.x || ev->geometry.y != output->base.y || buffer == NULL || b->gbm == NULL || buffer->width != output->base.current_mode->width || buffer->height != output->base.current_mode->height || output->base.transform != viewport->buffer.transform || ev->transform.enabled) return NULL; if (ev->geometry.scissor_enabled) return NULL; bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, buffer->resource, GBM_BO_USE_SCANOUT); /* Unable to use the buffer for scanout */ if (!bo) return NULL; format = drm_output_check_scanout_format(output, ev->surface, bo); if (format == 0) { gbm_bo_destroy(bo); return NULL; } output->next = drm_fb_get_from_bo(bo, b, format); if (!output->next) { gbm_bo_destroy(bo); return NULL; } drm_fb_set_buffer(output->next, buffer); return &output->fb_plane; } static void drm_output_render_gl(struct drm_output *output, pixman_region32_t *damage) { struct drm_backend *b = (struct drm_backend *)output->base.compositor->backend; struct gbm_bo *bo; output->base.compositor->renderer->repaint_output(&output->base, damage); bo = gbm_surface_lock_front_buffer(output->surface); if (!bo) { weston_log("failed to lock front buffer: %m\n"); return; } output->next = drm_fb_get_from_bo(bo, b, output->format); if (!output->next) { weston_log("failed to get drm_fb for bo\n"); gbm_surface_release_buffer(output->surface, bo); return; } } static void drm_output_render_pixman(struct drm_output *output, pixman_region32_t *damage) { struct weston_compositor *ec = output->base.compositor; pixman_region32_t total_damage, previous_damage; pixman_region32_init(&total_damage); pixman_region32_init(&previous_damage); pixman_region32_copy(&previous_damage, damage); pixman_region32_union(&total_damage, damage, &output->previous_damage); pixman_region32_copy(&output->previous_damage, &previous_damage); output->current_image ^= 1; output->next = output->dumb[output->current_image]; pixman_renderer_output_set_buffer(&output->base, output->image[output->current_image]); ec->renderer->repaint_output(&output->base, &total_damage); pixman_region32_fini(&total_damage); pixman_region32_fini(&previous_damage); } static void drm_output_render(struct drm_output *output, pixman_region32_t *damage) { struct weston_compositor *c = output->base.compositor; struct drm_backend *b = (struct drm_backend *)c->backend; if (b->use_pixman) drm_output_render_pixman(output, damage); else drm_output_render_gl(output, damage); pixman_region32_subtract(&c->primary_plane.damage, &c->primary_plane.damage, damage); } static void drm_output_set_gamma(struct weston_output *output_base, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b) { int rc; struct drm_output *output = (struct drm_output *) output_base; struct drm_backend *backend = (struct drm_backend *) output->base.compositor->backend; /* check */ if (output_base->gamma_size != size) return; if (!output->original_crtc) return; rc = drmModeCrtcSetGamma(backend->drm.fd, output->crtc_id, size, r, g, b); if (rc) weston_log("set gamma failed: %m\n"); } /* Determine the type of vblank synchronization to use for the output. * * The pipe parameter indicates which CRTC is in use. Knowing this, we * can determine which vblank sequence type to use for it. Traditional * cards had only two CRTCs, with CRTC 0 using no special flags, and * CRTC 1 using DRM_VBLANK_SECONDARY. The first bit of the pipe * parameter indicates this. * * Bits 1-5 of the pipe parameter are 5 bit wide pipe number between * 0-31. If this is non-zero it indicates we're dealing with a * multi-gpu situation and we need to calculate the vblank sync * using DRM_BLANK_HIGH_CRTC_MASK. */ static unsigned int drm_waitvblank_pipe(struct drm_output *output) { if (output->pipe > 1) return (output->pipe << DRM_VBLANK_HIGH_CRTC_SHIFT) & DRM_VBLANK_HIGH_CRTC_MASK; else if (output->pipe > 0) return DRM_VBLANK_SECONDARY; else return 0; } static int drm_output_repaint(struct weston_output *output_base, pixman_region32_t *damage) { struct drm_output *output = (struct drm_output *) output_base; struct drm_backend *backend = (struct drm_backend *)output->base.compositor->backend; struct drm_sprite *s; struct drm_mode *mode; int ret = 0; if (output->destroy_pending) return -1; if (!output->next) drm_output_render(output, damage); if (!output->next) return -1; mode = container_of(output->base.current_mode, struct drm_mode, base); if (!output->current || output->current->stride != output->next->stride) { ret = drmModeSetCrtc(backend->drm.fd, output->crtc_id, output->next->fb_id, 0, 0, &output->connector_id, 1, &mode->mode_info); if (ret) { weston_log("set mode failed: %m\n"); goto err_pageflip; } output_base->set_dpms(output_base, WESTON_DPMS_ON); } if (drmModePageFlip(backend->drm.fd, output->crtc_id, output->next->fb_id, DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { weston_log("queueing pageflip failed: %m\n"); goto err_pageflip; } output->page_flip_pending = 1; drm_output_set_cursor(output); /* * Now, update all the sprite surfaces */ wl_list_for_each(s, &backend->sprite_list, link) { uint32_t flags = 0, fb_id = 0; drmVBlank vbl = { .request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT, .request.sequence = 1, }; if ((!s->current && !s->next) || !drm_sprite_crtc_supported(output, s->possible_crtcs)) continue; if (s->next && !backend->sprites_hidden) fb_id = s->next->fb_id; ret = drmModeSetPlane(backend->drm.fd, s->plane_id, output->crtc_id, fb_id, flags, s->dest_x, s->dest_y, s->dest_w, s->dest_h, s->src_x, s->src_y, s->src_w, s->src_h); if (ret) weston_log("setplane failed: %d: %s\n", ret, strerror(errno)); vbl.request.type |= drm_waitvblank_pipe(output); /* * Queue a vblank signal so we know when the surface * becomes active on the display or has been replaced. */ vbl.request.signal = (unsigned long)s; ret = drmWaitVBlank(backend->drm.fd, &vbl); if (ret) { weston_log("vblank event request failed: %d: %s\n", ret, strerror(errno)); } s->output = output; output->vblank_pending = 1; } return 0; err_pageflip: output->cursor_view = NULL; if (output->next) { drm_output_release_fb(output, output->next); output->next = NULL; } return -1; } static void drm_output_start_repaint_loop(struct weston_output *output_base) { struct drm_output *output = (struct drm_output *) output_base; struct drm_backend *backend = (struct drm_backend *) output_base->compositor->backend; uint32_t fb_id; struct timespec ts, tnow; struct timespec vbl2now; int64_t refresh_nsec; int ret; drmVBlank vbl = { .request.type = DRM_VBLANK_RELATIVE, .request.sequence = 0, .request.signal = 0, }; if (output->destroy_pending) return; if (!output->current) { /* We can't page flip if there's no mode set */ goto finish_frame; } /* Try to get current msc and timestamp via instant query */ vbl.request.type |= drm_waitvblank_pipe(output); ret = drmWaitVBlank(backend->drm.fd, &vbl); /* Error ret or zero timestamp means failure to get valid timestamp */ if ((ret == 0) && (vbl.reply.tval_sec > 0 || vbl.reply.tval_usec > 0)) { ts.tv_sec = vbl.reply.tval_sec; ts.tv_nsec = vbl.reply.tval_usec * 1000; /* Valid timestamp for most recent vblank - not stale? * Stale ts could happen on Linux 3.17+, so make sure it * is not older than 1 refresh duration since now. */ weston_compositor_read_presentation_clock(backend->compositor, &tnow); timespec_sub(&vbl2now, &tnow, &ts); refresh_nsec = millihz_to_nsec(output->base.current_mode->refresh); if (timespec_to_nsec(&vbl2now) < refresh_nsec) { drm_output_update_msc(output, vbl.reply.sequence); weston_output_finish_frame(output_base, &ts, PRESENTATION_FEEDBACK_INVALID); return; } } /* Immediate query didn't provide valid timestamp. * Use pageflip fallback. */ fb_id = output->current->fb_id; if (drmModePageFlip(backend->drm.fd, output->crtc_id, fb_id, DRM_MODE_PAGE_FLIP_EVENT, output) < 0) { weston_log("queueing pageflip failed: %m\n"); goto finish_frame; } return; finish_frame: /* if we cannot page-flip, immediately finish frame */ weston_compositor_read_presentation_clock(output_base->compositor, &ts); weston_output_finish_frame(output_base, &ts, PRESENTATION_FEEDBACK_INVALID); } static void drm_output_update_msc(struct drm_output *output, unsigned int seq) { uint64_t msc_hi = output->base.msc >> 32; if (seq < (output->base.msc & 0xffffffff)) msc_hi++; output->base.msc = (msc_hi << 32) + seq; } static void vblank_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) { struct drm_sprite *s = (struct drm_sprite *)data; struct drm_output *output = s->output; struct timespec ts; uint32_t flags = PRESENTATION_FEEDBACK_KIND_HW_COMPLETION | PRESENTATION_FEEDBACK_KIND_HW_CLOCK; drm_output_update_msc(output, frame); output->vblank_pending = 0; drm_output_release_fb(output, s->current); s->current = s->next; s->next = NULL; if (!output->page_flip_pending) { ts.tv_sec = sec; ts.tv_nsec = usec * 1000; weston_output_finish_frame(&output->base, &ts, flags); } } static void drm_output_destroy(struct weston_output *output_base); static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec, void *data) { struct drm_output *output = (struct drm_output *) data; struct timespec ts; uint32_t flags = PRESENTATION_FEEDBACK_KIND_VSYNC | PRESENTATION_FEEDBACK_KIND_HW_COMPLETION | PRESENTATION_FEEDBACK_KIND_HW_CLOCK; drm_output_update_msc(output, frame); /* We don't set page_flip_pending on start_repaint_loop, in that case * we just want to page flip to the current buffer to get an accurate * timestamp */ if (output->page_flip_pending) { drm_output_release_fb(output, output->current); output->current = output->next; output->next = NULL; } output->page_flip_pending = 0; if (output->destroy_pending) drm_output_destroy(&output->base); else if (!output->vblank_pending) { ts.tv_sec = sec; ts.tv_nsec = usec * 1000; weston_output_finish_frame(&output->base, &ts, flags); /* We can't call this from frame_notify, because the output's * repaint needed flag is cleared just after that */ if (output->recorder) weston_output_schedule_repaint(&output->base); } } static uint32_t drm_output_check_sprite_format(struct drm_sprite *s, struct weston_view *ev, struct gbm_bo *bo) { uint32_t i, format; format = gbm_bo_get_format(bo); if (format == GBM_FORMAT_ARGB8888) { pixman_region32_t r; pixman_region32_init_rect(&r, 0, 0, ev->surface->width, ev->surface->height); pixman_region32_subtract(&r, &r, &ev->surface->opaque); if (!pixman_region32_not_empty(&r)) format = GBM_FORMAT_XRGB8888; pixman_region32_fini(&r); } for (i = 0; i < s->count_formats; i++) if (s->formats[i] == format) return format; return 0; } static int drm_view_transform_supported(struct weston_view *ev) { return !ev->transform.enabled || (ev->transform.matrix.type < WESTON_MATRIX_TRANSFORM_ROTATE); } static struct weston_plane * drm_output_prepare_overlay_view(struct drm_output *output, struct weston_view *ev) { struct weston_compositor *ec = output->base.compositor; struct drm_backend *b = (struct drm_backend *)ec->backend; struct weston_buffer_viewport *viewport = &ev->surface->buffer_viewport; struct wl_resource *buffer_resource; struct drm_sprite *s; struct linux_dmabuf_buffer *dmabuf; int found = 0; struct gbm_bo *bo; pixman_region32_t dest_rect, src_rect; pixman_box32_t *box, tbox; uint32_t format; wl_fixed_t sx1, sy1, sx2, sy2; if (b->gbm == NULL) return NULL; if (viewport->buffer.transform != output->base.transform) return NULL; if (viewport->buffer.scale != output->base.current_scale) return NULL; if (b->sprites_are_broken) return NULL; if (ev->output_mask != (1u << output->base.id)) return NULL; if (ev->surface->buffer_ref.buffer == NULL) return NULL; buffer_resource = ev->surface->buffer_ref.buffer->resource; if (ev->alpha != 1.0f) return NULL; if (wl_shm_buffer_get(buffer_resource)) return NULL; if (!drm_view_transform_supported(ev)) return NULL; wl_list_for_each(s, &b->sprite_list, link) { if (!drm_sprite_crtc_supported(output, s->possible_crtcs)) continue; if (!s->next) { found = 1; break; } } /* No sprites available */ if (!found) return NULL; if ((dmabuf = linux_dmabuf_buffer_get(buffer_resource))) { #ifdef HAVE_GBM_FD_IMPORT /* XXX: TODO: * * Use AddFB2 directly, do not go via GBM. * Add support for multiplanar formats. * Both require refactoring in the DRM-backend to * support a mix of gbm_bos and drmfbs. */ struct gbm_import_fd_data gbm_dmabuf = { .fd = dmabuf->dmabuf_fd[0], .width = dmabuf->width, .height = dmabuf->height, .stride = dmabuf->stride[0], .format = dmabuf->format }; if (dmabuf->n_planes != 1 || dmabuf->offset[0] != 0) return NULL; bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_FD, &gbm_dmabuf, GBM_BO_USE_SCANOUT); #else return NULL; #endif } else { bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER, buffer_resource, GBM_BO_USE_SCANOUT); } if (!bo) return NULL; format = drm_output_check_sprite_format(s, ev, bo); if (format == 0) { gbm_bo_destroy(bo); return NULL; } s->next = drm_fb_get_from_bo(bo, b, format); if (!s->next) { gbm_bo_destroy(bo); return NULL; } drm_fb_set_buffer(s->next, ev->surface->buffer_ref.buffer); box = pixman_region32_extents(&ev->transform.boundingbox); s->plane.x = box->x1; s->plane.y = box->y1; /* * Calculate the source & dest rects properly based on actual * position (note the caller has called weston_view_update_transform() * for us already). */ pixman_region32_init(&dest_rect); pixman_region32_intersect(&dest_rect, &ev->transform.boundingbox, &output->base.region); pixman_region32_translate(&dest_rect, -output->base.x, -output->base.y); box = pixman_region32_extents(&dest_rect); tbox = weston_transformed_rect(output->base.width, output->base.height, output->base.transform, output->base.current_scale, *box); s->dest_x = tbox.x1; s->dest_y = tbox.y1; s->dest_w = tbox.x2 - tbox.x1; s->dest_h = tbox.y2 - tbox.y1; pixman_region32_fini(&dest_rect); pixman_region32_init(&src_rect); pixman_region32_intersect(&src_rect, &ev->transform.boundingbox, &output->base.region); box = pixman_region32_extents(&src_rect); weston_view_from_global_fixed(ev, wl_fixed_from_int(box->x1), wl_fixed_from_int(box->y1), &sx1, &sy1); weston_view_from_global_fixed(ev, wl_fixed_from_int(box->x2), wl_fixed_from_int(box->y2), &sx2, &sy2); if (sx1 < 0) sx1 = 0; if (sy1 < 0) sy1 = 0; if (sx2 > wl_fixed_from_int(ev->surface->width)) sx2 = wl_fixed_from_int(ev->surface->width); if (sy2 > wl_fixed_from_int(ev->surface->height)) sy2 = wl_fixed_from_int(ev->surface->height); tbox.x1 = sx1; tbox.y1 = sy1; tbox.x2 = sx2; tbox.y2 = sy2; tbox = weston_transformed_rect(wl_fixed_from_int(ev->surface->width), wl_fixed_from_int(ev->surface->height), viewport->buffer.transform, viewport->buffer.scale, tbox); s->src_x = tbox.x1 << 8; s->src_y = tbox.y1 << 8; s->src_w = (tbox.x2 - tbox.x1) << 8; s->src_h = (tbox.y2 - tbox.y1) << 8; pixman_region32_fini(&src_rect); return &s->plane; } static struct weston_plane * drm_output_prepare_cursor_view(struct drm_output *output, struct weston_view *ev) { struct drm_backend *b = (struct drm_backend *)output->base.compositor->backend; struct weston_buffer_viewport *viewport = &ev->surface->buffer_viewport; if (b->gbm == NULL) return NULL; if (output->base.transform != WL_OUTPUT_TRANSFORM_NORMAL) return NULL; if (viewport->buffer.scale != output->base.current_scale) return NULL; if (output->cursor_view) return NULL; if (ev->output_mask != (1u << output->base.id)) return NULL; if (b->cursors_are_broken) return NULL; if (ev->geometry.scissor_enabled) return NULL; if (ev->surface->buffer_ref.buffer == NULL || !wl_shm_buffer_get(ev->surface->buffer_ref.buffer->resource) || ev->surface->width > b->cursor_width || ev->surface->height > b->cursor_height) return NULL; output->cursor_view = ev; return &output->cursor_plane; } /** * Update the image for the current cursor surface * * @param b DRM backend structure * @param bo GBM buffer object to write into * @param ev View to use for cursor image */ static void cursor_bo_update(struct drm_backend *b, struct gbm_bo *bo, struct weston_view *ev) { struct weston_buffer *buffer = ev->surface->buffer_ref.buffer; uint32_t buf[b->cursor_width * b->cursor_height]; int32_t stride; uint8_t *s; int i; assert(buffer && buffer->shm_buffer); assert(buffer->shm_buffer == wl_shm_buffer_get(buffer->resource)); assert(ev->surface->width <= b->cursor_width); assert(ev->surface->height <= b->cursor_height); memset(buf, 0, sizeof buf); stride = wl_shm_buffer_get_stride(buffer->shm_buffer); s = wl_shm_buffer_get_data(buffer->shm_buffer); wl_shm_buffer_begin_access(buffer->shm_buffer); for (i = 0; i < ev->surface->height; i++) memcpy(buf + i * b->cursor_width, s + i * stride, ev->surface->width * 4); wl_shm_buffer_end_access(buffer->shm_buffer); if (gbm_bo_write(bo, buf, sizeof buf) < 0) weston_log("failed update cursor: %m\n"); } static void drm_output_set_cursor(struct drm_output *output) { struct weston_view *ev = output->cursor_view; struct weston_buffer *buffer; struct drm_backend *b = (struct drm_backend *) output->base.compositor->backend; EGLint handle; struct gbm_bo *bo; int x, y; output->cursor_view = NULL; if (ev == NULL) { drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0); return; } buffer = ev->surface->buffer_ref.buffer; if (buffer && pixman_region32_not_empty(&output->cursor_plane.damage)) { pixman_region32_fini(&output->cursor_plane.damage); pixman_region32_init(&output->cursor_plane.damage); output->current_cursor ^= 1; bo = output->cursor_bo[output->current_cursor]; cursor_bo_update(b, bo, ev); handle = gbm_bo_get_handle(bo).s32; if (drmModeSetCursor(b->drm.fd, output->crtc_id, handle, b->cursor_width, b->cursor_height)) { weston_log("failed to set cursor: %m\n"); b->cursors_are_broken = 1; } } x = (ev->geometry.x - output->base.x) * output->base.current_scale; y = (ev->geometry.y - output->base.y) * output->base.current_scale; if (output->cursor_plane.x != x || output->cursor_plane.y != y) { if (drmModeMoveCursor(b->drm.fd, output->crtc_id, x, y)) { weston_log("failed to move cursor: %m\n"); b->cursors_are_broken = 1; } output->cursor_plane.x = x; output->cursor_plane.y = y; } } static void drm_assign_planes(struct weston_output *output_base) { struct drm_backend *b = (struct drm_backend *)output_base->compositor->backend; struct drm_output *output = (struct drm_output *)output_base; struct weston_view *ev, *next; pixman_region32_t overlap, surface_overlap; struct weston_plane *primary, *next_plane; /* * Find a surface for each sprite in the output using some heuristics: * 1) size * 2) frequency of update * 3) opacity (though some hw might support alpha blending) * 4) clipping (this can be fixed with color keys) * * The idea is to save on blitting since this should save power. * If we can get a large video surface on the sprite for example, * the main display surface may not need to update at all, and * the client buffer can be used directly for the sprite surface * as we do for flipping full screen surfaces. */ pixman_region32_init(&overlap); primary = &output_base->compositor->primary_plane; wl_list_for_each_safe(ev, next, &output_base->compositor->view_list, link) { struct weston_surface *es = ev->surface; /* Test whether this buffer can ever go into a plane: * non-shm, or small enough to be a cursor. * * Also, keep a reference when using the pixman renderer. * That makes it possible to do a seamless switch to the GL * renderer and since the pixman renderer keeps a reference * to the buffer anyway, there is no side effects. */ if (b->use_pixman || (es->buffer_ref.buffer && (!wl_shm_buffer_get(es->buffer_ref.buffer->resource) || (ev->surface->width <= 64 && ev->surface->height <= 64)))) es->keep_buffer = true; else es->keep_buffer = false; pixman_region32_init(&surface_overlap); pixman_region32_intersect(&surface_overlap, &overlap, &ev->transform.boundingbox); next_plane = NULL; if (pixman_region32_not_empty(&surface_overlap)) next_plane = primary; if (next_plane == NULL) next_plane = drm_output_prepare_cursor_view(output, ev); if (next_plane == NULL) next_plane = drm_output_prepare_scanout_view(output, ev); if (next_plane == NULL) next_plane = drm_output_prepare_overlay_view(output, ev); if (next_plane == NULL) next_plane = primary; weston_view_move_to_plane(ev, next_plane); if (next_plane == primary) pixman_region32_union(&overlap, &overlap, &ev->transform.boundingbox); if (next_plane == primary || next_plane == &output->cursor_plane) { /* cursor plane involves a copy */ ev->psf_flags = 0; } else { /* All other planes are a direct scanout of a * single client buffer. */ ev->psf_flags = PRESENTATION_FEEDBACK_KIND_ZERO_COPY; } pixman_region32_fini(&surface_overlap); } pixman_region32_fini(&overlap); } static void drm_output_fini_pixman(struct drm_output *output); static void drm_output_destroy(struct weston_output *output_base) { struct drm_output *output = (struct drm_output *) output_base; struct drm_backend *b = (struct drm_backend *)output->base.compositor->backend; drmModeCrtcPtr origcrtc = output->original_crtc; if (output->page_flip_pending) { output->destroy_pending = 1; weston_log("destroy output while page flip pending\n"); return; } if (output->backlight) backlight_destroy(output->backlight); drmModeFreeProperty(output->dpms_prop); /* Turn off hardware cursor */ drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0); /* Restore original CRTC state */ drmModeSetCrtc(b->drm.fd, origcrtc->crtc_id, origcrtc->buffer_id, origcrtc->x, origcrtc->y, &output->connector_id, 1, &origcrtc->mode); drmModeFreeCrtc(origcrtc); b->crtc_allocator &= ~(1 << output->crtc_id); b->connector_allocator &= ~(1 << output->connector_id); if (b->use_pixman) { drm_output_fini_pixman(output); } else { gl_renderer->output_destroy(output_base); gbm_surface_destroy(output->surface); } weston_plane_release(&output->fb_plane); weston_plane_release(&output->cursor_plane); weston_output_destroy(&output->base); free(output); } /** * Find the closest-matching mode for a given target * * Given a target mode, find the most suitable mode amongst the output's * current mode list to use, preferring the current mode if possible, to * avoid an expensive mode switch. * * @param output DRM output * @param target_mode Mode to attempt to match * @returns Pointer to a mode from the output's mode list */ static struct drm_mode * choose_mode (struct drm_output *output, struct weston_mode *target_mode) { struct drm_mode *tmp_mode = NULL, *mode; if (output->base.current_mode->width == target_mode->width && output->base.current_mode->height == target_mode->height && (output->base.current_mode->refresh == target_mode->refresh || target_mode->refresh == 0)) return (struct drm_mode *)output->base.current_mode; wl_list_for_each(mode, &output->base.mode_list, base.link) { if (mode->mode_info.hdisplay == target_mode->width && mode->mode_info.vdisplay == target_mode->height) { if (mode->base.refresh == target_mode->refresh || target_mode->refresh == 0) { return mode; } else if (!tmp_mode) tmp_mode = mode; } } return tmp_mode; } static int drm_output_init_egl(struct drm_output *output, struct drm_backend *b); static int drm_output_init_pixman(struct drm_output *output, struct drm_backend *b); static int drm_output_switch_mode(struct weston_output *output_base, struct weston_mode *mode) { struct drm_output *output; struct drm_mode *drm_mode; struct drm_backend *b; if (output_base == NULL) { weston_log("output is NULL.\n"); return -1; } if (mode == NULL) { weston_log("mode is NULL.\n"); return -1; } b = (struct drm_backend *)output_base->compositor->backend; output = (struct drm_output *)output_base; drm_mode = choose_mode (output, mode); if (!drm_mode) { weston_log("%s, invalid resolution:%dx%d\n", __func__, mode->width, mode->height); return -1; } if (&drm_mode->base == output->base.current_mode) return 0; output->base.current_mode->flags = 0; output->base.current_mode = &drm_mode->base; output->base.current_mode->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; /* reset rendering stuff. */ drm_output_release_fb(output, output->current); drm_output_release_fb(output, output->next); output->current = output->next = NULL; if (b->use_pixman) { drm_output_fini_pixman(output); if (drm_output_init_pixman(output, b) < 0) { weston_log("failed to init output pixman state with " "new mode\n"); return -1; } } else { gl_renderer->output_destroy(&output->base); gbm_surface_destroy(output->surface); if (drm_output_init_egl(output, b) < 0) { weston_log("failed to init output egl state with " "new mode"); return -1; } } return 0; } static int on_drm_input(int fd, uint32_t mask, void *data) { drmEventContext evctx; memset(&evctx, 0, sizeof evctx); evctx.version = DRM_EVENT_CONTEXT_VERSION; evctx.page_flip_handler = page_flip_handler; evctx.vblank_handler = vblank_handler; drmHandleEvent(fd, &evctx); return 1; } static int init_drm(struct drm_backend *b, struct udev_device *device) { const char *filename, *sysnum; uint64_t cap; int fd, ret; clockid_t clk_id; sysnum = udev_device_get_sysnum(device); if (sysnum) b->drm.id = atoi(sysnum); if (!sysnum || b->drm.id < 0) { weston_log("cannot get device sysnum\n"); return -1; } filename = udev_device_get_devnode(device); fd = weston_launcher_open(b->compositor->launcher, filename, O_RDWR); if (fd < 0) { /* Probably permissions error */ weston_log("couldn't open %s, skipping\n", udev_device_get_devnode(device)); return -1; } weston_log("using %s\n", filename); b->drm.fd = fd; b->drm.filename = strdup(filename); ret = drmGetCap(fd, DRM_CAP_TIMESTAMP_MONOTONIC, &cap); if (ret == 0 && cap == 1) clk_id = CLOCK_MONOTONIC; else clk_id = CLOCK_REALTIME; if (weston_compositor_set_presentation_clock(b->compositor, clk_id) < 0) { weston_log("Error: failed to set presentation clock %d.\n", clk_id); return -1; } ret = drmGetCap(fd, DRM_CAP_CURSOR_WIDTH, &cap); if (ret == 0) b->cursor_width = cap; else b->cursor_width = 64; ret = drmGetCap(fd, DRM_CAP_CURSOR_HEIGHT, &cap); if (ret == 0) b->cursor_height = cap; else b->cursor_height = 64; return 0; } static struct gbm_device * create_gbm_device(int fd) { struct gbm_device *gbm; gl_renderer = weston_load_module("gl-renderer.so", "gl_renderer_interface"); if (!gl_renderer) return NULL; /* GBM will load a dri driver, but even though they need symbols from * libglapi, in some version of Mesa they are not linked to it. Since * only the gl-renderer module links to it, the call above won't make * these symbols globally available, and loading the DRI driver fails. * Workaround this by dlopen()'ing libglapi with RTLD_GLOBAL. */ dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL); gbm = gbm_create_device(fd); return gbm; } /* When initializing EGL, if the preferred buffer format isn't available * we may be able to susbstitute an ARGB format for an XRGB one. * * This returns 0 if substitution isn't possible, but 0 might be a * legitimate format for other EGL platforms, so the caller is * responsible for checking for 0 before calling gl_renderer->create(). * * This works around https://bugs.freedesktop.org/show_bug.cgi?id=89689 * but it's entirely possible we'll see this again on other implementations. */ static int fallback_format_for(uint32_t format) { switch (format) { case GBM_FORMAT_XRGB8888: return GBM_FORMAT_ARGB8888; case GBM_FORMAT_XRGB2101010: return GBM_FORMAT_ARGB2101010; default: return 0; } } static int drm_backend_create_gl_renderer(struct drm_backend *b) { EGLint format[2] = { b->format, fallback_format_for(b->format), }; int n_formats = 1; if (format[1]) n_formats = 2; if (gl_renderer->create(b->compositor, EGL_PLATFORM_GBM_KHR, (void *)b->gbm, gl_renderer->opaque_attribs, format, n_formats) < 0) { return -1; } return 0; } static int init_egl(struct drm_backend *b) { b->gbm = create_gbm_device(b->drm.fd); if (!b->gbm) return -1; if (drm_backend_create_gl_renderer(b) < 0) { gbm_device_destroy(b->gbm); return -1; } return 0; } static int init_pixman(struct drm_backend *b) { return pixman_renderer_init(b->compositor); } /** * Add a mode to output's mode list * * Copy the supplied DRM mode into a Weston mode structure, and add it to the * output's mode list. * * @param output DRM output to add mode to * @param info DRM mode structure to add * @returns Newly-allocated Weston/DRM mode structure */ static struct drm_mode * drm_output_add_mode(struct drm_output *output, const drmModeModeInfo *info) { struct drm_mode *mode; uint64_t refresh; mode = malloc(sizeof *mode); if (mode == NULL) return NULL; mode->base.flags = 0; mode->base.width = info->hdisplay; mode->base.height = info->vdisplay; /* Calculate higher precision (mHz) refresh rate */ refresh = (info->clock * 1000000LL / info->htotal + info->vtotal / 2) / info->vtotal; if (info->flags & DRM_MODE_FLAG_INTERLACE) refresh *= 2; if (info->flags & DRM_MODE_FLAG_DBLSCAN) refresh /= 2; if (info->vscan > 1) refresh /= info->vscan; mode->base.refresh = refresh; mode->mode_info = *info; if (info->type & DRM_MODE_TYPE_PREFERRED) mode->base.flags |= WL_OUTPUT_MODE_PREFERRED; wl_list_insert(output->base.mode_list.prev, &mode->base.link); return mode; } static int drm_subpixel_to_wayland(int drm_value) { switch (drm_value) { default: case DRM_MODE_SUBPIXEL_UNKNOWN: return WL_OUTPUT_SUBPIXEL_UNKNOWN; case DRM_MODE_SUBPIXEL_NONE: return WL_OUTPUT_SUBPIXEL_NONE; case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB: return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR: return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; case DRM_MODE_SUBPIXEL_VERTICAL_RGB: return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; case DRM_MODE_SUBPIXEL_VERTICAL_BGR: return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; } } /* returns a value between 0-255 range, where higher is brighter */ static uint32_t drm_get_backlight(struct drm_output *output) { long brightness, max_brightness, norm; brightness = backlight_get_brightness(output->backlight); max_brightness = backlight_get_max_brightness(output->backlight); /* convert it on a scale of 0 to 255 */ norm = (brightness * 255)/(max_brightness); return (uint32_t) norm; } /* values accepted are between 0-255 range */ static void drm_set_backlight(struct weston_output *output_base, uint32_t value) { struct drm_output *output = (struct drm_output *) output_base; long max_brightness, new_brightness; if (!output->backlight) return; if (value > 255) return; max_brightness = backlight_get_max_brightness(output->backlight); /* get denormalized value */ new_brightness = (value * max_brightness) / 255; backlight_set_brightness(output->backlight, new_brightness); } static drmModePropertyPtr drm_get_prop(int fd, drmModeConnectorPtr connector, const char *name) { drmModePropertyPtr props; int i; for (i = 0; i < connector->count_props; i++) { props = drmModeGetProperty(fd, connector->props[i]); if (!props) continue; if (!strcmp(props->name, name)) return props; drmModeFreeProperty(props); } return NULL; } static void drm_set_dpms(struct weston_output *output_base, enum dpms_enum level) { struct drm_output *output = (struct drm_output *) output_base; struct weston_compositor *ec = output_base->compositor; struct drm_backend *b = (struct drm_backend *)ec->backend; int ret; if (!output->dpms_prop) return; ret = drmModeConnectorSetProperty(b->drm.fd, output->connector_id, output->dpms_prop->prop_id, level); if (ret) { weston_log("DRM: DPMS: failed property set for %s\n", output->base.name); return; } output->dpms = level; } static const char * const connector_type_names[] = { [DRM_MODE_CONNECTOR_Unknown] = "Unknown", [DRM_MODE_CONNECTOR_VGA] = "VGA", [DRM_MODE_CONNECTOR_DVII] = "DVI-I", [DRM_MODE_CONNECTOR_DVID] = "DVI-D", [DRM_MODE_CONNECTOR_DVIA] = "DVI-A", [DRM_MODE_CONNECTOR_Composite] = "Composite", [DRM_MODE_CONNECTOR_SVIDEO] = "SVIDEO", [DRM_MODE_CONNECTOR_LVDS] = "LVDS", [DRM_MODE_CONNECTOR_Component] = "Component", [DRM_MODE_CONNECTOR_9PinDIN] = "DIN", [DRM_MODE_CONNECTOR_DisplayPort] = "DP", [DRM_MODE_CONNECTOR_HDMIA] = "HDMI-A", [DRM_MODE_CONNECTOR_HDMIB] = "HDMI-B", [DRM_MODE_CONNECTOR_TV] = "TV", [DRM_MODE_CONNECTOR_eDP] = "eDP", #ifdef DRM_MODE_CONNECTOR_DSI [DRM_MODE_CONNECTOR_VIRTUAL] = "Virtual", [DRM_MODE_CONNECTOR_DSI] = "DSI", #endif }; static char * make_connector_name(const drmModeConnector *con) { char name[32]; const char *type_name = NULL; if (con->connector_type < ARRAY_LENGTH(connector_type_names)) type_name = connector_type_names[con->connector_type]; if (!type_name) type_name = "UNNAMED"; snprintf(name, sizeof name, "%s-%d", type_name, con->connector_type_id); return strdup(name); } static int find_crtc_for_connector(struct drm_backend *b, drmModeRes *resources, drmModeConnector *connector) { drmModeEncoder *encoder; uint32_t possible_crtcs; int i, j; for (j = 0; j < connector->count_encoders; j++) { encoder = drmModeGetEncoder(b->drm.fd, connector->encoders[j]); if (encoder == NULL) { weston_log("Failed to get encoder.\n"); return -1; } possible_crtcs = encoder->possible_crtcs; drmModeFreeEncoder(encoder); for (i = 0; i < resources->count_crtcs; i++) { if (possible_crtcs & (1 << i) && !(b->crtc_allocator & (1 << resources->crtcs[i]))) return i; } } return -1; } /* Init output state that depends on gl or gbm */ static int drm_output_init_egl(struct drm_output *output, struct drm_backend *b) { EGLint format[2] = { output->format, fallback_format_for(output->format), }; int i, flags, n_formats = 1; output->surface = gbm_surface_create(b->gbm, output->base.current_mode->width, output->base.current_mode->height, format[0], GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); if (!output->surface) { weston_log("failed to create gbm surface\n"); return -1; } if (format[1]) n_formats = 2; if (gl_renderer->output_create(&output->base, (EGLNativeWindowType)output->surface, output->surface, gl_renderer->opaque_attribs, format, n_formats) < 0) { weston_log("failed to create gl renderer output state\n"); gbm_surface_destroy(output->surface); return -1; } flags = GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE; for (i = 0; i < 2; i++) { if (output->cursor_bo[i]) continue; output->cursor_bo[i] = gbm_bo_create(b->gbm, b->cursor_width, b->cursor_height, GBM_FORMAT_ARGB8888, flags); } if (output->cursor_bo[0] == NULL || output->cursor_bo[1] == NULL) { weston_log("cursor buffers unavailable, using gl cursors\n"); b->cursors_are_broken = 1; } return 0; } static int drm_output_init_pixman(struct drm_output *output, struct drm_backend *b) { int w = output->base.current_mode->width; int h = output->base.current_mode->height; unsigned int i; /* FIXME error checking */ for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) { output->dumb[i] = drm_fb_create_dumb(b, w, h); if (!output->dumb[i]) goto err; output->image[i] = pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h, output->dumb[i]->map, output->dumb[i]->stride); if (!output->image[i]) goto err; } if (pixman_renderer_output_create(&output->base) < 0) goto err; pixman_region32_init_rect(&output->previous_damage, output->base.x, output->base.y, output->base.width, output->base.height); return 0; err: for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) { if (output->dumb[i]) drm_fb_destroy_dumb(output->dumb[i]); if (output->image[i]) pixman_image_unref(output->image[i]); output->dumb[i] = NULL; output->image[i] = NULL; } return -1; } static void drm_output_fini_pixman(struct drm_output *output) { unsigned int i; pixman_renderer_output_destroy(&output->base); pixman_region32_fini(&output->previous_damage); for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) { drm_fb_destroy_dumb(output->dumb[i]); pixman_image_unref(output->image[i]); output->dumb[i] = NULL; output->image[i] = NULL; } } static void edid_parse_string(const uint8_t *data, char text[]) { int i; int replaced = 0; /* this is always 12 bytes, but we can't guarantee it's null * terminated or not junk. */ strncpy(text, (const char *) data, 12); /* remove insane chars */ for (i = 0; text[i] != '\0'; i++) { if (text[i] == '\n' || text[i] == '\r') { text[i] = '\0'; break; } } /* ensure string is printable */ for (i = 0; text[i] != '\0'; i++) { if (!isprint(text[i])) { text[i] = '-'; replaced++; } } /* if the string is random junk, ignore the string */ if (replaced > 4) text[0] = '\0'; } #define EDID_DESCRIPTOR_ALPHANUMERIC_DATA_STRING 0xfe #define EDID_DESCRIPTOR_DISPLAY_PRODUCT_NAME 0xfc #define EDID_DESCRIPTOR_DISPLAY_PRODUCT_SERIAL_NUMBER 0xff #define EDID_OFFSET_DATA_BLOCKS 0x36 #define EDID_OFFSET_LAST_BLOCK 0x6c #define EDID_OFFSET_PNPID 0x08 #define EDID_OFFSET_SERIAL 0x0c static int edid_parse(struct drm_edid *edid, const uint8_t *data, size_t length) { int i; uint32_t serial_number; /* check header */ if (length < 128) return -1; if (data[0] != 0x00 || data[1] != 0xff) return -1; /* decode the PNP ID from three 5 bit words packed into 2 bytes * /--08--\/--09--\ * 7654321076543210 * |\---/\---/\---/ * R C1 C2 C3 */ edid->pnp_id[0] = 'A' + ((data[EDID_OFFSET_PNPID + 0] & 0x7c) / 4) - 1; edid->pnp_id[1] = 'A' + ((data[EDID_OFFSET_PNPID + 0] & 0x3) * 8) + ((data[EDID_OFFSET_PNPID + 1] & 0xe0) / 32) - 1; edid->pnp_id[2] = 'A' + (data[EDID_OFFSET_PNPID + 1] & 0x1f) - 1; edid->pnp_id[3] = '\0'; /* maybe there isn't a ASCII serial number descriptor, so use this instead */ serial_number = (uint32_t) data[EDID_OFFSET_SERIAL + 0]; serial_number += (uint32_t) data[EDID_OFFSET_SERIAL + 1] * 0x100; serial_number += (uint32_t) data[EDID_OFFSET_SERIAL + 2] * 0x10000; serial_number += (uint32_t) data[EDID_OFFSET_SERIAL + 3] * 0x1000000; if (serial_number > 0) sprintf(edid->serial_number, "%lu", (unsigned long) serial_number); /* parse EDID data */ for (i = EDID_OFFSET_DATA_BLOCKS; i <= EDID_OFFSET_LAST_BLOCK; i += 18) { /* ignore pixel clock data */ if (data[i] != 0) continue; if (data[i+2] != 0) continue; /* any useful blocks? */ if (data[i+3] == EDID_DESCRIPTOR_DISPLAY_PRODUCT_NAME) { edid_parse_string(&data[i+5], edid->monitor_name); } else if (data[i+3] == EDID_DESCRIPTOR_DISPLAY_PRODUCT_SERIAL_NUMBER) { edid_parse_string(&data[i+5], edid->serial_number); } else if (data[i+3] == EDID_DESCRIPTOR_ALPHANUMERIC_DATA_STRING) { edid_parse_string(&data[i+5], edid->eisa_id); } } return 0; } static void find_and_parse_output_edid(struct drm_backend *b, struct drm_output *output, drmModeConnector *connector) { drmModePropertyBlobPtr edid_blob = NULL; drmModePropertyPtr property; int i; int rc; for (i = 0; i < connector->count_props && !edid_blob; i++) { property = drmModeGetProperty(b->drm.fd, connector->props[i]); if (!property) continue; if ((property->flags & DRM_MODE_PROP_BLOB) && !strcmp(property->name, "EDID")) { edid_blob = drmModeGetPropertyBlob(b->drm.fd, connector->prop_values[i]); } drmModeFreeProperty(property); } if (!edid_blob) return; rc = edid_parse(&output->edid, edid_blob->data, edid_blob->length); if (!rc) { weston_log("EDID data '%s', '%s', '%s'\n", output->edid.pnp_id, output->edid.monitor_name, output->edid.serial_number); if (output->edid.pnp_id[0] != '\0') output->base.make = output->edid.pnp_id; if (output->edid.monitor_name[0] != '\0') output->base.model = output->edid.monitor_name; if (output->edid.serial_number[0] != '\0') output->base.serial_number = output->edid.serial_number; } drmModeFreePropertyBlob(edid_blob); } static int parse_modeline(const char *s, drmModeModeInfo *mode) { char hsync[16]; char vsync[16]; float fclock; mode->type = DRM_MODE_TYPE_USERDEF; mode->hskew = 0; mode->vscan = 0; mode->vrefresh = 0; mode->flags = 0; if (sscanf(s, "%f %hd %hd %hd %hd %hd %hd %hd %hd %15s %15s", &fclock, &mode->hdisplay, &mode->hsync_start, &mode->hsync_end, &mode->htotal, &mode->vdisplay, &mode->vsync_start, &mode->vsync_end, &mode->vtotal, hsync, vsync) != 11) return -1; mode->clock = fclock * 1000; if (strcmp(hsync, "+hsync") == 0) mode->flags |= DRM_MODE_FLAG_PHSYNC; else if (strcmp(hsync, "-hsync") == 0) mode->flags |= DRM_MODE_FLAG_NHSYNC; else return -1; if (strcmp(vsync, "+vsync") == 0) mode->flags |= DRM_MODE_FLAG_PVSYNC; else if (strcmp(vsync, "-vsync") == 0) mode->flags |= DRM_MODE_FLAG_NVSYNC; else return -1; return 0; } static void setup_output_seat_constraint(struct drm_backend *b, struct weston_output *output, const char *s) { if (strcmp(s, "") != 0) { struct weston_pointer *pointer; struct udev_seat *seat; seat = udev_seat_get_named(&b->input, s); if (!seat) return; seat->base.output = output; pointer = weston_seat_get_pointer(&seat->base); if (pointer) weston_pointer_clamp(pointer, &pointer->x, &pointer->y); } } static int get_gbm_format_from_section(struct weston_config_section *section, uint32_t default_value, uint32_t *format) { char *s; int ret = 0; weston_config_section_get_string(section, "gbm-format", &s, NULL); if (s == NULL) *format = default_value; else if (strcmp(s, "xrgb8888") == 0) *format = GBM_FORMAT_XRGB8888; else if (strcmp(s, "rgb565") == 0) *format = GBM_FORMAT_RGB565; else if (strcmp(s, "xrgb2101010") == 0) *format = GBM_FORMAT_XRGB2101010; else { weston_log("fatal: unrecognized pixel format: %s\n", s); ret = -1; } free(s); return ret; } /** * Choose suitable mode for an output * * Find the most suitable mode to use for initial setup (or reconfiguration on * hotplug etc) for a DRM output. * * @param output DRM output to choose mode for * @param kind Strategy and preference to use when choosing mode * @param width Desired width for this output * @param height Desired height for this output * @param current_mode Mode currently being displayed on this output * @param modeline Manually-entered mode (may be NULL) * @returns A mode from the output's mode list, or NULL if none available */ static struct drm_mode * drm_output_choose_initial_mode(struct drm_output *output, enum output_config kind, int width, int height, const drmModeModeInfo *current_mode, const drmModeModeInfo *modeline) { struct drm_mode *preferred = NULL; struct drm_mode *current = NULL; struct drm_mode *configured = NULL; struct drm_mode *best = NULL; struct drm_mode *drm_mode; wl_list_for_each_reverse(drm_mode, &output->base.mode_list, base.link) { if (kind == OUTPUT_CONFIG_MODE && width == drm_mode->base.width && height == drm_mode->base.height) configured = drm_mode; if (memcmp(¤t_mode, &drm_mode->mode_info, sizeof *current_mode) == 0) current = drm_mode; if (drm_mode->base.flags & WL_OUTPUT_MODE_PREFERRED) preferred = drm_mode; best = drm_mode; } if (kind == OUTPUT_CONFIG_MODELINE) { configured = drm_output_add_mode(output, modeline); if (!configured) return NULL; } if (current == NULL && current_mode->clock != 0) { current = drm_output_add_mode(output, current_mode); if (!current) return NULL; } if (kind == OUTPUT_CONFIG_CURRENT) configured = current; if (option_current_mode && current) return current; if (configured) return configured; if (preferred) return preferred; if (current) return current; if (best) return best; weston_log("no available modes for %s\n", output->base.name); return NULL; } static int connector_get_current_mode(drmModeConnector *connector, int drm_fd, drmModeModeInfo *mode) { drmModeEncoder *encoder; drmModeCrtc *crtc; /* Get the current mode on the crtc that's currently driving * this connector. */ encoder = drmModeGetEncoder(drm_fd, connector->encoder_id); memset(mode, 0, sizeof *mode); if (encoder != NULL) { crtc = drmModeGetCrtc(drm_fd, encoder->crtc_id); drmModeFreeEncoder(encoder); if (crtc == NULL) return -1; if (crtc->mode_valid) *mode = crtc->mode; drmModeFreeCrtc(crtc); } return 0; } /** * Create and configure a Weston output structure * * Given a DRM connector, create a matching drm_output structure and add it * to Weston's output list. * * @param b Weston backend structure structure * @param resources DRM resources for this device * @param connector DRM connector to use for this new output * @param x Horizontal offset to use into global co-ordinate space * @param y Vertical offset to use into global co-ordinate space * @param drm_device udev device pointer * @returns 0 on success, or -1 on failure */ static int create_output_for_connector(struct drm_backend *b, drmModeRes *resources, drmModeConnector *connector, int x, int y, struct udev_device *drm_device) { struct drm_output *output; struct drm_mode *drm_mode, *next, *current; struct weston_mode *m; struct weston_config_section *section; drmModeModeInfo crtc_mode, modeline; int i, width, height, scale; char *s; enum output_config config; uint32_t transform; i = find_crtc_for_connector(b, resources, connector); if (i < 0) { weston_log("No usable crtc/encoder pair for connector.\n"); return -1; } output = zalloc(sizeof *output); if (output == NULL) return -1; output->base.subpixel = drm_subpixel_to_wayland(connector->subpixel); output->base.name = make_connector_name(connector); output->base.make = "unknown"; output->base.model = "unknown"; output->base.serial_number = "unknown"; wl_list_init(&output->base.mode_list); section = weston_config_get_section(b->compositor->config, "output", "name", output->base.name); weston_config_section_get_string(section, "mode", &s, "preferred"); if (strcmp(s, "off") == 0) config = OUTPUT_CONFIG_OFF; else if (strcmp(s, "preferred") == 0) config = OUTPUT_CONFIG_PREFERRED; else if (strcmp(s, "current") == 0) config = OUTPUT_CONFIG_CURRENT; else if (sscanf(s, "%dx%d", &width, &height) == 2) config = OUTPUT_CONFIG_MODE; else if (parse_modeline(s, &modeline) == 0) config = OUTPUT_CONFIG_MODELINE; else { weston_log("Invalid mode \"%s\" for output %s\n", s, output->base.name); config = OUTPUT_CONFIG_PREFERRED; } free(s); weston_config_section_get_int(section, "scale", &scale, 1); weston_config_section_get_string(section, "transform", &s, "normal"); if (weston_parse_transform(s, &transform) < 0) weston_log("Invalid transform \"%s\" for output %s\n", s, output->base.name); free(s); if (get_gbm_format_from_section(section, b->format, &output->format) == -1) output->format = b->format; weston_config_section_get_string(section, "seat", &s, ""); setup_output_seat_constraint(b, &output->base, s); free(s); output->crtc_id = resources->crtcs[i]; output->pipe = i; b->crtc_allocator |= (1 << output->crtc_id); output->connector_id = connector->connector_id; b->connector_allocator |= (1 << output->connector_id); output->original_crtc = drmModeGetCrtc(b->drm.fd, output->crtc_id); output->dpms_prop = drm_get_prop(b->drm.fd, connector, "DPMS"); if (connector_get_current_mode(connector, b->drm.fd, &crtc_mode) < 0) goto err_free; for (i = 0; i < connector->count_modes; i++) { drm_mode = drm_output_add_mode(output, &connector->modes[i]); if (!drm_mode) goto err_free; } if (config == OUTPUT_CONFIG_OFF) { weston_log("Disabling output %s\n", output->base.name); drmModeSetCrtc(b->drm.fd, output->crtc_id, 0, 0, 0, 0, 0, NULL); goto err_free; } current = drm_output_choose_initial_mode(output, config, width, height, &crtc_mode, &modeline); if (!current) goto err_free; output->base.current_mode = ¤t->base; output->base.current_mode->flags |= WL_OUTPUT_MODE_CURRENT; weston_output_init(&output->base, b->compositor, x, y, connector->mmWidth, connector->mmHeight, transform, scale); if (b->use_pixman) { if (drm_output_init_pixman(output, b) < 0) { weston_log("Failed to init output pixman state\n"); goto err_output; } } else if (drm_output_init_egl(output, b) < 0) { weston_log("Failed to init output gl state\n"); goto err_output; } output->backlight = backlight_init(drm_device, connector->connector_type); if (output->backlight) { weston_log("Initialized backlight, device %s\n", output->backlight->path); output->base.set_backlight = drm_set_backlight; output->base.backlight_current = drm_get_backlight(output); } else { weston_log("Failed to initialize backlight\n"); } weston_compositor_add_output(b->compositor, &output->base); find_and_parse_output_edid(b, output, connector); if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) output->base.connection_internal = 1; output->base.start_repaint_loop = drm_output_start_repaint_loop; output->base.repaint = drm_output_repaint; output->base.destroy = drm_output_destroy; output->base.assign_planes = drm_assign_planes; output->base.set_dpms = drm_set_dpms; output->base.switch_mode = drm_output_switch_mode; output->base.gamma_size = output->original_crtc->gamma_size; output->base.set_gamma = drm_output_set_gamma; weston_plane_init(&output->cursor_plane, b->compositor, 0, 0); weston_plane_init(&output->fb_plane, b->compositor, 0, 0); weston_compositor_stack_plane(b->compositor, &output->cursor_plane, NULL); weston_compositor_stack_plane(b->compositor, &output->fb_plane, &b->compositor->primary_plane); weston_log("Output %s, (connector %d, crtc %d)\n", output->base.name, output->connector_id, output->crtc_id); wl_list_for_each(m, &output->base.mode_list, link) weston_log_continue(STAMP_SPACE "mode %dx%d@%.1f%s%s%s\n", m->width, m->height, m->refresh / 1000.0, m->flags & WL_OUTPUT_MODE_PREFERRED ? ", preferred" : "", m->flags & WL_OUTPUT_MODE_CURRENT ? ", current" : "", connector->count_modes == 0 ? ", built-in" : ""); /* Set native_ fields, so weston_output_mode_switch_to_native() works */ output->base.native_mode = output->base.current_mode; output->base.native_scale = output->base.current_scale; return 0; err_output: weston_output_destroy(&output->base); err_free: wl_list_for_each_safe(drm_mode, next, &output->base.mode_list, base.link) { wl_list_remove(&drm_mode->base.link); free(drm_mode); } drmModeFreeCrtc(output->original_crtc); b->crtc_allocator &= ~(1 << output->crtc_id); b->connector_allocator &= ~(1 << output->connector_id); free(output); return -1; } static void create_sprites(struct drm_backend *b) { struct drm_sprite *sprite; drmModePlaneRes *plane_res; drmModePlane *plane; uint32_t i; plane_res = drmModeGetPlaneResources(b->drm.fd); if (!plane_res) { weston_log("failed to get plane resources: %s\n", strerror(errno)); return; } for (i = 0; i < plane_res->count_planes; i++) { plane = drmModeGetPlane(b->drm.fd, plane_res->planes[i]); if (!plane) continue; sprite = zalloc(sizeof(*sprite) + ((sizeof(uint32_t)) * plane->count_formats)); if (!sprite) { weston_log("%s: out of memory\n", __func__); drmModeFreePlane(plane); continue; } sprite->possible_crtcs = plane->possible_crtcs; sprite->plane_id = plane->plane_id; sprite->current = NULL; sprite->next = NULL; sprite->backend = b; sprite->count_formats = plane->count_formats; memcpy(sprite->formats, plane->formats, plane->count_formats * sizeof(plane->formats[0])); drmModeFreePlane(plane); weston_plane_init(&sprite->plane, b->compositor, 0, 0); weston_compositor_stack_plane(b->compositor, &sprite->plane, &b->compositor->primary_plane); wl_list_insert(&b->sprite_list, &sprite->link); } drmModeFreePlaneResources(plane_res); } static void destroy_sprites(struct drm_backend *backend) { struct drm_sprite *sprite, *next; struct drm_output *output; output = container_of(backend->compositor->output_list.next, struct drm_output, base.link); wl_list_for_each_safe(sprite, next, &backend->sprite_list, link) { drmModeSetPlane(backend->drm.fd, sprite->plane_id, output->crtc_id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); drm_output_release_fb(output, sprite->current); drm_output_release_fb(output, sprite->next); weston_plane_release(&sprite->plane); free(sprite); } } static int create_outputs(struct drm_backend *b, uint32_t option_connector, struct udev_device *drm_device) { drmModeConnector *connector; drmModeRes *resources; int i; int x = 0, y = 0; resources = drmModeGetResources(b->drm.fd); if (!resources) { weston_log("drmModeGetResources failed\n"); return -1; } b->crtcs = calloc(resources->count_crtcs, sizeof(uint32_t)); if (!b->crtcs) { drmModeFreeResources(resources); return -1; } b->min_width = resources->min_width; b->max_width = resources->max_width; b->min_height = resources->min_height; b->max_height = resources->max_height; b->num_crtcs = resources->count_crtcs; memcpy(b->crtcs, resources->crtcs, sizeof(uint32_t) * b->num_crtcs); for (i = 0; i < resources->count_connectors; i++) { connector = drmModeGetConnector(b->drm.fd, resources->connectors[i]); if (connector == NULL) continue; if (connector->connection == DRM_MODE_CONNECTED && (option_connector == 0 || connector->connector_id == option_connector)) { if (create_output_for_connector(b, resources, connector, x, y, drm_device) < 0) { drmModeFreeConnector(connector); continue; } x += container_of(b->compositor->output_list.prev, struct weston_output, link)->width; } drmModeFreeConnector(connector); } if (wl_list_empty(&b->compositor->output_list)) { weston_log("No currently active connector found.\n"); drmModeFreeResources(resources); return -1; } drmModeFreeResources(resources); return 0; } static void update_outputs(struct drm_backend *b, struct udev_device *drm_device) { drmModeConnector *connector; drmModeRes *resources; struct drm_output *output, *next; int x = 0, y = 0; uint32_t connected = 0, disconnects = 0; int i; resources = drmModeGetResources(b->drm.fd); if (!resources) { weston_log("drmModeGetResources failed\n"); return; } /* collect new connects */ for (i = 0; i < resources->count_connectors; i++) { int connector_id = resources->connectors[i]; connector = drmModeGetConnector(b->drm.fd, connector_id); if (connector == NULL) continue; if (connector->connection != DRM_MODE_CONNECTED) { drmModeFreeConnector(connector); continue; } connected |= (1 << connector_id); if (!(b->connector_allocator & (1 << connector_id))) { struct weston_output *last = container_of(b->compositor->output_list.prev, struct weston_output, link); /* XXX: not yet needed, we die with 0 outputs */ if (!wl_list_empty(&b->compositor->output_list)) x = last->x + last->width; else x = 0; y = 0; create_output_for_connector(b, resources, connector, x, y, drm_device); weston_log("connector %d connected\n", connector_id); } drmModeFreeConnector(connector); } drmModeFreeResources(resources); disconnects = b->connector_allocator & ~connected; if (disconnects) { wl_list_for_each_safe(output, next, &b->compositor->output_list, base.link) { if (disconnects & (1 << output->connector_id)) { disconnects &= ~(1 << output->connector_id); weston_log("connector %d disconnected\n", output->connector_id); drm_output_destroy(&output->base); } } } /* FIXME: handle zero outputs, without terminating */ if (b->connector_allocator == 0) weston_compositor_exit(b->compositor); } static int udev_event_is_hotplug(struct drm_backend *b, struct udev_device *device) { const char *sysnum; const char *val; sysnum = udev_device_get_sysnum(device); if (!sysnum || atoi(sysnum) != b->drm.id) return 0; val = udev_device_get_property_value(device, "HOTPLUG"); if (!val) return 0; return strcmp(val, "1") == 0; } static int udev_drm_event(int fd, uint32_t mask, void *data) { struct drm_backend *b = data; struct udev_device *event; event = udev_monitor_receive_device(b->udev_monitor); if (udev_event_is_hotplug(b, event)) update_outputs(b, event); udev_device_unref(event); return 1; } static void drm_restore(struct weston_compositor *ec) { weston_launcher_restore(ec->launcher); } static void drm_destroy(struct weston_compositor *ec) { struct drm_backend *b = (struct drm_backend *) ec->backend; udev_input_destroy(&b->input); wl_event_source_remove(b->udev_drm_source); wl_event_source_remove(b->drm_source); destroy_sprites(b); weston_compositor_shutdown(ec); if (b->gbm) gbm_device_destroy(b->gbm); weston_launcher_destroy(ec->launcher); close(b->drm.fd); free(b); } static void drm_backend_set_modes(struct drm_backend *backend) { struct drm_output *output; struct drm_mode *drm_mode; int ret; wl_list_for_each(output, &backend->compositor->output_list, base.link) { if (!output->current) { /* If something that would cause the output to * switch mode happened while in another vt, we * might not have a current drm_fb. In that case, * schedule a repaint and let drm_output_repaint * handle setting the mode. */ weston_output_schedule_repaint(&output->base); continue; } drm_mode = (struct drm_mode *) output->base.current_mode; ret = drmModeSetCrtc(backend->drm.fd, output->crtc_id, output->current->fb_id, 0, 0, &output->connector_id, 1, &drm_mode->mode_info); if (ret < 0) { weston_log( "failed to set mode %dx%d for output at %d,%d: %m\n", drm_mode->base.width, drm_mode->base.height, output->base.x, output->base.y); } } } static void session_notify(struct wl_listener *listener, void *data) { struct weston_compositor *compositor = data; struct drm_backend *b = (struct drm_backend *)compositor->backend; struct drm_sprite *sprite; struct drm_output *output; if (compositor->session_active) { weston_log("activating session\n"); compositor->state = b->prev_state; drm_backend_set_modes(b); weston_compositor_damage_all(compositor); udev_input_enable(&b->input); } else { weston_log("deactivating session\n"); udev_input_disable(&b->input); b->prev_state = compositor->state; weston_compositor_offscreen(compositor); /* If we have a repaint scheduled (either from a * pending pageflip or the idle handler), make sure we * cancel that so we don't try to pageflip when we're * vt switched away. The OFFSCREEN state will prevent * further attemps at repainting. When we switch * back, we schedule a repaint, which will process * pending frame callbacks. */ wl_list_for_each(output, &compositor->output_list, base.link) { output->base.repaint_needed = 0; drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0); } output = container_of(compositor->output_list.next, struct drm_output, base.link); wl_list_for_each(sprite, &b->sprite_list, link) drmModeSetPlane(b->drm.fd, sprite->plane_id, output->crtc_id, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); }; } static void switch_vt_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1); } /* * Find primary GPU * Some systems may have multiple DRM devices attached to a single seat. This * function loops over all devices and tries to find a PCI device with the * boot_vga sysfs attribute set to 1. * If no such device is found, the first DRM device reported by udev is used. */ static struct udev_device* find_primary_gpu(struct drm_backend *b, const char *seat) { struct udev_enumerate *e; struct udev_list_entry *entry; const char *path, *device_seat, *id; struct udev_device *device, *drm_device, *pci; e = udev_enumerate_new(b->udev); udev_enumerate_add_match_subsystem(e, "drm"); udev_enumerate_add_match_sysname(e, "card[0-9]*"); udev_enumerate_scan_devices(e); drm_device = NULL; udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { path = udev_list_entry_get_name(entry); device = udev_device_new_from_syspath(b->udev, path); if (!device) continue; device_seat = udev_device_get_property_value(device, "ID_SEAT"); if (!device_seat) device_seat = default_seat; if (strcmp(device_seat, seat)) { udev_device_unref(device); continue; } pci = udev_device_get_parent_with_subsystem_devtype(device, "pci", NULL); if (pci) { id = udev_device_get_sysattr_value(pci, "boot_vga"); if (id && !strcmp(id, "1")) { if (drm_device) udev_device_unref(drm_device); drm_device = device; break; } } if (!drm_device) drm_device = device; else udev_device_unref(device); } udev_enumerate_unref(e); return drm_device; } static void planes_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct drm_backend *b = data; switch (key) { case KEY_C: b->cursors_are_broken ^= 1; break; case KEY_V: b->sprites_are_broken ^= 1; break; case KEY_O: b->sprites_hidden ^= 1; break; default: break; } } #ifdef BUILD_VAAPI_RECORDER static void recorder_destroy(struct drm_output *output) { vaapi_recorder_destroy(output->recorder); output->recorder = NULL; output->base.disable_planes--; wl_list_remove(&output->recorder_frame_listener.link); weston_log("[libva recorder] done\n"); } static void recorder_frame_notify(struct wl_listener *listener, void *data) { struct drm_output *output; struct drm_backend *b; int fd, ret; output = container_of(listener, struct drm_output, recorder_frame_listener); b = (struct drm_backend *)output->base.compositor->backend; if (!output->recorder) return; ret = drmPrimeHandleToFD(b->drm.fd, output->current->handle, DRM_CLOEXEC, &fd); if (ret) { weston_log("[libva recorder] " "failed to create prime fd for front buffer\n"); return; } ret = vaapi_recorder_frame(output->recorder, fd, output->current->stride); if (ret < 0) { weston_log("[libva recorder] aborted: %m\n"); recorder_destroy(output); } } static void * create_recorder(struct drm_backend *b, int width, int height, const char *filename) { int fd; drm_magic_t magic; fd = open(b->drm.filename, O_RDWR | O_CLOEXEC); if (fd < 0) return NULL; drmGetMagic(fd, &magic); drmAuthMagic(b->drm.fd, magic); return vaapi_recorder_create(fd, width, height, filename); } static void recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct drm_backend *b = data; struct drm_output *output; int width, height; output = container_of(b->compositor->output_list.next, struct drm_output, base.link); if (!output->recorder) { if (output->format != GBM_FORMAT_XRGB8888) { weston_log("failed to start vaapi recorder: " "output format not supported\n"); return; } width = output->base.current_mode->width; height = output->base.current_mode->height; output->recorder = create_recorder(b, width, height, "capture.h264"); if (!output->recorder) { weston_log("failed to create vaapi recorder\n"); return; } output->base.disable_planes++; output->recorder_frame_listener.notify = recorder_frame_notify; wl_signal_add(&output->base.frame_signal, &output->recorder_frame_listener); weston_output_schedule_repaint(&output->base); weston_log("[libva recorder] initialized\n"); } else { recorder_destroy(output); } } #else static void recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { weston_log("Compiled without libva support\n"); } #endif static void switch_to_gl_renderer(struct drm_backend *b) { struct drm_output *output; bool dmabuf_support_inited; if (!b->use_pixman) return; dmabuf_support_inited = !!b->compositor->renderer->import_dmabuf; weston_log("Switching to GL renderer\n"); b->gbm = create_gbm_device(b->drm.fd); if (!b->gbm) { weston_log("Failed to create gbm device. " "Aborting renderer switch\n"); return; } wl_list_for_each(output, &b->compositor->output_list, base.link) pixman_renderer_output_destroy(&output->base); b->compositor->renderer->destroy(b->compositor); if (drm_backend_create_gl_renderer(b) < 0) { gbm_device_destroy(b->gbm); weston_log("Failed to create GL renderer. Quitting.\n"); /* FIXME: we need a function to shutdown cleanly */ assert(0); } wl_list_for_each(output, &b->compositor->output_list, base.link) drm_output_init_egl(output, b); b->use_pixman = 0; if (!dmabuf_support_inited && b->compositor->renderer->import_dmabuf) { if (linux_dmabuf_setup(b->compositor) < 0) weston_log("Error: initializing dmabuf " "support failed.\n"); } } static void renderer_switch_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct drm_backend *b = (struct drm_backend *) keyboard->seat->compositor; switch_to_gl_renderer(b); } static struct drm_backend * drm_backend_create(struct weston_compositor *compositor, struct drm_parameters *param, int *argc, char *argv[], struct weston_config *config) { struct drm_backend *b; struct weston_config_section *section; struct udev_device *drm_device; struct wl_event_loop *loop; const char *path; uint32_t key; weston_log("initializing drm backend\n"); b = zalloc(sizeof *b); if (b == NULL) return NULL; /* * KMS support for hardware planes cannot properly synchronize * without nuclear page flip. Without nuclear/atomic, hw plane * and cursor plane updates would either tear or cause extra * waits for vblanks which means dropping the compositor framerate * to a fraction. For cursors, it's not so bad, so they are * enabled. * * These can be enabled again when nuclear/atomic support lands. */ b->sprites_are_broken = 1; b->compositor = compositor; section = weston_config_get_section(config, "core", NULL, NULL); if (get_gbm_format_from_section(section, GBM_FORMAT_XRGB8888, &b->format) == -1) goto err_base; b->use_pixman = param->use_pixman; /* Check if we run drm-backend using weston-launch */ compositor->launcher = weston_launcher_connect(compositor, param->tty, param->seat_id, true); if (compositor->launcher == NULL) { weston_log("fatal: drm backend should be run " "using weston-launch binary or as root\n"); goto err_compositor; } b->udev = udev_new(); if (b->udev == NULL) { weston_log("failed to initialize udev context\n"); goto err_launcher; } b->session_listener.notify = session_notify; wl_signal_add(&compositor->session_signal, &b->session_listener); drm_device = find_primary_gpu(b, param->seat_id); if (drm_device == NULL) { weston_log("no drm device found\n"); goto err_udev; } path = udev_device_get_syspath(drm_device); if (init_drm(b, drm_device) < 0) { weston_log("failed to initialize kms\n"); goto err_udev_dev; } if (b->use_pixman) { if (init_pixman(b) < 0) { weston_log("failed to initialize pixman renderer\n"); goto err_udev_dev; } } else { if (init_egl(b) < 0) { weston_log("failed to initialize egl\n"); goto err_udev_dev; } } b->base.destroy = drm_destroy; b->base.restore = drm_restore; b->prev_state = WESTON_COMPOSITOR_ACTIVE; for (key = KEY_F1; key < KEY_F9; key++) weston_compositor_add_key_binding(compositor, key, MODIFIER_CTRL | MODIFIER_ALT, switch_vt_binding, compositor); wl_list_init(&b->sprite_list); create_sprites(b); if (udev_input_init(&b->input, compositor, b->udev, param->seat_id) < 0) { weston_log("failed to create input devices\n"); goto err_sprite; } if (create_outputs(b, param->connector, drm_device) < 0) { weston_log("failed to create output for %s\n", path); goto err_udev_input; } /* A this point we have some idea of whether or not we have a working * cursor plane. */ if (!b->cursors_are_broken) compositor->capabilities |= WESTON_CAP_CURSOR_PLANE; path = NULL; loop = wl_display_get_event_loop(compositor->wl_display); b->drm_source = wl_event_loop_add_fd(loop, b->drm.fd, WL_EVENT_READABLE, on_drm_input, b); b->udev_monitor = udev_monitor_new_from_netlink(b->udev, "udev"); if (b->udev_monitor == NULL) { weston_log("failed to intialize udev monitor\n"); goto err_drm_source; } udev_monitor_filter_add_match_subsystem_devtype(b->udev_monitor, "drm", NULL); b->udev_drm_source = wl_event_loop_add_fd(loop, udev_monitor_get_fd(b->udev_monitor), WL_EVENT_READABLE, udev_drm_event, b); if (udev_monitor_enable_receiving(b->udev_monitor) < 0) { weston_log("failed to enable udev-monitor receiving\n"); goto err_udev_monitor; } udev_device_unref(drm_device); weston_compositor_add_debug_binding(compositor, KEY_O, planes_binding, b); weston_compositor_add_debug_binding(compositor, KEY_C, planes_binding, b); weston_compositor_add_debug_binding(compositor, KEY_V, planes_binding, b); weston_compositor_add_debug_binding(compositor, KEY_Q, recorder_binding, b); weston_compositor_add_debug_binding(compositor, KEY_W, renderer_switch_binding, b); if (compositor->renderer->import_dmabuf) { if (linux_dmabuf_setup(compositor) < 0) weston_log("Error: initializing dmabuf " "support failed.\n"); } compositor->backend = &b->base; return b; err_udev_monitor: wl_event_source_remove(b->udev_drm_source); udev_monitor_unref(b->udev_monitor); err_drm_source: wl_event_source_remove(b->drm_source); err_udev_input: udev_input_destroy(&b->input); err_sprite: gbm_device_destroy(b->gbm); destroy_sprites(b); err_udev_dev: udev_device_unref(drm_device); err_launcher: weston_launcher_destroy(compositor->launcher); err_udev: udev_unref(b->udev); err_compositor: weston_compositor_shutdown(compositor); err_base: free(b); return NULL; } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config) { struct drm_backend *b; struct drm_parameters param = { 0, }; const struct weston_option drm_options[] = { { WESTON_OPTION_INTEGER, "connector", 0, ¶m.connector }, { WESTON_OPTION_STRING, "seat", 0, ¶m.seat_id }, { WESTON_OPTION_INTEGER, "tty", 0, ¶m.tty }, { WESTON_OPTION_BOOLEAN, "current-mode", 0, &option_current_mode }, { WESTON_OPTION_BOOLEAN, "use-pixman", 0, ¶m.use_pixman }, }; param.seat_id = default_seat; parse_options(drm_options, ARRAY_LENGTH(drm_options), argc, argv); b = drm_backend_create(compositor, ¶m, argc, argv, config); if (b == NULL) return -1; return 0; } weston-1.9.0/src/libbacklight.h0000664000175000017500000000471712537627702013366 00000000000000/* * libbacklight - userspace interface to Linux backlight control * * Copyright © 2012 Intel Corporation * Copyright 2010 Red Hat * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Matthew Garrett * Tiago Vignatti */ #ifndef LIBBACKLIGHT_H #define LIBBACKLIGHT_H #include #include #ifdef __cplusplus extern "C" { #endif enum backlight_type { BACKLIGHT_RAW, BACKLIGHT_PLATFORM, BACKLIGHT_FIRMWARE }; struct backlight { char *path; int max_brightness; int brightness; enum backlight_type type; }; /* * Find and set up a backlight for a valid udev connector device, i.e. one * matching drm subsytem and with status of connected. */ struct backlight *backlight_init(struct udev_device *drm_device, uint32_t connector_type); /* Free backlight resources */ void backlight_destroy(struct backlight *backlight); /* Provide the maximum backlight value */ long backlight_get_max_brightness(struct backlight *backlight); /* Provide the cached backlight value */ long backlight_get_brightness(struct backlight *backlight); /* Provide the hardware backlight value */ long backlight_get_actual_brightness(struct backlight *backlight); /* Set the backlight to a value between 0 and max */ long backlight_set_brightness(struct backlight *backlight, long brightness); #ifdef __cplusplus } #endif #endif /* LIBBACKLIGHT_H */ weston-1.9.0/src/libinput-device.h0000664000175000017500000000444612537627702014031 00000000000000/* * Copyright © 2011, 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _LIBINPUT_DEVICE_H_ #define _LIBINPUT_DEVICE_H_ #include "config.h" #include #include #include #include "compositor.h" enum evdev_device_seat_capability { EVDEV_SEAT_POINTER = (1 << 0), EVDEV_SEAT_KEYBOARD = (1 << 1), EVDEV_SEAT_TOUCH = (1 << 2) }; struct evdev_device { struct weston_seat *seat; enum evdev_device_seat_capability seat_caps; struct libinput_device *device; struct wl_list link; struct weston_output *output; struct wl_listener output_destroy_listener; char *devnode; char *output_name; int fd; }; void evdev_led_update(struct evdev_device *device, enum weston_led leds); struct evdev_device * evdev_device_create(struct libinput_device *libinput_device, struct weston_seat *seat); int evdev_device_process_event(struct libinput_event *event); void evdev_device_set_output(struct evdev_device *device, struct weston_output *output); void evdev_device_destroy(struct evdev_device *device); void evdev_notify_keyboard_focus(struct weston_seat *seat, struct wl_list *evdev_devices); int dispatch_libinput(struct libinput *libinput); #endif /* _LIBINPUT_DEVICE_H_ */ weston-1.9.0/src/compositor-wayland.c0000664000175000017500000016116112560760452014566 00000000000000/* * Copyright © 2010-2011 Benjamin Franzke * Copyright © 2013 Jason Ekstrand * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "gl-renderer.h" #include "pixman-renderer.h" #include "shared/helpers.h" #include "shared/image-loader.h" #include "shared/os-compatibility.h" #include "shared/cairo-util.h" #include "fullscreen-shell-client-protocol.h" #include "presentation_timing-server-protocol.h" #define WINDOW_TITLE "Weston Compositor" struct wayland_backend { struct weston_backend base; struct weston_compositor *compositor; struct { struct wl_display *wl_display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shell *shell; struct _wl_fullscreen_shell *fshell; struct wl_shm *shm; struct wl_list output_list; struct wl_event_source *wl_source; uint32_t event_mask; } parent; int use_pixman; int sprawl_across_outputs; struct theme *theme; cairo_device_t *frame_device; struct wl_cursor_theme *cursor_theme; struct wl_cursor *cursor; struct wl_list input_list; }; struct wayland_output { struct weston_output base; struct { int draw_initial_frame; struct wl_surface *surface; struct wl_output *output; uint32_t global_id; struct wl_shell_surface *shell_surface; int configure_width, configure_height; } parent; int keyboard_count; char *name; struct frame *frame; struct { struct wl_egl_window *egl_window; struct { cairo_surface_t *top; cairo_surface_t *left; cairo_surface_t *right; cairo_surface_t *bottom; } border; } gl; struct { struct wl_list buffers; struct wl_list free_buffers; } shm; struct weston_mode mode; uint32_t scale; }; struct wayland_parent_output { struct wayland_output *output; struct wl_list link; struct wl_output *global; uint32_t id; struct { char *make; char *model; int32_t width, height; uint32_t subpixel; } physical; int32_t x, y; uint32_t transform; uint32_t scale; struct wl_list mode_list; struct weston_mode *preferred_mode; struct weston_mode *current_mode; }; struct wayland_shm_buffer { struct wayland_output *output; struct wl_list link; struct wl_list free_link; struct wl_buffer *buffer; void *data; size_t size; pixman_region32_t damage; int frame_damaged; pixman_image_t *pm_image; cairo_surface_t *c_surface; }; struct wayland_input { struct weston_seat base; struct wayland_backend *backend; struct wl_list link; struct { struct wl_seat *seat; struct wl_pointer *pointer; struct wl_keyboard *keyboard; struct wl_touch *touch; struct { struct wl_surface *surface; int32_t hx, hy; } cursor; } parent; enum weston_key_state_update keyboard_state_update; uint32_t key_serial; uint32_t enter_serial; int focus; struct wayland_output *output; struct wayland_output *keyboard_focus; }; struct gl_renderer_interface *gl_renderer; static void wayland_shm_buffer_destroy(struct wayland_shm_buffer *buffer) { cairo_surface_destroy(buffer->c_surface); pixman_image_unref(buffer->pm_image); wl_buffer_destroy(buffer->buffer); munmap(buffer->data, buffer->size); pixman_region32_fini(&buffer->damage); wl_list_remove(&buffer->link); wl_list_remove(&buffer->free_link); free(buffer); } static void buffer_release(void *data, struct wl_buffer *buffer) { struct wayland_shm_buffer *sb = data; if (sb->output) { wl_list_insert(&sb->output->shm.free_buffers, &sb->free_link); } else { wayland_shm_buffer_destroy(sb); } } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static struct wayland_shm_buffer * wayland_output_get_shm_buffer(struct wayland_output *output) { struct wayland_backend *b = (struct wayland_backend *) output->base.compositor->backend; struct wl_shm *shm = b->parent.shm; struct wayland_shm_buffer *sb; struct wl_shm_pool *pool; int width, height, stride; int32_t fx, fy; int fd; unsigned char *data; if (!wl_list_empty(&output->shm.free_buffers)) { sb = container_of(output->shm.free_buffers.next, struct wayland_shm_buffer, free_link); wl_list_remove(&sb->free_link); wl_list_init(&sb->free_link); return sb; } if (output->frame) { width = frame_width(output->frame); height = frame_height(output->frame); } else { width = output->base.current_mode->width; height = output->base.current_mode->height; } stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); fd = os_create_anonymous_file(height * stride); if (fd < 0) { weston_log("could not create an anonymous file buffer: %m\n"); return NULL; } data = mmap(NULL, height * stride, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { weston_log("could not mmap %d memory for data: %m\n", height * stride); close(fd); return NULL; } sb = zalloc(sizeof *sb); if (sb == NULL) { weston_log("could not zalloc %zu memory for sb: %m\n", sizeof *sb); close(fd); free(data); return NULL; } sb->output = output; wl_list_init(&sb->free_link); wl_list_insert(&output->shm.buffers, &sb->link); pixman_region32_init_rect(&sb->damage, 0, 0, output->base.width, output->base.height); sb->frame_damaged = 1; sb->data = data; sb->size = height * stride; pool = wl_shm_create_pool(shm, fd, sb->size); sb->buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_ARGB8888); wl_buffer_add_listener(sb->buffer, &buffer_listener, sb); wl_shm_pool_destroy(pool); close(fd); memset(data, 0, sb->size); sb->c_surface = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, width, height, stride); fx = 0; fy = 0; if (output->frame) frame_interior(output->frame, &fx, &fy, 0, 0); sb->pm_image = pixman_image_create_bits(PIXMAN_a8r8g8b8, width, height, (uint32_t *)(data + fy * stride) + fx, stride); return sb; } static void frame_done(void *data, struct wl_callback *callback, uint32_t time) { struct weston_output *output = data; struct timespec ts; wl_callback_destroy(callback); /* XXX: use the presentation extension for proper timings */ /* * This is the fallback case, where Presentation extension is not * available from the parent compositor. We do not know the base for * 'time', so we cannot feed it to finish_frame(). Do the only thing * we can, and pretend finish_frame time is when we process this * event. */ weston_compositor_read_presentation_clock(output->compositor, &ts); weston_output_finish_frame(output, &ts, 0); } static const struct wl_callback_listener frame_listener = { frame_done }; static void draw_initial_frame(struct wayland_output *output) { struct wayland_shm_buffer *sb; sb = wayland_output_get_shm_buffer(output); /* If we are rendering with GL, then orphan it so that it gets * destroyed immediately */ if (output->gl.egl_window) sb->output = NULL; wl_surface_attach(output->parent.surface, sb->buffer, 0, 0); wl_surface_damage(output->parent.surface, 0, 0, output->base.current_mode->width, output->base.current_mode->height); } static void wayland_output_update_gl_border(struct wayland_output *output) { int32_t ix, iy, iwidth, iheight, fwidth, fheight; cairo_t *cr; if (!output->frame) return; if (!(frame_status(output->frame) & FRAME_STATUS_REPAINT)) return; fwidth = frame_width(output->frame); fheight = frame_height(output->frame); frame_interior(output->frame, &ix, &iy, &iwidth, &iheight); if (!output->gl.border.top) output->gl.border.top = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, fwidth, iy); cr = cairo_create(output->gl.border.top); frame_repaint(output->frame, cr); cairo_destroy(cr); gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_TOP, fwidth, iy, cairo_image_surface_get_stride(output->gl.border.top) / 4, cairo_image_surface_get_data(output->gl.border.top)); if (!output->gl.border.left) output->gl.border.left = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, ix, 1); cr = cairo_create(output->gl.border.left); cairo_translate(cr, 0, -iy); frame_repaint(output->frame, cr); cairo_destroy(cr); gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_LEFT, ix, 1, cairo_image_surface_get_stride(output->gl.border.left) / 4, cairo_image_surface_get_data(output->gl.border.left)); if (!output->gl.border.right) output->gl.border.right = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, fwidth - (ix + iwidth), 1); cr = cairo_create(output->gl.border.right); cairo_translate(cr, -(iwidth + ix), -iy); frame_repaint(output->frame, cr); cairo_destroy(cr); gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_RIGHT, fwidth - (ix + iwidth), 1, cairo_image_surface_get_stride(output->gl.border.right) / 4, cairo_image_surface_get_data(output->gl.border.right)); if (!output->gl.border.bottom) output->gl.border.bottom = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, fwidth, fheight - (iy + iheight)); cr = cairo_create(output->gl.border.bottom); cairo_translate(cr, 0, -(iy + iheight)); frame_repaint(output->frame, cr); cairo_destroy(cr); gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_BOTTOM, fwidth, fheight - (iy + iheight), cairo_image_surface_get_stride(output->gl.border.bottom) / 4, cairo_image_surface_get_data(output->gl.border.bottom)); } static void wayland_output_start_repaint_loop(struct weston_output *output_base) { struct wayland_output *output = (struct wayland_output *) output_base; struct wayland_backend *wb = (struct wayland_backend *)output->base.compositor->backend; struct wl_callback *callback; /* If this is the initial frame, we need to attach a buffer so that * the compositor can map the surface and include it in its render * loop. If the surface doesn't end up in the render loop, the frame * callback won't be invoked. The buffer is transparent and of the * same size as the future real output buffer. */ if (output->parent.draw_initial_frame) { output->parent.draw_initial_frame = 0; draw_initial_frame(output); } callback = wl_surface_frame(output->parent.surface); wl_callback_add_listener(callback, &frame_listener, output); wl_surface_commit(output->parent.surface); wl_display_flush(wb->parent.wl_display); } static int wayland_output_repaint_gl(struct weston_output *output_base, pixman_region32_t *damage) { struct wayland_output *output = (struct wayland_output *) output_base; struct weston_compositor *ec = output->base.compositor; struct wl_callback *callback; callback = wl_surface_frame(output->parent.surface); wl_callback_add_listener(callback, &frame_listener, output); wayland_output_update_gl_border(output); ec->renderer->repaint_output(&output->base, damage); pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); return 0; } static void wayland_output_update_shm_border(struct wayland_shm_buffer *buffer) { int32_t ix, iy, iwidth, iheight, fwidth, fheight; cairo_t *cr; if (!buffer->output->frame || !buffer->frame_damaged) return; cr = cairo_create(buffer->c_surface); frame_interior(buffer->output->frame, &ix, &iy, &iwidth, &iheight); fwidth = frame_width(buffer->output->frame); fheight = frame_height(buffer->output->frame); /* Set the clip so we don't unnecisaraly damage the surface */ cairo_move_to(cr, ix, iy); cairo_rel_line_to(cr, iwidth, 0); cairo_rel_line_to(cr, 0, iheight); cairo_rel_line_to(cr, -iwidth, 0); cairo_line_to(cr, ix, iy); cairo_line_to(cr, 0, iy); cairo_line_to(cr, 0, fheight); cairo_line_to(cr, fwidth, fheight); cairo_line_to(cr, fwidth, 0); cairo_line_to(cr, 0, 0); cairo_line_to(cr, 0, iy); cairo_close_path(cr); cairo_clip(cr); /* Draw using a pattern so that the final result gets clipped */ cairo_push_group(cr); frame_repaint(buffer->output->frame, cr); cairo_pop_group_to_source(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_paint(cr); cairo_destroy(cr); } static void wayland_shm_buffer_attach(struct wayland_shm_buffer *sb) { pixman_region32_t damage; pixman_box32_t *rects; int32_t ix, iy, iwidth, iheight, fwidth, fheight; int i, n; pixman_region32_init(&damage); weston_transformed_region(sb->output->base.width, sb->output->base.height, sb->output->base.transform, sb->output->base.current_scale, &sb->damage, &damage); if (sb->output->frame) { frame_interior(sb->output->frame, &ix, &iy, &iwidth, &iheight); fwidth = frame_width(sb->output->frame); fheight = frame_height(sb->output->frame); pixman_region32_translate(&damage, ix, iy); if (sb->frame_damaged) { pixman_region32_union_rect(&damage, &damage, 0, 0, fwidth, iy); pixman_region32_union_rect(&damage, &damage, 0, iy, ix, iheight); pixman_region32_union_rect(&damage, &damage, ix + iwidth, iy, fwidth - (ix + iwidth), iheight); pixman_region32_union_rect(&damage, &damage, 0, iy + iheight, fwidth, fheight - (iy + iheight)); } } rects = pixman_region32_rectangles(&damage, &n); wl_surface_attach(sb->output->parent.surface, sb->buffer, 0, 0); for (i = 0; i < n; ++i) wl_surface_damage(sb->output->parent.surface, rects[i].x1, rects[i].y1, rects[i].x2 - rects[i].x1, rects[i].y2 - rects[i].y1); if (sb->output->frame) pixman_region32_fini(&damage); } static int wayland_output_repaint_pixman(struct weston_output *output_base, pixman_region32_t *damage) { struct wayland_output *output = (struct wayland_output *) output_base; struct wayland_backend *b = (struct wayland_backend *)output->base.compositor->backend; struct wl_callback *callback; struct wayland_shm_buffer *sb; if (output->frame) { if (frame_status(output->frame) & FRAME_STATUS_REPAINT) wl_list_for_each(sb, &output->shm.buffers, link) sb->frame_damaged = 1; } wl_list_for_each(sb, &output->shm.buffers, link) pixman_region32_union(&sb->damage, &sb->damage, damage); sb = wayland_output_get_shm_buffer(output); wayland_output_update_shm_border(sb); pixman_renderer_output_set_buffer(output_base, sb->pm_image); b->compositor->renderer->repaint_output(output_base, &sb->damage); wayland_shm_buffer_attach(sb); callback = wl_surface_frame(output->parent.surface); wl_callback_add_listener(callback, &frame_listener, output); wl_surface_commit(output->parent.surface); wl_display_flush(b->parent.wl_display); pixman_region32_fini(&sb->damage); pixman_region32_init(&sb->damage); sb->frame_damaged = 0; pixman_region32_subtract(&b->compositor->primary_plane.damage, &b->compositor->primary_plane.damage, damage); return 0; } static void wayland_output_destroy(struct weston_output *output_base) { struct wayland_output *output = (struct wayland_output *) output_base; struct wayland_backend *b = (struct wayland_backend *) output->base.compositor->backend; if (b->use_pixman) { pixman_renderer_output_destroy(output_base); } else { gl_renderer->output_destroy(output_base); } wl_egl_window_destroy(output->gl.egl_window); wl_surface_destroy(output->parent.surface); if (output->parent.shell_surface) wl_shell_surface_destroy(output->parent.shell_surface); if (output->frame) frame_destroy(output->frame); cairo_surface_destroy(output->gl.border.top); cairo_surface_destroy(output->gl.border.left); cairo_surface_destroy(output->gl.border.right); cairo_surface_destroy(output->gl.border.bottom); weston_output_destroy(&output->base); free(output); return; } static const struct wl_shell_surface_listener shell_surface_listener; static int wayland_output_init_gl_renderer(struct wayland_output *output) { int32_t fwidth = 0, fheight = 0; if (output->frame) { fwidth = frame_width(output->frame); fheight = frame_height(output->frame); } else { fwidth = output->base.current_mode->width; fheight = output->base.current_mode->height; } output->gl.egl_window = wl_egl_window_create(output->parent.surface, fwidth, fheight); if (!output->gl.egl_window) { weston_log("failure to create wl_egl_window\n"); return -1; } if (gl_renderer->output_create(&output->base, output->gl.egl_window, output->gl.egl_window, gl_renderer->alpha_attribs, NULL, 0) < 0) goto cleanup_window; return 0; cleanup_window: wl_egl_window_destroy(output->gl.egl_window); return -1; } static int wayland_output_init_pixman_renderer(struct wayland_output *output) { return pixman_renderer_output_create(&output->base); } static void wayland_output_resize_surface(struct wayland_output *output) { struct wayland_backend *b = (struct wayland_backend *)output->base.compositor->backend; struct wayland_shm_buffer *buffer, *next; int32_t ix, iy, iwidth, iheight; int32_t width, height; struct wl_region *region; width = output->base.current_mode->width; height = output->base.current_mode->height; if (output->frame) { frame_resize_inside(output->frame, width, height); frame_input_rect(output->frame, &ix, &iy, &iwidth, &iheight); region = wl_compositor_create_region(b->parent.compositor); wl_region_add(region, ix, iy, iwidth, iheight); wl_surface_set_input_region(output->parent.surface, region); wl_region_destroy(region); frame_opaque_rect(output->frame, &ix, &iy, &iwidth, &iheight); region = wl_compositor_create_region(b->parent.compositor); wl_region_add(region, ix, iy, iwidth, iheight); wl_surface_set_opaque_region(output->parent.surface, region); wl_region_destroy(region); width = frame_width(output->frame); height = frame_height(output->frame); } else { region = wl_compositor_create_region(b->parent.compositor); wl_region_add(region, 0, 0, width, height); wl_surface_set_input_region(output->parent.surface, region); wl_region_destroy(region); region = wl_compositor_create_region(b->parent.compositor); wl_region_add(region, 0, 0, width, height); wl_surface_set_opaque_region(output->parent.surface, region); wl_region_destroy(region); } if (output->gl.egl_window) { wl_egl_window_resize(output->gl.egl_window, width, height, 0, 0); /* These will need to be re-created due to the resize */ gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_TOP, 0, 0, 0, NULL); cairo_surface_destroy(output->gl.border.top); output->gl.border.top = NULL; gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_LEFT, 0, 0, 0, NULL); cairo_surface_destroy(output->gl.border.left); output->gl.border.left = NULL; gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_RIGHT, 0, 0, 0, NULL); cairo_surface_destroy(output->gl.border.right); output->gl.border.right = NULL; gl_renderer->output_set_border(&output->base, GL_RENDERER_BORDER_BOTTOM, 0, 0, 0, NULL); cairo_surface_destroy(output->gl.border.bottom); output->gl.border.bottom = NULL; } /* Throw away any remaining SHM buffers */ wl_list_for_each_safe(buffer, next, &output->shm.free_buffers, free_link) wayland_shm_buffer_destroy(buffer); /* These will get thrown away when they get released */ wl_list_for_each(buffer, &output->shm.buffers, link) buffer->output = NULL; } static int wayland_output_set_windowed(struct wayland_output *output) { struct wayland_backend *b = (struct wayland_backend *)output->base.compositor->backend; int tlen; char *title; if (output->frame) return 0; if (output->name) { tlen = strlen(output->name) + strlen(WINDOW_TITLE " - "); title = malloc(tlen + 1); if (!title) return -1; snprintf(title, tlen + 1, WINDOW_TITLE " - %s", output->name); } else { title = strdup(WINDOW_TITLE); } if (!b->theme) { b->theme = theme_create(); if (!b->theme) { free(title); return -1; } } output->frame = frame_create(b->theme, 100, 100, FRAME_BUTTON_CLOSE, title); free(title); if (!output->frame) return -1; if (output->keyboard_count) frame_set_flag(output->frame, FRAME_FLAG_ACTIVE); wayland_output_resize_surface(output); wl_shell_surface_set_toplevel(output->parent.shell_surface); return 0; } static void wayland_output_set_fullscreen(struct wayland_output *output, enum wl_shell_surface_fullscreen_method method, uint32_t framerate, struct wl_output *target) { struct wayland_backend *b = (struct wayland_backend *)output->base.compositor->backend; if (output->frame) { frame_destroy(output->frame); output->frame = NULL; } wayland_output_resize_surface(output); if (output->parent.shell_surface) { wl_shell_surface_set_fullscreen(output->parent.shell_surface, method, framerate, target); } else if (b->parent.fshell) { _wl_fullscreen_shell_present_surface(b->parent.fshell, output->parent.surface, method, target); } } static struct weston_mode * wayland_output_choose_mode(struct wayland_output *output, struct weston_mode *ref_mode) { struct weston_mode *mode; /* First look for an exact match */ wl_list_for_each(mode, &output->base.mode_list, link) if (mode->width == ref_mode->width && mode->height == ref_mode->height && mode->refresh == ref_mode->refresh) return mode; /* If we can't find an exact match, ignore refresh and try again */ wl_list_for_each(mode, &output->base.mode_list, link) if (mode->width == ref_mode->width && mode->height == ref_mode->height) return mode; /* Yeah, we failed */ return NULL; } enum mode_status { MODE_STATUS_UNKNOWN, MODE_STATUS_SUCCESS, MODE_STATUS_FAIL, MODE_STATUS_CANCEL, }; static void mode_feedback_successful(void *data, struct _wl_fullscreen_shell_mode_feedback *fb) { enum mode_status *value = data; printf("Mode switch successful\n"); *value = MODE_STATUS_SUCCESS; } static void mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb) { enum mode_status *value = data; printf("Mode switch failed\n"); *value = MODE_STATUS_FAIL; } static void mode_feedback_cancelled(void *data, struct _wl_fullscreen_shell_mode_feedback *fb) { enum mode_status *value = data; printf("Mode switch cancelled\n"); *value = MODE_STATUS_CANCEL; } struct _wl_fullscreen_shell_mode_feedback_listener mode_feedback_listener = { mode_feedback_successful, mode_feedback_failed, mode_feedback_cancelled, }; static int wayland_output_switch_mode(struct weston_output *output_base, struct weston_mode *mode) { struct wayland_output *output = (struct wayland_output *) output_base; struct wayland_backend *b; struct wl_surface *old_surface; struct weston_mode *old_mode; struct _wl_fullscreen_shell_mode_feedback *mode_feedback; enum mode_status mode_status; int ret = 0; if (output_base == NULL) { weston_log("output is NULL.\n"); return -1; } if (mode == NULL) { weston_log("mode is NULL.\n"); return -1; } b = (struct wayland_backend *)output_base->compositor->backend; if (output->parent.shell_surface || !b->parent.fshell) return -1; mode = wayland_output_choose_mode(output, mode); if (mode == NULL) return -1; if (output->base.current_mode == mode) return 0; old_mode = output->base.current_mode; old_surface = output->parent.surface; output->base.current_mode = mode; output->parent.surface = wl_compositor_create_surface(b->parent.compositor); wl_surface_set_user_data(output->parent.surface, output); /* Blow the old buffers because we changed size/surfaces */ wayland_output_resize_surface(output); mode_feedback = _wl_fullscreen_shell_present_surface_for_mode(b->parent.fshell, output->parent.surface, output->parent.output, mode->refresh); _wl_fullscreen_shell_mode_feedback_add_listener(mode_feedback, &mode_feedback_listener, &mode_status); /* This should kick-start things again */ output->parent.draw_initial_frame = 1; wayland_output_start_repaint_loop(&output->base); mode_status = MODE_STATUS_UNKNOWN; while (mode_status == MODE_STATUS_UNKNOWN && ret >= 0) ret = wl_display_dispatch(b->parent.wl_display); _wl_fullscreen_shell_mode_feedback_destroy(mode_feedback); if (mode_status == MODE_STATUS_FAIL) { output->base.current_mode = old_mode; wl_surface_destroy(output->parent.surface); output->parent.surface = old_surface; wayland_output_resize_surface(output); return -1; } old_mode->flags &= ~WL_OUTPUT_MODE_CURRENT; output->base.current_mode->flags |= WL_OUTPUT_MODE_CURRENT; if (b->use_pixman) { pixman_renderer_output_destroy(output_base); if (wayland_output_init_pixman_renderer(output) < 0) goto err_output; } else { gl_renderer->output_destroy(output_base); wl_egl_window_destroy(output->gl.egl_window); if (wayland_output_init_gl_renderer(output) < 0) goto err_output; } wl_surface_destroy(old_surface); weston_output_schedule_repaint(&output->base); return 0; err_output: /* XXX */ return -1; } static struct wayland_output * wayland_output_create(struct wayland_backend *b, int x, int y, int width, int height, const char *name, int fullscreen, uint32_t transform, int32_t scale) { struct wayland_output *output; int output_width, output_height; weston_log("Creating %dx%d wayland output at (%d, %d)\n", width, height, x, y); output = zalloc(sizeof *output); if (output == NULL) return NULL; output->name = name ? strdup(name) : NULL; output->base.make = "waywayland"; output->base.model = "none"; output_width = width * scale; output_height = height * scale; output->parent.surface = wl_compositor_create_surface(b->parent.compositor); if (!output->parent.surface) goto err_name; wl_surface_set_user_data(output->parent.surface, output); output->parent.draw_initial_frame = 1; if (b->parent.shell) { output->parent.shell_surface = wl_shell_get_shell_surface(b->parent.shell, output->parent.surface); if (!output->parent.shell_surface) goto err_surface; wl_shell_surface_add_listener(output->parent.shell_surface, &shell_surface_listener, output); } if (fullscreen && b->parent.shell) { wl_shell_surface_set_fullscreen(output->parent.shell_surface, 0, 0, NULL); wl_display_roundtrip(b->parent.wl_display); if (!width) output_width = output->parent.configure_width; if (!height) output_height = output->parent.configure_height; } output->mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; output->mode.width = output_width; output->mode.height = output_height; output->mode.refresh = 60000; output->scale = scale; wl_list_init(&output->base.mode_list); wl_list_insert(&output->base.mode_list, &output->mode.link); output->base.current_mode = &output->mode; wl_list_init(&output->shm.buffers); wl_list_init(&output->shm.free_buffers); weston_output_init(&output->base, b->compositor, x, y, width, height, transform, scale); if (b->use_pixman) { if (wayland_output_init_pixman_renderer(output) < 0) goto err_output; output->base.repaint = wayland_output_repaint_pixman; } else { if (wayland_output_init_gl_renderer(output) < 0) goto err_output; output->base.repaint = wayland_output_repaint_gl; } output->base.start_repaint_loop = wayland_output_start_repaint_loop; output->base.destroy = wayland_output_destroy; output->base.assign_planes = NULL; output->base.set_backlight = NULL; output->base.set_dpms = NULL; output->base.switch_mode = wayland_output_switch_mode; weston_compositor_add_output(b->compositor, &output->base); return output; err_output: weston_output_destroy(&output->base); if (output->parent.shell_surface) wl_shell_surface_destroy(output->parent.shell_surface); err_surface: wl_surface_destroy(output->parent.surface); err_name: free(output->name); /* FIXME: cleanup weston_output */ free(output); return NULL; } static struct wayland_output * wayland_output_create_for_config(struct wayland_backend *b, struct weston_config_section *config_section, int option_width, int option_height, int option_scale, int32_t x, int32_t y) { struct wayland_output *output; char *mode, *t, *name, *str; int width, height, scale; uint32_t transform; unsigned int slen; weston_config_section_get_string(config_section, "name", &name, NULL); if (name) { slen = strlen(name); slen += strlen(WINDOW_TITLE " - "); str = malloc(slen + 1); if (str) snprintf(str, slen + 1, WINDOW_TITLE " - %s", name); free(name); name = str; } if (!name) name = strdup(WINDOW_TITLE); weston_config_section_get_string(config_section, "mode", &mode, "1024x600"); if (sscanf(mode, "%dx%d", &width, &height) != 2) { weston_log("Invalid mode \"%s\" for output %s\n", mode, name); width = 1024; height = 640; } free(mode); if (option_width) width = option_width; if (option_height) height = option_height; weston_config_section_get_int(config_section, "scale", &scale, 1); if (option_scale) scale = option_scale; weston_config_section_get_string(config_section, "transform", &t, "normal"); if (weston_parse_transform(t, &transform) < 0) weston_log("Invalid transform \"%s\" for output %s\n", t, name); free(t); output = wayland_output_create(b, x, y, width, height, name, 0, transform, scale); free(name); return output; } static struct wayland_output * wayland_output_create_for_parent_output(struct wayland_backend *b, struct wayland_parent_output *poutput) { struct wayland_output *output; struct weston_mode *mode; int32_t x; if (poutput->current_mode) { mode = poutput->current_mode; } else if (poutput->preferred_mode) { mode = poutput->preferred_mode; } else if (!wl_list_empty(&poutput->mode_list)) { mode = container_of(poutput->mode_list.next, struct weston_mode, link); } else { weston_log("No valid modes found. Skipping output"); return NULL; } if (!wl_list_empty(&b->compositor->output_list)) { output = container_of(b->compositor->output_list.prev, struct wayland_output, base.link); x = output->base.x + output->base.current_mode->width; } else { x = 0; } output = wayland_output_create(b, x, 0, mode->width, mode->height, NULL, 0, WL_OUTPUT_TRANSFORM_NORMAL, 1); if (!output) return NULL; output->parent.output = poutput->global; output->base.make = poutput->physical.make; output->base.model = poutput->physical.model; wl_list_init(&output->base.mode_list); wl_list_insert_list(&output->base.mode_list, &poutput->mode_list); wl_list_init(&poutput->mode_list); wayland_output_set_fullscreen(output, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER, mode->refresh, poutput->global); if (output->parent.shell_surface) { wl_shell_surface_set_fullscreen(output->parent.shell_surface, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER, mode->refresh, poutput->global); } else if (b->parent.fshell) { _wl_fullscreen_shell_present_surface(b->parent.fshell, output->parent.surface, _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER, poutput->global); _wl_fullscreen_shell_mode_feedback_destroy( _wl_fullscreen_shell_present_surface_for_mode(b->parent.fshell, output->parent.surface, poutput->global, mode->refresh)); } return output; } static void shell_surface_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial) { wl_shell_surface_pong(shell_surface, serial); } static void shell_surface_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t edges, int32_t width, int32_t height) { struct wayland_output *output = data; output->parent.configure_width = width; output->parent.configure_height = height; /* FIXME: implement resizing */ } static void shell_surface_popup_done(void *data, struct wl_shell_surface *shell_surface) { } static const struct wl_shell_surface_listener shell_surface_listener = { shell_surface_ping, shell_surface_configure, shell_surface_popup_done }; /* Events received from the wayland-server this compositor is client of: */ /* parent input interface */ static void input_set_cursor(struct wayland_input *input) { struct wl_buffer *buffer; struct wl_cursor_image *image; if (!input->backend->cursor) return; /* Couldn't load the cursor. Can't set it */ image = input->backend->cursor->images[0]; buffer = wl_cursor_image_get_buffer(image); if (!buffer) return; wl_pointer_set_cursor(input->parent.pointer, input->enter_serial, input->parent.cursor.surface, image->hotspot_x, image->hotspot_y); wl_surface_attach(input->parent.cursor.surface, buffer, 0, 0); wl_surface_damage(input->parent.cursor.surface, 0, 0, image->width, image->height); wl_surface_commit(input->parent.cursor.surface); } static void input_handle_pointer_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y) { struct wayland_input *input = data; int32_t fx, fy; enum theme_location location; /* XXX: If we get a modifier event immediately before the focus, * we should try to keep the same serial. */ input->enter_serial = serial; input->output = wl_surface_get_user_data(surface); if (input->output->frame) { location = frame_pointer_enter(input->output->frame, input, wl_fixed_to_int(x), wl_fixed_to_int(y)); frame_interior(input->output->frame, &fx, &fy, NULL, NULL); x -= wl_fixed_from_int(fx); y -= wl_fixed_from_int(fy); if (frame_status(input->output->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&input->output->base); } else { location = THEME_LOCATION_CLIENT_AREA; } weston_output_transform_coordinate(&input->output->base, x, y, &x, &y); if (location == THEME_LOCATION_CLIENT_AREA) { input->focus = 1; notify_pointer_focus(&input->base, &input->output->base, x, y); wl_pointer_set_cursor(input->parent.pointer, input->enter_serial, NULL, 0, 0); } else { input->focus = 0; notify_pointer_focus(&input->base, NULL, 0, 0); input_set_cursor(input); } } static void input_handle_pointer_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) { struct wayland_input *input = data; if (!input->output) return; if (input->output->frame) { frame_pointer_leave(input->output->frame, input); if (frame_status(input->output->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&input->output->base); } notify_pointer_focus(&input->base, NULL, 0, 0); input->output = NULL; input->focus = 0; } static void input_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct wayland_input *input = data; int32_t fx, fy; enum theme_location location; if (!input->output) return; if (input->output->frame) { location = frame_pointer_motion(input->output->frame, input, wl_fixed_to_int(x), wl_fixed_to_int(y)); frame_interior(input->output->frame, &fx, &fy, NULL, NULL); x -= wl_fixed_from_int(fx); y -= wl_fixed_from_int(fy); if (frame_status(input->output->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&input->output->base); } else { location = THEME_LOCATION_CLIENT_AREA; } weston_output_transform_coordinate(&input->output->base, x, y, &x, &y); if (input->focus && location != THEME_LOCATION_CLIENT_AREA) { input_set_cursor(input); notify_pointer_focus(&input->base, NULL, 0, 0); input->focus = 0; } else if (!input->focus && location == THEME_LOCATION_CLIENT_AREA) { wl_pointer_set_cursor(input->parent.pointer, input->enter_serial, NULL, 0, 0); notify_pointer_focus(&input->base, &input->output->base, x, y); input->focus = 1; } if (location == THEME_LOCATION_CLIENT_AREA) notify_motion_absolute(&input->base, time, x, y); } static void input_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w) { struct wayland_input *input = data; enum wl_pointer_button_state state = state_w; enum frame_button_state fstate; enum theme_location location; if (!input->output) return; if (input->output->frame) { fstate = state == WL_POINTER_BUTTON_STATE_PRESSED ? FRAME_BUTTON_PRESSED : FRAME_BUTTON_RELEASED; location = frame_pointer_button(input->output->frame, input, button, fstate); if (frame_status(input->output->frame) & FRAME_STATUS_MOVE) { wl_shell_surface_move(input->output->parent.shell_surface, input->parent.seat, serial); frame_status_clear(input->output->frame, FRAME_STATUS_MOVE); return; } if (frame_status(input->output->frame) & FRAME_STATUS_CLOSE) { wayland_output_destroy(&input->output->base); input->output = NULL; input->keyboard_focus = NULL; if (wl_list_empty(&input->backend->compositor->output_list)) weston_compositor_exit(input->backend->compositor); return; } if (frame_status(input->output->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&input->output->base); } else { location = THEME_LOCATION_CLIENT_AREA; } if (location == THEME_LOCATION_CLIENT_AREA) notify_button(&input->base, time, button, state); } static void input_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct wayland_input *input = data; notify_axis(&input->base, time, axis, value); } static const struct wl_pointer_listener pointer_listener = { input_handle_pointer_enter, input_handle_pointer_leave, input_handle_motion, input_handle_button, input_handle_axis, }; static void input_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { struct wayland_input *input = data; struct xkb_keymap *keymap; char *map_str; if (!data) { close(fd); return; } if (format == WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (map_str == MAP_FAILED) { weston_log("mmap failed: %m\n"); goto error; } keymap = xkb_keymap_new_from_string(input->backend->compositor->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(map_str, size); if (!keymap) { weston_log("failed to compile keymap\n"); goto error; } input->keyboard_state_update = STATE_UPDATE_NONE; } else if (format == WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP) { weston_log("No keymap provided; falling back to defalt\n"); keymap = NULL; input->keyboard_state_update = STATE_UPDATE_AUTOMATIC; } else { weston_log("Invalid keymap\n"); goto error; } close(fd); if (weston_seat_get_keyboard(&input->base)) weston_seat_update_keymap(&input->base, keymap); else weston_seat_init_keyboard(&input->base, keymap); xkb_keymap_unref(keymap); return; error: wl_keyboard_release(input->parent.keyboard); close(fd); } static void input_handle_keyboard_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { struct wayland_input *input = data; struct wayland_output *focus; focus = input->keyboard_focus; if (focus) { /* This shouldn't happen */ focus->keyboard_count--; if (!focus->keyboard_count && focus->frame) frame_unset_flag(focus->frame, FRAME_FLAG_ACTIVE); if (frame_status(focus->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&focus->base); } input->keyboard_focus = wl_surface_get_user_data(surface); input->keyboard_focus->keyboard_count++; focus = input->keyboard_focus; if (focus->frame) { frame_set_flag(focus->frame, FRAME_FLAG_ACTIVE); if (frame_status(focus->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&focus->base); } /* XXX: If we get a modifier event immediately before the focus, * we should try to keep the same serial. */ notify_keyboard_focus_in(&input->base, keys, STATE_UPDATE_AUTOMATIC); } static void input_handle_keyboard_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { struct wayland_input *input = data; struct wayland_output *focus; notify_keyboard_focus_out(&input->base); focus = input->keyboard_focus; if (!focus) return; focus->keyboard_count--; if (!focus->keyboard_count && focus->frame) { frame_unset_flag(focus->frame, FRAME_FLAG_ACTIVE); if (frame_status(focus->frame) & FRAME_STATUS_REPAINT) weston_output_schedule_repaint(&focus->base); } input->keyboard_focus = NULL; } static void input_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { struct wayland_input *input = data; input->key_serial = serial; notify_key(&input->base, time, key, state ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED, input->keyboard_state_update); } static void input_handle_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial_in, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct weston_keyboard *keyboard; struct wayland_input *input = data; struct wayland_backend *b = input->backend; uint32_t serial_out; /* If we get a key event followed by a modifier event with the * same serial number, then we try to preserve those semantics by * reusing the same serial number on the way out too. */ if (serial_in == input->key_serial) serial_out = wl_display_get_serial(b->compositor->wl_display); else serial_out = wl_display_next_serial(b->compositor->wl_display); keyboard = weston_seat_get_keyboard(&input->base); xkb_state_update_mask(keyboard->xkb_state.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); notify_modifiers(&input->base, serial_out); } static void input_handle_repeat_info(void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay) { struct wayland_input *input = data; struct wayland_backend *b = input->backend; b->compositor->kb_repeat_rate = rate; b->compositor->kb_repeat_delay = delay; } static const struct wl_keyboard_listener keyboard_listener = { input_handle_keymap, input_handle_keyboard_enter, input_handle_keyboard_leave, input_handle_key, input_handle_modifiers, input_handle_repeat_info, }; static void input_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { struct wayland_input *input = data; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->parent.pointer) { input->parent.pointer = wl_seat_get_pointer(seat); wl_pointer_set_user_data(input->parent.pointer, input); wl_pointer_add_listener(input->parent.pointer, &pointer_listener, input); weston_seat_init_pointer(&input->base); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->parent.pointer) { wl_pointer_destroy(input->parent.pointer); input->parent.pointer = NULL; } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->parent.keyboard) { input->parent.keyboard = wl_seat_get_keyboard(seat); wl_keyboard_set_user_data(input->parent.keyboard, input); wl_keyboard_add_listener(input->parent.keyboard, &keyboard_listener, input); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->parent.keyboard) { wl_keyboard_destroy(input->parent.keyboard); input->parent.keyboard = NULL; } } static void input_handle_name(void *data, struct wl_seat *seat, const char *name) { } static const struct wl_seat_listener seat_listener = { input_handle_capabilities, input_handle_name, }; static void display_add_seat(struct wayland_backend *b, uint32_t id, uint32_t version) { struct wayland_input *input; input = zalloc(sizeof *input); if (input == NULL) return; weston_seat_init(&input->base, b->compositor, "default"); input->backend = b; input->parent.seat = wl_registry_bind(b->parent.registry, id, &wl_seat_interface, MIN(version, 4)); wl_list_insert(b->input_list.prev, &input->link); wl_seat_add_listener(input->parent.seat, &seat_listener, input); wl_seat_set_user_data(input->parent.seat, input); input->parent.cursor.surface = wl_compositor_create_surface(b->parent.compositor); } static void wayland_parent_output_geometry(void *data, struct wl_output *output_proxy, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform) { struct wayland_parent_output *output = data; output->x = x; output->y = y; output->physical.width = physical_width; output->physical.height = physical_height; output->physical.subpixel = subpixel; free(output->physical.make); output->physical.make = strdup(make); free(output->physical.model); output->physical.model = strdup(model); output->transform = transform; } static struct weston_mode * find_mode(struct wl_list *list, int32_t width, int32_t height, uint32_t refresh) { struct weston_mode *mode; wl_list_for_each(mode, list, link) { if (mode->width == width && mode->height == height && mode->refresh == refresh) return mode; } mode = zalloc(sizeof *mode); if (!mode) return NULL; mode->width = width; mode->height = height; mode->refresh = refresh; wl_list_insert(list, &mode->link); return mode; } static void wayland_parent_output_mode(void *data, struct wl_output *wl_output_proxy, uint32_t flags, int32_t width, int32_t height, int32_t refresh) { struct wayland_parent_output *output = data; struct weston_mode *mode; if (output->output) { mode = find_mode(&output->output->base.mode_list, width, height, refresh); if (!mode) return; mode->flags = flags; /* Do a mode-switch on current mode change? */ } else { mode = find_mode(&output->mode_list, width, height, refresh); if (!mode) return; mode->flags = flags; if (flags & WL_OUTPUT_MODE_CURRENT) output->current_mode = mode; if (flags & WL_OUTPUT_MODE_PREFERRED) output->preferred_mode = mode; } } static const struct wl_output_listener output_listener = { wayland_parent_output_geometry, wayland_parent_output_mode }; static void wayland_backend_register_output(struct wayland_backend *b, uint32_t id) { struct wayland_parent_output *output; output = zalloc(sizeof *output); if (!output) return; output->id = id; output->global = wl_registry_bind(b->parent.registry, id, &wl_output_interface, 1); if (!output->global) { free(output); return; } wl_output_add_listener(output->global, &output_listener, output); output->scale = 0; output->transform = WL_OUTPUT_TRANSFORM_NORMAL; output->physical.subpixel = WL_OUTPUT_SUBPIXEL_UNKNOWN; wl_list_init(&output->mode_list); wl_list_insert(&b->parent.output_list, &output->link); if (b->sprawl_across_outputs) { wl_display_roundtrip(b->parent.wl_display); wayland_output_create_for_parent_output(b, output); } } static void wayland_parent_output_destroy(struct wayland_parent_output *output) { struct weston_mode *mode, *next; if (output->output) wayland_output_destroy(&output->output->base); wl_output_destroy(output->global); free(output->physical.make); free(output->physical.model); wl_list_for_each_safe(mode, next, &output->mode_list, link) { wl_list_remove(&mode->link); free(mode); } } static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct wayland_backend *b = data; if (strcmp(interface, "wl_compositor") == 0) { b->parent.compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { b->parent.shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) { b->parent.fshell = wl_registry_bind(registry, name, &_wl_fullscreen_shell_interface, 1); } else if (strcmp(interface, "wl_seat") == 0) { display_add_seat(b, name, version); } else if (strcmp(interface, "wl_output") == 0) { wayland_backend_register_output(b, name); } else if (strcmp(interface, "wl_shm") == 0) { b->parent.shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { struct wayland_backend *b = data; struct wayland_parent_output *output; wl_list_for_each(output, &b->parent.output_list, link) if (output->id == name) wayland_parent_output_destroy(output); } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static int wayland_backend_handle_event(int fd, uint32_t mask, void *data) { struct wayland_backend *b = data; int count = 0; if ((mask & WL_EVENT_HANGUP) || (mask & WL_EVENT_ERROR)) { weston_compositor_exit(b->compositor); return 0; } if (mask & WL_EVENT_READABLE) count = wl_display_dispatch(b->parent.wl_display); if (mask & WL_EVENT_WRITABLE) wl_display_flush(b->parent.wl_display); if (mask == 0) { count = wl_display_dispatch_pending(b->parent.wl_display); wl_display_flush(b->parent.wl_display); } return count; } static void wayland_restore(struct weston_compositor *ec) { } static void wayland_destroy(struct weston_compositor *ec) { struct wayland_backend *b = (struct wayland_backend *) ec->backend; weston_compositor_shutdown(ec); if (b->parent.shm) wl_shm_destroy(b->parent.shm); free(b); } static const char *left_ptrs[] = { "left_ptr", "default", "top_left_arrow", "left-arrow" }; static void create_cursor(struct wayland_backend *b, struct weston_config *config) { struct weston_config_section *s; int size; char *theme = NULL; unsigned int i; s = weston_config_get_section(config, "shell", NULL, NULL); weston_config_section_get_string(s, "cursor-theme", &theme, NULL); weston_config_section_get_int(s, "cursor-size", &size, 32); b->cursor_theme = wl_cursor_theme_load(theme, size, b->parent.shm); if (!b->cursor_theme) { fprintf(stderr, "could not load cursor theme\n"); return; } free(theme); b->cursor = NULL; for (i = 0; !b->cursor && i < ARRAY_LENGTH(left_ptrs); ++i) b->cursor = wl_cursor_theme_get_cursor(b->cursor_theme, left_ptrs[i]); if (!b->cursor) { fprintf(stderr, "could not load left cursor\n"); return; } } static void fullscreen_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct wayland_backend *b = data; struct wayland_input *input = NULL; wl_list_for_each(input, &b->input_list, link) if (&input->base == keyboard->seat) break; if (!input || !input->output) return; if (input->output->frame) wayland_output_set_fullscreen(input->output, 0, 0, NULL); else wayland_output_set_windowed(input->output); weston_output_schedule_repaint(&input->output->base); } static struct wayland_backend * wayland_backend_create(struct weston_compositor *compositor, int use_pixman, const char *display_name, int *argc, char *argv[], struct weston_config *config) { struct wayland_backend *b; struct wl_event_loop *loop; int fd; b = zalloc(sizeof *b); if (b == NULL) return NULL; b->compositor = compositor; if (weston_compositor_set_presentation_clock_software(compositor) < 0) goto err_compositor; b->parent.wl_display = wl_display_connect(display_name); if (b->parent.wl_display == NULL) { weston_log("failed to create display: %m\n"); goto err_compositor; } wl_list_init(&b->parent.output_list); wl_list_init(&b->input_list); b->parent.registry = wl_display_get_registry(b->parent.wl_display); wl_registry_add_listener(b->parent.registry, ®istry_listener, b); wl_display_roundtrip(b->parent.wl_display); create_cursor(b, config); b->use_pixman = use_pixman; if (!b->use_pixman) { gl_renderer = weston_load_module("gl-renderer.so", "gl_renderer_interface"); if (!gl_renderer) b->use_pixman = 1; } if (!b->use_pixman) { if (gl_renderer->create(compositor, EGL_PLATFORM_WAYLAND_KHR, b->parent.wl_display, gl_renderer->alpha_attribs, NULL, 0) < 0) { weston_log("Failed to initialize the GL renderer; " "falling back to pixman.\n"); b->use_pixman = 1; } } if (b->use_pixman) { if (pixman_renderer_init(compositor) < 0) { weston_log("Failed to initialize pixman renderer\n"); goto err_display; } } b->base.destroy = wayland_destroy; b->base.restore = wayland_restore; loop = wl_display_get_event_loop(compositor->wl_display); fd = wl_display_get_fd(b->parent.wl_display); b->parent.wl_source = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, wayland_backend_handle_event, b); if (b->parent.wl_source == NULL) goto err_display; wl_event_source_check(b->parent.wl_source); compositor->backend = &b->base; return b; err_display: wl_display_disconnect(b->parent.wl_display); err_compositor: weston_compositor_shutdown(compositor); free(b); return NULL; } static void wayland_backend_destroy(struct wayland_backend *b) { wl_display_disconnect(b->parent.wl_display); if (b->theme) theme_destroy(b->theme); if (b->frame_device) cairo_device_destroy(b->frame_device); wl_cursor_theme_destroy(b->cursor_theme); weston_compositor_shutdown(b->compositor); free(b); } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config) { struct wayland_backend *b; struct wayland_output *output; struct wayland_parent_output *poutput; struct weston_config_section *section; int x, count, width, height, scale, use_pixman, fullscreen, sprawl; const char *section_name, *display_name; char *name; const struct weston_option wayland_options[] = { { WESTON_OPTION_INTEGER, "width", 0, &width }, { WESTON_OPTION_INTEGER, "height", 0, &height }, { WESTON_OPTION_INTEGER, "scale", 0, &scale }, { WESTON_OPTION_STRING, "display", 0, &display_name }, { WESTON_OPTION_BOOLEAN, "use-pixman", 0, &use_pixman }, { WESTON_OPTION_INTEGER, "output-count", 0, &count }, { WESTON_OPTION_BOOLEAN, "fullscreen", 0, &fullscreen }, { WESTON_OPTION_BOOLEAN, "sprawl", 0, &sprawl }, }; width = 0; height = 0; scale = 0; display_name = NULL; use_pixman = 0; count = 1; fullscreen = 0; sprawl = 0; parse_options(wayland_options, ARRAY_LENGTH(wayland_options), argc, argv); b = wayland_backend_create(compositor, use_pixman, display_name, argc, argv, config); if (!b) return -1; if (sprawl || b->parent.fshell) { b->sprawl_across_outputs = 1; wl_display_roundtrip(b->parent.wl_display); wl_list_for_each(poutput, &b->parent.output_list, link) wayland_output_create_for_parent_output(b, poutput); return 0; } if (fullscreen) { output = wayland_output_create(b, 0, 0, width, height, NULL, 1, 0, 1); if (!output) goto err_outputs; wayland_output_set_fullscreen(output, 0, 0, NULL); return 0; } section = NULL; x = 0; while (weston_config_next_section(config, §ion, §ion_name)) { if (!section_name || strcmp(section_name, "output") != 0) continue; weston_config_section_get_string(section, "name", &name, NULL); if (name == NULL) continue; if (name[0] != 'W' || name[1] != 'L') { free(name); continue; } free(name); output = wayland_output_create_for_config(b, section, width, height, scale, x, 0); if (!output) goto err_outputs; if (wayland_output_set_windowed(output)) goto err_outputs; x += output->base.width; --count; } if (!width) width = 1024; if (!height) height = 640; if (!scale) scale = 1; while (count > 0) { output = wayland_output_create(b, x, 0, width, height, NULL, 0, 0, scale); if (!output) goto err_outputs; if (wayland_output_set_windowed(output)) goto err_outputs; x += width; --count; } weston_compositor_add_key_binding(compositor, KEY_F, MODIFIER_CTRL | MODIFIER_ALT, fullscreen_binding, b); return 0; err_outputs: wayland_backend_destroy(b); return -1; } weston-1.9.0/src/vaapi-recorder.c0000664000175000017500000006635712537627703013656 00000000000000/* * Copyright (c) 2012 Intel Corporation. All Rights Reserved. * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "vaapi-recorder.h" #define NAL_REF_IDC_NONE 0 #define NAL_REF_IDC_LOW 1 #define NAL_REF_IDC_MEDIUM 2 #define NAL_REF_IDC_HIGH 3 #define NAL_NON_IDR 1 #define NAL_IDR 5 #define NAL_SPS 7 #define NAL_PPS 8 #define NAL_SEI 6 #define SLICE_TYPE_P 0 #define SLICE_TYPE_B 1 #define SLICE_TYPE_I 2 #define ENTROPY_MODE_CAVLC 0 #define ENTROPY_MODE_CABAC 1 #define PROFILE_IDC_BASELINE 66 #define PROFILE_IDC_MAIN 77 #define PROFILE_IDC_HIGH 100 struct vaapi_recorder { int drm_fd, output_fd; int width, height; int frame_count; int error; int destroying; pthread_t worker_thread; pthread_mutex_t mutex; pthread_cond_t input_cond; struct { int valid; int prime_fd, stride; } input; VADisplay va_dpy; /* video post processing is used for colorspace conversion */ struct { VAConfigID cfg; VAContextID ctx; VABufferID pipeline_buf; VASurfaceID output; } vpp; struct { VAConfigID cfg; VAContextID ctx; VASurfaceID reference_picture[3]; int intra_period; int output_size; int constraint_set_flag; struct { VAEncSequenceParameterBufferH264 seq; VAEncPictureParameterBufferH264 pic; VAEncSliceParameterBufferH264 slice; } param; } encoder; }; static void * worker_thread_function(void *); /* bistream code used for writing the packed headers */ #define BITSTREAM_ALLOCATE_STEPPING 4096 struct bitstream { unsigned int *buffer; int bit_offset; int max_size_in_dword; }; static unsigned int va_swap32(unsigned int val) { unsigned char *pval = (unsigned char *)&val; return ((pval[0] << 24) | (pval[1] << 16) | (pval[2] << 8) | (pval[3] << 0)); } static void bitstream_start(struct bitstream *bs) { bs->max_size_in_dword = BITSTREAM_ALLOCATE_STEPPING; bs->buffer = calloc(bs->max_size_in_dword * sizeof(int), 1); bs->bit_offset = 0; } static void bitstream_end(struct bitstream *bs) { int pos = (bs->bit_offset >> 5); int bit_offset = (bs->bit_offset & 0x1f); int bit_left = 32 - bit_offset; if (bit_offset) { bs->buffer[pos] = va_swap32((bs->buffer[pos] << bit_left)); } } static void bitstream_put_ui(struct bitstream *bs, unsigned int val, int size_in_bits) { int pos = (bs->bit_offset >> 5); int bit_offset = (bs->bit_offset & 0x1f); int bit_left = 32 - bit_offset; if (!size_in_bits) return; bs->bit_offset += size_in_bits; if (bit_left > size_in_bits) { bs->buffer[pos] = (bs->buffer[pos] << size_in_bits | val); return; } size_in_bits -= bit_left; bs->buffer[pos] = (bs->buffer[pos] << bit_left) | (val >> size_in_bits); bs->buffer[pos] = va_swap32(bs->buffer[pos]); if (pos + 1 == bs->max_size_in_dword) { bs->max_size_in_dword += BITSTREAM_ALLOCATE_STEPPING; bs->buffer = realloc(bs->buffer, bs->max_size_in_dword * sizeof(unsigned int)); } bs->buffer[pos + 1] = val; } static void bitstream_put_ue(struct bitstream *bs, unsigned int val) { int size_in_bits = 0; int tmp_val = ++val; while (tmp_val) { tmp_val >>= 1; size_in_bits++; } bitstream_put_ui(bs, 0, size_in_bits - 1); // leading zero bitstream_put_ui(bs, val, size_in_bits); } static void bitstream_put_se(struct bitstream *bs, int val) { unsigned int new_val; if (val <= 0) new_val = -2 * val; else new_val = 2 * val - 1; bitstream_put_ue(bs, new_val); } static void bitstream_byte_aligning(struct bitstream *bs, int bit) { int bit_offset = (bs->bit_offset & 0x7); int bit_left = 8 - bit_offset; int new_val; if (!bit_offset) return; if (bit) new_val = (1 << bit_left) - 1; else new_val = 0; bitstream_put_ui(bs, new_val, bit_left); } static VAStatus encoder_create_config(struct vaapi_recorder *r) { VAConfigAttrib attrib[2]; VAStatus status; /* FIXME: should check if VAEntrypointEncSlice is supported */ /* FIXME: should check if specified attributes are supported */ attrib[0].type = VAConfigAttribRTFormat; attrib[0].value = VA_RT_FORMAT_YUV420; attrib[1].type = VAConfigAttribRateControl; attrib[1].value = VA_RC_CQP; status = vaCreateConfig(r->va_dpy, VAProfileH264Main, VAEntrypointEncSlice, attrib, 2, &r->encoder.cfg); if (status != VA_STATUS_SUCCESS) return status; status = vaCreateContext(r->va_dpy, r->encoder.cfg, r->width, r->height, VA_PROGRESSIVE, 0, 0, &r->encoder.ctx); if (status != VA_STATUS_SUCCESS) { vaDestroyConfig(r->va_dpy, r->encoder.cfg); return status; } return VA_STATUS_SUCCESS; } static void encoder_destroy_config(struct vaapi_recorder *r) { vaDestroyContext(r->va_dpy, r->encoder.ctx); vaDestroyConfig(r->va_dpy, r->encoder.cfg); } static void encoder_init_seq_parameters(struct vaapi_recorder *r) { int width_in_mbs, height_in_mbs; int frame_cropping_flag = 0; int frame_crop_bottom_offset = 0; width_in_mbs = (r->width + 15) / 16; height_in_mbs = (r->height + 15) / 16; r->encoder.param.seq.level_idc = 41; r->encoder.param.seq.intra_period = r->encoder.intra_period; r->encoder.param.seq.max_num_ref_frames = 4; r->encoder.param.seq.picture_width_in_mbs = width_in_mbs; r->encoder.param.seq.picture_height_in_mbs = height_in_mbs; r->encoder.param.seq.seq_fields.bits.frame_mbs_only_flag = 1; /* Tc = num_units_in_tick / time_scale */ r->encoder.param.seq.time_scale = 1800; r->encoder.param.seq.num_units_in_tick = 15; if (height_in_mbs * 16 - r->height > 0) { frame_cropping_flag = 1; frame_crop_bottom_offset = (height_in_mbs * 16 - r->height) / 2; } r->encoder.param.seq.frame_cropping_flag = frame_cropping_flag; r->encoder.param.seq.frame_crop_bottom_offset = frame_crop_bottom_offset; r->encoder.param.seq.seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4 = 2; } static VABufferID encoder_update_seq_parameters(struct vaapi_recorder *r) { VABufferID seq_buf; VAStatus status; status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncSequenceParameterBufferType, sizeof(r->encoder.param.seq), 1, &r->encoder.param.seq, &seq_buf); if (status == VA_STATUS_SUCCESS) return seq_buf; else return VA_INVALID_ID; } static void encoder_init_pic_parameters(struct vaapi_recorder *r) { VAEncPictureParameterBufferH264 *pic = &r->encoder.param.pic; pic->pic_init_qp = 0; /* ENTROPY_MODE_CABAC */ pic->pic_fields.bits.entropy_coding_mode_flag = 1; pic->pic_fields.bits.deblocking_filter_control_present_flag = 1; } static VABufferID encoder_update_pic_parameters(struct vaapi_recorder *r, VABufferID output_buf) { VAEncPictureParameterBufferH264 *pic = &r->encoder.param.pic; VAStatus status; VABufferID pic_param_buf; VASurfaceID curr_pic, pic0; curr_pic = r->encoder.reference_picture[r->frame_count % 2]; pic0 = r->encoder.reference_picture[(r->frame_count + 1) % 2]; pic->CurrPic.picture_id = curr_pic; pic->CurrPic.TopFieldOrderCnt = r->frame_count * 2; pic->ReferenceFrames[0].picture_id = pic0; pic->ReferenceFrames[1].picture_id = r->encoder.reference_picture[2]; pic->ReferenceFrames[2].picture_id = VA_INVALID_ID; pic->coded_buf = output_buf; pic->frame_num = r->frame_count; pic->pic_fields.bits.idr_pic_flag = (r->frame_count == 0); pic->pic_fields.bits.reference_pic_flag = 1; status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncPictureParameterBufferType, sizeof(VAEncPictureParameterBufferH264), 1, pic, &pic_param_buf); if (status == VA_STATUS_SUCCESS) return pic_param_buf; else return VA_INVALID_ID; } static VABufferID encoder_update_slice_parameter(struct vaapi_recorder *r, int slice_type) { VABufferID slice_param_buf; VAStatus status; int width_in_mbs = (r->width + 15) / 16; int height_in_mbs = (r->height + 15) / 16; memset(&r->encoder.param.slice, 0, sizeof r->encoder.param.slice); r->encoder.param.slice.num_macroblocks = width_in_mbs * height_in_mbs; r->encoder.param.slice.slice_type = slice_type; r->encoder.param.slice.slice_alpha_c0_offset_div2 = 2; r->encoder.param.slice.slice_beta_offset_div2 = 2; status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncSliceParameterBufferType, sizeof(r->encoder.param.slice), 1, &r->encoder.param.slice, &slice_param_buf); if (status == VA_STATUS_SUCCESS) return slice_param_buf; else return VA_INVALID_ID; } static VABufferID encoder_update_misc_hdr_parameter(struct vaapi_recorder *r) { VAEncMiscParameterBuffer *misc_param; VAEncMiscParameterHRD *hrd; VABufferID buffer; VAStatus status; int total_size = sizeof(VAEncMiscParameterBuffer) + sizeof(VAEncMiscParameterRateControl); status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncMiscParameterBufferType, total_size, 1, NULL, &buffer); if (status != VA_STATUS_SUCCESS) return VA_INVALID_ID; status = vaMapBuffer(r->va_dpy, buffer, (void **) &misc_param); if (status != VA_STATUS_SUCCESS) { vaDestroyBuffer(r->va_dpy, buffer); return VA_INVALID_ID; } misc_param->type = VAEncMiscParameterTypeHRD; hrd = (VAEncMiscParameterHRD *) misc_param->data; hrd->initial_buffer_fullness = 0; hrd->buffer_size = 0; vaUnmapBuffer(r->va_dpy, buffer); return buffer; } static int setup_encoder(struct vaapi_recorder *r) { VAStatus status; status = encoder_create_config(r); if (status != VA_STATUS_SUCCESS) { return -1; } status = vaCreateSurfaces(r->va_dpy, VA_RT_FORMAT_YUV420, r->width, r->height, r->encoder.reference_picture, 3, NULL, 0); if (status != VA_STATUS_SUCCESS) { encoder_destroy_config(r); return -1; } /* VAProfileH264Main */ r->encoder.constraint_set_flag |= (1 << 1); /* Annex A.2.2 */ r->encoder.output_size = r->width * r->height; r->encoder.intra_period = 30; encoder_init_seq_parameters(r); encoder_init_pic_parameters(r); return 0; } static void encoder_destroy(struct vaapi_recorder *r) { vaDestroySurfaces(r->va_dpy, r->encoder.reference_picture, 3); encoder_destroy_config(r); } static void nal_start_code_prefix(struct bitstream *bs) { bitstream_put_ui(bs, 0x00000001, 32); } static void nal_header(struct bitstream *bs, int nal_ref_idc, int nal_unit_type) { /* forbidden_zero_bit: 0 */ bitstream_put_ui(bs, 0, 1); bitstream_put_ui(bs, nal_ref_idc, 2); bitstream_put_ui(bs, nal_unit_type, 5); } static void rbsp_trailing_bits(struct bitstream *bs) { bitstream_put_ui(bs, 1, 1); bitstream_byte_aligning(bs, 0); } static void sps_rbsp(struct bitstream *bs, VAEncSequenceParameterBufferH264 *seq, int constraint_set_flag) { int i; bitstream_put_ui(bs, PROFILE_IDC_MAIN, 8); /* constraint_set[0-3] flag */ for (i = 0; i < 4; i++) { int set = (constraint_set_flag & (1 << i)) ? 1 : 0; bitstream_put_ui(bs, set, 1); } /* reserved_zero_4bits */ bitstream_put_ui(bs, 0, 4); bitstream_put_ui(bs, seq->level_idc, 8); bitstream_put_ue(bs, seq->seq_parameter_set_id); bitstream_put_ue(bs, seq->seq_fields.bits.log2_max_frame_num_minus4); bitstream_put_ue(bs, seq->seq_fields.bits.pic_order_cnt_type); bitstream_put_ue(bs, seq->seq_fields.bits.log2_max_pic_order_cnt_lsb_minus4); bitstream_put_ue(bs, seq->max_num_ref_frames); /* gaps_in_frame_num_value_allowed_flag */ bitstream_put_ui(bs, 0, 1); /* pic_width_in_mbs_minus1, pic_height_in_map_units_minus1 */ bitstream_put_ue(bs, seq->picture_width_in_mbs - 1); bitstream_put_ue(bs, seq->picture_height_in_mbs - 1); bitstream_put_ui(bs, seq->seq_fields.bits.frame_mbs_only_flag, 1); bitstream_put_ui(bs, seq->seq_fields.bits.direct_8x8_inference_flag, 1); bitstream_put_ui(bs, seq->frame_cropping_flag, 1); if (seq->frame_cropping_flag) { bitstream_put_ue(bs, seq->frame_crop_left_offset); bitstream_put_ue(bs, seq->frame_crop_right_offset); bitstream_put_ue(bs, seq->frame_crop_top_offset); bitstream_put_ue(bs, seq->frame_crop_bottom_offset); } /* vui_parameters_present_flag */ bitstream_put_ui(bs, 1, 1); /* aspect_ratio_info_present_flag */ bitstream_put_ui(bs, 0, 1); /* overscan_info_present_flag */ bitstream_put_ui(bs, 0, 1); /* video_signal_type_present_flag */ bitstream_put_ui(bs, 0, 1); /* chroma_loc_info_present_flag */ bitstream_put_ui(bs, 0, 1); /* timing_info_present_flag */ bitstream_put_ui(bs, 1, 1); bitstream_put_ui(bs, seq->num_units_in_tick, 32); bitstream_put_ui(bs, seq->time_scale, 32); /* fixed_frame_rate_flag */ bitstream_put_ui(bs, 1, 1); /* nal_hrd_parameters_present_flag */ bitstream_put_ui(bs, 0, 1); /* vcl_hrd_parameters_present_flag */ bitstream_put_ui(bs, 0, 1); /* low_delay_hrd_flag */ bitstream_put_ui(bs, 0, 1); /* pic_struct_present_flag */ bitstream_put_ui(bs, 0, 1); /* bitstream_restriction_flag */ bitstream_put_ui(bs, 0, 1); rbsp_trailing_bits(bs); } static void pps_rbsp(struct bitstream *bs, VAEncPictureParameterBufferH264 *pic) { /* pic_parameter_set_id, seq_parameter_set_id */ bitstream_put_ue(bs, pic->pic_parameter_set_id); bitstream_put_ue(bs, pic->seq_parameter_set_id); bitstream_put_ui(bs, pic->pic_fields.bits.entropy_coding_mode_flag, 1); /* pic_order_present_flag: 0 */ bitstream_put_ui(bs, 0, 1); /* num_slice_groups_minus1 */ bitstream_put_ue(bs, 0); bitstream_put_ue(bs, pic->num_ref_idx_l0_active_minus1); bitstream_put_ue(bs, pic->num_ref_idx_l1_active_minus1); bitstream_put_ui(bs, pic->pic_fields.bits.weighted_pred_flag, 1); bitstream_put_ui(bs, pic->pic_fields.bits.weighted_bipred_idc, 2); /* pic_init_qp_minus26, pic_init_qs_minus26, chroma_qp_index_offset */ bitstream_put_se(bs, pic->pic_init_qp - 26); bitstream_put_se(bs, 0); bitstream_put_se(bs, 0); bitstream_put_ui(bs, pic->pic_fields.bits.deblocking_filter_control_present_flag, 1); /* constrained_intra_pred_flag, redundant_pic_cnt_present_flag */ bitstream_put_ui(bs, 0, 1); bitstream_put_ui(bs, 0, 1); bitstream_put_ui(bs, pic->pic_fields.bits.transform_8x8_mode_flag, 1); /* pic_scaling_matrix_present_flag */ bitstream_put_ui(bs, 0, 1); bitstream_put_se(bs, pic->second_chroma_qp_index_offset ); rbsp_trailing_bits(bs); } static int build_packed_pic_buffer(struct vaapi_recorder *r, void **header_buffer) { struct bitstream bs; bitstream_start(&bs); nal_start_code_prefix(&bs); nal_header(&bs, NAL_REF_IDC_HIGH, NAL_PPS); pps_rbsp(&bs, &r->encoder.param.pic); bitstream_end(&bs); *header_buffer = bs.buffer; return bs.bit_offset; } static int build_packed_seq_buffer(struct vaapi_recorder *r, void **header_buffer) { struct bitstream bs; bitstream_start(&bs); nal_start_code_prefix(&bs); nal_header(&bs, NAL_REF_IDC_HIGH, NAL_SPS); sps_rbsp(&bs, &r->encoder.param.seq, r->encoder.constraint_set_flag); bitstream_end(&bs); *header_buffer = bs.buffer; return bs.bit_offset; } static int create_packed_header_buffers(struct vaapi_recorder *r, VABufferID *buffers, VAEncPackedHeaderType type, void *data, int bit_length) { VAEncPackedHeaderParameterBuffer packed_header; VAStatus status; packed_header.type = type; packed_header.bit_length = bit_length; packed_header.has_emulation_bytes = 0; status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncPackedHeaderParameterBufferType, sizeof packed_header, 1, &packed_header, &buffers[0]); if (status != VA_STATUS_SUCCESS) return 0; status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncPackedHeaderDataBufferType, (bit_length + 7) / 8, 1, data, &buffers[1]); if (status != VA_STATUS_SUCCESS) { vaDestroyBuffer(r->va_dpy, buffers[0]); return 0; } return 2; } static int encoder_prepare_headers(struct vaapi_recorder *r, VABufferID *buffers) { VABufferID *p; int bit_length; void *data; p = buffers; bit_length = build_packed_seq_buffer(r, &data); p += create_packed_header_buffers(r, p, VAEncPackedHeaderSequence, data, bit_length); free(data); bit_length = build_packed_pic_buffer(r, &data); p += create_packed_header_buffers(r, p, VAEncPackedHeaderPicture, data, bit_length); free(data); return p - buffers; } static VAStatus encoder_render_picture(struct vaapi_recorder *r, VASurfaceID input, VABufferID *buffers, int count) { VAStatus status; status = vaBeginPicture(r->va_dpy, r->encoder.ctx, input); if (status != VA_STATUS_SUCCESS) return status; status = vaRenderPicture(r->va_dpy, r->encoder.ctx, buffers, count); if (status != VA_STATUS_SUCCESS) return status; status = vaEndPicture(r->va_dpy, r->encoder.ctx); if (status != VA_STATUS_SUCCESS) return status; return vaSyncSurface(r->va_dpy, input); } static VABufferID encoder_create_output_buffer(struct vaapi_recorder *r) { VABufferID output_buf; VAStatus status; status = vaCreateBuffer(r->va_dpy, r->encoder.ctx, VAEncCodedBufferType, r->encoder.output_size, 1, NULL, &output_buf); if (status == VA_STATUS_SUCCESS) return output_buf; else return VA_INVALID_ID; } enum output_write_status { OUTPUT_WRITE_SUCCESS, OUTPUT_WRITE_OVERFLOW, OUTPUT_WRITE_FATAL }; static enum output_write_status encoder_write_output(struct vaapi_recorder *r, VABufferID output_buf) { VACodedBufferSegment *segment; VAStatus status; int count; status = vaMapBuffer(r->va_dpy, output_buf, (void **) &segment); if (status != VA_STATUS_SUCCESS) return OUTPUT_WRITE_FATAL; if (segment->status & VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK) { r->encoder.output_size *= 2; vaUnmapBuffer(r->va_dpy, output_buf); return OUTPUT_WRITE_OVERFLOW; } count = write(r->output_fd, segment->buf, segment->size); vaUnmapBuffer(r->va_dpy, output_buf); if (count < 0) return OUTPUT_WRITE_FATAL; return OUTPUT_WRITE_SUCCESS; } static void encoder_encode(struct vaapi_recorder *r, VASurfaceID input) { VABufferID output_buf = VA_INVALID_ID; VABufferID buffers[8]; int count = 0; int i, slice_type; enum output_write_status ret; if ((r->frame_count % r->encoder.intra_period) == 0) slice_type = SLICE_TYPE_I; else slice_type = SLICE_TYPE_P; buffers[count++] = encoder_update_seq_parameters(r); buffers[count++] = encoder_update_misc_hdr_parameter(r); buffers[count++] = encoder_update_slice_parameter(r, slice_type); for (i = 0; i < count; i++) if (buffers[i] == VA_INVALID_ID) goto bail; if (r->frame_count == 0) count += encoder_prepare_headers(r, buffers + count); do { output_buf = encoder_create_output_buffer(r); if (output_buf == VA_INVALID_ID) goto bail; buffers[count++] = encoder_update_pic_parameters(r, output_buf); if (buffers[count - 1] == VA_INVALID_ID) goto bail; encoder_render_picture(r, input, buffers, count); ret = encoder_write_output(r, output_buf); vaDestroyBuffer(r->va_dpy, output_buf); output_buf = VA_INVALID_ID; vaDestroyBuffer(r->va_dpy, buffers[--count]); } while (ret == OUTPUT_WRITE_OVERFLOW); if (ret == OUTPUT_WRITE_FATAL) r->error = errno; for (i = 0; i < count; i++) vaDestroyBuffer(r->va_dpy, buffers[i]); r->frame_count++; return; bail: for (i = 0; i < count; i++) vaDestroyBuffer(r->va_dpy, buffers[i]); if (output_buf != VA_INVALID_ID) vaDestroyBuffer(r->va_dpy, output_buf); } static int setup_vpp(struct vaapi_recorder *r) { VAStatus status; status = vaCreateConfig(r->va_dpy, VAProfileNone, VAEntrypointVideoProc, NULL, 0, &r->vpp.cfg); if (status != VA_STATUS_SUCCESS) { weston_log("vaapi: failed to create VPP config\n"); return -1; } status = vaCreateContext(r->va_dpy, r->vpp.cfg, r->width, r->height, 0, NULL, 0, &r->vpp.ctx); if (status != VA_STATUS_SUCCESS) { weston_log("vaapi: failed to create VPP context\n"); goto err_cfg; } status = vaCreateBuffer(r->va_dpy, r->vpp.ctx, VAProcPipelineParameterBufferType, sizeof(VAProcPipelineParameterBuffer), 1, NULL, &r->vpp.pipeline_buf); if (status != VA_STATUS_SUCCESS) { weston_log("vaapi: failed to create VPP pipeline buffer\n"); goto err_ctx; } status = vaCreateSurfaces(r->va_dpy, VA_RT_FORMAT_YUV420, r->width, r->height, &r->vpp.output, 1, NULL, 0); if (status != VA_STATUS_SUCCESS) { weston_log("vaapi: failed to create YUV surface\n"); goto err_buf; } return 0; err_buf: vaDestroyBuffer(r->va_dpy, r->vpp.pipeline_buf); err_ctx: vaDestroyConfig(r->va_dpy, r->vpp.ctx); err_cfg: vaDestroyConfig(r->va_dpy, r->vpp.cfg); return -1; } static void vpp_destroy(struct vaapi_recorder *r) { vaDestroySurfaces(r->va_dpy, &r->vpp.output, 1); vaDestroyBuffer(r->va_dpy, r->vpp.pipeline_buf); vaDestroyConfig(r->va_dpy, r->vpp.ctx); vaDestroyConfig(r->va_dpy, r->vpp.cfg); } static int setup_worker_thread(struct vaapi_recorder *r) { pthread_mutex_init(&r->mutex, NULL); pthread_cond_init(&r->input_cond, NULL); pthread_create(&r->worker_thread, NULL, worker_thread_function, r); return 1; } static void destroy_worker_thread(struct vaapi_recorder *r) { pthread_mutex_lock(&r->mutex); /* Make sure the worker thread finishes */ r->destroying = 1; pthread_cond_signal(&r->input_cond); pthread_mutex_unlock(&r->mutex); pthread_join(r->worker_thread, NULL); pthread_mutex_destroy(&r->mutex); pthread_cond_destroy(&r->input_cond); } struct vaapi_recorder * vaapi_recorder_create(int drm_fd, int width, int height, const char *filename) { struct vaapi_recorder *r; VAStatus status; int major, minor; int flags; r = zalloc(sizeof *r); if (r == NULL) return NULL; r->width = width; r->height = height; r->drm_fd = drm_fd; if (setup_worker_thread(r) < 0) goto err_free; flags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC; r->output_fd = open(filename, flags, 0644); if (r->output_fd < 0) goto err_thread; r->va_dpy = vaGetDisplayDRM(drm_fd); if (!r->va_dpy) { weston_log("failed to create VA display\n"); goto err_fd; } status = vaInitialize(r->va_dpy, &major, &minor); if (status != VA_STATUS_SUCCESS) { weston_log("vaapi: failed to initialize display\n"); goto err_fd; } if (setup_vpp(r) < 0) { weston_log("vaapi: failed to initialize VPP pipeline\n"); goto err_va_dpy; } if (setup_encoder(r) < 0) { goto err_vpp; } return r; err_vpp: vpp_destroy(r); err_va_dpy: vaTerminate(r->va_dpy); err_fd: close(r->output_fd); err_thread: destroy_worker_thread(r); err_free: free(r); return NULL; } void vaapi_recorder_destroy(struct vaapi_recorder *r) { destroy_worker_thread(r); encoder_destroy(r); vpp_destroy(r); vaTerminate(r->va_dpy); close(r->output_fd); close(r->drm_fd); free(r); } static VAStatus create_surface_from_fd(struct vaapi_recorder *r, int prime_fd, int stride, VASurfaceID *surface) { VASurfaceAttrib va_attribs[2]; VASurfaceAttribExternalBuffers va_attrib_extbuf; VAStatus status; unsigned long buffer_fd = prime_fd; va_attrib_extbuf.pixel_format = VA_FOURCC_BGRX; va_attrib_extbuf.width = r->width; va_attrib_extbuf.height = r->height; va_attrib_extbuf.data_size = r->height * stride; va_attrib_extbuf.num_planes = 1; va_attrib_extbuf.pitches[0] = stride; va_attrib_extbuf.offsets[0] = 0; va_attrib_extbuf.buffers = &buffer_fd; va_attrib_extbuf.num_buffers = 1; va_attrib_extbuf.flags = 0; va_attrib_extbuf.private_data = NULL; va_attribs[0].type = VASurfaceAttribMemoryType; va_attribs[0].flags = VA_SURFACE_ATTRIB_SETTABLE; va_attribs[0].value.type = VAGenericValueTypeInteger; va_attribs[0].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME; va_attribs[1].type = VASurfaceAttribExternalBufferDescriptor; va_attribs[1].flags = VA_SURFACE_ATTRIB_SETTABLE; va_attribs[1].value.type = VAGenericValueTypePointer; va_attribs[1].value.value.p = &va_attrib_extbuf; status = vaCreateSurfaces(r->va_dpy, VA_RT_FORMAT_RGB32, r->width, r->height, surface, 1, va_attribs, 2); return status; } static VAStatus convert_rgb_to_yuv(struct vaapi_recorder *r, VASurfaceID rgb_surface) { VAProcPipelineParameterBuffer *pipeline_param; VAStatus status; status = vaMapBuffer(r->va_dpy, r->vpp.pipeline_buf, (void **) &pipeline_param); if (status != VA_STATUS_SUCCESS) return status; memset(pipeline_param, 0, sizeof *pipeline_param); pipeline_param->surface = rgb_surface; pipeline_param->surface_color_standard = VAProcColorStandardNone; pipeline_param->output_background_color = 0xff000000; pipeline_param->output_color_standard = VAProcColorStandardNone; status = vaUnmapBuffer(r->va_dpy, r->vpp.pipeline_buf); if (status != VA_STATUS_SUCCESS) return status; status = vaBeginPicture(r->va_dpy, r->vpp.ctx, r->vpp.output); if (status != VA_STATUS_SUCCESS) return status; status = vaRenderPicture(r->va_dpy, r->vpp.ctx, &r->vpp.pipeline_buf, 1); if (status != VA_STATUS_SUCCESS) return status; status = vaEndPicture(r->va_dpy, r->vpp.ctx); if (status != VA_STATUS_SUCCESS) return status; return status; } static void recorder_frame(struct vaapi_recorder *r) { VASurfaceID rgb_surface; VAStatus status; status = create_surface_from_fd(r, r->input.prime_fd, r->input.stride, &rgb_surface); if (status != VA_STATUS_SUCCESS) { weston_log("[libva recorder] " "failed to create surface from bo\n"); return; } close(r->input.prime_fd); status = convert_rgb_to_yuv(r, rgb_surface); if (status != VA_STATUS_SUCCESS) { weston_log("[libva recorder] " "color space conversion failed\n"); return; } encoder_encode(r, r->vpp.output); vaDestroySurfaces(r->va_dpy, &rgb_surface, 1); } static void * worker_thread_function(void *data) { struct vaapi_recorder *r = data; pthread_mutex_lock(&r->mutex); while (!r->destroying) { if (!r->input.valid) pthread_cond_wait(&r->input_cond, &r->mutex); /* If the thread is awaken by destroy_worker_thread(), * there might not be valid input */ if (!r->input.valid) continue; recorder_frame(r); r->input.valid = 0; } pthread_mutex_unlock(&r->mutex); return NULL; } int vaapi_recorder_frame(struct vaapi_recorder *r, int prime_fd, int stride) { int ret = 0; pthread_mutex_lock(&r->mutex); if (r->error) { errno = r->error; ret = -1; goto unlock; } /* The mutex is never released while encoding, so this point should * never be reached if input.valid is true. */ assert(!r->input.valid); r->input.prime_fd = prime_fd; r->input.stride = stride; r->input.valid = 1; pthread_cond_signal(&r->input_cond); unlock: pthread_mutex_unlock(&r->mutex); return ret; } weston-1.9.0/src/main.c0000664000175000017500000005447112556777533011701 00000000000000/* * Copyright © 2010-2011 Intel Corporation * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2012-2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #ifdef HAVE_LIBUNWIND #define UNW_LOCAL_ONLY #include #endif #include "compositor.h" #include "../shared/os-compatibility.h" #include "../shared/helpers.h" #include "git-version.h" #include "version.h" static struct wl_list child_process_list; static struct weston_compositor *segv_compositor; static int sigchld_handler(int signal_number, void *data) { struct weston_process *p; int status; pid_t pid; while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { wl_list_for_each(p, &child_process_list, link) { if (p->pid == pid) break; } if (&p->link == &child_process_list) { weston_log("unknown child process exited\n"); continue; } wl_list_remove(&p->link); p->cleanup(p, status); } if (pid < 0 && errno != ECHILD) weston_log("waitpid error %m\n"); return 1; } #ifdef HAVE_LIBUNWIND static void print_backtrace(void) { unw_cursor_t cursor; unw_context_t context; unw_word_t off; unw_proc_info_t pip; int ret, i = 0; char procname[256]; const char *filename; Dl_info dlinfo; pip.unwind_info = NULL; ret = unw_getcontext(&context); if (ret) { weston_log("unw_getcontext: %d\n", ret); return; } ret = unw_init_local(&cursor, &context); if (ret) { weston_log("unw_init_local: %d\n", ret); return; } ret = unw_step(&cursor); while (ret > 0) { ret = unw_get_proc_info(&cursor, &pip); if (ret) { weston_log("unw_get_proc_info: %d\n", ret); break; } ret = unw_get_proc_name(&cursor, procname, 256, &off); if (ret && ret != -UNW_ENOMEM) { if (ret != -UNW_EUNSPEC) weston_log("unw_get_proc_name: %d\n", ret); procname[0] = '?'; procname[1] = 0; } if (dladdr((void *)(pip.start_ip + off), &dlinfo) && dlinfo.dli_fname && *dlinfo.dli_fname) filename = dlinfo.dli_fname; else filename = "?"; weston_log("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, ret == -UNW_ENOMEM ? "..." : "", (int)off, (void *)(pip.start_ip + off)); ret = unw_step(&cursor); if (ret < 0) weston_log("unw_step: %d\n", ret); } } #else static void print_backtrace(void) { void *buffer[32]; int i, count; Dl_info info; count = backtrace(buffer, ARRAY_LENGTH(buffer)); for (i = 0; i < count; i++) { dladdr(buffer[i], &info); weston_log(" [%016lx] %s (%s)\n", (long) buffer[i], info.dli_sname ? info.dli_sname : "--", info.dli_fname); } } #endif WL_EXPORT void weston_watch_process(struct weston_process *process) { wl_list_insert(&child_process_list, &process->link); } static void log_uname(void) { struct utsname usys; uname(&usys); weston_log("OS: %s, %s, %s, %s\n", usys.sysname, usys.release, usys.version, usys.machine); } static const char xdg_error_message[] = "fatal: environment variable XDG_RUNTIME_DIR is not set.\n"; static const char xdg_wrong_message[] = "fatal: environment variable XDG_RUNTIME_DIR\n" "is set to \"%s\", which is not a directory.\n"; static const char xdg_wrong_mode_message[] = "warning: XDG_RUNTIME_DIR \"%s\" is not configured\n" "correctly. Unix access mode must be 0700 (current mode is %o),\n" "and must be owned by the user (current owner is UID %d).\n"; static const char xdg_detail_message[] = "Refer to your distribution on how to get it, or\n" "http://www.freedesktop.org/wiki/Specifications/basedir-spec\n" "on how to implement it.\n"; static void verify_xdg_runtime_dir(void) { char *dir = getenv("XDG_RUNTIME_DIR"); struct stat s; if (!dir) { weston_log(xdg_error_message); weston_log_continue(xdg_detail_message); exit(EXIT_FAILURE); } if (stat(dir, &s) || !S_ISDIR(s.st_mode)) { weston_log(xdg_wrong_message, dir); weston_log_continue(xdg_detail_message); exit(EXIT_FAILURE); } if ((s.st_mode & 0777) != 0700 || s.st_uid != getuid()) { weston_log(xdg_wrong_mode_message, dir, s.st_mode & 0777, s.st_uid); weston_log_continue(xdg_detail_message); } } static int usage(int error_code) { fprintf(stderr, "Usage: weston [OPTIONS]\n\n" "This is weston version " VERSION ", the Wayland reference compositor.\n" "Weston supports multiple backends, and depending on which backend is in use\n" "different options will be accepted.\n\n" "Core options:\n\n" " --version\t\tPrint weston version\n" " -B, --backend=MODULE\tBackend module, one of\n" #if defined(BUILD_DRM_COMPOSITOR) "\t\t\t\tdrm-backend.so\n" #endif #if defined(BUILD_FBDEV_COMPOSITOR) "\t\t\t\tfbdev-backend.so\n" #endif #if defined(BUILD_HEADLESS_COMPOSITOR) "\t\t\t\theadless-backend.so\n" #endif #if defined(BUILD_RDP_COMPOSITOR) "\t\t\t\trdp-backend.so\n" #endif #if defined(BUILD_RPI_COMPOSITOR) && defined(HAVE_BCM_HOST) "\t\t\t\trpi-backend.so\n" #endif #if defined(BUILD_WAYLAND_COMPOSITOR) "\t\t\t\twayland-backend.so\n" #endif #if defined(BUILD_X11_COMPOSITOR) "\t\t\t\tx11-backend.so\n" #endif " --shell=MODULE\tShell module, defaults to desktop-shell.so\n" " -S, --socket=NAME\tName of socket to listen on\n" " -i, --idle-time=SECS\tIdle time in seconds\n" " --modules\t\tLoad the comma-separated list of modules\n" " --log=FILE\t\tLog to the given file\n" " -c, --config=FILE\tConfig file to load, defaults to weston.ini\n" " --no-config\t\tDo not read weston.ini\n" " -h, --help\t\tThis help message\n\n"); #if defined(BUILD_DRM_COMPOSITOR) fprintf(stderr, "Options for drm-backend.so:\n\n" " --connector=ID\tBring up only this connector\n" " --seat=SEAT\t\tThe seat that weston should run on\n" " --tty=TTY\t\tThe tty to use\n" " --use-pixman\t\tUse the pixman (CPU) renderer\n" " --current-mode\tPrefer current KMS mode over EDID preferred mode\n\n"); #endif #if defined(BUILD_FBDEV_COMPOSITOR) fprintf(stderr, "Options for fbdev-backend.so:\n\n" " --tty=TTY\t\tThe tty to use\n" " --device=DEVICE\tThe framebuffer device to use\n" " --use-gl\t\tUse the GL renderer\n\n"); #endif #if defined(BUILD_HEADLESS_COMPOSITOR) fprintf(stderr, "Options for headless-backend.so:\n\n" " --width=WIDTH\t\tWidth of memory surface\n" " --height=HEIGHT\tHeight of memory surface\n" " --transform=TR\tThe output transformation, TR is one of:\n" "\tnormal 90 180 270 flipped flipped-90 flipped-180 flipped-270\n" " --use-pixman\t\tUse the pixman (CPU) renderer (default: no rendering)\n\n"); #endif #if defined(BUILD_RDP_COMPOSITOR) fprintf(stderr, "Options for rdp-backend.so:\n\n" " --width=WIDTH\t\tWidth of desktop\n" " --height=HEIGHT\tHeight of desktop\n" " --env-socket\t\tUse socket defined in RDP_FD env variable as peer connection\n" " --address=ADDR\tThe address to bind\n" " --port=PORT\t\tThe port to listen on\n" " --no-clients-resize\tThe RDP peers will be forced to the size of the desktop\n" " --rdp4-key=FILE\tThe file containing the key for RDP4 encryption\n" " --rdp-tls-cert=FILE\tThe file containing the certificate for TLS encryption\n" " --rdp-tls-key=FILE\tThe file containing the private key for TLS encryption\n" "\n"); #endif #if defined(BUILD_RPI_COMPOSITOR) && defined(HAVE_BCM_HOST) fprintf(stderr, "Options for rpi-backend.so:\n\n" " --tty=TTY\t\tThe tty to use\n" " --single-buffer\tUse single-buffered Dispmanx elements.\n" " --transform=TR\tThe output transformation, TR is one of:\n" "\tnormal 90 180 270 flipped flipped-90 flipped-180 flipped-270\n" " --opaque-regions\tEnable support for opaque regions, can be " "very slow without support in the GPU firmware.\n" "\n"); #endif #if defined(BUILD_WAYLAND_COMPOSITOR) fprintf(stderr, "Options for wayland-backend.so:\n\n" " --width=WIDTH\t\tWidth of Wayland surface\n" " --height=HEIGHT\tHeight of Wayland surface\n" " --scale=SCALE\t\tScale factor of output\n" " --fullscreen\t\tRun in fullscreen mode\n" " --use-pixman\t\tUse the pixman (CPU) renderer\n" " --output-count=COUNT\tCreate multiple outputs\n" " --sprawl\t\tCreate one fullscreen output for every parent output\n" " --display=DISPLAY\tWayland display to connect to\n\n"); #endif #if defined(BUILD_X11_COMPOSITOR) fprintf(stderr, "Options for x11-backend.so:\n\n" " --width=WIDTH\t\tWidth of X window\n" " --height=HEIGHT\tHeight of X window\n" " --scale=SCALE\t\tScale factor of output\n" " --fullscreen\t\tRun in fullscreen mode\n" " --use-pixman\t\tUse the pixman (CPU) renderer\n" " --output-count=COUNT\tCreate multiple outputs\n" " --no-input\t\tDont create input devices\n\n"); #endif exit(error_code); } static int on_term_signal(int signal_number, void *data) { struct wl_display *display = data; weston_log("caught signal %d\n", signal_number); wl_display_terminate(display); return 1; } static void on_caught_signal(int s, siginfo_t *siginfo, void *context) { /* This signal handler will do a best-effort backtrace, and * then call the backend restore function, which will switch * back to the vt we launched from or ungrab X etc and then * raise SIGTRAP. If we run weston under gdb from X or a * different vt, and tell gdb "handle *s* nostop", this * will allow weston to switch back to gdb on crash and then * gdb will catch the crash with SIGTRAP.*/ weston_log("caught signal: %d\n", s); print_backtrace(); segv_compositor->backend->restore(segv_compositor); raise(SIGTRAP); } static void catch_signals(void) { struct sigaction action; action.sa_flags = SA_SIGINFO | SA_RESETHAND; action.sa_sigaction = on_caught_signal; sigemptyset(&action.sa_mask); sigaction(SIGSEGV, &action, NULL); sigaction(SIGABRT, &action, NULL); } static const char * clock_name(clockid_t clk_id) { static const char *names[] = { [CLOCK_REALTIME] = "CLOCK_REALTIME", [CLOCK_MONOTONIC] = "CLOCK_MONOTONIC", [CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW", [CLOCK_REALTIME_COARSE] = "CLOCK_REALTIME_COARSE", [CLOCK_MONOTONIC_COARSE] = "CLOCK_MONOTONIC_COARSE", [CLOCK_BOOTTIME] = "CLOCK_BOOTTIME", }; if (clk_id < 0 || (unsigned)clk_id >= ARRAY_LENGTH(names)) return "unknown"; return names[clk_id]; } static const struct { uint32_t bit; /* enum weston_capability */ const char *desc; } capability_strings[] = { { WESTON_CAP_ROTATION_ANY, "arbitrary surface rotation:" }, { WESTON_CAP_CAPTURE_YFLIP, "screen capture uses y-flip:" }, }; static void weston_compositor_log_capabilities(struct weston_compositor *compositor) { unsigned i; int yes; weston_log("Compositor capabilities:\n"); for (i = 0; i < ARRAY_LENGTH(capability_strings); i++) { yes = compositor->capabilities & capability_strings[i].bit; weston_log_continue(STAMP_SPACE "%s %s\n", capability_strings[i].desc, yes ? "yes" : "no"); } weston_log_continue(STAMP_SPACE "presentation clock: %s, id %d\n", clock_name(compositor->presentation_clock), compositor->presentation_clock); } static void handle_primary_client_destroyed(struct wl_listener *listener, void *data) { struct wl_client *client = data; weston_log("Primary client died. Closing...\n"); wl_display_terminate(wl_client_get_display(client)); } static int weston_create_listening_socket(struct wl_display *display, const char *socket_name) { if (socket_name) { if (wl_display_add_socket(display, socket_name)) { weston_log("fatal: failed to add socket: %m\n"); return -1; } } else { socket_name = wl_display_add_socket_auto(display); if (!socket_name) { weston_log("fatal: failed to add socket: %m\n"); return -1; } } setenv("WAYLAND_DISPLAY", socket_name, 1); return 0; } static int load_modules(struct weston_compositor *ec, const char *modules, int *argc, char *argv[]) { const char *p, *end; char buffer[256]; int (*module_init)(struct weston_compositor *ec, int *argc, char *argv[]); if (modules == NULL) return 0; p = modules; while (*p) { end = strchrnul(p, ','); snprintf(buffer, sizeof buffer, "%.*s", (int) (end - p), p); module_init = weston_load_module(buffer, "module_init"); if (!module_init) return -1; if (module_init(ec, argc, argv) < 0) return -1; p = end; while (*p == ',') p++; } return 0; } static int weston_compositor_init_config(struct weston_compositor *ec, struct weston_config *config) { struct xkb_rule_names xkb_names; struct weston_config_section *s; int repaint_msec; s = weston_config_get_section(config, "keyboard", NULL, NULL); weston_config_section_get_string(s, "keymap_rules", (char **) &xkb_names.rules, NULL); weston_config_section_get_string(s, "keymap_model", (char **) &xkb_names.model, NULL); weston_config_section_get_string(s, "keymap_layout", (char **) &xkb_names.layout, NULL); weston_config_section_get_string(s, "keymap_variant", (char **) &xkb_names.variant, NULL); weston_config_section_get_string(s, "keymap_options", (char **) &xkb_names.options, NULL); if (weston_compositor_xkb_init(ec, &xkb_names) < 0) return -1; weston_config_section_get_int(s, "repeat-rate", &ec->kb_repeat_rate, 40); weston_config_section_get_int(s, "repeat-delay", &ec->kb_repeat_delay, 400); s = weston_config_get_section(config, "core", NULL, NULL); weston_config_section_get_int(s, "repaint-window", &repaint_msec, ec->repaint_msec); if (repaint_msec < -10 || repaint_msec > 1000) { weston_log("Invalid repaint_window value in config: %d\n", repaint_msec); } else { ec->repaint_msec = repaint_msec; } weston_log("Output repaint window is %d ms maximum.\n", ec->repaint_msec); return 0; } static char * weston_choose_default_backend(void) { char *backend = NULL; if (getenv("WAYLAND_DISPLAY") || getenv("WAYLAND_SOCKET")) backend = strdup("wayland-backend.so"); else if (getenv("DISPLAY")) backend = strdup("x11-backend.so"); else backend = strdup(WESTON_NATIVE_BACKEND); return backend; } static const struct { const char *name; uint32_t token; } transforms[] = { { "normal", WL_OUTPUT_TRANSFORM_NORMAL }, { "90", WL_OUTPUT_TRANSFORM_90 }, { "180", WL_OUTPUT_TRANSFORM_180 }, { "270", WL_OUTPUT_TRANSFORM_270 }, { "flipped", WL_OUTPUT_TRANSFORM_FLIPPED }, { "flipped-90", WL_OUTPUT_TRANSFORM_FLIPPED_90 }, { "flipped-180", WL_OUTPUT_TRANSFORM_FLIPPED_180 }, { "flipped-270", WL_OUTPUT_TRANSFORM_FLIPPED_270 }, }; WL_EXPORT int weston_parse_transform(const char *transform, uint32_t *out) { unsigned int i; for (i = 0; i < ARRAY_LENGTH(transforms); i++) if (strcmp(transforms[i].name, transform) == 0) { *out = transforms[i].token; return 0; } *out = WL_OUTPUT_TRANSFORM_NORMAL; return -1; } WL_EXPORT const char * weston_transform_to_string(uint32_t output_transform) { unsigned int i; for (i = 0; i < ARRAY_LENGTH(transforms); i++) if (transforms[i].token == output_transform) return transforms[i].name; return ""; } static int load_configuration(struct weston_config **config, int32_t noconfig, const char *config_file) { const char *file = "weston.ini"; const char *full_path; *config = NULL; if (config_file) file = config_file; if (noconfig == 0) *config = weston_config_parse(file); if (*config) { full_path = weston_config_get_full_path(*config); weston_log("Using config file '%s'\n", full_path); setenv(WESTON_CONFIG_FILE_ENV_VAR, full_path, 1); return 0; } if (config_file && noconfig == 0) { weston_log("fatal: error opening or reading config file" " '%s'.\n", config_file); return -1; } weston_log("Starting with no config file.\n"); setenv(WESTON_CONFIG_FILE_ENV_VAR, "", 1); return 0; } static void handle_exit(struct weston_compositor *c) { wl_display_terminate(c->wl_display); } int main(int argc, char *argv[]) { int ret = EXIT_FAILURE; struct wl_display *display; struct weston_compositor *ec; struct wl_event_source *signals[4]; struct wl_event_loop *loop; int (*backend_init)(struct weston_compositor *c, int *argc, char *argv[], struct weston_config *config); int i, fd; char *backend = NULL; char *shell = NULL; char *modules = NULL; char *option_modules = NULL; char *log = NULL; char *server_socket = NULL, *end; int32_t idle_time = -1; int32_t help = 0; char *socket_name = NULL; int32_t version = 0; int32_t noconfig = 0; int32_t numlock_on; char *config_file = NULL; struct weston_config *config = NULL; struct weston_config_section *section; struct wl_client *primary_client; struct wl_listener primary_client_destroyed; struct weston_seat *seat; const struct weston_option core_options[] = { { WESTON_OPTION_STRING, "backend", 'B', &backend }, { WESTON_OPTION_STRING, "shell", 0, &shell }, { WESTON_OPTION_STRING, "socket", 'S', &socket_name }, { WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time }, { WESTON_OPTION_STRING, "modules", 0, &option_modules }, { WESTON_OPTION_STRING, "log", 0, &log }, { WESTON_OPTION_BOOLEAN, "help", 'h', &help }, { WESTON_OPTION_BOOLEAN, "version", 0, &version }, { WESTON_OPTION_BOOLEAN, "no-config", 0, &noconfig }, { WESTON_OPTION_STRING, "config", 'c', &config_file }, }; parse_options(core_options, ARRAY_LENGTH(core_options), &argc, argv); if (help) usage(EXIT_SUCCESS); if (version) { printf(PACKAGE_STRING "\n"); return EXIT_SUCCESS; } weston_log_file_open(log); weston_log("%s\n" STAMP_SPACE "%s\n" STAMP_SPACE "Bug reports to: %s\n" STAMP_SPACE "Build: %s\n", PACKAGE_STRING, PACKAGE_URL, PACKAGE_BUGREPORT, BUILD_ID); log_uname(); verify_xdg_runtime_dir(); display = wl_display_create(); loop = wl_display_get_event_loop(display); signals[0] = wl_event_loop_add_signal(loop, SIGTERM, on_term_signal, display); signals[1] = wl_event_loop_add_signal(loop, SIGINT, on_term_signal, display); signals[2] = wl_event_loop_add_signal(loop, SIGQUIT, on_term_signal, display); wl_list_init(&child_process_list); signals[3] = wl_event_loop_add_signal(loop, SIGCHLD, sigchld_handler, NULL); if (!signals[0] || !signals[1] || !signals[2] || !signals[3]) goto out_signals; if (load_configuration(&config, noconfig, config_file) < 0) goto out_signals; section = weston_config_get_section(config, "core", NULL, NULL); if (!backend) { weston_config_section_get_string(section, "backend", &backend, NULL); if (!backend) backend = weston_choose_default_backend(); } backend_init = weston_load_module(backend, "backend_init"); if (!backend_init) goto out_signals; ec = weston_compositor_create(display, NULL); if (ec == NULL) { weston_log("fatal: failed to create compositor\n"); goto out_signals; } ec->config = config; if (weston_compositor_init_config(ec, config) < 0) goto out_signals; if (backend_init(ec, &argc, argv, config) < 0) { weston_log("fatal: failed to create compositor backend\n"); goto out_signals; } catch_signals(); segv_compositor = ec; if (idle_time < 0) weston_config_section_get_int(section, "idle-time", &idle_time, -1); if (idle_time < 0) idle_time = 300; /* default idle timeout, in seconds */ ec->idle_time = idle_time; ec->default_pointer_grab = NULL; ec->exit = handle_exit; weston_compositor_log_capabilities(ec); server_socket = getenv("WAYLAND_SERVER_SOCKET"); if (server_socket) { weston_log("Running with single client\n"); fd = strtol(server_socket, &end, 0); if (*end != '\0') fd = -1; } else { fd = -1; } if (fd != -1) { primary_client = wl_client_create(display, fd); if (!primary_client) { weston_log("fatal: failed to add client: %m\n"); goto out; } primary_client_destroyed.notify = handle_primary_client_destroyed; wl_client_add_destroy_listener(primary_client, &primary_client_destroyed); } else if (weston_create_listening_socket(display, socket_name)) { goto out; } if (!shell) weston_config_section_get_string(section, "shell", &shell, "desktop-shell.so"); if (load_modules(ec, shell, &argc, argv) < 0) goto out; weston_config_section_get_string(section, "modules", &modules, ""); if (load_modules(ec, modules, &argc, argv) < 0) goto out; if (load_modules(ec, option_modules, &argc, argv) < 0) goto out; section = weston_config_get_section(config, "keyboard", NULL, NULL); weston_config_section_get_bool(section, "numlock-on", &numlock_on, 0); if (numlock_on) { wl_list_for_each(seat, &ec->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (keyboard) weston_keyboard_set_locks(keyboard, WESTON_NUM_LOCK, WESTON_NUM_LOCK); } } for (i = 1; i < argc; i++) weston_log("fatal: unhandled option: %s\n", argv[i]); if (argc > 1) goto out; weston_compositor_wake(ec); wl_display_run(display); /* Allow for setting return exit code after * wl_display_run returns normally. This is * useful for devs/testers and automated tests * that want to indicate failure status to * testing infrastructure above */ ret = ec->exit_code; out: weston_compositor_destroy(ec); out_signals: for (i = ARRAY_LENGTH(signals) - 1; i >= 0; i--) if (signals[i]) wl_event_source_remove(signals[i]); wl_display_destroy(display); weston_log_file_close(); if (config) weston_config_destroy(config); free(config_file); free(backend); free(shell); free(socket_name); free(option_modules); free(log); free(modules); return ret; } weston-1.9.0/src/version.h.in0000664000175000017500000000410012537627702013023 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_VERSION_H #define WESTON_VERSION_H #define WESTON_VERSION_MAJOR @WESTON_VERSION_MAJOR@ #define WESTON_VERSION_MINOR @WESTON_VERSION_MINOR@ #define WESTON_VERSION_MICRO @WESTON_VERSION_MICRO@ #define WESTON_VERSION "@WESTON_VERSION@" /* This macro may not do what you expect. Weston doesn't guarantee * a stable API between 1.X and 1.Y, and thus this macro will return * FALSE on any WESTON_VERSION_AT_LEAST(1,X,0) if the actual version * is 1.Y.0 and X != Y). In particular, it fails if X < Y, that is, * 1.3.0 is considered to not be "at least" 1.4.0. * * If you want to test for the version number being 1.3.0 or above or * maybe in a range (eg 1.2.0 to 1.4.0), just use the WESTON_VERSION_* * defines above directly. */ #define WESTON_VERSION_AT_LEAST(major, minor, micro) \ (WESTON_VERSION_MAJOR == (major) && \ WESTON_VERSION_MINOR == (minor) && \ WESTON_VERSION_MICRO >= (micro)) #endif weston-1.9.0/src/timeline.h0000664000175000017500000000403312537627702012544 00000000000000/* * Copyright © 2014 Pekka Paalanen * Copyright © 2014 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_TIMELINE_H #define WESTON_TIMELINE_H extern int weston_timeline_enabled_; struct weston_compositor; void weston_timeline_open(struct weston_compositor *compositor); void weston_timeline_close(void); enum timeline_type { TLT_END = 0, TLT_OUTPUT, TLT_SURFACE, TLT_VBLANK, }; #define TYPEVERIFY(type, arg) ({ \ typeof(arg) tmp___ = (arg); \ (void)((type)0 == tmp___); \ tmp___; }) #define TLP_END TLT_END, NULL #define TLP_OUTPUT(o) TLT_OUTPUT, TYPEVERIFY(struct weston_output *, (o)) #define TLP_SURFACE(s) TLT_SURFACE, TYPEVERIFY(struct weston_surface *, (s)) #define TLP_VBLANK(t) TLT_VBLANK, TYPEVERIFY(const struct timespec *, (t)) #define TL_POINT(...) do { \ if (weston_timeline_enabled_) \ weston_timeline_point(__VA_ARGS__); \ } while (0) void weston_timeline_point(const char *name, ...); #endif /* WESTON_TIMELINE_H */ weston-1.9.0/src/spring-tool.c0000664000175000017500000000371512537627702013214 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "compositor.h" WL_EXPORT void weston_view_geometry_dirty(struct weston_view *view) { } WL_EXPORT int weston_log(const char *fmt, ...) { return 0; } WL_EXPORT void weston_view_schedule_repaint(struct weston_view *view) { } WL_EXPORT void weston_compositor_schedule_repaint(struct weston_compositor *compositor) { } int main(int argc, char *argv[]) { const double k = 300.0; const double current = 0.5; const double target = 1.0; const double friction = 1400; struct weston_spring spring; uint32_t time = 0; weston_spring_init(&spring, k, current, target); spring.friction = friction; spring.previous = 0.48; spring.timestamp = 0; while (!weston_spring_done(&spring)) { printf("\t%d\t%f\n", time, spring.current); weston_spring_update(&spring, time); time += 16; } return 0; } weston-1.9.0/src/gl-renderer.c0000664000175000017500000022773012575610240013141 00000000000000/* * Copyright © 2012 Intel Corporation * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "gl-renderer.h" #include "vertex-clipping.h" #include "linux-dmabuf.h" #include "linux-dmabuf-server-protocol.h" #include "shared/helpers.h" #include "weston-egl-ext.h" struct gl_shader { GLuint program; GLuint vertex_shader, fragment_shader; GLint proj_uniform; GLint tex_uniforms[3]; GLint alpha_uniform; GLint color_uniform; const char *vertex_source, *fragment_source; }; #define BUFFER_DAMAGE_COUNT 2 enum gl_border_status { BORDER_STATUS_CLEAN = 0, BORDER_TOP_DIRTY = 1 << GL_RENDERER_BORDER_TOP, BORDER_LEFT_DIRTY = 1 << GL_RENDERER_BORDER_LEFT, BORDER_RIGHT_DIRTY = 1 << GL_RENDERER_BORDER_RIGHT, BORDER_BOTTOM_DIRTY = 1 << GL_RENDERER_BORDER_BOTTOM, BORDER_ALL_DIRTY = 0xf, BORDER_SIZE_CHANGED = 0x10 }; struct gl_border_image { GLuint tex; int32_t width, height; int32_t tex_width; void *data; }; struct gl_output_state { EGLSurface egl_surface; pixman_region32_t buffer_damage[BUFFER_DAMAGE_COUNT]; int buffer_damage_index; enum gl_border_status border_damage[BUFFER_DAMAGE_COUNT]; struct gl_border_image borders[4]; enum gl_border_status border_status; struct weston_matrix output_matrix; }; enum buffer_type { BUFFER_TYPE_NULL, BUFFER_TYPE_SOLID, /* internal solid color surfaces without a buffer */ BUFFER_TYPE_SHM, BUFFER_TYPE_EGL }; struct gl_renderer; struct egl_image { struct gl_renderer *renderer; EGLImageKHR image; int refcount; /* Only used for dmabuf imported buffer */ struct linux_dmabuf_buffer *dmabuf; struct wl_list link; }; struct gl_surface_state { GLfloat color[4]; struct gl_shader *shader; GLuint textures[3]; int num_textures; int needs_full_upload; pixman_region32_t texture_damage; /* These are only used by SHM surfaces to detect when we need * to do a full upload to specify a new internal texture * format */ GLenum gl_format; GLenum gl_pixel_type; struct egl_image* images[3]; GLenum target; int num_images; struct weston_buffer_reference buffer_ref; enum buffer_type buffer_type; int pitch; /* in pixels */ int height; /* in pixels */ int y_inverted; struct weston_surface *surface; struct wl_listener surface_destroy_listener; struct wl_listener renderer_destroy_listener; }; struct gl_renderer { struct weston_renderer base; int fragment_shader_debug; int fan_debug; struct weston_binding *fragment_binding; struct weston_binding *fan_binding; EGLDisplay egl_display; EGLContext egl_context; EGLConfig egl_config; struct wl_array vertices; struct wl_array vtxcnt; PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d; PFNEGLCREATEIMAGEKHRPROC create_image; PFNEGLDESTROYIMAGEKHRPROC destroy_image; #ifdef EGL_EXT_swap_buffers_with_damage PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage; #endif PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window; int has_unpack_subimage; PFNEGLBINDWAYLANDDISPLAYWL bind_display; PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display; PFNEGLQUERYWAYLANDBUFFERWL query_buffer; int has_bind_display; int has_egl_image_external; int has_egl_buffer_age; int has_configless_context; int has_dmabuf_import; struct wl_list dmabuf_images; struct gl_shader texture_shader_rgba; struct gl_shader texture_shader_rgbx; struct gl_shader texture_shader_egl_external; struct gl_shader texture_shader_y_uv; struct gl_shader texture_shader_y_u_v; struct gl_shader texture_shader_y_xuxv; struct gl_shader invert_color_shader; struct gl_shader solid_shader; struct gl_shader *current_shader; struct wl_signal destroy_signal; }; static PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display = NULL; static inline struct gl_output_state * get_output_state(struct weston_output *output) { return (struct gl_output_state *)output->renderer_state; } static int gl_renderer_create_surface(struct weston_surface *surface); static inline struct gl_surface_state * get_surface_state(struct weston_surface *surface) { if (!surface->renderer_state) gl_renderer_create_surface(surface); return (struct gl_surface_state *)surface->renderer_state; } static inline struct gl_renderer * get_renderer(struct weston_compositor *ec) { return (struct gl_renderer *)ec->renderer; } static struct egl_image* egl_image_create(struct gl_renderer *gr, EGLenum target, EGLClientBuffer buffer, const EGLint *attribs) { struct egl_image *img; img = zalloc(sizeof *img); wl_list_init(&img->link); img->renderer = gr; img->refcount = 1; img->image = gr->create_image(gr->egl_display, EGL_NO_CONTEXT, target, buffer, attribs); if (img->image == EGL_NO_IMAGE_KHR) { free(img); return NULL; } return img; } static struct egl_image* egl_image_ref(struct egl_image *image) { image->refcount++; return image; } static int egl_image_unref(struct egl_image *image) { struct gl_renderer *gr = image->renderer; assert(image->refcount > 0); image->refcount--; if (image->refcount > 0) return image->refcount; if (image->dmabuf) linux_dmabuf_buffer_set_user_data(image->dmabuf, NULL, NULL); gr->destroy_image(gr->egl_display, image->image); wl_list_remove(&image->link); free(image); return 0; } static const char * egl_error_string(EGLint code) { #define MYERRCODE(x) case x: return #x; switch (code) { MYERRCODE(EGL_SUCCESS) MYERRCODE(EGL_NOT_INITIALIZED) MYERRCODE(EGL_BAD_ACCESS) MYERRCODE(EGL_BAD_ALLOC) MYERRCODE(EGL_BAD_ATTRIBUTE) MYERRCODE(EGL_BAD_CONTEXT) MYERRCODE(EGL_BAD_CONFIG) MYERRCODE(EGL_BAD_CURRENT_SURFACE) MYERRCODE(EGL_BAD_DISPLAY) MYERRCODE(EGL_BAD_SURFACE) MYERRCODE(EGL_BAD_MATCH) MYERRCODE(EGL_BAD_PARAMETER) MYERRCODE(EGL_BAD_NATIVE_PIXMAP) MYERRCODE(EGL_BAD_NATIVE_WINDOW) MYERRCODE(EGL_CONTEXT_LOST) default: return "unknown"; } #undef MYERRCODE } static void gl_renderer_print_egl_error_state(void) { EGLint code; code = eglGetError(); weston_log("EGL error state: %s (0x%04lx)\n", egl_error_string(code), (long)code); } #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) > (b)) ? (b) : (a)) /* * Compute the boundary vertices of the intersection of the global coordinate * aligned rectangle 'rect', and an arbitrary quadrilateral produced from * 'surf_rect' when transformed from surface coordinates into global coordinates. * The vertices are written to 'ex' and 'ey', and the return value is the * number of vertices. Vertices are produced in clockwise winding order. * Guarantees to produce either zero vertices, or 3-8 vertices with non-zero * polygon area. */ static int calculate_edges(struct weston_view *ev, pixman_box32_t *rect, pixman_box32_t *surf_rect, GLfloat *ex, GLfloat *ey) { struct clip_context ctx; int i, n; GLfloat min_x, max_x, min_y, max_y; struct polygon8 surf = { { surf_rect->x1, surf_rect->x2, surf_rect->x2, surf_rect->x1 }, { surf_rect->y1, surf_rect->y1, surf_rect->y2, surf_rect->y2 }, 4 }; ctx.clip.x1 = rect->x1; ctx.clip.y1 = rect->y1; ctx.clip.x2 = rect->x2; ctx.clip.y2 = rect->y2; /* transform surface to screen space: */ for (i = 0; i < surf.n; i++) weston_view_to_global_float(ev, surf.x[i], surf.y[i], &surf.x[i], &surf.y[i]); /* find bounding box: */ min_x = max_x = surf.x[0]; min_y = max_y = surf.y[0]; for (i = 1; i < surf.n; i++) { min_x = min(min_x, surf.x[i]); max_x = max(max_x, surf.x[i]); min_y = min(min_y, surf.y[i]); max_y = max(max_y, surf.y[i]); } /* First, simple bounding box check to discard early transformed * surface rects that do not intersect with the clip region: */ if ((min_x >= ctx.clip.x2) || (max_x <= ctx.clip.x1) || (min_y >= ctx.clip.y2) || (max_y <= ctx.clip.y1)) return 0; /* Simple case, bounding box edges are parallel to surface edges, * there will be only four edges. We just need to clip the surface * vertices to the clip rect bounds: */ if (!ev->transform.enabled) return clip_simple(&ctx, &surf, ex, ey); /* Transformed case: use a general polygon clipping algorithm to * clip the surface rectangle with each side of 'rect'. * The algorithm is Sutherland-Hodgman, as explained in * http://www.codeguru.com/cpp/misc/misc/graphics/article.php/c8965/Polygon-Clipping.htm * but without looking at any of that code. */ n = clip_transformed(&ctx, &surf, ex, ey); if (n < 3) return 0; return n; } static bool merge_down(pixman_box32_t *a, pixman_box32_t *b, pixman_box32_t *merge) { if (a->x1 == b->x1 && a->x2 == b->x2 && a->y1 == b->y2) { merge->x1 = a->x1; merge->x2 = a->x2; merge->y1 = b->y1; merge->y2 = a->y2; return true; } return false; } static int compress_bands(pixman_box32_t *inrects, int nrects, pixman_box32_t **outrects) { bool merged; pixman_box32_t *out, merge_rect; int i, j, nout; if (!nrects) { *outrects = NULL; return 0; } /* nrects is an upper bound - we're not too worried about * allocating a little extra */ out = malloc(sizeof(pixman_box32_t) * nrects); out[0] = inrects[0]; nout = 1; for (i = 1; i < nrects; i++) { for (j = 0; j < nout; j++) { merged = merge_down(&inrects[i], &out[j], &merge_rect); if (merged) { out[j] = merge_rect; break; } } if (!merged) { out[nout] = inrects[i]; nout++; } } *outrects = out; return nout; } static int texture_region(struct weston_view *ev, pixman_region32_t *region, pixman_region32_t *surf_region) { struct gl_surface_state *gs = get_surface_state(ev->surface); struct weston_compositor *ec = ev->surface->compositor; struct gl_renderer *gr = get_renderer(ec); GLfloat *v, inv_width, inv_height; unsigned int *vtxcnt, nvtx = 0; pixman_box32_t *rects, *surf_rects; pixman_box32_t *raw_rects; int i, j, k, nrects, nsurf, raw_nrects; bool used_band_compression; raw_rects = pixman_region32_rectangles(region, &raw_nrects); surf_rects = pixman_region32_rectangles(surf_region, &nsurf); if (raw_nrects < 4) { used_band_compression = false; nrects = raw_nrects; rects = raw_rects; } else { nrects = compress_bands(raw_rects, raw_nrects, &rects); used_band_compression = true; } /* worst case we can have 8 vertices per rect (ie. clipped into * an octagon): */ v = wl_array_add(&gr->vertices, nrects * nsurf * 8 * 4 * sizeof *v); vtxcnt = wl_array_add(&gr->vtxcnt, nrects * nsurf * sizeof *vtxcnt); inv_width = 1.0 / gs->pitch; inv_height = 1.0 / gs->height; for (i = 0; i < nrects; i++) { pixman_box32_t *rect = &rects[i]; for (j = 0; j < nsurf; j++) { pixman_box32_t *surf_rect = &surf_rects[j]; GLfloat sx, sy, bx, by; GLfloat ex[8], ey[8]; /* edge points in screen space */ int n; /* The transformed surface, after clipping to the clip region, * can have as many as eight sides, emitted as a triangle-fan. * The first vertex in the triangle fan can be chosen arbitrarily, * since the area is guaranteed to be convex. * * If a corner of the transformed surface falls outside of the * clip region, instead of emitting one vertex for the corner * of the surface, up to two are emitted for two corresponding * intersection point(s) between the surface and the clip region. * * To do this, we first calculate the (up to eight) points that * form the intersection of the clip rect and the transformed * surface. */ n = calculate_edges(ev, rect, surf_rect, ex, ey); if (n < 3) continue; /* emit edge points: */ for (k = 0; k < n; k++) { weston_view_from_global_float(ev, ex[k], ey[k], &sx, &sy); /* position: */ *(v++) = ex[k]; *(v++) = ey[k]; /* texcoord: */ weston_surface_to_buffer_float(ev->surface, sx, sy, &bx, &by); *(v++) = bx * inv_width; if (gs->y_inverted) { *(v++) = by * inv_height; } else { *(v++) = (gs->height - by) * inv_height; } } vtxcnt[nvtx++] = n; } } if (used_band_compression) free(rects); return nvtx; } static void triangle_fan_debug(struct weston_view *view, int first, int count) { struct weston_compositor *compositor = view->surface->compositor; struct gl_renderer *gr = get_renderer(compositor); int i; GLushort *buffer; GLushort *index; int nelems; static int color_idx = 0; static const GLfloat color[][4] = { { 1.0, 0.0, 0.0, 1.0 }, { 0.0, 1.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0, 1.0 }, { 1.0, 1.0, 1.0, 1.0 }, }; nelems = (count - 1 + count - 2) * 2; buffer = malloc(sizeof(GLushort) * nelems); index = buffer; for (i = 1; i < count; i++) { *index++ = first; *index++ = first + i; } for (i = 2; i < count; i++) { *index++ = first + i - 1; *index++ = first + i; } glUseProgram(gr->solid_shader.program); glUniform4fv(gr->solid_shader.color_uniform, 1, color[color_idx++ % ARRAY_LENGTH(color)]); glDrawElements(GL_LINES, nelems, GL_UNSIGNED_SHORT, buffer); glUseProgram(gr->current_shader->program); free(buffer); } static void repaint_region(struct weston_view *ev, pixman_region32_t *region, pixman_region32_t *surf_region) { struct weston_compositor *ec = ev->surface->compositor; struct gl_renderer *gr = get_renderer(ec); GLfloat *v; unsigned int *vtxcnt; int i, first, nfans; /* The final region to be painted is the intersection of * 'region' and 'surf_region'. However, 'region' is in the global * coordinates, and 'surf_region' is in the surface-local * coordinates. texture_region() will iterate over all pairs of * rectangles from both regions, compute the intersection * polygon for each pair, and store it as a triangle fan if * it has a non-zero area (at least 3 vertices1, actually). */ nfans = texture_region(ev, region, surf_region); v = gr->vertices.data; vtxcnt = gr->vtxcnt.data; /* position: */ glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof *v, &v[0]); glEnableVertexAttribArray(0); /* texcoord: */ glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof *v, &v[2]); glEnableVertexAttribArray(1); for (i = 0, first = 0; i < nfans; i++) { glDrawArrays(GL_TRIANGLE_FAN, first, vtxcnt[i]); if (gr->fan_debug) triangle_fan_debug(ev, first, vtxcnt[i]); first += vtxcnt[i]; } glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); gr->vertices.size = 0; gr->vtxcnt.size = 0; } static int use_output(struct weston_output *output) { static int errored; struct gl_output_state *go = get_output_state(output); struct gl_renderer *gr = get_renderer(output->compositor); EGLBoolean ret; ret = eglMakeCurrent(gr->egl_display, go->egl_surface, go->egl_surface, gr->egl_context); if (ret == EGL_FALSE) { if (errored) return -1; errored = 1; weston_log("Failed to make EGL context current.\n"); gl_renderer_print_egl_error_state(); return -1; } return 0; } static int shader_init(struct gl_shader *shader, struct gl_renderer *gr, const char *vertex_source, const char *fragment_source); static void use_shader(struct gl_renderer *gr, struct gl_shader *shader) { if (!shader->program) { int ret; ret = shader_init(shader, gr, shader->vertex_source, shader->fragment_source); if (ret < 0) weston_log("warning: failed to compile shader\n"); } if (gr->current_shader == shader) return; glUseProgram(shader->program); gr->current_shader = shader; } static void shader_uniforms(struct gl_shader *shader, struct weston_view *view, struct weston_output *output) { int i; struct gl_surface_state *gs = get_surface_state(view->surface); struct gl_output_state *go = get_output_state(output); glUniformMatrix4fv(shader->proj_uniform, 1, GL_FALSE, go->output_matrix.d); glUniform4fv(shader->color_uniform, 1, gs->color); glUniform1f(shader->alpha_uniform, view->alpha); for (i = 0; i < gs->num_textures; i++) glUniform1i(shader->tex_uniforms[i], i); } static void draw_view(struct weston_view *ev, struct weston_output *output, pixman_region32_t *damage) /* in global coordinates */ { struct weston_compositor *ec = ev->surface->compositor; struct gl_renderer *gr = get_renderer(ec); struct gl_surface_state *gs = get_surface_state(ev->surface); /* repaint bounding region in global coordinates: */ pixman_region32_t repaint; /* opaque region in surface coordinates: */ pixman_region32_t surface_opaque; /* non-opaque region in surface coordinates: */ pixman_region32_t surface_blend; GLint filter; int i; /* In case of a runtime switch of renderers, we may not have received * an attach for this surface since the switch. In that case we don't * have a valid buffer or a proper shader set up so skip rendering. */ if (!gs->shader) return; pixman_region32_init(&repaint); pixman_region32_intersect(&repaint, &ev->transform.boundingbox, damage); pixman_region32_subtract(&repaint, &repaint, &ev->clip); if (!pixman_region32_not_empty(&repaint)) goto out; glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); if (gr->fan_debug) { use_shader(gr, &gr->solid_shader); shader_uniforms(&gr->solid_shader, ev, output); } use_shader(gr, gs->shader); shader_uniforms(gs->shader, ev, output); if (ev->transform.enabled || output->zoom.active || output->current_scale != ev->surface->buffer_viewport.buffer.scale) filter = GL_LINEAR; else filter = GL_NEAREST; for (i = 0; i < gs->num_textures; i++) { glActiveTexture(GL_TEXTURE0 + i); glBindTexture(gs->target, gs->textures[i]); glTexParameteri(gs->target, GL_TEXTURE_MIN_FILTER, filter); glTexParameteri(gs->target, GL_TEXTURE_MAG_FILTER, filter); } /* blended region is whole surface minus opaque region: */ pixman_region32_init_rect(&surface_blend, 0, 0, ev->surface->width, ev->surface->height); if (ev->geometry.scissor_enabled) pixman_region32_intersect(&surface_blend, &surface_blend, &ev->geometry.scissor); pixman_region32_subtract(&surface_blend, &surface_blend, &ev->surface->opaque); /* XXX: Should we be using ev->transform.opaque here? */ pixman_region32_init(&surface_opaque); if (ev->geometry.scissor_enabled) pixman_region32_intersect(&surface_opaque, &ev->surface->opaque, &ev->geometry.scissor); else pixman_region32_copy(&surface_opaque, &ev->surface->opaque); if (pixman_region32_not_empty(&surface_opaque)) { if (gs->shader == &gr->texture_shader_rgba) { /* Special case for RGBA textures with possibly * bad data in alpha channel: use the shader * that forces texture alpha = 1.0. * Xwayland surfaces need this. */ use_shader(gr, &gr->texture_shader_rgbx); shader_uniforms(&gr->texture_shader_rgbx, ev, output); } if (ev->alpha < 1.0) glEnable(GL_BLEND); else glDisable(GL_BLEND); repaint_region(ev, &repaint, &surface_opaque); } if (pixman_region32_not_empty(&surface_blend)) { use_shader(gr, gs->shader); glEnable(GL_BLEND); repaint_region(ev, &repaint, &surface_blend); } pixman_region32_fini(&surface_blend); pixman_region32_fini(&surface_opaque); out: pixman_region32_fini(&repaint); } static void repaint_views(struct weston_output *output, pixman_region32_t *damage) { struct weston_compositor *compositor = output->compositor; struct weston_view *view; wl_list_for_each_reverse(view, &compositor->view_list, link) if (view->plane == &compositor->primary_plane) draw_view(view, output, damage); } static void draw_output_border_texture(struct gl_output_state *go, enum gl_renderer_border_side side, int32_t x, int32_t y, int32_t width, int32_t height) { struct gl_border_image *img = &go->borders[side]; static GLushort indices [] = { 0, 1, 3, 3, 1, 2 }; if (!img->data) { if (img->tex) { glDeleteTextures(1, &img->tex); img->tex = 0; } return; } if (!img->tex) { glGenTextures(1, &img->tex); glBindTexture(GL_TEXTURE_2D, img->tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); } else { glBindTexture(GL_TEXTURE_2D, img->tex); } if (go->border_status & (1 << side)) { #ifdef GL_EXT_unpack_subimage glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0); glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0); #endif glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT, img->tex_width, img->height, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, img->data); } GLfloat texcoord[] = { 0.0f, 0.0f, (GLfloat)img->width / (GLfloat)img->tex_width, 0.0f, (GLfloat)img->width / (GLfloat)img->tex_width, 1.0f, 0.0f, 1.0f, }; GLfloat verts[] = { x, y, x + width, y, x + width, y + height, x, y + height }; glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, verts); glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, texcoord); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); } static int output_has_borders(struct weston_output *output) { struct gl_output_state *go = get_output_state(output); return go->borders[GL_RENDERER_BORDER_TOP].data || go->borders[GL_RENDERER_BORDER_RIGHT].data || go->borders[GL_RENDERER_BORDER_BOTTOM].data || go->borders[GL_RENDERER_BORDER_LEFT].data; } static void draw_output_borders(struct weston_output *output, enum gl_border_status border_status) { struct gl_output_state *go = get_output_state(output); struct gl_renderer *gr = get_renderer(output->compositor); struct gl_shader *shader = &gr->texture_shader_rgba; struct gl_border_image *top, *bottom, *left, *right; struct weston_matrix matrix; int full_width, full_height; if (border_status == BORDER_STATUS_CLEAN) return; /* Clean. Nothing to do. */ top = &go->borders[GL_RENDERER_BORDER_TOP]; bottom = &go->borders[GL_RENDERER_BORDER_BOTTOM]; left = &go->borders[GL_RENDERER_BORDER_LEFT]; right = &go->borders[GL_RENDERER_BORDER_RIGHT]; full_width = output->current_mode->width + left->width + right->width; full_height = output->current_mode->height + top->height + bottom->height; glDisable(GL_BLEND); use_shader(gr, shader); glViewport(0, 0, full_width, full_height); weston_matrix_init(&matrix); weston_matrix_translate(&matrix, -full_width/2.0, -full_height/2.0, 0); weston_matrix_scale(&matrix, 2.0/full_width, -2.0/full_height, 1); glUniformMatrix4fv(shader->proj_uniform, 1, GL_FALSE, matrix.d); glUniform1i(shader->tex_uniforms[0], 0); glUniform1f(shader->alpha_uniform, 1); glActiveTexture(GL_TEXTURE0); if (border_status & BORDER_TOP_DIRTY) draw_output_border_texture(go, GL_RENDERER_BORDER_TOP, 0, 0, full_width, top->height); if (border_status & BORDER_LEFT_DIRTY) draw_output_border_texture(go, GL_RENDERER_BORDER_LEFT, 0, top->height, left->width, output->current_mode->height); if (border_status & BORDER_RIGHT_DIRTY) draw_output_border_texture(go, GL_RENDERER_BORDER_RIGHT, full_width - right->width, top->height, right->width, output->current_mode->height); if (border_status & BORDER_BOTTOM_DIRTY) draw_output_border_texture(go, GL_RENDERER_BORDER_BOTTOM, 0, full_height - bottom->height, full_width, bottom->height); } static void output_get_border_damage(struct weston_output *output, enum gl_border_status border_status, pixman_region32_t *damage) { struct gl_output_state *go = get_output_state(output); struct gl_border_image *top, *bottom, *left, *right; int full_width, full_height; if (border_status == BORDER_STATUS_CLEAN) return; /* Clean. Nothing to do. */ top = &go->borders[GL_RENDERER_BORDER_TOP]; bottom = &go->borders[GL_RENDERER_BORDER_BOTTOM]; left = &go->borders[GL_RENDERER_BORDER_LEFT]; right = &go->borders[GL_RENDERER_BORDER_RIGHT]; full_width = output->current_mode->width + left->width + right->width; full_height = output->current_mode->height + top->height + bottom->height; if (border_status & BORDER_TOP_DIRTY) pixman_region32_union_rect(damage, damage, 0, 0, full_width, top->height); if (border_status & BORDER_LEFT_DIRTY) pixman_region32_union_rect(damage, damage, 0, top->height, left->width, output->current_mode->height); if (border_status & BORDER_RIGHT_DIRTY) pixman_region32_union_rect(damage, damage, full_width - right->width, top->height, right->width, output->current_mode->height); if (border_status & BORDER_BOTTOM_DIRTY) pixman_region32_union_rect(damage, damage, 0, full_height - bottom->height, full_width, bottom->height); } static void output_get_damage(struct weston_output *output, pixman_region32_t *buffer_damage, uint32_t *border_damage) { struct gl_output_state *go = get_output_state(output); struct gl_renderer *gr = get_renderer(output->compositor); EGLint buffer_age = 0; EGLBoolean ret; int i; if (gr->has_egl_buffer_age) { ret = eglQuerySurface(gr->egl_display, go->egl_surface, EGL_BUFFER_AGE_EXT, &buffer_age); if (ret == EGL_FALSE) { weston_log("buffer age query failed.\n"); gl_renderer_print_egl_error_state(); } } if (buffer_age == 0 || buffer_age - 1 > BUFFER_DAMAGE_COUNT) { pixman_region32_copy(buffer_damage, &output->region); *border_damage = BORDER_ALL_DIRTY; } else { for (i = 0; i < buffer_age - 1; i++) *border_damage |= go->border_damage[(go->buffer_damage_index + i) % BUFFER_DAMAGE_COUNT]; if (*border_damage & BORDER_SIZE_CHANGED) { /* If we've had a resize, we have to do a full * repaint. */ *border_damage |= BORDER_ALL_DIRTY; pixman_region32_copy(buffer_damage, &output->region); } else { for (i = 0; i < buffer_age - 1; i++) pixman_region32_union(buffer_damage, buffer_damage, &go->buffer_damage[(go->buffer_damage_index + i) % BUFFER_DAMAGE_COUNT]); } } } static void output_rotate_damage(struct weston_output *output, pixman_region32_t *output_damage, enum gl_border_status border_status) { struct gl_output_state *go = get_output_state(output); struct gl_renderer *gr = get_renderer(output->compositor); if (!gr->has_egl_buffer_age) return; go->buffer_damage_index += BUFFER_DAMAGE_COUNT - 1; go->buffer_damage_index %= BUFFER_DAMAGE_COUNT; pixman_region32_copy(&go->buffer_damage[go->buffer_damage_index], output_damage); go->border_damage[go->buffer_damage_index] = border_status; } /* NOTE: We now allow falling back to ARGB gl visuals when XRGB is * unavailable, so we're assuming the background has no transparency * and that everything with a blend, like drop shadows, will have something * opaque (like the background) drawn underneath it. * * Depending on the underlying hardware, violating that assumption could * result in seeing through to another display plane. */ static void gl_renderer_repaint_output(struct weston_output *output, pixman_region32_t *output_damage) { struct gl_output_state *go = get_output_state(output); struct weston_compositor *compositor = output->compositor; struct gl_renderer *gr = get_renderer(compositor); EGLBoolean ret; static int errored; #ifdef EGL_EXT_swap_buffers_with_damage int i, nrects, buffer_height; EGLint *egl_damage, *d; pixman_box32_t *rects; #endif pixman_region32_t buffer_damage, total_damage; enum gl_border_status border_damage = BORDER_STATUS_CLEAN; if (use_output(output) < 0) return; /* Calculate the viewport */ glViewport(go->borders[GL_RENDERER_BORDER_LEFT].width, go->borders[GL_RENDERER_BORDER_BOTTOM].height, output->current_mode->width, output->current_mode->height); /* Calculate the global GL matrix */ go->output_matrix = output->matrix; weston_matrix_translate(&go->output_matrix, -(output->current_mode->width / 2.0), -(output->current_mode->height / 2.0), 0); weston_matrix_scale(&go->output_matrix, 2.0 / output->current_mode->width, -2.0 / output->current_mode->height, 1); /* if debugging, redraw everything outside the damage to clean up * debug lines from the previous draw on this buffer: */ if (gr->fan_debug) { pixman_region32_t undamaged; pixman_region32_init(&undamaged); pixman_region32_subtract(&undamaged, &output->region, output_damage); gr->fan_debug = 0; repaint_views(output, &undamaged); gr->fan_debug = 1; pixman_region32_fini(&undamaged); } pixman_region32_init(&total_damage); pixman_region32_init(&buffer_damage); output_get_damage(output, &buffer_damage, &border_damage); output_rotate_damage(output, output_damage, go->border_status); pixman_region32_union(&total_damage, &buffer_damage, output_damage); border_damage |= go->border_status; repaint_views(output, &total_damage); pixman_region32_fini(&total_damage); pixman_region32_fini(&buffer_damage); draw_output_borders(output, border_damage); pixman_region32_copy(&output->previous_damage, output_damage); wl_signal_emit(&output->frame_signal, output); #ifdef EGL_EXT_swap_buffers_with_damage if (gr->swap_buffers_with_damage) { pixman_region32_init(&buffer_damage); weston_transformed_region(output->width, output->height, output->transform, output->current_scale, output_damage, &buffer_damage); if (output_has_borders(output)) { pixman_region32_translate(&buffer_damage, go->borders[GL_RENDERER_BORDER_LEFT].width, go->borders[GL_RENDERER_BORDER_TOP].height); output_get_border_damage(output, go->border_status, &buffer_damage); } rects = pixman_region32_rectangles(&buffer_damage, &nrects); egl_damage = malloc(nrects * 4 * sizeof(EGLint)); buffer_height = go->borders[GL_RENDERER_BORDER_TOP].height + output->current_mode->height + go->borders[GL_RENDERER_BORDER_BOTTOM].height; d = egl_damage; for (i = 0; i < nrects; ++i) { *d++ = rects[i].x1; *d++ = buffer_height - rects[i].y2; *d++ = rects[i].x2 - rects[i].x1; *d++ = rects[i].y2 - rects[i].y1; } ret = gr->swap_buffers_with_damage(gr->egl_display, go->egl_surface, egl_damage, nrects); free(egl_damage); pixman_region32_fini(&buffer_damage); } else { ret = eglSwapBuffers(gr->egl_display, go->egl_surface); } #else /* ! defined EGL_EXT_swap_buffers_with_damage */ ret = eglSwapBuffers(gr->egl_display, go->egl_surface); #endif if (ret == EGL_FALSE && !errored) { errored = 1; weston_log("Failed in eglSwapBuffers.\n"); gl_renderer_print_egl_error_state(); } go->border_status = BORDER_STATUS_CLEAN; } static int gl_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { GLenum gl_format; struct gl_output_state *go = get_output_state(output); x += go->borders[GL_RENDERER_BORDER_LEFT].width; y += go->borders[GL_RENDERER_BORDER_BOTTOM].height; switch (format) { case PIXMAN_a8r8g8b8: gl_format = GL_BGRA_EXT; break; case PIXMAN_a8b8g8r8: gl_format = GL_RGBA; break; default: return -1; } if (use_output(output) < 0) return -1; glPixelStorei(GL_PACK_ALIGNMENT, 1); glReadPixels(x, y, width, height, gl_format, GL_UNSIGNED_BYTE, pixels); return 0; } static void gl_renderer_flush_damage(struct weston_surface *surface) { struct gl_renderer *gr = get_renderer(surface->compositor); struct gl_surface_state *gs = get_surface_state(surface); struct weston_buffer *buffer = gs->buffer_ref.buffer; struct weston_view *view; int texture_used; #ifdef GL_EXT_unpack_subimage pixman_box32_t *rectangles; void *data; int i, n; #endif pixman_region32_union(&gs->texture_damage, &gs->texture_damage, &surface->damage); if (!buffer) return; /* Avoid upload, if the texture won't be used this time. * We still accumulate the damage in texture_damage, and * hold the reference to the buffer, in case the surface * migrates back to the primary plane. */ texture_used = 0; wl_list_for_each(view, &surface->views, surface_link) { if (view->plane == &surface->compositor->primary_plane) { texture_used = 1; break; } } if (!texture_used) return; if (!pixman_region32_not_empty(&gs->texture_damage) && !gs->needs_full_upload) goto done; glBindTexture(GL_TEXTURE_2D, gs->textures[0]); if (!gr->has_unpack_subimage) { wl_shm_buffer_begin_access(buffer->shm_buffer); glTexImage2D(GL_TEXTURE_2D, 0, gs->gl_format, gs->pitch, buffer->height, 0, gs->gl_format, gs->gl_pixel_type, wl_shm_buffer_get_data(buffer->shm_buffer)); wl_shm_buffer_end_access(buffer->shm_buffer); goto done; } #ifdef GL_EXT_unpack_subimage glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch); data = wl_shm_buffer_get_data(buffer->shm_buffer); if (gs->needs_full_upload) { glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0); glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0); wl_shm_buffer_begin_access(buffer->shm_buffer); glTexImage2D(GL_TEXTURE_2D, 0, gs->gl_format, gs->pitch, buffer->height, 0, gs->gl_format, gs->gl_pixel_type, data); wl_shm_buffer_end_access(buffer->shm_buffer); goto done; } rectangles = pixman_region32_rectangles(&gs->texture_damage, &n); wl_shm_buffer_begin_access(buffer->shm_buffer); for (i = 0; i < n; i++) { pixman_box32_t r; r = weston_surface_to_buffer_rect(surface, rectangles[i]); glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, r.x1); glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1); glTexSubImage2D(GL_TEXTURE_2D, 0, r.x1, r.y1, r.x2 - r.x1, r.y2 - r.y1, gs->gl_format, gs->gl_pixel_type, data); } wl_shm_buffer_end_access(buffer->shm_buffer); #endif done: pixman_region32_fini(&gs->texture_damage); pixman_region32_init(&gs->texture_damage); gs->needs_full_upload = 0; weston_buffer_reference(&gs->buffer_ref, NULL); } static void ensure_textures(struct gl_surface_state *gs, int num_textures) { int i; if (num_textures <= gs->num_textures) return; for (i = gs->num_textures; i < num_textures; i++) { glGenTextures(1, &gs->textures[i]); glBindTexture(gs->target, gs->textures[i]); glTexParameteri(gs->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(gs->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } gs->num_textures = num_textures; glBindTexture(gs->target, 0); } static void gl_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer, struct wl_shm_buffer *shm_buffer) { struct weston_compositor *ec = es->compositor; struct gl_renderer *gr = get_renderer(ec); struct gl_surface_state *gs = get_surface_state(es); GLenum gl_format, gl_pixel_type; int pitch; buffer->shm_buffer = shm_buffer; buffer->width = wl_shm_buffer_get_width(shm_buffer); buffer->height = wl_shm_buffer_get_height(shm_buffer); switch (wl_shm_buffer_get_format(shm_buffer)) { case WL_SHM_FORMAT_XRGB8888: gs->shader = &gr->texture_shader_rgbx; pitch = wl_shm_buffer_get_stride(shm_buffer) / 4; gl_format = GL_BGRA_EXT; gl_pixel_type = GL_UNSIGNED_BYTE; break; case WL_SHM_FORMAT_ARGB8888: gs->shader = &gr->texture_shader_rgba; pitch = wl_shm_buffer_get_stride(shm_buffer) / 4; gl_format = GL_BGRA_EXT; gl_pixel_type = GL_UNSIGNED_BYTE; break; case WL_SHM_FORMAT_RGB565: gs->shader = &gr->texture_shader_rgbx; pitch = wl_shm_buffer_get_stride(shm_buffer) / 2; gl_format = GL_RGB; gl_pixel_type = GL_UNSIGNED_SHORT_5_6_5; break; default: weston_log("warning: unknown shm buffer format: %08x\n", wl_shm_buffer_get_format(shm_buffer)); return; } /* Only allocate a texture if it doesn't match existing one. * If a switch from DRM allocated buffer to a SHM buffer is * happening, we need to allocate a new texture buffer. */ if (pitch != gs->pitch || buffer->height != gs->height || gl_format != gs->gl_format || gl_pixel_type != gs->gl_pixel_type || gs->buffer_type != BUFFER_TYPE_SHM) { gs->pitch = pitch; gs->height = buffer->height; gs->target = GL_TEXTURE_2D; gs->gl_format = gl_format; gs->gl_pixel_type = gl_pixel_type; gs->buffer_type = BUFFER_TYPE_SHM; gs->needs_full_upload = 1; gs->y_inverted = 1; gs->surface = es; ensure_textures(gs, 1); } } static void gl_renderer_attach_egl(struct weston_surface *es, struct weston_buffer *buffer, uint32_t format) { struct weston_compositor *ec = es->compositor; struct gl_renderer *gr = get_renderer(ec); struct gl_surface_state *gs = get_surface_state(es); EGLint attribs[3]; int i, num_planes; buffer->legacy_buffer = (struct wl_buffer *)buffer->resource; gr->query_buffer(gr->egl_display, buffer->legacy_buffer, EGL_WIDTH, &buffer->width); gr->query_buffer(gr->egl_display, buffer->legacy_buffer, EGL_HEIGHT, &buffer->height); gr->query_buffer(gr->egl_display, buffer->legacy_buffer, EGL_WAYLAND_Y_INVERTED_WL, &buffer->y_inverted); for (i = 0; i < gs->num_images; i++) { egl_image_unref(gs->images[i]); gs->images[i] = NULL; } gs->num_images = 0; gs->target = GL_TEXTURE_2D; switch (format) { case EGL_TEXTURE_RGB: case EGL_TEXTURE_RGBA: default: num_planes = 1; gs->shader = &gr->texture_shader_rgba; break; case EGL_TEXTURE_EXTERNAL_WL: num_planes = 1; gs->target = GL_TEXTURE_EXTERNAL_OES; gs->shader = &gr->texture_shader_egl_external; break; case EGL_TEXTURE_Y_UV_WL: num_planes = 2; gs->shader = &gr->texture_shader_y_uv; break; case EGL_TEXTURE_Y_U_V_WL: num_planes = 3; gs->shader = &gr->texture_shader_y_u_v; break; case EGL_TEXTURE_Y_XUXV_WL: num_planes = 2; gs->shader = &gr->texture_shader_y_xuxv; break; } ensure_textures(gs, num_planes); for (i = 0; i < num_planes; i++) { attribs[0] = EGL_WAYLAND_PLANE_WL; attribs[1] = i; attribs[2] = EGL_NONE; gs->images[i] = egl_image_create(gr, EGL_WAYLAND_BUFFER_WL, buffer->legacy_buffer, attribs); if (!gs->images[i]) { weston_log("failed to create img for plane %d\n", i); continue; } gs->num_images++; glActiveTexture(GL_TEXTURE0 + i); glBindTexture(gs->target, gs->textures[i]); gr->image_target_texture_2d(gs->target, gs->images[i]->image); } gs->pitch = buffer->width; gs->height = buffer->height; gs->buffer_type = BUFFER_TYPE_EGL; gs->y_inverted = buffer->y_inverted; } static void gl_renderer_destroy_dmabuf(struct linux_dmabuf_buffer *dmabuf) { struct egl_image *image = dmabuf->user_data; egl_image_unref(image); } static struct egl_image * import_dmabuf(struct gl_renderer *gr, struct linux_dmabuf_buffer *dmabuf) { struct egl_image *image; EGLint attribs[30]; int atti = 0; image = linux_dmabuf_buffer_get_user_data(dmabuf); if (image) return egl_image_ref(image); /* This requires the Mesa commit in * Mesa 10.3 (08264e5dad4df448e7718e782ad9077902089a07) or * Mesa 10.2.7 (55d28925e6109a4afd61f109e845a8a51bd17652). * Otherwise Mesa closes the fd behind our back and re-importing * will fail. * https://bugs.freedesktop.org/show_bug.cgi?id=76188 */ attribs[atti++] = EGL_WIDTH; attribs[atti++] = dmabuf->width; attribs[atti++] = EGL_HEIGHT; attribs[atti++] = dmabuf->height; attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; attribs[atti++] = dmabuf->format; /* XXX: Add modifier here when supported */ if (dmabuf->n_planes > 0) { attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; attribs[atti++] = dmabuf->dmabuf_fd[0]; attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; attribs[atti++] = dmabuf->offset[0]; attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; attribs[atti++] = dmabuf->stride[0]; } if (dmabuf->n_planes > 1) { attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT; attribs[atti++] = dmabuf->dmabuf_fd[1]; attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT; attribs[atti++] = dmabuf->offset[1]; attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT; attribs[atti++] = dmabuf->stride[1]; } if (dmabuf->n_planes > 2) { attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT; attribs[atti++] = dmabuf->dmabuf_fd[2]; attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT; attribs[atti++] = dmabuf->offset[2]; attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT; attribs[atti++] = dmabuf->stride[2]; } attribs[atti++] = EGL_NONE; image = egl_image_create(gr, EGL_LINUX_DMA_BUF_EXT, NULL, attribs); if (!image) return NULL; /* The cache owns one ref. The caller gets another. */ image->dmabuf = dmabuf; wl_list_insert(&gr->dmabuf_images, &image->link); linux_dmabuf_buffer_set_user_data(dmabuf, egl_image_ref(image), gl_renderer_destroy_dmabuf); return image; } static bool gl_renderer_import_dmabuf(struct weston_compositor *ec, struct linux_dmabuf_buffer *dmabuf) { struct gl_renderer *gr = get_renderer(ec); struct egl_image *image; int i; assert(gr->has_dmabuf_import); for (i = 0; i < dmabuf->n_planes; i++) { /* EGL import does not have modifiers */ if (dmabuf->modifier[i] != 0) return false; } /* reject all flags we do not recognize or handle */ if (dmabuf->flags & ~ZLINUX_BUFFER_PARAMS_FLAGS_Y_INVERT) return false; image = import_dmabuf(gr, dmabuf); if (!image) return false; /* Cache retains a ref. */ egl_image_unref(image); return true; } static GLenum choose_texture_target(struct linux_dmabuf_buffer *dmabuf) { if (dmabuf->n_planes > 1) return GL_TEXTURE_EXTERNAL_OES; switch (dmabuf->format & ~DRM_FORMAT_BIG_ENDIAN) { case DRM_FORMAT_YUYV: case DRM_FORMAT_YVYU: case DRM_FORMAT_UYVY: case DRM_FORMAT_VYUY: case DRM_FORMAT_AYUV: return GL_TEXTURE_EXTERNAL_OES; default: return GL_TEXTURE_2D; } } static void gl_renderer_attach_dmabuf(struct weston_surface *surface, struct weston_buffer *buffer, struct linux_dmabuf_buffer *dmabuf) { struct gl_renderer *gr = get_renderer(surface->compositor); struct gl_surface_state *gs = get_surface_state(surface); int i; if (!gr->has_dmabuf_import) { linux_dmabuf_buffer_send_server_error(dmabuf, "EGL dmabuf import not supported"); return; } buffer->width = dmabuf->width; buffer->height = dmabuf->height; buffer->y_inverted = !!(dmabuf->flags & ZLINUX_BUFFER_PARAMS_FLAGS_Y_INVERT); for (i = 0; i < gs->num_images; i++) egl_image_unref(gs->images[i]); gs->num_images = 0; gs->target = choose_texture_target(dmabuf); switch (gs->target) { case GL_TEXTURE_2D: gs->shader = &gr->texture_shader_rgba; break; default: gs->shader = &gr->texture_shader_egl_external; } /* * We try to always hold an imported EGLImage from the dmabuf * to prevent the client from preventing re-imports. But, we also * need to re-import every time the contents may change because * GL driver's caching may need flushing. * * Here we release the cache reference which has to be final. */ gs->images[0] = linux_dmabuf_buffer_get_user_data(dmabuf); if (gs->images[0]) { int ret; ret = egl_image_unref(gs->images[0]); assert(ret == 0); } gs->images[0] = import_dmabuf(gr, dmabuf); if (!gs->images[0]) { linux_dmabuf_buffer_send_server_error(dmabuf, "EGL dmabuf import failed"); return; } gs->num_images = 1; ensure_textures(gs, 1); glActiveTexture(GL_TEXTURE0); glBindTexture(gs->target, gs->textures[0]); gr->image_target_texture_2d(gs->target, gs->images[0]->image); gs->pitch = buffer->width; gs->height = buffer->height; gs->buffer_type = BUFFER_TYPE_EGL; gs->y_inverted = buffer->y_inverted; } static void gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) { struct weston_compositor *ec = es->compositor; struct gl_renderer *gr = get_renderer(ec); struct gl_surface_state *gs = get_surface_state(es); struct wl_shm_buffer *shm_buffer; struct linux_dmabuf_buffer *dmabuf; EGLint format; int i; weston_buffer_reference(&gs->buffer_ref, buffer); if (!buffer) { for (i = 0; i < gs->num_images; i++) { egl_image_unref(gs->images[i]); gs->images[i] = NULL; } gs->num_images = 0; glDeleteTextures(gs->num_textures, gs->textures); gs->num_textures = 0; gs->buffer_type = BUFFER_TYPE_NULL; gs->y_inverted = 1; return; } shm_buffer = wl_shm_buffer_get(buffer->resource); if (shm_buffer) gl_renderer_attach_shm(es, buffer, shm_buffer); else if (gr->query_buffer(gr->egl_display, (void *) buffer->resource, EGL_TEXTURE_FORMAT, &format)) gl_renderer_attach_egl(es, buffer, format); else if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource))) gl_renderer_attach_dmabuf(es, buffer, dmabuf); else { weston_log("unhandled buffer type!\n"); weston_buffer_reference(&gs->buffer_ref, NULL); gs->buffer_type = BUFFER_TYPE_NULL; gs->y_inverted = 1; } } static void gl_renderer_surface_set_color(struct weston_surface *surface, float red, float green, float blue, float alpha) { struct gl_surface_state *gs = get_surface_state(surface); struct gl_renderer *gr = get_renderer(surface->compositor); gs->color[0] = red; gs->color[1] = green; gs->color[2] = blue; gs->color[3] = alpha; gs->buffer_type = BUFFER_TYPE_SOLID; gs->pitch = 1; gs->height = 1; gs->shader = &gr->solid_shader; } static void gl_renderer_surface_get_content_size(struct weston_surface *surface, int *width, int *height) { struct gl_surface_state *gs = get_surface_state(surface); if (gs->buffer_type == BUFFER_TYPE_NULL) { *width = 0; *height = 0; } else { *width = gs->pitch; *height = gs->height; } } static uint32_t pack_color(pixman_format_code_t format, float *c) { uint8_t r = round(c[0] * 255.0f); uint8_t g = round(c[1] * 255.0f); uint8_t b = round(c[2] * 255.0f); uint8_t a = round(c[3] * 255.0f); switch (format) { case PIXMAN_a8b8g8r8: return (a << 24) | (b << 16) | (g << 8) | r; default: assert(0); return 0; } } static int gl_renderer_surface_copy_content(struct weston_surface *surface, void *target, size_t size, int src_x, int src_y, int width, int height) { static const GLfloat verts[4 * 2] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f }; static const GLfloat projmat_normal[16] = { /* transpose */ 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, 1.0f }; static const GLfloat projmat_yinvert[16] = { /* transpose */ 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f }; const pixman_format_code_t format = PIXMAN_a8b8g8r8; const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ const GLenum gl_format = GL_RGBA; /* PIXMAN_a8b8g8r8 little-endian */ struct gl_renderer *gr = get_renderer(surface->compositor); struct gl_surface_state *gs = get_surface_state(surface); int cw, ch; GLuint fbo; GLuint tex; GLenum status; const GLfloat *proj; int i; gl_renderer_surface_get_content_size(surface, &cw, &ch); switch (gs->buffer_type) { case BUFFER_TYPE_NULL: return -1; case BUFFER_TYPE_SOLID: *(uint32_t *)target = pack_color(format, gs->color); return 0; case BUFFER_TYPE_SHM: gl_renderer_flush_damage(surface); /* fall through */ case BUFFER_TYPE_EGL: break; } glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cw, ch, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_2D, 0); glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0); status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { weston_log("%s: fbo error: %#x\n", __func__, status); glDeleteFramebuffers(1, &fbo); glDeleteTextures(1, &tex); return -1; } glViewport(0, 0, cw, ch); glDisable(GL_BLEND); use_shader(gr, gs->shader); if (gs->y_inverted) proj = projmat_normal; else proj = projmat_yinvert; glUniformMatrix4fv(gs->shader->proj_uniform, 1, GL_FALSE, proj); glUniform1f(gs->shader->alpha_uniform, 1.0f); for (i = 0; i < gs->num_textures; i++) { glUniform1i(gs->shader->tex_uniforms[i], i); glActiveTexture(GL_TEXTURE0 + i); glBindTexture(gs->target, gs->textures[i]); glTexParameteri(gs->target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(gs->target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); } /* position: */ glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, verts); glEnableVertexAttribArray(0); /* texcoord: */ glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, verts); glEnableVertexAttribArray(1); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableVertexAttribArray(1); glDisableVertexAttribArray(0); glPixelStorei(GL_PACK_ALIGNMENT, bytespp); glReadPixels(src_x, src_y, width, height, gl_format, GL_UNSIGNED_BYTE, target); glDeleteFramebuffers(1, &fbo); glDeleteTextures(1, &tex); return 0; } static void surface_state_destroy(struct gl_surface_state *gs, struct gl_renderer *gr) { int i; wl_list_remove(&gs->surface_destroy_listener.link); wl_list_remove(&gs->renderer_destroy_listener.link); gs->surface->renderer_state = NULL; glDeleteTextures(gs->num_textures, gs->textures); for (i = 0; i < gs->num_images; i++) egl_image_unref(gs->images[i]); weston_buffer_reference(&gs->buffer_ref, NULL); pixman_region32_fini(&gs->texture_damage); free(gs); } static void surface_state_handle_surface_destroy(struct wl_listener *listener, void *data) { struct gl_surface_state *gs; struct gl_renderer *gr; gs = container_of(listener, struct gl_surface_state, surface_destroy_listener); gr = get_renderer(gs->surface->compositor); surface_state_destroy(gs, gr); } static void surface_state_handle_renderer_destroy(struct wl_listener *listener, void *data) { struct gl_surface_state *gs; struct gl_renderer *gr; gr = data; gs = container_of(listener, struct gl_surface_state, renderer_destroy_listener); surface_state_destroy(gs, gr); } static int gl_renderer_create_surface(struct weston_surface *surface) { struct gl_surface_state *gs; struct gl_renderer *gr = get_renderer(surface->compositor); gs = zalloc(sizeof *gs); if (gs == NULL) return -1; /* A buffer is never attached to solid color surfaces, yet * they still go through texcoord computations. Do not divide * by zero there. */ gs->pitch = 1; gs->y_inverted = 1; gs->surface = surface; pixman_region32_init(&gs->texture_damage); surface->renderer_state = gs; gs->surface_destroy_listener.notify = surface_state_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &gs->surface_destroy_listener); gs->renderer_destroy_listener.notify = surface_state_handle_renderer_destroy; wl_signal_add(&gr->destroy_signal, &gs->renderer_destroy_listener); if (surface->buffer_ref.buffer) { gl_renderer_attach(surface, surface->buffer_ref.buffer); gl_renderer_flush_damage(surface); } return 0; } static const char vertex_shader[] = "uniform mat4 proj;\n" "attribute vec2 position;\n" "attribute vec2 texcoord;\n" "varying vec2 v_texcoord;\n" "void main()\n" "{\n" " gl_Position = proj * vec4(position, 0.0, 1.0);\n" " v_texcoord = texcoord;\n" "}\n"; /* Declare common fragment shader uniforms */ #define FRAGMENT_CONVERT_YUV \ " y *= alpha;\n" \ " u *= alpha;\n" \ " v *= alpha;\n" \ " gl_FragColor.r = y + 1.59602678 * v;\n" \ " gl_FragColor.g = y - 0.39176229 * u - 0.81296764 * v;\n" \ " gl_FragColor.b = y + 2.01723214 * u;\n" \ " gl_FragColor.a = alpha;\n" static const char fragment_debug[] = " gl_FragColor = vec4(0.0, 0.3, 0.0, 0.2) + gl_FragColor * 0.8;\n"; static const char fragment_brace[] = "}\n"; static const char texture_fragment_shader_rgba[] = "precision mediump float;\n" "varying vec2 v_texcoord;\n" "uniform sampler2D tex;\n" "uniform float alpha;\n" "void main()\n" "{\n" " gl_FragColor = alpha * texture2D(tex, v_texcoord)\n;" ; static const char texture_fragment_shader_rgbx[] = "precision mediump float;\n" "varying vec2 v_texcoord;\n" "uniform sampler2D tex;\n" "uniform float alpha;\n" "void main()\n" "{\n" " gl_FragColor.rgb = alpha * texture2D(tex, v_texcoord).rgb\n;" " gl_FragColor.a = alpha;\n" ; static const char texture_fragment_shader_egl_external[] = "#extension GL_OES_EGL_image_external : require\n" "precision mediump float;\n" "varying vec2 v_texcoord;\n" "uniform samplerExternalOES tex;\n" "uniform float alpha;\n" "void main()\n" "{\n" " gl_FragColor = alpha * texture2D(tex, v_texcoord)\n;" ; static const char texture_fragment_shader_y_uv[] = "precision mediump float;\n" "uniform sampler2D tex;\n" "uniform sampler2D tex1;\n" "varying vec2 v_texcoord;\n" "uniform float alpha;\n" "void main() {\n" " float y = 1.16438356 * (texture2D(tex, v_texcoord).x - 0.0625);\n" " float u = texture2D(tex1, v_texcoord).r - 0.5;\n" " float v = texture2D(tex1, v_texcoord).g - 0.5;\n" FRAGMENT_CONVERT_YUV ; static const char texture_fragment_shader_y_u_v[] = "precision mediump float;\n" "uniform sampler2D tex;\n" "uniform sampler2D tex1;\n" "uniform sampler2D tex2;\n" "varying vec2 v_texcoord;\n" "uniform float alpha;\n" "void main() {\n" " float y = 1.16438356 * (texture2D(tex, v_texcoord).x - 0.0625);\n" " float u = texture2D(tex1, v_texcoord).x - 0.5;\n" " float v = texture2D(tex2, v_texcoord).x - 0.5;\n" FRAGMENT_CONVERT_YUV ; static const char texture_fragment_shader_y_xuxv[] = "precision mediump float;\n" "uniform sampler2D tex;\n" "uniform sampler2D tex1;\n" "varying vec2 v_texcoord;\n" "uniform float alpha;\n" "void main() {\n" " float y = 1.16438356 * (texture2D(tex, v_texcoord).x - 0.0625);\n" " float u = texture2D(tex1, v_texcoord).g - 0.5;\n" " float v = texture2D(tex1, v_texcoord).a - 0.5;\n" FRAGMENT_CONVERT_YUV ; static const char solid_fragment_shader[] = "precision mediump float;\n" "uniform vec4 color;\n" "uniform float alpha;\n" "void main()\n" "{\n" " gl_FragColor = alpha * color\n;" ; static int compile_shader(GLenum type, int count, const char **sources) { GLuint s; char msg[512]; GLint status; s = glCreateShader(type); glShaderSource(s, count, sources, NULL); glCompileShader(s); glGetShaderiv(s, GL_COMPILE_STATUS, &status); if (!status) { glGetShaderInfoLog(s, sizeof msg, NULL, msg); weston_log("shader info: %s\n", msg); return GL_NONE; } return s; } static int shader_init(struct gl_shader *shader, struct gl_renderer *renderer, const char *vertex_source, const char *fragment_source) { char msg[512]; GLint status; int count; const char *sources[3]; shader->vertex_shader = compile_shader(GL_VERTEX_SHADER, 1, &vertex_source); if (renderer->fragment_shader_debug) { sources[0] = fragment_source; sources[1] = fragment_debug; sources[2] = fragment_brace; count = 3; } else { sources[0] = fragment_source; sources[1] = fragment_brace; count = 2; } shader->fragment_shader = compile_shader(GL_FRAGMENT_SHADER, count, sources); shader->program = glCreateProgram(); glAttachShader(shader->program, shader->vertex_shader); glAttachShader(shader->program, shader->fragment_shader); glBindAttribLocation(shader->program, 0, "position"); glBindAttribLocation(shader->program, 1, "texcoord"); glLinkProgram(shader->program); glGetProgramiv(shader->program, GL_LINK_STATUS, &status); if (!status) { glGetProgramInfoLog(shader->program, sizeof msg, NULL, msg); weston_log("link info: %s\n", msg); return -1; } shader->proj_uniform = glGetUniformLocation(shader->program, "proj"); shader->tex_uniforms[0] = glGetUniformLocation(shader->program, "tex"); shader->tex_uniforms[1] = glGetUniformLocation(shader->program, "tex1"); shader->tex_uniforms[2] = glGetUniformLocation(shader->program, "tex2"); shader->alpha_uniform = glGetUniformLocation(shader->program, "alpha"); shader->color_uniform = glGetUniformLocation(shader->program, "color"); return 0; } static void shader_release(struct gl_shader *shader) { glDeleteShader(shader->vertex_shader); glDeleteShader(shader->fragment_shader); glDeleteProgram(shader->program); shader->vertex_shader = 0; shader->fragment_shader = 0; shader->program = 0; } static void log_extensions(const char *name, const char *extensions) { const char *p, *end; int l; int len; l = weston_log("%s:", name); p = extensions; while (*p) { end = strchrnul(p, ' '); len = end - p; if (l + len > 78) l = weston_log_continue("\n" STAMP_SPACE "%.*s", len, p); else l += weston_log_continue(" %.*s", len, p); for (p = end; isspace(*p); p++) ; } weston_log_continue("\n"); } static void log_egl_gl_info(EGLDisplay egldpy) { const char *str; str = eglQueryString(egldpy, EGL_VERSION); weston_log("EGL version: %s\n", str ? str : "(null)"); str = eglQueryString(egldpy, EGL_VENDOR); weston_log("EGL vendor: %s\n", str ? str : "(null)"); str = eglQueryString(egldpy, EGL_CLIENT_APIS); weston_log("EGL client APIs: %s\n", str ? str : "(null)"); str = eglQueryString(egldpy, EGL_EXTENSIONS); log_extensions("EGL extensions", str ? str : "(null)"); str = (char *)glGetString(GL_VERSION); weston_log("GL version: %s\n", str ? str : "(null)"); str = (char *)glGetString(GL_SHADING_LANGUAGE_VERSION); weston_log("GLSL version: %s\n", str ? str : "(null)"); str = (char *)glGetString(GL_VENDOR); weston_log("GL vendor: %s\n", str ? str : "(null)"); str = (char *)glGetString(GL_RENDERER); weston_log("GL renderer: %s\n", str ? str : "(null)"); str = (char *)glGetString(GL_EXTENSIONS); log_extensions("GL extensions", str ? str : "(null)"); } static void log_egl_config_info(EGLDisplay egldpy, EGLConfig eglconfig) { EGLint r, g, b, a; weston_log("Chosen EGL config details:\n"); weston_log_continue(STAMP_SPACE "RGBA bits"); if (eglGetConfigAttrib(egldpy, eglconfig, EGL_RED_SIZE, &r) && eglGetConfigAttrib(egldpy, eglconfig, EGL_GREEN_SIZE, &g) && eglGetConfigAttrib(egldpy, eglconfig, EGL_BLUE_SIZE, &b) && eglGetConfigAttrib(egldpy, eglconfig, EGL_ALPHA_SIZE, &a)) weston_log_continue(": %d %d %d %d\n", r, g, b, a); else weston_log_continue(" unknown\n"); weston_log_continue(STAMP_SPACE "swap interval range"); if (eglGetConfigAttrib(egldpy, eglconfig, EGL_MIN_SWAP_INTERVAL, &a) && eglGetConfigAttrib(egldpy, eglconfig, EGL_MAX_SWAP_INTERVAL, &b)) weston_log_continue(": %d - %d\n", a, b); else weston_log_continue(" unknown\n"); } static int match_config_to_visual(EGLDisplay egl_display, EGLint visual_id, EGLConfig *configs, int count) { int i; for (i = 0; i < count; ++i) { EGLint id; if (!eglGetConfigAttrib(egl_display, configs[i], EGL_NATIVE_VISUAL_ID, &id)) continue; if (id == visual_id) return i; } return -1; } static int egl_choose_config(struct gl_renderer *gr, const EGLint *attribs, const EGLint *visual_id, const int n_ids, EGLConfig *config_out) { EGLint count = 0; EGLint matched = 0; EGLConfig *configs; int i, config_index = -1; if (!eglGetConfigs(gr->egl_display, NULL, 0, &count) || count < 1) { weston_log("No EGL configs to choose from.\n"); return -1; } configs = calloc(count, sizeof *configs); if (!configs) return -1; if (!eglChooseConfig(gr->egl_display, attribs, configs, count, &matched) || !matched) { weston_log("No EGL configs with appropriate attributes.\n"); goto out; } if (!visual_id) config_index = 0; for (i = 0; config_index == -1 && i < n_ids; i++) config_index = match_config_to_visual(gr->egl_display, visual_id[i], configs, matched); if (config_index != -1) *config_out = configs[config_index]; out: free(configs); if (config_index == -1) return -1; if (i > 1) weston_log("Unable to use first choice EGL config with id" " 0x%x, succeeded with alternate id 0x%x.\n", visual_id[0], visual_id[i - 1]); return 0; } static void gl_renderer_output_set_border(struct weston_output *output, enum gl_renderer_border_side side, int32_t width, int32_t height, int32_t tex_width, unsigned char *data) { struct gl_output_state *go = get_output_state(output); if (go->borders[side].width != width || go->borders[side].height != height) /* In this case, we have to blow everything and do a full * repaint. */ go->border_status |= BORDER_SIZE_CHANGED | BORDER_ALL_DIRTY; if (data == NULL) { width = 0; height = 0; } go->borders[side].width = width; go->borders[side].height = height; go->borders[side].tex_width = tex_width; go->borders[side].data = data; go->border_status |= 1 << side; } static int gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface); static int gl_renderer_output_create(struct weston_output *output, EGLNativeWindowType window_for_legacy, void *window_for_platform, const EGLint *attribs, const EGLint *visual_id, int n_ids) { struct weston_compositor *ec = output->compositor; struct gl_renderer *gr = get_renderer(ec); struct gl_output_state *go; EGLConfig egl_config; int i; if (egl_choose_config(gr, attribs, visual_id, n_ids, &egl_config) == -1) { weston_log("failed to choose EGL config for output\n"); return -1; } if (egl_config != gr->egl_config && !gr->has_configless_context) { weston_log("attempted to use a different EGL config for an " "output but EGL_MESA_configless_context is not " "supported\n"); return -1; } go = zalloc(sizeof *go); if (go == NULL) return -1; if (gr->create_platform_window) { go->egl_surface = gr->create_platform_window(gr->egl_display, egl_config, window_for_platform, NULL); } else { go->egl_surface = eglCreateWindowSurface(gr->egl_display, egl_config, window_for_legacy, NULL); } if (go->egl_surface == EGL_NO_SURFACE) { weston_log("failed to create egl surface\n"); free(go); return -1; } if (gr->egl_context == NULL) if (gl_renderer_setup(ec, go->egl_surface) < 0) { free(go); return -1; } for (i = 0; i < BUFFER_DAMAGE_COUNT; i++) pixman_region32_init(&go->buffer_damage[i]); output->renderer_state = go; log_egl_config_info(gr->egl_display, egl_config); return 0; } static void gl_renderer_output_destroy(struct weston_output *output) { struct gl_renderer *gr = get_renderer(output->compositor); struct gl_output_state *go = get_output_state(output); int i; for (i = 0; i < 2; i++) pixman_region32_fini(&go->buffer_damage[i]); eglDestroySurface(gr->egl_display, go->egl_surface); free(go); } static EGLSurface gl_renderer_output_surface(struct weston_output *output) { return get_output_state(output)->egl_surface; } static void gl_renderer_destroy(struct weston_compositor *ec) { struct gl_renderer *gr = get_renderer(ec); struct egl_image *image, *next; wl_signal_emit(&gr->destroy_signal, gr); if (gr->has_bind_display) gr->unbind_display(gr->egl_display, ec->wl_display); /* Work around crash in egl_dri2.c's dri2_make_current() - when does this apply? */ eglMakeCurrent(gr->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); wl_list_for_each_safe(image, next, &gr->dmabuf_images, link) { int ret; ret = egl_image_unref(image); assert(ret == 0); } eglTerminate(gr->egl_display); eglReleaseThread(); wl_array_release(&gr->vertices); wl_array_release(&gr->vtxcnt); if (gr->fragment_binding) weston_binding_destroy(gr->fragment_binding); if (gr->fan_binding) weston_binding_destroy(gr->fan_binding); free(gr); } static void renderer_setup_egl_client_extensions(struct gl_renderer *gr) { const char *extensions; extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); if (!extensions) { weston_log("Retrieving EGL client extension string failed.\n"); return; } if (strstr(extensions, "EGL_EXT_platform_base")) gr->create_platform_window = (void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"); else weston_log("warning: EGL_EXT_platform_base not supported.\n"); } static int gl_renderer_setup_egl_extensions(struct weston_compositor *ec) { struct gl_renderer *gr = get_renderer(ec); const char *extensions; EGLBoolean ret; gr->create_image = (void *) eglGetProcAddress("eglCreateImageKHR"); gr->destroy_image = (void *) eglGetProcAddress("eglDestroyImageKHR"); gr->bind_display = (void *) eglGetProcAddress("eglBindWaylandDisplayWL"); gr->unbind_display = (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); gr->query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); extensions = (const char *) eglQueryString(gr->egl_display, EGL_EXTENSIONS); if (!extensions) { weston_log("Retrieving EGL extension string failed.\n"); return -1; } if (strstr(extensions, "EGL_WL_bind_wayland_display")) gr->has_bind_display = 1; if (gr->has_bind_display) { ret = gr->bind_display(gr->egl_display, ec->wl_display); if (!ret) gr->has_bind_display = 0; } if (strstr(extensions, "EGL_EXT_buffer_age")) gr->has_egl_buffer_age = 1; else weston_log("warning: EGL_EXT_buffer_age not supported. " "Performance could be affected.\n"); #ifdef EGL_EXT_swap_buffers_with_damage if (strstr(extensions, "EGL_EXT_swap_buffers_with_damage")) gr->swap_buffers_with_damage = (void *) eglGetProcAddress("eglSwapBuffersWithDamageEXT"); else weston_log("warning: EGL_EXT_swap_buffers_with_damage not " "supported. Performance could be affected.\n"); #endif #ifdef EGL_MESA_configless_context if (strstr(extensions, "EGL_MESA_configless_context")) gr->has_configless_context = 1; #endif #ifdef EGL_EXT_image_dma_buf_import if (strstr(extensions, "EGL_EXT_image_dma_buf_import")) gr->has_dmabuf_import = 1; #endif renderer_setup_egl_client_extensions(gr); return 0; } static const EGLint gl_renderer_opaque_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 0, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; static const EGLint gl_renderer_alpha_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 1, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; /** Checks whether a platform EGL client extension is supported * * \param ec The weston compositor * \param extension_suffix The EGL client extension suffix * \return 1 if supported, 0 if using fallbacks, -1 unsupported * * This function checks whether a specific platform_* extension is supported * by EGL. * * The extension suffix should be the suffix of the platform extension (that * specifies a argument as defined in EGL_EXT_platform_base). For * example, passing "foo" will check whether either "EGL_KHR_platform_foo", * "EGL_EXT_platform_foo", or "EGL_MESA_platform_foo" is supported. * * The return value is 1: * - if the supplied EGL client extension is supported. * The return value is 0: * - if the platform_base client extension isn't supported so will * fallback to eglGetDisplay and friends. * The return value is -1: * - if the supplied EGL client extension is not supported. */ static int gl_renderer_supports(struct weston_compositor *ec, const char *extension_suffix) { static const char *extensions = NULL; char s[64]; if (!extensions) { extensions = (const char *) eglQueryString( EGL_NO_DISPLAY, EGL_EXTENSIONS); if (!extensions) return 0; log_extensions("EGL client extensions", extensions); } if (!strstr(extensions, "EGL_EXT_platform_base")) return 0; snprintf(s, sizeof s, "EGL_KHR_platform_%s", extension_suffix); if (strstr(extensions, s)) return 1; snprintf(s, sizeof s, "EGL_EXT_platform_%s", extension_suffix); if (strstr(extensions, s)) return 1; snprintf(s, sizeof s, "EGL_MESA_platform_%s", extension_suffix); if (strstr(extensions, s)) return 1; /* at this point we definitely have some platform extensions but * haven't found the supplied platform, so chances are it's * not supported. */ return -1; } static const char * platform_to_extension(EGLenum platform) { switch (platform) { case EGL_PLATFORM_GBM_KHR: return "gbm"; case EGL_PLATFORM_WAYLAND_KHR: return "wayland"; case EGL_PLATFORM_X11_KHR: return "x11"; default: assert(0 && "bad EGL platform enum"); } } static int gl_renderer_create(struct weston_compositor *ec, EGLenum platform, void *native_window, const EGLint *attribs, const EGLint *visual_id, int n_ids) { struct gl_renderer *gr; EGLint major, minor; int supports = 0; if (platform) { supports = gl_renderer_supports( ec, platform_to_extension(platform)); if (supports < 0) return -1; } gr = zalloc(sizeof *gr); if (gr == NULL) return -1; gr->base.read_pixels = gl_renderer_read_pixels; gr->base.repaint_output = gl_renderer_repaint_output; gr->base.flush_damage = gl_renderer_flush_damage; gr->base.attach = gl_renderer_attach; gr->base.surface_set_color = gl_renderer_surface_set_color; gr->base.destroy = gl_renderer_destroy; gr->base.surface_get_content_size = gl_renderer_surface_get_content_size; gr->base.surface_copy_content = gl_renderer_surface_copy_content; gr->egl_display = NULL; /* extension_suffix is supported */ if (supports) { if (!get_platform_display) { get_platform_display = (void *) eglGetProcAddress( "eglGetPlatformDisplayEXT"); } /* also wrap this in the supports check because * eglGetProcAddress can return non-NULL and still not * support the feature at runtime, so ensure the * appropriate extension checks have been done. */ if (get_platform_display && platform) { gr->egl_display = get_platform_display(platform, native_window, NULL); } } if (!gr->egl_display) { weston_log("warning: either no EGL_EXT_platform_base " "support or specific platform support; " "falling back to eglGetDisplay.\n"); gr->egl_display = eglGetDisplay(native_window); } if (gr->egl_display == EGL_NO_DISPLAY) { weston_log("failed to create display\n"); goto fail; } if (!eglInitialize(gr->egl_display, &major, &minor)) { weston_log("failed to initialize display\n"); goto fail_with_error; } if (egl_choose_config(gr, attribs, visual_id, n_ids, &gr->egl_config) < 0) { weston_log("failed to choose EGL config\n"); goto fail_terminate; } ec->renderer = &gr->base; ec->capabilities |= WESTON_CAP_ROTATION_ANY; ec->capabilities |= WESTON_CAP_CAPTURE_YFLIP; ec->capabilities |= WESTON_CAP_VIEW_CLIP_MASK; if (gl_renderer_setup_egl_extensions(ec) < 0) goto fail_with_error; wl_list_init(&gr->dmabuf_images); if (gr->has_dmabuf_import) gr->base.import_dmabuf = gl_renderer_import_dmabuf; wl_display_add_shm_format(ec->wl_display, WL_SHM_FORMAT_RGB565); wl_signal_init(&gr->destroy_signal); return 0; fail_with_error: gl_renderer_print_egl_error_state(); fail_terminate: eglTerminate(gr->egl_display); fail: free(gr); return -1; } static EGLDisplay gl_renderer_display(struct weston_compositor *ec) { return get_renderer(ec)->egl_display; } static int compile_shaders(struct weston_compositor *ec) { struct gl_renderer *gr = get_renderer(ec); gr->texture_shader_rgba.vertex_source = vertex_shader; gr->texture_shader_rgba.fragment_source = texture_fragment_shader_rgba; gr->texture_shader_rgbx.vertex_source = vertex_shader; gr->texture_shader_rgbx.fragment_source = texture_fragment_shader_rgbx; gr->texture_shader_egl_external.vertex_source = vertex_shader; gr->texture_shader_egl_external.fragment_source = texture_fragment_shader_egl_external; gr->texture_shader_y_uv.vertex_source = vertex_shader; gr->texture_shader_y_uv.fragment_source = texture_fragment_shader_y_uv; gr->texture_shader_y_u_v.vertex_source = vertex_shader; gr->texture_shader_y_u_v.fragment_source = texture_fragment_shader_y_u_v; gr->texture_shader_y_xuxv.vertex_source = vertex_shader; gr->texture_shader_y_xuxv.fragment_source = texture_fragment_shader_y_xuxv; gr->solid_shader.vertex_source = vertex_shader; gr->solid_shader.fragment_source = solid_fragment_shader; return 0; } static void fragment_debug_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *ec = data; struct gl_renderer *gr = get_renderer(ec); struct weston_output *output; gr->fragment_shader_debug ^= 1; shader_release(&gr->texture_shader_rgba); shader_release(&gr->texture_shader_rgbx); shader_release(&gr->texture_shader_egl_external); shader_release(&gr->texture_shader_y_uv); shader_release(&gr->texture_shader_y_u_v); shader_release(&gr->texture_shader_y_xuxv); shader_release(&gr->solid_shader); /* Force use_shader() to call glUseProgram(), since we need to use * the recompiled version of the shader. */ gr->current_shader = NULL; wl_list_for_each(output, &ec->output_list, link) weston_output_damage(output); } static void fan_debug_repaint_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; struct gl_renderer *gr = get_renderer(compositor); gr->fan_debug = !gr->fan_debug; weston_compositor_damage_all(compositor); } static int gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface) { struct gl_renderer *gr = get_renderer(ec); const char *extensions; EGLConfig context_config; EGLBoolean ret; static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; if (!eglBindAPI(EGL_OPENGL_ES_API)) { weston_log("failed to bind EGL_OPENGL_ES_API\n"); gl_renderer_print_egl_error_state(); return -1; } context_config = gr->egl_config; #ifdef EGL_MESA_configless_context if (gr->has_configless_context) context_config = EGL_NO_CONFIG_MESA; #endif gr->egl_context = eglCreateContext(gr->egl_display, context_config, EGL_NO_CONTEXT, context_attribs); if (gr->egl_context == NULL) { weston_log("failed to create context\n"); gl_renderer_print_egl_error_state(); return -1; } ret = eglMakeCurrent(gr->egl_display, egl_surface, egl_surface, gr->egl_context); if (ret == EGL_FALSE) { weston_log("Failed to make EGL context current.\n"); gl_renderer_print_egl_error_state(); return -1; } log_egl_gl_info(gr->egl_display); gr->image_target_texture_2d = (void *) eglGetProcAddress("glEGLImageTargetTexture2DOES"); extensions = (const char *) glGetString(GL_EXTENSIONS); if (!extensions) { weston_log("Retrieving GL extension string failed.\n"); return -1; } if (!strstr(extensions, "GL_EXT_texture_format_BGRA8888")) { weston_log("GL_EXT_texture_format_BGRA8888 not available\n"); return -1; } if (strstr(extensions, "GL_EXT_read_format_bgra")) ec->read_format = PIXMAN_a8r8g8b8; else ec->read_format = PIXMAN_a8b8g8r8; #ifdef GL_EXT_unpack_subimage if (strstr(extensions, "GL_EXT_unpack_subimage")) gr->has_unpack_subimage = 1; #endif if (strstr(extensions, "GL_OES_EGL_image_external")) gr->has_egl_image_external = 1; glActiveTexture(GL_TEXTURE0); if (compile_shaders(ec)) return -1; gr->fragment_binding = weston_compositor_add_debug_binding(ec, KEY_S, fragment_debug_binding, ec); gr->fan_binding = weston_compositor_add_debug_binding(ec, KEY_F, fan_debug_repaint_binding, ec); weston_log("GL ES 2 renderer features:\n"); weston_log_continue(STAMP_SPACE "read-back format: %s\n", ec->read_format == PIXMAN_a8r8g8b8 ? "BGRA" : "RGBA"); weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n", gr->has_unpack_subimage ? "yes" : "no"); weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n", gr->has_bind_display ? "yes" : "no"); return 0; } WL_EXPORT struct gl_renderer_interface gl_renderer_interface = { .opaque_attribs = gl_renderer_opaque_attribs, .alpha_attribs = gl_renderer_alpha_attribs, .create = gl_renderer_create, .display = gl_renderer_display, .output_create = gl_renderer_output_create, .output_destroy = gl_renderer_output_destroy, .output_surface = gl_renderer_output_surface, .output_set_border = gl_renderer_output_set_border, .print_egl_error_state = gl_renderer_print_egl_error_state }; weston-1.9.0/src/rpi-renderer.c0000664000175000017500000013442412573702126013331 00000000000000/* * Copyright © 2012-2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #ifdef HAVE_BCM_HOST # include #else # include "rpi-bcm-stubs.h" #endif #include "compositor.h" #include "rpi-renderer.h" #include "shared/helpers.h" #ifdef ENABLE_EGL #include #include #include "weston-egl-ext.h" #endif /* * Dispmanx API offers alpha-blended overlays for hardware compositing. * The final composite consists of dispmanx elements, and their contents: * the dispmanx resource assigned to the element. The elements may be * scanned out directly, or composited to a temporary surface, depending on * how the firmware decides to handle the scene. Updates to multiple elements * may be queued in a single dispmanx update object, resulting in atomic and * vblank synchronized display updates. * * To avoid tearing and display artifacts, the current dispmanx resource in a * dispmanx element must not be touched. Therefore each element must be * double-buffered, using two resources, the front and the back. While a * dispmanx update is running, the both resources must be considered in use. * * A resource may be destroyed only, when the update removing the element has * completed. Otherwise you risk showing an incomplete composition. */ #ifndef ELEMENT_CHANGE_LAYER /* copied from interface/vmcs_host/vc_vchi_dispmanx.h of userland.git */ #define ELEMENT_CHANGE_LAYER (1<<0) #define ELEMENT_CHANGE_OPACITY (1<<1) #define ELEMENT_CHANGE_DEST_RECT (1<<2) #define ELEMENT_CHANGE_SRC_RECT (1<<3) #define ELEMENT_CHANGE_MASK_RESOURCE (1<<4) #define ELEMENT_CHANGE_TRANSFORM (1<<5) #endif #if 0 #define DBG(...) \ weston_log(__VA_ARGS__) #else #define DBG(...) do {} while (0) #endif /* If we had a fully featured vc_dispmanx_resource_write_data()... */ /*#define HAVE_RESOURCE_WRITE_DATA_RECT 1*/ /* If we had a vc_dispmanx_element_set_opaque_rect()... */ /*#define HAVE_ELEMENT_SET_OPAQUE_RECT 1*/ struct rpi_resource { DISPMANX_RESOURCE_HANDLE_T handle; int width; int height; /* height of the image (valid pixel data) */ int stride; /* bytes */ int buffer_height; /* height of the buffer */ int enable_opaque_regions; VC_IMAGE_TYPE_T ifmt; }; struct rpir_output; struct rpir_egl_buffer { struct weston_buffer_reference buffer_ref; DISPMANX_RESOURCE_HANDLE_T resource_handle; }; enum buffer_type { BUFFER_TYPE_NULL, BUFFER_TYPE_SHM, BUFFER_TYPE_EGL }; struct rpir_surface { struct weston_surface *surface; struct wl_list views; int visible_views; int need_swap; int single_buffer; int enable_opaque_regions; struct rpi_resource resources[2]; struct rpi_resource *front; struct rpi_resource *back; pixman_region32_t prev_damage; struct rpir_egl_buffer *egl_front; struct rpir_egl_buffer *egl_back; struct rpir_egl_buffer *egl_old_front; struct weston_buffer_reference buffer_ref; enum buffer_type buffer_type; struct wl_listener surface_destroy_listener; }; struct rpir_view { struct rpir_surface *surface; struct wl_list surface_link; struct weston_view *view; /* If link is empty, the view is guaranteed to not be on screen, * i.e. updates removing Elements have completed. */ struct wl_list link; DISPMANX_ELEMENT_HANDLE_T handle; int layer; struct wl_listener view_destroy_listener; }; struct rpir_output { DISPMANX_DISPLAY_HANDLE_T display; DISPMANX_UPDATE_HANDLE_T update; /* all Elements currently on screen */ struct wl_list view_list; /* struct rpir_surface::link */ /* Elements just removed, waiting for update completion */ struct wl_list view_cleanup_list; /* struct rpir_surface::link */ struct rpi_resource capture_buffer; uint8_t *capture_data; }; struct rpi_renderer { struct weston_renderer base; int single_buffer; int enable_opaque_regions; #ifdef ENABLE_EGL EGLDisplay egl_display; PFNEGLBINDWAYLANDDISPLAYWL bind_display; PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display; PFNEGLQUERYWAYLANDBUFFERWL query_buffer; #endif int has_bind_display; }; static int rpi_renderer_create_surface(struct weston_surface *base); static int rpi_renderer_create_view(struct weston_view *base); static void rpir_view_handle_view_destroy(struct wl_listener *listener, void *data); static inline struct rpir_surface * to_rpir_surface(struct weston_surface *surface) { if (!surface->renderer_state) rpi_renderer_create_surface(surface); return surface->renderer_state; } static inline struct rpir_view * to_rpir_view(struct weston_view *view) { if (!view->renderer_state) rpi_renderer_create_view(view); return view->renderer_state; } static inline struct rpir_output * to_rpir_output(struct weston_output *output) { return output->renderer_state; } static inline struct rpi_renderer * to_rpi_renderer(struct weston_compositor *compositor) { return container_of(compositor->renderer, struct rpi_renderer, base); } static inline int int_max(int a, int b) { return a > b ? a : b; } static inline void int_swap(int *a, int *b) { int tmp = *a; *a = *b; *b = tmp; } static uint8_t float2uint8(float f) { int v = roundf(f * 255.0f); return v < 0 ? 0 : (v > 255 ? 255 : v); } static void rpi_resource_init(struct rpi_resource *resource) { resource->handle = DISPMANX_NO_HANDLE; } static void rpi_resource_release(struct rpi_resource *resource) { if (resource->handle == DISPMANX_NO_HANDLE) return; vc_dispmanx_resource_delete(resource->handle); DBG("resource %p release\n", resource); resource->handle = DISPMANX_NO_HANDLE; } static int rpi_resource_realloc(struct rpi_resource *resource, VC_IMAGE_TYPE_T ifmt, int width, int height, int stride, int buffer_height) { uint32_t dummy; if (resource->handle != DISPMANX_NO_HANDLE && resource->width == width && resource->height == height && resource->stride == stride && resource->buffer_height == buffer_height && resource->ifmt == ifmt) return 0; rpi_resource_release(resource); /* NOTE: if stride is not a multiple of 16 pixels in bytes, * the vc_image_* functions may break. Dispmanx elements * should be fine, though. Buffer_height probably has similar * constraints, too. */ resource->handle = vc_dispmanx_resource_create(ifmt, width | (stride << 16), height | (buffer_height << 16), &dummy); if (resource->handle == DISPMANX_NO_HANDLE) return -1; resource->width = width; resource->height = height; resource->stride = stride; resource->buffer_height = buffer_height; resource->ifmt = ifmt; DBG("resource %p alloc\n", resource); return 1; } /* A firmware workaround for broken ALPHA_PREMULT + ALPHA_MIX hardware. */ #define PREMULT_ALPHA_FLAG (1 << 31) static VC_IMAGE_TYPE_T shm_buffer_get_vc_format(struct wl_shm_buffer *buffer) { switch (wl_shm_buffer_get_format(buffer)) { case WL_SHM_FORMAT_XRGB8888: return VC_IMAGE_XRGB8888; case WL_SHM_FORMAT_ARGB8888: return VC_IMAGE_ARGB8888 | PREMULT_ALPHA_FLAG; case WL_SHM_FORMAT_RGB565: return VC_IMAGE_RGB565; default: /* invalid format */ return VC_IMAGE_MIN; } } #ifndef HAVE_ELEMENT_SET_OPAQUE_RECT static uint32_t * apply_opaque_region(struct wl_shm_buffer *buffer, pixman_region32_t *opaque_region) { uint32_t *src, *dst; int width; int height; int stride; int x, y; width = wl_shm_buffer_get_width(buffer); height = wl_shm_buffer_get_height(buffer); stride = wl_shm_buffer_get_stride(buffer); src = wl_shm_buffer_get_data(buffer); dst = malloc(height * stride); if (dst == NULL) { weston_log("rpi-renderer error: out of memory\n"); return NULL; } for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { int i = y * stride / 4 + x; if (pixman_region32_contains_point (opaque_region, x, y, NULL)) { dst[i] = src[i] | 0xff000000; } else { dst[i] = src[i]; } } } return dst; } #endif static int rpi_resource_update(struct rpi_resource *resource, struct weston_buffer *buffer, pixman_region32_t *region, pixman_region32_t *opaque_region) { pixman_region32_t write_region; pixman_box32_t *r; VC_RECT_T rect; VC_IMAGE_TYPE_T ifmt; uint32_t *pixels; int width; int height; int stride; int ret; int applied_opaque_region = 0; #ifdef HAVE_RESOURCE_WRITE_DATA_RECT int n; #endif if (!buffer) return -1; ifmt = shm_buffer_get_vc_format(buffer->shm_buffer); width = wl_shm_buffer_get_width(buffer->shm_buffer); height = wl_shm_buffer_get_height(buffer->shm_buffer); stride = wl_shm_buffer_get_stride(buffer->shm_buffer); pixels = wl_shm_buffer_get_data(buffer->shm_buffer); #ifndef HAVE_ELEMENT_SET_OPAQUE_RECT if (pixman_region32_not_empty(opaque_region) && wl_shm_buffer_get_format(buffer->shm_buffer) == WL_SHM_FORMAT_ARGB8888 && resource->enable_opaque_regions) { pixels = apply_opaque_region(buffer->shm_buffer, opaque_region); if (!pixels) return -1; applied_opaque_region = 1; } #endif ret = rpi_resource_realloc(resource, ifmt & ~PREMULT_ALPHA_FLAG, width, height, stride, height); if (ret < 0) { if (applied_opaque_region) free(pixels); return -1; } pixman_region32_init_rect(&write_region, 0, 0, width, height); if (ret == 0) pixman_region32_intersect(&write_region, &write_region, region); wl_shm_buffer_begin_access(buffer->shm_buffer); #ifdef HAVE_RESOURCE_WRITE_DATA_RECT /* XXX: Can this do a format conversion, so that scanout does not have to? */ r = pixman_region32_rectangles(&write_region, &n); while (n--) { vc_dispmanx_rect_set(&rect, r[n].x1, r[n].y1, r[n].x2 - r[n].x1, r[n].y2 - r[n].y1); ret = vc_dispmanx_resource_write_data_rect(resource->handle, ifmt, stride, pixels, &rect, rect.x, rect.y); DBG("%s: %p %ux%u@%u,%u, ret %d\n", __func__, resource, rect.width, rect.height, rect.x, rect.y, ret); if (ret) break; } #else /* vc_dispmanx_resource_write_data() ignores ifmt, * rect.x, rect.width, and uses stride only for computing * the size of the transfer as rect.height * stride. * Therefore we can only write rows starting at x=0. * To be able to write more than one scanline at a time, * the resource must have been created with the same stride * as used here, and we must write full scanlines. */ r = pixman_region32_extents(&write_region); vc_dispmanx_rect_set(&rect, 0, r->y1, width, r->y2 - r->y1); ret = vc_dispmanx_resource_write_data(resource->handle, ifmt, stride, pixels, &rect); DBG("%s: %p %ux%u@%u,%u, ret %d\n", __func__, resource, width, r->y2 - r->y1, 0, r->y1, ret); #endif wl_shm_buffer_end_access(buffer->shm_buffer); pixman_region32_fini(&write_region); if (applied_opaque_region) free(pixels); return ret ? -1 : 0; } static inline void rpi_buffer_egl_lock(struct weston_buffer *buffer) { #ifdef ENABLE_EGL vc_dispmanx_set_wl_buffer_in_use(buffer->resource, 1); #endif } static inline void rpi_buffer_egl_unlock(struct weston_buffer *buffer) { #ifdef ENABLE_EGL vc_dispmanx_set_wl_buffer_in_use(buffer->resource, 0); #endif } static void rpir_egl_buffer_destroy(struct rpir_egl_buffer *egl_buffer) { struct weston_buffer *buffer; if (egl_buffer == NULL) return; buffer = egl_buffer->buffer_ref.buffer; if (buffer == NULL) { /* The client has already destroyed the wl_buffer, the * compositor has the responsibility to delete the resource. */ vc_dispmanx_resource_delete(egl_buffer->resource_handle); } else { rpi_buffer_egl_unlock(buffer); weston_buffer_reference(&egl_buffer->buffer_ref, NULL); } free(egl_buffer); } static struct rpir_surface * rpir_surface_create(struct rpi_renderer *renderer) { struct rpir_surface *surface; surface = zalloc(sizeof *surface); if (surface == NULL) return NULL; wl_list_init(&surface->views); surface->single_buffer = renderer->single_buffer; surface->enable_opaque_regions = renderer->enable_opaque_regions; rpi_resource_init(&surface->resources[0]); rpi_resource_init(&surface->resources[1]); surface->front = &surface->resources[0]; if (surface->single_buffer) surface->back = &surface->resources[0]; else surface->back = &surface->resources[1]; surface->front->enable_opaque_regions = renderer->enable_opaque_regions; surface->back->enable_opaque_regions = renderer->enable_opaque_regions; surface->buffer_type = BUFFER_TYPE_NULL; pixman_region32_init(&surface->prev_damage); return surface; } static void rpir_surface_destroy(struct rpir_surface *surface) { if (surface->visible_views) weston_log("ERROR rpi: destroying on-screen element\n"); assert(wl_list_empty(&surface->views)); if (surface->surface) surface->surface->renderer_state = NULL; pixman_region32_fini(&surface->prev_damage); rpi_resource_release(&surface->resources[0]); rpi_resource_release(&surface->resources[1]); DBG("rpir_surface %p destroyed (%u)\n", surface, surface->visible_views); rpir_egl_buffer_destroy(surface->egl_back); rpir_egl_buffer_destroy(surface->egl_front); rpir_egl_buffer_destroy(surface->egl_old_front); free(surface); } static int rpir_surface_damage(struct rpir_surface *surface, struct weston_buffer *buffer, pixman_region32_t *damage) { pixman_region32_t upload; int ret; if (!pixman_region32_not_empty(damage)) return 0; DBG("rpir_surface %p update resource %p\n", surface, surface->back); /* XXX: todo: if no surface->handle, update front buffer directly * to avoid creating a new back buffer */ if (surface->single_buffer) { ret = rpi_resource_update(surface->front, buffer, damage, &surface->surface->opaque); } else { pixman_region32_init(&upload); pixman_region32_union(&upload, &surface->prev_damage, damage); ret = rpi_resource_update(surface->back, buffer, &upload, &surface->surface->opaque); pixman_region32_fini(&upload); } pixman_region32_copy(&surface->prev_damage, damage); surface->need_swap = 1; return ret; } static struct rpir_view * rpir_view_create(struct rpir_surface *surface) { struct rpir_view *view; view = zalloc(sizeof *view); if (view == NULL) return NULL; view->surface = surface; wl_list_insert(&surface->views, &view->surface_link); wl_list_init(&view->link); view->handle = DISPMANX_NO_HANDLE; return view; } static void rpir_view_destroy(struct rpir_view *view) { wl_list_remove(&view->link); if (view->handle != DISPMANX_NO_HANDLE) { view->surface->visible_views--; weston_log("ERROR rpi: destroying on-screen element\n"); } if (view->view) view->view->renderer_state = NULL; wl_list_remove(&view->surface_link); if (wl_list_empty(&view->surface->views) && view->surface->surface == NULL) rpir_surface_destroy(view->surface); DBG("rpir_view %p destroyed (%d)\n", view, view->handle); free(view); } static void matrix_type_str(struct weston_matrix *matrix, char *buf, int len) { static const char types[33] = "TSRO"; unsigned mask = matrix->type; int i = 0; while (mask && i < len - 1) { if (mask & (1u << i)) *buf++ = types[i]; mask &= ~(1u << i); i++; } *buf = '\0'; } static void log_print_matrix(struct weston_matrix *matrix) { char typestr[6]; float *d = matrix->d; matrix_type_str(matrix, typestr, sizeof typestr); weston_log_continue("%14.6e %14.6e %14.6e %14.6e\n", d[0], d[4], d[8], d[12]); weston_log_continue("%14.6e %14.6e %14.6e %14.6e\n", d[1], d[5], d[9], d[13]); weston_log_continue("%14.6e %14.6e %14.6e %14.6e\n", d[2], d[6], d[10], d[14]); weston_log_continue("%14.6e %14.6e %14.6e %14.6e type: %s\n", d[3], d[7], d[11], d[15], typestr); } static void warn_bad_matrix(struct weston_matrix *total, struct weston_matrix *output, struct weston_matrix *surface) { static int n_warn; char typestr[6]; if (n_warn++ == 10) weston_log("%s: not showing more warnings\n", __func__); if (n_warn > 10) return; weston_log("%s: warning: total transformation is not renderable:\n", __func__); log_print_matrix(total); matrix_type_str(surface, typestr, sizeof typestr); weston_log_continue("surface matrix type: %s\n", typestr); matrix_type_str(output, typestr, sizeof typestr); weston_log_continue("output matrix type: %s\n", typestr); } /*#define SURFACE_TRANSFORM */ static int rpir_view_compute_rects(struct rpir_view *view, VC_RECT_T *src_rect, VC_RECT_T *dst_rect, VC_IMAGE_TRANSFORM_T *flipmask) { struct weston_output *output_base = view->view->surface->output; struct weston_matrix matrix = view->view->transform.matrix; VC_IMAGE_TRANSFORM_T flipt = 0; int src_x, src_y; int dst_x, dst_y; int src_width, src_height; int dst_width, dst_height; struct weston_vector p1 = {{ 0.0f, 0.0f, 0.0f, 1.0f }}; struct weston_vector p2 = {{ 0.0f, 0.0f, 0.0f, 1.0f }}; int t; int over; /* XXX: take buffer transform into account */ /* src is in 16.16, dst is in 32.0 fixed point. * Negative values are not allowed in VC_RECT_T. * Clip size to output boundaries, firmware ignores * huge elements like 8192x8192. */ src_x = 0 << 16; src_y = 0 << 16; if (view->surface->buffer_type == BUFFER_TYPE_EGL) { struct weston_buffer *buffer = view->surface->egl_front->buffer_ref.buffer; if (!buffer) return -1; src_width = buffer->width << 16; src_height = buffer->height << 16; } else { src_width = view->surface->front->width << 16; src_height = view->surface->front->height << 16; } weston_matrix_multiply(&matrix, &output_base->matrix); #ifdef SURFACE_TRANSFORM if (matrix.type >= WESTON_MATRIX_TRANSFORM_OTHER) { #else if (matrix.type >= WESTON_MATRIX_TRANSFORM_ROTATE) { #endif warn_bad_matrix(&matrix, &output_base->matrix, &view->view->transform.matrix); } else { if (matrix.type & WESTON_MATRIX_TRANSFORM_ROTATE) { if (fabsf(matrix.d[0]) < 1e-4f && fabsf(matrix.d[5]) < 1e-4f) { flipt |= TRANSFORM_TRANSPOSE; } else if (fabsf(matrix.d[1]) < 1e-4 && fabsf(matrix.d[4]) < 1e-4) { /* no transpose */ } else { warn_bad_matrix(&matrix, &output_base->matrix, &view->view->transform.matrix); } } } p2.f[0] = view->view->surface->width; p2.f[1] = view->view->surface->height; /* transform top-left and bot-right corner into screen coordinates */ weston_matrix_transform(&matrix, &p1); weston_matrix_transform(&matrix, &p2); /* Compute the destination rectangle on screen, converting * negative dimensions to flips. */ dst_width = round(p2.f[0] - p1.f[0]); if (dst_width < 0) { dst_x = round(p2.f[0]); dst_width = -dst_width; if (!(flipt & TRANSFORM_TRANSPOSE)) flipt |= TRANSFORM_HFLIP; else flipt |= TRANSFORM_VFLIP; } else { dst_x = round(p1.f[0]); } dst_height = round(p2.f[1] - p1.f[1]); if (dst_height < 0) { dst_y = round(p2.f[1]); dst_height = -dst_height; if (!(flipt & TRANSFORM_TRANSPOSE)) flipt |= TRANSFORM_VFLIP; else flipt |= TRANSFORM_HFLIP; } else { dst_y = round(p1.f[1]); } if (dst_width == 0 || dst_height == 0) { DBG("ignored, zero surface area before clipping\n"); return -1; } #ifdef SURFACE_TRANSFORM /* Dispmanx works as if you flipped the whole screen, when * you flip an element. But, we want to flip an element in place. * XXX: fixme */ if (flipt & TRANSFORM_HFLIP) dst_x = output_base->width - dst_x; if (flipt & TRANSFORM_VFLIP) dst_y = output_base->height - dst_y; if (flipt & TRANSFORM_TRANSPOSE) { int_swap(&dst_x, &dst_y); int_swap(&dst_width, &dst_height); } #else switch (output_base->transform) { case WL_OUTPUT_TRANSFORM_FLIPPED: flipt = TRANSFORM_HFLIP; break; case WL_OUTPUT_TRANSFORM_NORMAL: flipt = 0; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: flipt = TRANSFORM_HFLIP | TRANSFORM_VFLIP | TRANSFORM_TRANSPOSE; break; case WL_OUTPUT_TRANSFORM_90: flipt = TRANSFORM_VFLIP | TRANSFORM_TRANSPOSE; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: flipt = TRANSFORM_VFLIP; break; case WL_OUTPUT_TRANSFORM_180: flipt = TRANSFORM_HFLIP | TRANSFORM_VFLIP; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: flipt = TRANSFORM_TRANSPOSE; break; case WL_OUTPUT_TRANSFORM_270: flipt = TRANSFORM_HFLIP | TRANSFORM_TRANSPOSE; break; default: break; } #endif /* clip destination rectangle to screen dimensions */ if (dst_x < 0) { t = (int64_t)dst_x * src_width / dst_width; src_width += t; dst_width += dst_x; src_x -= t; dst_x = 0; } if (dst_y < 0) { t = (int64_t)dst_y * src_height / dst_height; src_height += t; dst_height += dst_y; src_y -= t; dst_y = 0; } over = dst_x + dst_width - output_base->width; if (over > 0) { t = (int64_t)over * src_width / dst_width; src_width -= t; dst_width -= over; } over = dst_y + dst_height - output_base->height; if (over > 0) { t = (int64_t)over * src_height / dst_height; src_height -= t; dst_height -= over; } src_width = int_max(src_width, 0); src_height = int_max(src_height, 0); DBG("rpir_view %p %dx%d: p1 %f, %f; p2 %f, %f\n", view, view->view->surface->width, view->view->surface->height, p1.f[0], p1.f[1], p2.f[0], p2.f[1]); DBG("src rect %d;%d, %d;%d, %d;%dx%d;%d\n", src_x >> 16, src_x & 0xffff, src_y >> 16, src_y & 0xffff, src_width >> 16, src_width & 0xffff, src_height >> 16, src_height & 0xffff); DBG("dest rect %d, %d, %dx%d%s%s%s\n", dst_x, dst_y, dst_width, dst_height, (flipt & TRANSFORM_HFLIP) ? " hflip" : "", (flipt & TRANSFORM_VFLIP) ? " vflip" : "", (flipt & TRANSFORM_TRANSPOSE) ? " transp" : ""); assert(src_x >= 0); assert(src_y >= 0); assert(dst_x >= 0); assert(dst_y >= 0); if (dst_width < 1 || dst_height < 1) { DBG("ignored, zero surface area after clipping\n"); return -1; } /* EGL buffers will be upside-down related to what DispmanX expects */ if (view->surface->buffer_type == BUFFER_TYPE_EGL) flipt ^= TRANSFORM_VFLIP; vc_dispmanx_rect_set(src_rect, src_x, src_y, src_width, src_height); vc_dispmanx_rect_set(dst_rect, dst_x, dst_y, dst_width, dst_height); *flipmask = flipt; return 0; } static DISPMANX_TRANSFORM_T vc_image2dispmanx_transform(VC_IMAGE_TRANSFORM_T t) { /* XXX: uhh, are these right? */ switch (t) { case VC_IMAGE_ROT0: return DISPMANX_NO_ROTATE; case VC_IMAGE_MIRROR_ROT0: return DISPMANX_FLIP_HRIZ; case VC_IMAGE_MIRROR_ROT180: return DISPMANX_FLIP_VERT; case VC_IMAGE_ROT180: return DISPMANX_ROTATE_180; case VC_IMAGE_MIRROR_ROT90: return DISPMANX_ROTATE_90 | DISPMANX_FLIP_HRIZ; case VC_IMAGE_ROT270: return DISPMANX_ROTATE_270; case VC_IMAGE_ROT90: return DISPMANX_ROTATE_90; case VC_IMAGE_MIRROR_ROT270: return DISPMANX_ROTATE_270 | DISPMANX_FLIP_VERT; default: assert(0 && "bad VC_IMAGE_TRANSFORM_T"); return DISPMANX_NO_ROTATE; } } static DISPMANX_RESOURCE_HANDLE_T rpir_surface_get_resource(struct rpir_surface *surface) { switch (surface->buffer_type) { case BUFFER_TYPE_SHM: case BUFFER_TYPE_NULL: return surface->front->handle; case BUFFER_TYPE_EGL: if (surface->egl_front != NULL) return surface->egl_front->resource_handle; default: return DISPMANX_NO_HANDLE; } } #ifdef HAVE_ELEMENT_SET_OPAQUE_RECT static int rpir_surface_set_opaque_rect(struct rpir_surface *surface, DISPMANX_UPDATE_HANDLE_T update) { int ret; if (pixman_region32_not_empty(&surface->surface->opaque) && surface->opaque_regions) { pixman_box32_t *box; VC_RECT_T opaque_rect; box = pixman_region32_extents(&surface->surface->opaque); opaque_rect.x = box->x1; opaque_rect.y = box->y1; opaque_rect.width = box->x2 - box->x1; opaque_rect.height = box->y2 - box->y1; ret = vc_dispmanx_element_set_opaque_rect(update, surface->handle, &opaque_rect); if (ret) { weston_log("vc_dispmanx_element_set_opaque_rect failed\n"); return -1; } } return 0; } #endif static int rpir_view_dmx_add(struct rpir_view *view, struct rpir_output *output, DISPMANX_UPDATE_HANDLE_T update, int layer) { /* Do not use DISPMANX_FLAGS_ALPHA_PREMULT here. * If you define PREMULT and ALPHA_MIX, the hardware will not * multiply the source color with the element alpha, leading to * bad colors. Instead, we define PREMULT during pixel data upload. */ VC_DISPMANX_ALPHA_T alphasetup = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE | DISPMANX_FLAGS_ALPHA_MIX, float2uint8(view->view->alpha), /* opacity 0-255 */ 0 /* mask resource handle */ }; VC_RECT_T dst_rect; VC_RECT_T src_rect; VC_IMAGE_TRANSFORM_T flipmask; int ret; DISPMANX_RESOURCE_HANDLE_T resource_handle; resource_handle = rpir_surface_get_resource(view->surface); if (resource_handle == DISPMANX_NO_HANDLE) { weston_log("%s: no buffer yet, aborting\n", __func__); return 0; } ret = rpir_view_compute_rects(view, &src_rect, &dst_rect, &flipmask); if (ret < 0) return 0; view->handle = vc_dispmanx_element_add( update, output->display, layer, &dst_rect, resource_handle, &src_rect, DISPMANX_PROTECTION_NONE, &alphasetup, NULL /* clamp */, vc_image2dispmanx_transform(flipmask)); DBG("rpir_surface %p add %u, alpha %f resource %d\n", view, view->handle, view->view->alpha, resource_handle); if (view->handle == DISPMANX_NO_HANDLE) return -1; #ifdef HAVE_ELEMENT_SET_OPAQUE_RECT ret = rpir_surface_set_opaque_rect(surface, update); if (ret < 0) return -1; #endif view->surface->visible_views++; return 1; } static void rpir_view_dmx_swap(struct rpir_view *view, DISPMANX_UPDATE_HANDLE_T update) { VC_RECT_T rect; pixman_box32_t *r; /* XXX: skip, iff resource was not reallocated, and single-buffering */ vc_dispmanx_element_change_source(update, view->handle, view->surface->front->handle); /* This is current damage now, after rpir_surface_damage() */ r = pixman_region32_extents(&view->surface->prev_damage); vc_dispmanx_rect_set(&rect, r->x1, r->y1, r->x2 - r->x1, r->y2 - r->y1); vc_dispmanx_element_modified(update, view->handle, &rect); DBG("rpir_view %p swap\n", view); } static int rpir_view_dmx_move(struct rpir_view *view, DISPMANX_UPDATE_HANDLE_T update, int layer) { uint8_t alpha = float2uint8(view->view->alpha); VC_RECT_T dst_rect; VC_RECT_T src_rect; VC_IMAGE_TRANSFORM_T flipmask; int ret; /* XXX: return early, if all attributes stay the same */ if (view->surface->buffer_type == BUFFER_TYPE_EGL) { DISPMANX_RESOURCE_HANDLE_T resource_handle; resource_handle = rpir_surface_get_resource(view->surface); if (resource_handle == DISPMANX_NO_HANDLE) { weston_log("%s: no buffer yet, aborting\n", __func__); return 0; } vc_dispmanx_element_change_source(update, view->handle, resource_handle); } ret = rpir_view_compute_rects(view, &src_rect, &dst_rect, &flipmask); if (ret < 0) return 0; ret = vc_dispmanx_element_change_attributes( update, view->handle, ELEMENT_CHANGE_LAYER | ELEMENT_CHANGE_OPACITY | ELEMENT_CHANGE_TRANSFORM | ELEMENT_CHANGE_DEST_RECT | ELEMENT_CHANGE_SRC_RECT, layer, alpha, &dst_rect, &src_rect, DISPMANX_NO_HANDLE, /* This really is DISPMANX_TRANSFORM_T, no matter * what the header says. */ vc_image2dispmanx_transform(flipmask)); DBG("rpir_view %p move\n", view); if (ret) return -1; #ifdef HAVE_ELEMENT_SET_OPAQUE_RECT ret = rpir_surface_set_opaque_rect(surface, update); if (ret < 0) return -1; #endif return 1; } static void rpir_view_dmx_remove(struct rpir_view *view, DISPMANX_UPDATE_HANDLE_T update) { if (view->handle == DISPMANX_NO_HANDLE) return; vc_dispmanx_element_remove(update, view->handle); DBG("rpir_view %p remove %u\n", view, view->handle); view->handle = DISPMANX_NO_HANDLE; view->surface->visible_views--; } static void rpir_surface_swap_pointers(struct rpir_surface *surface) { struct rpi_resource *tmp; if (surface->buffer_type == BUFFER_TYPE_EGL) { if (surface->egl_back != NULL) { assert(surface->egl_old_front == NULL); surface->egl_old_front = surface->egl_front; surface->egl_front = surface->egl_back; surface->egl_back = NULL; DBG("new front %d\n", surface->egl_front->resource_handle); } } else { tmp = surface->front; surface->front = surface->back; surface->back = tmp; DBG("new back %p, new front %p\n", surface->back, surface->front); } } static int is_view_not_visible(struct weston_view *view) { /* Return true, if surface is guaranteed to be totally obscured. */ int ret; pixman_region32_t unocc; pixman_region32_init(&unocc); pixman_region32_subtract(&unocc, &view->transform.boundingbox, &view->clip); ret = !pixman_region32_not_empty(&unocc); pixman_region32_fini(&unocc); return ret; } static void rpir_view_update(struct rpir_view *view, struct rpir_output *output, DISPMANX_UPDATE_HANDLE_T update, int layer) { int ret; int obscured; obscured = is_view_not_visible(view->view); if (obscured) { DBG("rpir_view %p totally obscured.\n", view); wl_list_remove(&view->link); if (view->handle == DISPMANX_NO_HANDLE) { wl_list_init(&view->link); } else { rpir_view_dmx_remove(view, update); wl_list_insert(&output->view_cleanup_list, &view->link); } goto out; } if (view->handle == DISPMANX_NO_HANDLE) { ret = rpir_view_dmx_add(view, output, update, layer); if (ret == 0) { wl_list_remove(&view->link); wl_list_init(&view->link); } else if (ret < 0) { weston_log("ERROR rpir_view_dmx_add() failed.\n"); } } else { if (view->surface->need_swap) rpir_view_dmx_swap(view, update); ret = rpir_view_dmx_move(view, update, layer); if (ret == 0) { rpir_view_dmx_remove(view, update); wl_list_remove(&view->link); wl_list_insert(&output->view_cleanup_list, &view->link); } else if (ret < 0) { weston_log("ERROR rpir_view_dmx_move() failed.\n"); } } out: view->layer = layer; } static int rpi_renderer_read_pixels(struct weston_output *base, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { struct rpir_output *output = to_rpir_output(base); struct rpi_resource *buffer = &output->capture_buffer; VC_RECT_T rect; uint32_t fb_width, fb_height; uint32_t dst_pitch; uint32_t i; int ret; fb_width = base->current_mode->width; fb_height = base->current_mode->height; DBG("%s(%u, %u, %u, %u), resource %p\n", __func__, x, y, width, height, buffer); if (format != PIXMAN_a8r8g8b8) { weston_log("rpi-renderer error: bad read_format\n"); return -1; } dst_pitch = fb_width * 4; if (buffer->handle == DISPMANX_NO_HANDLE) { free(output->capture_data); output->capture_data = NULL; ret = rpi_resource_realloc(buffer, VC_IMAGE_ARGB8888, fb_width, fb_height, dst_pitch, fb_height); if (ret < 0) { weston_log("rpi-renderer error: " "allocating read buffer failed\n"); return -1; } ret = vc_dispmanx_snapshot(output->display, buffer->handle, VC_IMAGE_ROT0); if (ret) { weston_log("rpi-renderer error: " "vc_dispmanx_snapshot returned %d\n", ret); return -1; } DBG("%s: snapshot done.\n", __func__); } /* * If vc_dispmanx_resource_read_data was able to read sub-rectangles, * we could read directly into 'pixels'. But it cannot, it does not * use rect.x or rect.width, and does this: * host_start = (uint8_t *)dst_address + (dst_pitch * p_rect->y); * In other words, it is only good for reading the full buffer in * one go. */ vc_dispmanx_rect_set(&rect, 0, 0, fb_width, fb_height); if (x == 0 && y == 0 && width == fb_width && height == fb_height) { ret = vc_dispmanx_resource_read_data(buffer->handle, &rect, pixels, dst_pitch); if (ret) { weston_log("rpi-renderer error: " "resource_read_data returned %d\n", ret); return -1; } DBG("%s: full frame done.\n", __func__); return 0; } if (!output->capture_data) { output->capture_data = malloc(fb_height * dst_pitch); if (!output->capture_data) { weston_log("rpi-renderer error: " "out of memory\n"); return -1; } ret = vc_dispmanx_resource_read_data(buffer->handle, &rect, output->capture_data, dst_pitch); if (ret) { weston_log("rpi-renderer error: " "resource_read_data returned %d\n", ret); return -1; } } for (i = 0; i < height; i++) { uint8_t *src = output->capture_data + (y + i) * dst_pitch + x * 4; uint8_t *dst = (uint8_t *)pixels + i * width * 4; memcpy(dst, src, width * 4); } return 0; } static void rpir_output_dmx_remove_all(struct rpir_output *output, DISPMANX_UPDATE_HANDLE_T update) { struct rpir_view *view; while (!wl_list_empty(&output->view_list)) { view = container_of(output->view_list.next, struct rpir_view, link); rpir_view_dmx_remove(view, update); wl_list_remove(&view->link); wl_list_insert(&output->view_cleanup_list, &view->link); } } /* Note: this won't work right for multiple outputs. A DispmanX Element * is tied to one DispmanX Display, i.e. output. */ static void rpi_renderer_repaint_output(struct weston_output *base, pixman_region32_t *output_damage) { struct weston_compositor *compositor = base->compositor; struct rpir_output *output = to_rpir_output(base); struct weston_view *wv; struct rpir_view *view; struct wl_list done_list; int layer = 1; assert(output->update != DISPMANX_NO_HANDLE); rpi_resource_release(&output->capture_buffer); free(output->capture_data); output->capture_data = NULL; /* Swap resources on surfaces as needed */ wl_list_for_each_reverse(wv, &compositor->view_list, link) wv->surface->touched = 0; wl_list_for_each_reverse(wv, &compositor->view_list, link) { view = to_rpir_view(wv); if (!wv->surface->touched) { wv->surface->touched = 1; if (view->surface->buffer_type == BUFFER_TYPE_EGL || view->surface->need_swap) rpir_surface_swap_pointers(view->surface); } if (view->surface->buffer_type == BUFFER_TYPE_EGL) { struct weston_buffer *buffer; buffer = view->surface->egl_front->buffer_ref.buffer; if (buffer != NULL) { rpi_buffer_egl_lock(buffer); } else { weston_log("warning: client destroyed current front buffer\n"); wl_list_remove(&view->link); if (view->handle == DISPMANX_NO_HANDLE) { wl_list_init(&view->link); } else { rpir_view_dmx_remove(view, output->update); wl_list_insert(&output->view_cleanup_list, &view->link); } } } } /* update all renderable surfaces */ wl_list_init(&done_list); wl_list_for_each_reverse(wv, &compositor->view_list, link) { if (wv->plane != &compositor->primary_plane) continue; view = to_rpir_view(wv); assert(!wl_list_empty(&view->link) || view->handle == DISPMANX_NO_HANDLE); wl_list_remove(&view->link); wl_list_insert(&done_list, &view->link); rpir_view_update(view, output, output->update, layer++); } /* Mark all surfaces as swapped */ wl_list_for_each_reverse(wv, &compositor->view_list, link) to_rpir_surface(wv->surface)->need_swap = 0; /* Remove all surfaces that are still on screen, but were * not rendered this time. */ rpir_output_dmx_remove_all(output, output->update); wl_list_insert_list(&output->view_list, &done_list); output->update = DISPMANX_NO_HANDLE; /* The frame_signal is emitted in rpi_renderer_finish_frame(), * so that the firmware can capture the up-to-date contents. */ } static void rpi_renderer_flush_damage(struct weston_surface *base) { /* Called for every surface just before repainting it, if * having an shm buffer. */ struct rpir_surface *surface = to_rpir_surface(base); struct weston_buffer *buffer = surface->buffer_ref.buffer; int ret; assert(buffer); assert(wl_shm_buffer_get(buffer->resource)); ret = rpir_surface_damage(surface, buffer, &base->damage); if (ret) weston_log("%s error: updating Dispmanx resource failed.\n", __func__); weston_buffer_reference(&surface->buffer_ref, NULL); } static void rpi_renderer_attach(struct weston_surface *base, struct weston_buffer *buffer) { /* Called every time a client commits an attach. */ struct rpir_surface *surface = to_rpir_surface(base); assert(surface); if (!surface) return; if (surface->buffer_type == BUFFER_TYPE_SHM) { if (!surface->single_buffer) /* XXX: need to check if in middle of update */ rpi_resource_release(surface->back); if (!surface->visible_views) /* XXX: cannot do this, if middle of an update */ rpi_resource_release(surface->front); weston_buffer_reference(&surface->buffer_ref, NULL); } /* If buffer is NULL, Weston core unmaps the surface, the surface * will not appear in repaint list, and so rpi_renderer_repaint_output * will remove the DispmanX element. Later, for SHM, also the front * buffer will be released in the cleanup_list processing. */ if (!buffer) return; if (wl_shm_buffer_get(buffer->resource)) { surface->buffer_type = BUFFER_TYPE_SHM; buffer->shm_buffer = wl_shm_buffer_get(buffer->resource); buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer); buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer); weston_buffer_reference(&surface->buffer_ref, buffer); } else { #if ENABLE_EGL struct rpi_renderer *renderer = to_rpi_renderer(base->compositor); struct wl_resource *wl_resource = buffer->resource; if (!renderer->has_bind_display || !renderer->query_buffer(renderer->egl_display, wl_resource, EGL_WIDTH, &buffer->width)) { weston_log("unhandled buffer type!\n"); weston_buffer_reference(&surface->buffer_ref, NULL); surface->buffer_type = BUFFER_TYPE_NULL; } renderer->query_buffer(renderer->egl_display, wl_resource, EGL_HEIGHT, &buffer->height); surface->buffer_type = BUFFER_TYPE_EGL; if (surface->egl_back == NULL) surface->egl_back = zalloc(sizeof *surface->egl_back); weston_buffer_reference(&surface->egl_back->buffer_ref, buffer); surface->egl_back->resource_handle = vc_dispmanx_get_handle_from_wl_buffer(wl_resource); #else weston_log("unhandled buffer type!\n"); weston_buffer_reference(&surface->buffer_ref, NULL); surface->buffer_type = BUFFER_TYPE_NULL; #endif } } static void rpir_surface_handle_surface_destroy(struct wl_listener *listener, void *data) { struct rpir_surface *surface; struct weston_surface *base = data; surface = container_of(listener, struct rpir_surface, surface_destroy_listener); assert(surface); assert(surface->surface == base); if (!surface) return; surface->surface = NULL; base->renderer_state = NULL; if (wl_list_empty(&surface->views)) rpir_surface_destroy(surface); } static int rpi_renderer_create_surface(struct weston_surface *base) { struct rpi_renderer *renderer = to_rpi_renderer(base->compositor); struct rpir_surface *surface; assert(base->renderer_state == NULL); surface = rpir_surface_create(renderer); if (!surface) return -1; surface->surface = base; base->renderer_state = surface; surface->surface_destroy_listener.notify = rpir_surface_handle_surface_destroy; wl_signal_add(&base->destroy_signal, &surface->surface_destroy_listener); return 0; } static int rpi_renderer_create_view(struct weston_view *base) { struct rpir_surface *surface = to_rpir_surface(base->surface); struct rpir_view *view; assert(base->renderer_state == NULL); view = rpir_view_create(surface); if (!view) return -1; view->view = base; base->renderer_state = view; view->view_destroy_listener.notify = rpir_view_handle_view_destroy; wl_signal_add(&base->destroy_signal, &view->view_destroy_listener); return 0; } static void rpi_renderer_surface_set_color(struct weston_surface *base, float red, float green, float blue, float alpha) { struct rpir_surface *surface = to_rpir_surface(base); uint8_t color[4]; VC_RECT_T rect; int ret; assert(surface); ret = rpi_resource_realloc(surface->back, VC_IMAGE_ARGB8888, 1, 1, 4, 1); if (ret < 0) { weston_log("Error: %s: rpi_resource_realloc failed.\n", __func__); return; } color[0] = float2uint8(blue); color[1] = float2uint8(green); color[2] = float2uint8(red); color[3] = float2uint8(alpha); vc_dispmanx_rect_set(&rect, 0, 0, 1, 1); ret = vc_dispmanx_resource_write_data(surface->back->handle, VC_IMAGE_ARGB8888, 4, color, &rect); if (ret) { weston_log("Error: %s: resource_write_data failed.\n", __func__); return; } DBG("%s: resource %p solid color BGRA %u,%u,%u,%u\n", __func__, surface->back, color[0], color[1], color[2], color[3]); /*pixman_region32_copy(&surface->prev_damage, damage);*/ surface->need_swap = 1; } static void rpir_view_handle_view_destroy(struct wl_listener *listener, void *data) { struct rpir_view *view; struct weston_view *base = data; view = container_of(listener, struct rpir_view, view_destroy_listener); assert(view); assert(view->view == base); if (!view) return; view->view = NULL; base->renderer_state = NULL; /* If guaranteed to not be on screen, just destroy it. */ if (wl_list_empty(&view->link)) rpir_view_destroy(view); /* Otherwise, the view is either on screen and needs * to be removed by a repaint update, or it is in the * view_cleanup_list, and will be destroyed by * rpi_renderer_finish_frame(). */ } static void rpi_renderer_destroy(struct weston_compositor *compositor) { struct rpi_renderer *renderer = to_rpi_renderer(compositor); #if ENABLE_EGL if (renderer->has_bind_display) renderer->unbind_display(renderer->egl_display, compositor->wl_display); #endif free(renderer); compositor->renderer = NULL; } WL_EXPORT int rpi_renderer_create(struct weston_compositor *compositor, const struct rpi_renderer_parameters *params) { struct rpi_renderer *renderer; #if ENABLE_EGL const char *extensions; EGLBoolean ret; EGLint major, minor; #endif weston_log("Initializing the DispmanX compositing renderer\n"); renderer = zalloc(sizeof *renderer); if (renderer == NULL) return -1; renderer->single_buffer = params->single_buffer; renderer->enable_opaque_regions = params->opaque_regions; renderer->base.read_pixels = rpi_renderer_read_pixels; renderer->base.repaint_output = rpi_renderer_repaint_output; renderer->base.flush_damage = rpi_renderer_flush_damage; renderer->base.attach = rpi_renderer_attach; renderer->base.surface_set_color = rpi_renderer_surface_set_color; renderer->base.destroy = rpi_renderer_destroy; #ifdef ENABLE_EGL renderer->egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY); if (renderer->egl_display == EGL_NO_DISPLAY) { weston_log("failed to create EGL display\n"); free(renderer); return -1; } if (!eglInitialize(renderer->egl_display, &major, &minor)) { weston_log("failed to initialize EGL display\n"); free(renderer); return -1; } renderer->bind_display = (void *) eglGetProcAddress("eglBindWaylandDisplayWL"); renderer->unbind_display = (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); renderer->query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); extensions = (const char *) eglQueryString(renderer->egl_display, EGL_EXTENSIONS); if (!extensions) { weston_log("Retrieving EGL extension string failed.\n"); eglTerminate(renderer->egl_display); free(renderer); return -1; } if (strstr(extensions, "EGL_WL_bind_wayland_display")) renderer->has_bind_display = 1; if (renderer->has_bind_display) { ret = renderer->bind_display(renderer->egl_display, compositor->wl_display); if (!ret) renderer->has_bind_display = 0; } #endif compositor->renderer = &renderer->base; compositor->read_format = PIXMAN_a8r8g8b8; /* WESTON_CAP_ROTATION_ANY not supported */ wl_display_add_shm_format(compositor->wl_display, WL_SHM_FORMAT_RGB565); return 0; } WL_EXPORT int rpi_renderer_output_create(struct weston_output *base, DISPMANX_DISPLAY_HANDLE_T display) { struct rpir_output *output; assert(base->renderer_state == NULL); output = zalloc(sizeof *output); if (output == NULL) return -1; output->display = display; output->update = DISPMANX_NO_HANDLE; wl_list_init(&output->view_list); wl_list_init(&output->view_cleanup_list); rpi_resource_init(&output->capture_buffer); base->renderer_state = output; return 0; } WL_EXPORT void rpi_renderer_output_destroy(struct weston_output *base) { struct rpir_output *output = to_rpir_output(base); struct rpir_view *view; DISPMANX_UPDATE_HANDLE_T update; rpi_resource_release(&output->capture_buffer); free(output->capture_data); output->capture_data = NULL; update = vc_dispmanx_update_start(0); rpir_output_dmx_remove_all(output, update); vc_dispmanx_update_submit_sync(update); while (!wl_list_empty(&output->view_cleanup_list)) { view = container_of(output->view_cleanup_list.next, struct rpir_view, link); rpir_view_destroy(view); } free(output); base->renderer_state = NULL; } WL_EXPORT void rpi_renderer_set_update_handle(struct weston_output *base, DISPMANX_UPDATE_HANDLE_T handle) { struct rpir_output *output = to_rpir_output(base); output->update = handle; } WL_EXPORT void rpi_renderer_finish_frame(struct weston_output *base) { struct rpir_output *output = to_rpir_output(base); struct weston_compositor *compositor = base->compositor; struct weston_view *wv; struct rpir_view *view; while (!wl_list_empty(&output->view_cleanup_list)) { view = container_of(output->view_cleanup_list.next, struct rpir_view, link); if (view->view) { /* The weston_view still exists, but is * temporarily not visible, and hence its Element * was removed. The current front buffer contents * must be preserved. */ if (!view->surface->visible_views) rpi_resource_release(view->surface->back); wl_list_remove(&view->link); wl_list_init(&view->link); } else { rpir_view_destroy(view); } } wl_list_for_each(wv, &compositor->view_list, link) { view = to_rpir_view(wv); if (view->surface->buffer_type != BUFFER_TYPE_EGL) continue; rpir_egl_buffer_destroy(view->surface->egl_old_front); view->surface->egl_old_front = NULL; } wl_signal_emit(&base->frame_signal, base); } weston-1.9.0/src/pixman-renderer.h0000664000175000017500000000275312537627702014045 00000000000000/* * Copyright © 2013 Vasily Khoruzhick * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "compositor.h" int pixman_renderer_init(struct weston_compositor *ec); int pixman_renderer_output_create(struct weston_output *output); void pixman_renderer_output_set_buffer(struct weston_output *output, pixman_image_t *buffer); void pixman_renderer_output_destroy(struct weston_output *output); weston-1.9.0/src/compositor-rpi.c0000664000175000017500000003651612575610243013724 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2011 Intel Corporation * Copyright © 2012-2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_BCM_HOST # include #else # include "rpi-bcm-stubs.h" #endif #include "shared/helpers.h" #include "compositor.h" #include "rpi-renderer.h" #include "launcher-util.h" #include "libinput-seat.h" #include "presentation_timing-server-protocol.h" #if 0 #define DBG(...) \ weston_log(__VA_ARGS__) #else #define DBG(...) do {} while (0) #endif struct rpi_backend; struct rpi_output; struct rpi_flippipe { int readfd; int writefd; clockid_t clk_id; struct wl_event_source *source; }; struct rpi_output { struct rpi_backend *backend; struct weston_output base; int single_buffer; struct weston_mode mode; struct rpi_flippipe flippipe; DISPMANX_DISPLAY_HANDLE_T display; }; struct rpi_seat { struct weston_seat base; struct wl_list devices_list; struct udev_monitor *udev_monitor; struct wl_event_source *udev_monitor_source; char *seat_id; }; struct rpi_backend { struct weston_backend base; struct weston_compositor *compositor; uint32_t prev_state; struct udev *udev; struct udev_input input; struct wl_listener session_listener; int single_buffer; }; static inline struct rpi_output * to_rpi_output(struct weston_output *base) { return container_of(base, struct rpi_output, base); } static inline struct rpi_seat * to_rpi_seat(struct weston_seat *base) { return container_of(base, struct rpi_seat, base); } static inline struct rpi_backend * to_rpi_backend(struct weston_compositor *c) { return container_of(c->backend, struct rpi_backend, base); } static void rpi_flippipe_update_complete(DISPMANX_UPDATE_HANDLE_T update, void *data) { /* This function runs in a different thread. */ struct rpi_flippipe *flippipe = data; struct timespec ts; ssize_t ret; /* manufacture flip completion timestamp */ clock_gettime(flippipe->clk_id, &ts); ret = write(flippipe->writefd, &ts, sizeof ts); if (ret != sizeof ts) weston_log("ERROR: %s failed to write, ret %zd, errno %d\n", __func__, ret, errno); } static int rpi_dispmanx_update_submit(DISPMANX_UPDATE_HANDLE_T update, struct rpi_output *output) { /* * The callback registered here will eventually be called * in a different thread context. Therefore we cannot call * the usual functions from rpi_flippipe_update_complete(). * Instead, we have a pipe for passing the message from the * thread, waking up the Weston main event loop, calling * rpi_flippipe_handler(), and then ending up in * rpi_output_update_complete() in the main thread context, * where we can do the frame finishing work. */ return vc_dispmanx_update_submit(update, rpi_flippipe_update_complete, &output->flippipe); } static void rpi_output_update_complete(struct rpi_output *output, const struct timespec *stamp); static int rpi_flippipe_handler(int fd, uint32_t mask, void *data) { struct rpi_output *output = data; ssize_t ret; struct timespec ts; if (mask != WL_EVENT_READABLE) weston_log("ERROR: unexpected mask 0x%x in %s\n", mask, __func__); ret = read(fd, &ts, sizeof ts); if (ret != sizeof ts) { weston_log("ERROR: %s failed to read, ret %zd, errno %d\n", __func__, ret, errno); } rpi_output_update_complete(output, &ts); return 1; } static int rpi_flippipe_init(struct rpi_flippipe *flippipe, struct rpi_output *output) { struct weston_compositor *compositor = output->backend->compositor; struct wl_event_loop *loop; int fd[2]; if (pipe2(fd, O_CLOEXEC) == -1) return -1; flippipe->readfd = fd[0]; flippipe->writefd = fd[1]; flippipe->clk_id = compositor->presentation_clock; loop = wl_display_get_event_loop(compositor->wl_display); flippipe->source = wl_event_loop_add_fd(loop, flippipe->readfd, WL_EVENT_READABLE, rpi_flippipe_handler, output); if (!flippipe->source) { close(flippipe->readfd); close(flippipe->writefd); return -1; } return 0; } static void rpi_flippipe_release(struct rpi_flippipe *flippipe) { wl_event_source_remove(flippipe->source); close(flippipe->readfd); close(flippipe->writefd); } static void rpi_output_start_repaint_loop(struct weston_output *output) { struct timespec ts; /* XXX: do a phony dispmanx update and trigger on its completion? */ weston_compositor_read_presentation_clock(output->compositor, &ts); weston_output_finish_frame(output, &ts, PRESENTATION_FEEDBACK_INVALID); } static int rpi_output_repaint(struct weston_output *base, pixman_region32_t *damage) { struct rpi_output *output = to_rpi_output(base); struct weston_compositor *compositor = output->backend->compositor; struct weston_plane *primary_plane = &compositor->primary_plane; DISPMANX_UPDATE_HANDLE_T update; DBG("frame update start\n"); /* Update priority higher than in rpi-renderer's * output destroy function, see rpi_output_destroy(). */ update = vc_dispmanx_update_start(1); rpi_renderer_set_update_handle(&output->base, update); compositor->renderer->repaint_output(&output->base, damage); pixman_region32_subtract(&primary_plane->damage, &primary_plane->damage, damage); /* schedule callback to rpi_output_update_complete() */ rpi_dispmanx_update_submit(update, output); DBG("frame update submitted\n"); return 0; } static void rpi_output_update_complete(struct rpi_output *output, const struct timespec *stamp) { uint32_t flags = PRESENTATION_FEEDBACK_KIND_VSYNC | PRESENTATION_FEEDBACK_KIND_HW_COMPLETION; DBG("frame update complete(%ld.%09ld)\n", (long)stamp->tv_sec, (long)stamp->tv_nsec); rpi_renderer_finish_frame(&output->base); weston_output_finish_frame(&output->base, stamp, flags); } static void rpi_output_destroy(struct weston_output *base) { struct rpi_output *output = to_rpi_output(base); DBG("%s\n", __func__); rpi_renderer_output_destroy(base); /* rpi_renderer_output_destroy() will schedule a removal of * all Dispmanx Elements, and wait for the update to complete. * Assuming updates are sequential, the wait should guarantee, * that any pending rpi_flippipe_update_complete() callbacks * have happened already. Therefore we can destroy the flippipe * now. */ rpi_flippipe_release(&output->flippipe); weston_output_destroy(&output->base); vc_dispmanx_display_close(output->display); free(output); } static int rpi_output_create(struct rpi_backend *backend, uint32_t transform) { struct rpi_output *output; DISPMANX_MODEINFO_T modeinfo; int ret; float mm_width, mm_height; output = zalloc(sizeof *output); if (output == NULL) return -1; output->backend = backend; output->single_buffer = backend->single_buffer; if (rpi_flippipe_init(&output->flippipe, output) < 0) { weston_log("Creating message pipe failed.\n"); goto out_free; } output->display = vc_dispmanx_display_open(DISPMANX_ID_HDMI); if (!output->display) { weston_log("Failed to open dispmanx HDMI display.\n"); goto out_pipe; } ret = vc_dispmanx_display_get_info(output->display, &modeinfo); if (ret < 0) { weston_log("Failed to get display mode information.\n"); goto out_dmx_close; } output->base.start_repaint_loop = rpi_output_start_repaint_loop; output->base.repaint = rpi_output_repaint; output->base.destroy = rpi_output_destroy; output->base.assign_planes = NULL; output->base.set_backlight = NULL; output->base.set_dpms = NULL; output->base.switch_mode = NULL; /* XXX: use tvservice to get information from and control the * HDMI and SDTV outputs. See: * /opt/vc/include/interface/vmcs_host/vc_tvservice.h */ /* only one static mode in list */ output->mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; output->mode.width = modeinfo.width; output->mode.height = modeinfo.height; output->mode.refresh = 60000; wl_list_init(&output->base.mode_list); wl_list_insert(&output->base.mode_list, &output->mode.link); output->base.current_mode = &output->mode; output->base.subpixel = WL_OUTPUT_SUBPIXEL_UNKNOWN; output->base.make = "unknown"; output->base.model = "unknown"; output->base.name = strdup("rpi"); /* guess 96 dpi */ mm_width = modeinfo.width * (25.4f / 96.0f); mm_height = modeinfo.height * (25.4f / 96.0f); weston_output_init(&output->base, backend->compositor, 0, 0, round(mm_width), round(mm_height), transform, 1); if (rpi_renderer_output_create(&output->base, output->display) < 0) goto out_output; weston_compositor_add_output(backend->compositor, &output->base); weston_log("Raspberry Pi HDMI output %dx%d px\n", output->mode.width, output->mode.height); weston_log_continue(STAMP_SPACE "guessing %d Hz and 96 dpi\n", output->mode.refresh / 1000); weston_log_continue(STAMP_SPACE "orientation: %s\n", weston_transform_to_string(output->base.transform)); if (!strncmp(weston_transform_to_string(output->base.transform), "flipped", 7)) weston_log("warning: flipped output transforms may not work\n"); return 0; out_output: weston_output_destroy(&output->base); out_dmx_close: vc_dispmanx_display_close(output->display); out_pipe: rpi_flippipe_release(&output->flippipe); out_free: free(output); return -1; } static void rpi_backend_destroy(struct weston_compositor *base) { struct rpi_backend *backend = to_rpi_backend(base); udev_input_destroy(&backend->input); /* destroys outputs, too */ weston_compositor_shutdown(base); weston_launcher_destroy(base->launcher); bcm_host_deinit(); free(backend); } static void session_notify(struct wl_listener *listener, void *data) { struct weston_compositor *compositor = data; struct rpi_backend *backend = to_rpi_backend(compositor); struct weston_output *output; if (compositor->session_active) { weston_log("activating session\n"); compositor->state = backend->prev_state; weston_compositor_damage_all(compositor); udev_input_enable(&backend->input); } else { weston_log("deactivating session\n"); udev_input_disable(&backend->input); backend->prev_state = compositor->state; weston_compositor_offscreen(compositor); /* If we have a repaint scheduled (either from a * pending pageflip or the idle handler), make sure we * cancel that so we don't try to pageflip when we're * vt switched away. The OFFSCREEN state will prevent * further attemps at repainting. When we switch * back, we schedule a repaint, which will process * pending frame callbacks. */ wl_list_for_each(output, &compositor->output_list, link) { output->repaint_needed = 0; } }; } static void rpi_restore(struct weston_compositor *compositor) { weston_launcher_restore(compositor->launcher); } static void switch_vt_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1); } struct rpi_parameters { int tty; struct rpi_renderer_parameters renderer; uint32_t output_transform; }; static struct rpi_backend * rpi_backend_create(struct weston_compositor *compositor, struct rpi_parameters *param) { struct rpi_backend *backend; uint32_t key; weston_log("initializing Raspberry Pi backend\n"); backend = zalloc(sizeof *backend); if (backend == NULL) return NULL; if (weston_compositor_set_presentation_clock_software( compositor) < 0) goto out_compositor; backend->udev = udev_new(); if (backend->udev == NULL) { weston_log("Failed to initialize udev context.\n"); goto out_compositor; } backend->session_listener.notify = session_notify; wl_signal_add(&compositor->session_signal, &backend->session_listener); compositor->launcher = weston_launcher_connect(compositor, param->tty, "seat0", false); if (!compositor->launcher) { weston_log("Failed to initialize tty.\n"); goto out_udev; } backend->base.destroy = rpi_backend_destroy; backend->base.restore = rpi_restore; backend->compositor = compositor; backend->prev_state = WESTON_COMPOSITOR_ACTIVE; backend->single_buffer = param->renderer.single_buffer; weston_log("Dispmanx planes are %s buffered.\n", backend->single_buffer ? "single" : "double"); for (key = KEY_F1; key < KEY_F9; key++) weston_compositor_add_key_binding(compositor, key, MODIFIER_CTRL | MODIFIER_ALT, switch_vt_binding, compositor); /* * bcm_host_init() creates threads. * Therefore we must have all signal handlers set and signals blocked * before calling it. Otherwise the signals may end in the bcm * threads and cause the default behaviour there. For instance, * SIGUSR1 used for VT switching caused Weston to terminate there. */ bcm_host_init(); if (rpi_renderer_create(compositor, ¶m->renderer) < 0) goto out_launcher; if (rpi_output_create(backend, param->output_transform) < 0) goto out_launcher; if (udev_input_init(&backend->input, compositor, backend->udev, "seat0") != 0) { weston_log("Failed to initialize udev input.\n"); goto out_launcher; } compositor->backend = &backend->base; return backend; out_launcher: weston_launcher_destroy(compositor->launcher); out_udev: udev_unref(backend->udev); out_compositor: weston_compositor_shutdown(compositor); bcm_host_deinit(); free(backend); return NULL; } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config) { const char *transform = "normal"; struct rpi_backend *b; struct rpi_parameters param = { .tty = 0, /* default to current tty */ .renderer.single_buffer = 0, .output_transform = WL_OUTPUT_TRANSFORM_NORMAL, .renderer.opaque_regions = 0, }; const struct weston_option rpi_options[] = { { WESTON_OPTION_INTEGER, "tty", 0, ¶m.tty }, { WESTON_OPTION_BOOLEAN, "single-buffer", 0, ¶m.renderer.single_buffer }, { WESTON_OPTION_STRING, "transform", 0, &transform }, { WESTON_OPTION_BOOLEAN, "opaque-regions", 0, ¶m.renderer.opaque_regions }, }; parse_options(rpi_options, ARRAY_LENGTH(rpi_options), argc, argv); if (weston_parse_transform(transform, ¶m.output_transform) < 0) weston_log("invalid transform \"%s\"\n", transform); b = rpi_backend_create(compositor, ¶m); if (b == NULL) return -1; return 0; } weston-1.9.0/src/timeline-object.h0000664000175000017500000000375112537627702014016 00000000000000/* * Copyright © 2014 Pekka Paalanen * Copyright © 2014 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_TIMELINE_OBJECT_H #define WESTON_TIMELINE_OBJECT_H /* * This struct can be embedded in objects related to timeline output. * It must be initialized to all-zero. Afterwards, the timeline code * will handle it alone. No clean-up is necessary. */ struct weston_timeline_object { /* * Timeline series gets bumped every time a new log is opened. * This triggers id allocation and object info emission. * 0 is an invalid series value. */ unsigned series; /* Object id in the timeline JSON output. 0 is invalid. */ unsigned id; /* * If non-zero, forces a re-emission of object description. * Should be set to non-zero, when changing long-lived * object state that is not emitted on normal timeline * events. */ unsigned force_refresh; }; #endif /* WESTON_TIMELINE_OBJECT_H */ weston-1.9.0/src/linux-dmabuf.c0000664000175000017500000003320512563431500013313 00000000000000/* * Copyright © 2014, 2015 Collabora, Ltd. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of the copyright holders not be used in * advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The copyright holders make * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.h" #include #include #include #include "compositor.h" #include "linux-dmabuf.h" #include "linux-dmabuf-server-protocol.h" static void linux_dmabuf_buffer_destroy(struct linux_dmabuf_buffer *buffer) { int i; for (i = 0; i < buffer->n_planes; i++) { close(buffer->dmabuf_fd[i]); buffer->dmabuf_fd[i] = -1; } buffer->n_planes = 0; free(buffer); } static void destroy_params(struct wl_resource *params_resource) { struct linux_dmabuf_buffer *buffer; buffer = wl_resource_get_user_data(params_resource); if (!buffer) return; linux_dmabuf_buffer_destroy(buffer); } static void params_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void params_add(struct wl_client *client, struct wl_resource *params_resource, int32_t name_fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint32_t modifier_hi, uint32_t modifier_lo) { struct linux_dmabuf_buffer *buffer; buffer = wl_resource_get_user_data(params_resource); if (!buffer) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_ALREADY_USED, "params was already used to create a wl_buffer"); close(name_fd); return; } assert(buffer->params_resource == params_resource); assert(!buffer->buffer_resource); if (plane_idx >= MAX_DMABUF_PLANES) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_PLANE_IDX, "plane index %u is too high", plane_idx); close(name_fd); return; } if (buffer->dmabuf_fd[plane_idx] != -1) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_PLANE_SET, "a dmabuf has already been added for plane %u", plane_idx); close(name_fd); return; } buffer->dmabuf_fd[plane_idx] = name_fd; buffer->offset[plane_idx] = offset; buffer->stride[plane_idx] = stride; buffer->modifier[plane_idx] = ((uint64_t)modifier_hi << 32) | modifier_lo; buffer->n_planes++; } static void linux_dmabuf_wl_buffer_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_buffer_interface linux_dmabuf_buffer_implementation = { linux_dmabuf_wl_buffer_destroy }; static void destroy_linux_dmabuf_wl_buffer(struct wl_resource *resource) { struct linux_dmabuf_buffer *buffer; buffer = wl_resource_get_user_data(resource); assert(buffer->buffer_resource == resource); assert(!buffer->params_resource); if (buffer->user_data_destroy_func) buffer->user_data_destroy_func(buffer); linux_dmabuf_buffer_destroy(buffer); } static void params_create(struct wl_client *client, struct wl_resource *params_resource, int32_t width, int32_t height, uint32_t format, uint32_t flags) { struct linux_dmabuf_buffer *buffer; int i; buffer = wl_resource_get_user_data(params_resource); if (!buffer) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_ALREADY_USED, "params was already used to create a wl_buffer"); return; } assert(buffer->params_resource == params_resource); assert(!buffer->buffer_resource); /* Switch the linux_dmabuf_buffer object from params resource to * eventually wl_buffer resource. */ wl_resource_set_user_data(buffer->params_resource, NULL); buffer->params_resource = NULL; if (!buffer->n_planes) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_INCOMPLETE, "no dmabuf has been added to the params"); goto err_out; } /* Check for holes in the dmabufs set (e.g. [0, 1, 3]) */ for (i = 0; i < buffer->n_planes; i++) { if (buffer->dmabuf_fd[i] == -1) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_INCOMPLETE, "no dmabuf has been added for plane %i", i); goto err_out; } } buffer->width = width; buffer->height = height; buffer->format = format; buffer->flags = flags; if (width < 1 || height < 1) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_INVALID_DIMENSIONS, "invalid width %d or height %d", width, height); goto err_out; } for (i = 0; i < buffer->n_planes; i++) { off_t size; if ((uint64_t) buffer->offset[i] + buffer->stride[i] > UINT32_MAX) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS, "size overflow for plane %i", i); goto err_out; } if (i == 0 && (uint64_t) buffer->offset[i] + (uint64_t) buffer->stride[i] * height > UINT32_MAX) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS, "size overflow for plane %i", i); goto err_out; } /* Don't report an error as it might be caused * by the kernel not supporting seeking on dmabuf */ size = lseek(buffer->dmabuf_fd[i], 0, SEEK_END); if (size == -1) break; if (buffer->offset[i] >= size) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS, "invalid offset %i for plane %i", buffer->offset[i], i); goto err_out; } if (buffer->offset[i] + buffer->stride[i] > size) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS, "invalid stride %i for plane %i", buffer->stride[i], i); goto err_out; } /* Only valid for first plane as other planes might be * sub-sampled according to fourcc format */ if (i == 0 && buffer->offset[i] + buffer->stride[i] * height > size) { wl_resource_post_error(params_resource, ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS, "invalid buffer stride or height for plane %i", i); goto err_out; } } /* XXX: Some additional sanity checks could be done with respect * to the fourcc format. A centralized collection (kernel or * libdrm) would be useful to avoid code duplication for these * checks (e.g. drm_format_num_planes). */ if (!weston_compositor_import_dmabuf(buffer->compositor, buffer)) goto err_failed; buffer->buffer_resource = wl_resource_create(client, &wl_buffer_interface, 1, 0); if (!buffer->buffer_resource) { wl_resource_post_no_memory(params_resource); goto err_buffer; } wl_resource_set_implementation(buffer->buffer_resource, &linux_dmabuf_buffer_implementation, buffer, destroy_linux_dmabuf_wl_buffer); zlinux_buffer_params_send_created(params_resource, buffer->buffer_resource); return; err_buffer: if (buffer->user_data_destroy_func) buffer->user_data_destroy_func(buffer); err_failed: zlinux_buffer_params_send_failed(params_resource); err_out: linux_dmabuf_buffer_destroy(buffer); } static const struct zlinux_buffer_params_interface zlinux_buffer_params_implementation = { params_destroy, params_add, params_create }; static void linux_dmabuf_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void linux_dmabuf_create_params(struct wl_client *client, struct wl_resource *linux_dmabuf_resource, uint32_t params_id) { struct weston_compositor *compositor; struct linux_dmabuf_buffer *buffer; uint32_t version; int i; version = wl_resource_get_version(linux_dmabuf_resource); compositor = wl_resource_get_user_data(linux_dmabuf_resource); buffer = zalloc(sizeof *buffer); if (!buffer) goto err_out; for (i = 0; i < MAX_DMABUF_PLANES; i++) buffer->dmabuf_fd[i] = -1; buffer->compositor = compositor; buffer->params_resource = wl_resource_create(client, &zlinux_buffer_params_interface, version, params_id); if (!buffer->params_resource) goto err_dealloc; wl_resource_set_implementation(buffer->params_resource, &zlinux_buffer_params_implementation, buffer, destroy_params); return; err_dealloc: free(buffer); err_out: wl_resource_post_no_memory(linux_dmabuf_resource); } /** Get the linux_dmabuf_buffer from a wl_buffer resource * * If the given wl_buffer resource was created through the linux_dmabuf * protocol interface, returns the linux_dmabuf_buffer object. This can * be used as a type check for a wl_buffer. * * \param resource A wl_buffer resource. * \return The linux_dmabuf_buffer if it exists, or NULL otherwise. */ WL_EXPORT struct linux_dmabuf_buffer * linux_dmabuf_buffer_get(struct wl_resource *resource) { struct linux_dmabuf_buffer *buffer; if (!resource) return NULL; if (!wl_resource_instance_of(resource, &wl_buffer_interface, &linux_dmabuf_buffer_implementation)) return NULL; buffer = wl_resource_get_user_data(resource); assert(buffer); assert(!buffer->params_resource); assert(buffer->buffer_resource == resource); return buffer; } /** Set renderer-private data * * Set the user data for the linux_dmabuf_buffer. It is invalid to overwrite * a non-NULL user data with a new non-NULL pointer. This is meant to * protect against renderers fighting over linux_dmabuf_buffer user data * ownership. * * The renderer-private data is usually set from the * weston_renderer::import_dmabuf hook. * * \param buffer The linux_dmabuf_buffer object to set for. * \param data The new renderer-private data pointer. * \param func Destructor function to be called for the renderer-private * data when the linux_dmabuf_buffer gets destroyed. * * \sa weston_compositor_import_dmabuf */ WL_EXPORT void linux_dmabuf_buffer_set_user_data(struct linux_dmabuf_buffer *buffer, void *data, dmabuf_user_data_destroy_func func) { assert(data == NULL || buffer->user_data == NULL); buffer->user_data = data; buffer->user_data_destroy_func = func; } /** Get renderer-private data * * Get the user data from the linux_dmabuf_buffer. * * \param buffer The linux_dmabuf_buffer to query. * \return Renderer-private data pointer. * * \sa linux_dmabuf_buffer_set_user_data */ WL_EXPORT void * linux_dmabuf_buffer_get_user_data(struct linux_dmabuf_buffer *buffer) { return buffer->user_data; } static const struct zlinux_dmabuf_interface linux_dmabuf_implementation = { linux_dmabuf_destroy, linux_dmabuf_create_params }; static void bind_linux_dmabuf(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_compositor *compositor = data; struct wl_resource *resource; resource = wl_resource_create(client, &zlinux_dmabuf_interface, version, id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &linux_dmabuf_implementation, compositor, NULL); /* EGL_EXT_image_dma_buf_import does not provide a way to query the * supported pixel formats. */ /* XXX: send formats */ } /** Advertise linux_dmabuf support * * Calling this initializes the zlinux_dmabuf protocol support, so that * the interface will be advertised to clients. Essentially it creates a * global. Do not call this function multiple times in the compositor's * lifetime. There is no way to deinit explicitly, globals will be reaped * when the wl_display gets destroyed. * * \param compositor The compositor to init for. * \return Zero on success, -1 on failure. */ WL_EXPORT int linux_dmabuf_setup(struct weston_compositor *compositor) { if (!wl_global_create(compositor->wl_display, &zlinux_dmabuf_interface, 1, compositor, bind_linux_dmabuf)) return -1; return 0; } /** Resolve an internal compositor error by disconnecting the client. * * This function is used in cases when the dmabuf-based wl_buffer * turns out unusable and there is no fallback path. This is used by * renderers which are the fallback path in the first place. * * It is possible the fault is caused by a compositor bug, the underlying * graphics stack bug or normal behaviour, or perhaps a client mistake. * In any case, the options are to either composite garbage or nothing, * or disconnect the client. This is a helper function for the latter. * * The error is sent as a INVALID_OBJECT error on the client's wl_display. * * \param buffer The linux_dmabuf_buffer that is unusable. * \param msg A custom error message attached to the protocol error. */ WL_EXPORT void linux_dmabuf_buffer_send_server_error(struct linux_dmabuf_buffer *buffer, const char *msg) { struct wl_client *client; struct wl_resource *display_resource; uint32_t id; assert(buffer->buffer_resource); id = wl_resource_get_id(buffer->buffer_resource); client = wl_resource_get_client(buffer->buffer_resource); display_resource = wl_client_get_object(client, 1); assert(display_resource); wl_resource_post_error(display_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "linux_dmabuf server error with " "wl_buffer@%u: %s", id, msg); } weston-1.9.0/src/data-device.c0000664000175000017500000006252212560760452013102 00000000000000/* * Copyright © 2011 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "compositor.h" #include "shared/helpers.h" struct weston_drag { struct wl_client *client; struct weston_data_source *data_source; struct wl_listener data_source_listener; struct weston_view *focus; struct wl_resource *focus_resource; struct wl_listener focus_listener; struct weston_view *icon; struct wl_listener icon_destroy_listener; int32_t dx, dy; }; struct weston_pointer_drag { struct weston_drag base; struct weston_pointer_grab grab; }; struct weston_touch_drag { struct weston_drag base; struct weston_touch_grab grab; }; static void data_offer_accept(struct wl_client *client, struct wl_resource *resource, uint32_t serial, const char *mime_type) { struct weston_data_offer *offer = wl_resource_get_user_data(resource); /* FIXME: Check that client is currently focused by the input * device that is currently dragging this data source. Should * this be a wl_data_device request? */ if (offer->source) offer->source->accept(offer->source, serial, mime_type); } static void data_offer_receive(struct wl_client *client, struct wl_resource *resource, const char *mime_type, int32_t fd) { struct weston_data_offer *offer = wl_resource_get_user_data(resource); if (offer->source) offer->source->send(offer->source, mime_type, fd); else close(fd); } static void data_offer_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_data_offer_interface data_offer_interface = { data_offer_accept, data_offer_receive, data_offer_destroy, }; static void destroy_data_offer(struct wl_resource *resource) { struct weston_data_offer *offer = wl_resource_get_user_data(resource); if (offer->source) wl_list_remove(&offer->source_destroy_listener.link); free(offer); } static void destroy_offer_data_source(struct wl_listener *listener, void *data) { struct weston_data_offer *offer; offer = container_of(listener, struct weston_data_offer, source_destroy_listener); offer->source = NULL; } static struct wl_resource * weston_data_source_send_offer(struct weston_data_source *source, struct wl_resource *target) { struct weston_data_offer *offer; char **p; offer = malloc(sizeof *offer); if (offer == NULL) return NULL; offer->resource = wl_resource_create(wl_resource_get_client(target), &wl_data_offer_interface, 1, 0); if (offer->resource == NULL) { free(offer); return NULL; } wl_resource_set_implementation(offer->resource, &data_offer_interface, offer, destroy_data_offer); offer->source = source; offer->source_destroy_listener.notify = destroy_offer_data_source; wl_signal_add(&source->destroy_signal, &offer->source_destroy_listener); wl_data_device_send_data_offer(target, offer->resource); wl_array_for_each(p, &source->mime_types) wl_data_offer_send_offer(offer->resource, *p); return offer->resource; } static void data_source_offer(struct wl_client *client, struct wl_resource *resource, const char *type) { struct weston_data_source *source = wl_resource_get_user_data(resource); char **p; p = wl_array_add(&source->mime_types, sizeof *p); if (p) *p = strdup(type); if (!p || !*p) wl_resource_post_no_memory(resource); } static void data_source_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static struct wl_data_source_interface data_source_interface = { data_source_offer, data_source_destroy }; static void drag_surface_configure(struct weston_drag *drag, struct weston_pointer *pointer, struct weston_touch *touch, struct weston_surface *es, int32_t sx, int32_t sy) { struct weston_layer_entry *list; float fx, fy; assert((pointer != NULL && touch == NULL) || (pointer == NULL && touch != NULL)); if (!weston_surface_is_mapped(es) && es->buffer_ref.buffer) { if (pointer && pointer->sprite && weston_view_is_mapped(pointer->sprite)) list = &pointer->sprite->layer_link; else list = &es->compositor->cursor_layer.view_list; weston_layer_entry_remove(&drag->icon->layer_link); weston_layer_entry_insert(list, &drag->icon->layer_link); weston_view_update_transform(drag->icon); pixman_region32_clear(&es->pending.input); } drag->dx += sx; drag->dy += sy; /* init to 0 for avoiding a compile warning */ fx = fy = 0; if (pointer) { fx = wl_fixed_to_double(pointer->x) + drag->dx; fy = wl_fixed_to_double(pointer->y) + drag->dy; } else if (touch) { fx = wl_fixed_to_double(touch->grab_x) + drag->dx; fy = wl_fixed_to_double(touch->grab_y) + drag->dy; } weston_view_set_position(drag->icon, fx, fy); } static int pointer_drag_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "pointer drag icon"); } static void pointer_drag_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy) { struct weston_pointer_drag *drag = es->configure_private; struct weston_pointer *pointer = drag->grab.pointer; assert(es->configure == pointer_drag_surface_configure); drag_surface_configure(&drag->base, pointer, NULL, es, sx, sy); } static int touch_drag_surface_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "touch drag icon"); } static void touch_drag_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy) { struct weston_touch_drag *drag = es->configure_private; struct weston_touch *touch = drag->grab.touch; assert(es->configure == touch_drag_surface_configure); drag_surface_configure(&drag->base, NULL, touch, es, sx, sy); } static void destroy_drag_focus(struct wl_listener *listener, void *data) { struct weston_drag *drag = container_of(listener, struct weston_drag, focus_listener); drag->focus_resource = NULL; } static void weston_drag_set_focus(struct weston_drag *drag, struct weston_seat *seat, struct weston_view *view, wl_fixed_t sx, wl_fixed_t sy) { struct wl_resource *resource, *offer = NULL; struct wl_display *display = seat->compositor->wl_display; uint32_t serial; if (drag->focus && view && drag->focus->surface == view->surface) { drag->focus = view; return; } if (drag->focus_resource) { wl_data_device_send_leave(drag->focus_resource); wl_list_remove(&drag->focus_listener.link); drag->focus_resource = NULL; drag->focus = NULL; } if (!view || !view->surface->resource) return; if (!drag->data_source && wl_resource_get_client(view->surface->resource) != drag->client) return; resource = wl_resource_find_for_client(&seat->drag_resource_list, wl_resource_get_client(view->surface->resource)); if (!resource) return; serial = wl_display_next_serial(display); if (drag->data_source) { offer = weston_data_source_send_offer(drag->data_source, resource); if (offer == NULL) return; } wl_data_device_send_enter(resource, serial, view->surface->resource, sx, sy, offer); drag->focus = view; drag->focus_listener.notify = destroy_drag_focus; wl_resource_add_destroy_listener(resource, &drag->focus_listener); drag->focus_resource = resource; } static void drag_grab_focus(struct weston_pointer_grab *grab) { struct weston_pointer_drag *drag = container_of(grab, struct weston_pointer_drag, grab); struct weston_pointer *pointer = grab->pointer; struct weston_view *view; wl_fixed_t sx, sy; view = weston_compositor_pick_view(pointer->seat->compositor, pointer->x, pointer->y, &sx, &sy); if (drag->base.focus != view) weston_drag_set_focus(&drag->base, pointer->seat, view, sx, sy); } static void drag_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct weston_pointer_drag *drag = container_of(grab, struct weston_pointer_drag, grab); struct weston_pointer *pointer = drag->grab.pointer; float fx, fy; wl_fixed_t sx, sy; weston_pointer_move(pointer, x, y); if (drag->base.icon) { fx = wl_fixed_to_double(pointer->x) + drag->base.dx; fy = wl_fixed_to_double(pointer->y) + drag->base.dy; weston_view_set_position(drag->base.icon, fx, fy); weston_view_schedule_repaint(drag->base.icon); } if (drag->base.focus_resource) { weston_view_from_global_fixed(drag->base.focus, pointer->x, pointer->y, &sx, &sy); wl_data_device_send_motion(drag->base.focus_resource, time, sx, sy); } } static void data_device_end_drag_grab(struct weston_drag *drag, struct weston_seat *seat) { if (drag->icon) { if (weston_view_is_mapped(drag->icon)) weston_view_unmap(drag->icon); drag->icon->surface->configure = NULL; weston_surface_set_label_func(drag->icon->surface, NULL); pixman_region32_clear(&drag->icon->surface->pending.input); wl_list_remove(&drag->icon_destroy_listener.link); weston_view_destroy(drag->icon); } weston_drag_set_focus(drag, seat, NULL, 0, 0); } static void data_device_end_pointer_drag_grab(struct weston_pointer_drag *drag) { struct weston_pointer *pointer = drag->grab.pointer; data_device_end_drag_grab(&drag->base, pointer->seat); weston_pointer_end_grab(pointer); free(drag); } static void drag_grab_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { struct weston_pointer_drag *drag = container_of(grab, struct weston_pointer_drag, grab); struct weston_pointer *pointer = drag->grab.pointer; enum wl_pointer_button_state state = state_w; if (drag->base.focus_resource && pointer->grab_button == button && state == WL_POINTER_BUTTON_STATE_RELEASED) wl_data_device_send_drop(drag->base.focus_resource); if (pointer->button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { if (drag->base.data_source) wl_list_remove(&drag->base.data_source_listener.link); data_device_end_pointer_drag_grab(drag); } } static void drag_grab_cancel(struct weston_pointer_grab *grab) { struct weston_pointer_drag *drag = container_of(grab, struct weston_pointer_drag, grab); if (drag->base.data_source) wl_list_remove(&drag->base.data_source_listener.link); data_device_end_pointer_drag_grab(drag); } static const struct weston_pointer_grab_interface pointer_drag_grab_interface = { drag_grab_focus, drag_grab_motion, drag_grab_button, drag_grab_cancel, }; static void drag_grab_touch_down(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t sx, wl_fixed_t sy) { } static void data_device_end_touch_drag_grab(struct weston_touch_drag *drag) { struct weston_touch *touch = drag->grab.touch; data_device_end_drag_grab(&drag->base, touch->seat); weston_touch_end_grab(touch); free(drag); } static void drag_grab_touch_up(struct weston_touch_grab *grab, uint32_t time, int touch_id) { struct weston_touch_drag *touch_drag = container_of(grab, struct weston_touch_drag, grab); struct weston_touch *touch = grab->touch; if (touch_id != touch->grab_touch_id) return; if (touch_drag->base.focus_resource) wl_data_device_send_drop(touch_drag->base.focus_resource); if (touch_drag->base.data_source) wl_list_remove(&touch_drag->base.data_source_listener.link); data_device_end_touch_drag_grab(touch_drag); } static void drag_grab_touch_focus(struct weston_touch_drag *drag) { struct weston_touch *touch = drag->grab.touch; struct weston_view *view; wl_fixed_t view_x, view_y; view = weston_compositor_pick_view(touch->seat->compositor, touch->grab_x, touch->grab_y, &view_x, &view_y); if (drag->base.focus != view) weston_drag_set_focus(&drag->base, touch->seat, view, view_x, view_y); } static void drag_grab_touch_motion(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct weston_touch_drag *touch_drag = container_of(grab, struct weston_touch_drag, grab); struct weston_touch *touch = grab->touch; wl_fixed_t view_x, view_y; float fx, fy; if (touch_id != touch->grab_touch_id) return; drag_grab_touch_focus(touch_drag); if (touch_drag->base.icon) { fx = wl_fixed_to_double(touch->grab_x) + touch_drag->base.dx; fy = wl_fixed_to_double(touch->grab_y) + touch_drag->base.dy; weston_view_set_position(touch_drag->base.icon, fx, fy); weston_view_schedule_repaint(touch_drag->base.icon); } if (touch_drag->base.focus_resource) { weston_view_from_global_fixed(touch_drag->base.focus, touch->grab_x, touch->grab_y, &view_x, &view_y); wl_data_device_send_motion(touch_drag->base.focus_resource, time, view_x, view_y); } } static void drag_grab_touch_frame(struct weston_touch_grab *grab) { } static void drag_grab_touch_cancel(struct weston_touch_grab *grab) { struct weston_touch_drag *touch_drag = container_of(grab, struct weston_touch_drag, grab); if (touch_drag->base.data_source) wl_list_remove(&touch_drag->base.data_source_listener.link); data_device_end_touch_drag_grab(touch_drag); } static const struct weston_touch_grab_interface touch_drag_grab_interface = { drag_grab_touch_down, drag_grab_touch_up, drag_grab_touch_motion, drag_grab_touch_frame, drag_grab_touch_cancel }; static void destroy_pointer_data_device_source(struct wl_listener *listener, void *data) { struct weston_pointer_drag *drag = container_of(listener, struct weston_pointer_drag, base.data_source_listener); data_device_end_pointer_drag_grab(drag); } static void handle_drag_icon_destroy(struct wl_listener *listener, void *data) { struct weston_drag *drag = container_of(listener, struct weston_drag, icon_destroy_listener); drag->icon = NULL; } WL_EXPORT int weston_pointer_start_drag(struct weston_pointer *pointer, struct weston_data_source *source, struct weston_surface *icon, struct wl_client *client) { struct weston_pointer_drag *drag; drag = zalloc(sizeof *drag); if (drag == NULL) return -1; drag->grab.interface = &pointer_drag_grab_interface; drag->base.client = client; drag->base.data_source = source; if (icon) { drag->base.icon = weston_view_create(icon); if (drag->base.icon == NULL) { free(drag); return -1; } drag->base.icon_destroy_listener.notify = handle_drag_icon_destroy; wl_signal_add(&icon->destroy_signal, &drag->base.icon_destroy_listener); icon->configure = pointer_drag_surface_configure; icon->configure_private = drag; weston_surface_set_label_func(icon, pointer_drag_surface_get_label); } else { drag->base.icon = NULL; } if (source) { drag->base.data_source_listener.notify = destroy_pointer_data_device_source; wl_signal_add(&source->destroy_signal, &drag->base.data_source_listener); } weston_pointer_clear_focus(pointer); weston_pointer_start_grab(pointer, &drag->grab); return 0; } static void destroy_touch_data_device_source(struct wl_listener *listener, void *data) { struct weston_touch_drag *drag = container_of(listener, struct weston_touch_drag, base.data_source_listener); data_device_end_touch_drag_grab(drag); } WL_EXPORT int weston_touch_start_drag(struct weston_touch *touch, struct weston_data_source *source, struct weston_surface *icon, struct wl_client *client) { struct weston_touch_drag *drag; drag = zalloc(sizeof *drag); if (drag == NULL) return -1; drag->grab.interface = &touch_drag_grab_interface; drag->base.client = client; drag->base.data_source = source; if (icon) { drag->base.icon = weston_view_create(icon); if (drag->base.icon == NULL) { free(drag); return -1; } drag->base.icon_destroy_listener.notify = handle_drag_icon_destroy; wl_signal_add(&icon->destroy_signal, &drag->base.icon_destroy_listener); icon->configure = touch_drag_surface_configure; icon->configure_private = drag; weston_surface_set_label_func(icon, touch_drag_surface_get_label); } else { drag->base.icon = NULL; } if (source) { drag->base.data_source_listener.notify = destroy_touch_data_device_source; wl_signal_add(&source->destroy_signal, &drag->base.data_source_listener); } weston_touch_start_grab(touch, &drag->grab); drag_grab_touch_focus(drag); return 0; } static void data_device_start_drag(struct wl_client *client, struct wl_resource *resource, struct wl_resource *source_resource, struct wl_resource *origin_resource, struct wl_resource *icon_resource, uint32_t serial) { struct weston_seat *seat = wl_resource_get_user_data(resource); struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_touch *touch = weston_seat_get_touch(seat); struct weston_surface *origin = wl_resource_get_user_data(origin_resource); struct weston_data_source *source = NULL; struct weston_surface *icon = NULL; int is_pointer_grab, is_touch_grab; int32_t ret = 0; is_pointer_grab = pointer && pointer->button_count == 1 && pointer->grab_serial == serial && pointer->focus && pointer->focus->surface == origin; is_touch_grab = touch && touch->num_tp == 1 && touch->grab_serial == serial && touch->focus && touch->focus->surface == origin; if (!is_pointer_grab && !is_touch_grab) return; /* FIXME: Check that the data source type array isn't empty. */ if (source_resource) source = wl_resource_get_user_data(source_resource); if (icon_resource) icon = wl_resource_get_user_data(icon_resource); if (icon) { if (weston_surface_set_role(icon, "wl_data_device-icon", resource, WL_DATA_DEVICE_ERROR_ROLE) < 0) return; } if (is_pointer_grab) ret = weston_pointer_start_drag(pointer, source, icon, client); else if (is_touch_grab) ret = weston_touch_start_drag(touch, source, icon, client); if (ret < 0) wl_resource_post_no_memory(resource); } static void destroy_selection_data_source(struct wl_listener *listener, void *data) { struct weston_seat *seat = container_of(listener, struct weston_seat, selection_data_source_listener); struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct wl_resource *data_device; struct weston_surface *focus = NULL; seat->selection_data_source = NULL; if (keyboard) focus = keyboard->focus; if (focus && focus->resource) { data_device = wl_resource_find_for_client(&seat->drag_resource_list, wl_resource_get_client(focus->resource)); if (data_device) wl_data_device_send_selection(data_device, NULL); } wl_signal_emit(&seat->selection_signal, seat); } /** \brief Send the selection to the specified client * * This function creates a new wl_data_offer if there is a wl_data_source * currently set as the selection and sends it to the specified client, * followed by the wl_data_device.selection() event. * If there is no current selection the wl_data_device.selection() event * will carry a NULL wl_data_offer. * * If the client does not have a wl_data_device for the specified seat * nothing will be done. * * \param seat The seat owning the wl_data_device used to send the events. * \param client The client to which to send the selection. */ WL_EXPORT void weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client) { struct wl_resource *data_device, *offer; wl_resource_for_each(data_device, &seat->drag_resource_list) { if (wl_resource_get_client(data_device) != client) continue; if (seat->selection_data_source) { offer = weston_data_source_send_offer(seat->selection_data_source, data_device); wl_data_device_send_selection(data_device, offer); } else { wl_data_device_send_selection(data_device, NULL); } } } WL_EXPORT void weston_seat_set_selection(struct weston_seat *seat, struct weston_data_source *source, uint32_t serial) { struct weston_surface *focus = NULL; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (seat->selection_data_source && seat->selection_serial - serial < UINT32_MAX / 2) return; if (seat->selection_data_source) { seat->selection_data_source->cancel(seat->selection_data_source); wl_list_remove(&seat->selection_data_source_listener.link); seat->selection_data_source = NULL; } seat->selection_data_source = source; seat->selection_serial = serial; if (keyboard) focus = keyboard->focus; if (focus && focus->resource) { weston_seat_send_selection(seat, wl_resource_get_client(focus->resource)); } wl_signal_emit(&seat->selection_signal, seat); if (source) { seat->selection_data_source_listener.notify = destroy_selection_data_source; wl_signal_add(&source->destroy_signal, &seat->selection_data_source_listener); } } static void data_device_set_selection(struct wl_client *client, struct wl_resource *resource, struct wl_resource *source_resource, uint32_t serial) { if (!source_resource) return; /* FIXME: Store serial and check against incoming serial here. */ weston_seat_set_selection(wl_resource_get_user_data(resource), wl_resource_get_user_data(source_resource), serial); } static void data_device_release(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_data_device_interface data_device_interface = { data_device_start_drag, data_device_set_selection, data_device_release }; static void destroy_data_source(struct wl_resource *resource) { struct weston_data_source *source = wl_resource_get_user_data(resource); char **p; wl_signal_emit(&source->destroy_signal, source); wl_array_for_each(p, &source->mime_types) free(*p); wl_array_release(&source->mime_types); free(source); } static void client_source_accept(struct weston_data_source *source, uint32_t time, const char *mime_type) { wl_data_source_send_target(source->resource, mime_type); } static void client_source_send(struct weston_data_source *source, const char *mime_type, int32_t fd) { wl_data_source_send_send(source->resource, mime_type, fd); close(fd); } static void client_source_cancel(struct weston_data_source *source) { wl_data_source_send_cancelled(source->resource); } static void create_data_source(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct weston_data_source *source; source = malloc(sizeof *source); if (source == NULL) { wl_resource_post_no_memory(resource); return; } wl_signal_init(&source->destroy_signal); source->accept = client_source_accept; source->send = client_source_send; source->cancel = client_source_cancel; wl_array_init(&source->mime_types); source->resource = wl_resource_create(client, &wl_data_source_interface, 1, id); wl_resource_set_implementation(source->resource, &data_source_interface, source, destroy_data_source); } static void unbind_data_device(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); } static void get_data_device(struct wl_client *client, struct wl_resource *manager_resource, uint32_t id, struct wl_resource *seat_resource) { struct weston_seat *seat = wl_resource_get_user_data(seat_resource); struct wl_resource *resource; resource = wl_resource_create(client, &wl_data_device_interface, wl_resource_get_version(manager_resource), id); if (resource == NULL) { wl_resource_post_no_memory(manager_resource); return; } wl_list_insert(&seat->drag_resource_list, wl_resource_get_link(resource)); wl_resource_set_implementation(resource, &data_device_interface, seat, unbind_data_device); } static const struct wl_data_device_manager_interface manager_interface = { create_data_source, get_data_device }; static void bind_manager(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wl_resource *resource; resource = wl_resource_create(client, &wl_data_device_manager_interface, version, id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &manager_interface, NULL, NULL); } WL_EXPORT void wl_data_device_set_keyboard_focus(struct weston_seat *seat) { struct weston_surface *focus; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard) return; focus = keyboard->focus; if (!focus || !focus->resource) return; weston_seat_send_selection(seat, wl_resource_get_client(focus->resource)); } WL_EXPORT int wl_data_device_manager_init(struct wl_display *display) { if (wl_global_create(display, &wl_data_device_manager_interface, 2, NULL, bind_manager) == NULL) return -1; return 0; } weston-1.9.0/src/libinput-seat.h0000664000175000017500000000365312537627702013525 00000000000000/* * Copyright © 2013 Intel Corporation * Copyright © 2013 Jonas Ådahl * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _LIBINPUT_SEAT_H_ #define _LIBINPUT_SEAT_H_ #include "config.h" #include #include "compositor.h" struct udev_seat { struct weston_seat base; struct wl_list devices_list; struct wl_listener output_create_listener; }; struct udev_input { struct libinput *libinput; struct wl_event_source *libinput_source; struct weston_compositor *compositor; int suspended; }; int udev_input_enable(struct udev_input *input); void udev_input_disable(struct udev_input *input); int udev_input_init(struct udev_input *input, struct weston_compositor *c, struct udev *udev, const char *seat_id); void udev_input_destroy(struct udev_input *input); struct udev_seat * udev_seat_get_named(struct udev_input *u, const char *seat_name); #endif weston-1.9.0/src/weston.pc.in0000664000175000017500000000042312456345006013026 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ libexecdir=@libexecdir@ pkglibexecdir=${libexecdir}/@PACKAGE@ Name: Weston Plugin API Description: Header files for Weston plugin development Version: @WESTON_VERSION@ Cflags: -I${includedir} weston-1.9.0/src/weston-egl-ext.h0000664000175000017500000001154112563431500013606 00000000000000/* * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* Extensions used by Weston, copied from Mesa's eglmesaext.h, */ #ifndef WESTON_EGL_EXT_H #define WESTON_EGL_EXT_H #ifndef EGL_WL_bind_wayland_display #define EGL_WL_bind_wayland_display 1 struct wl_display; #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); #endif typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); #endif /* * This is a little different to the tests shipped with EGL implementations, * which wrap the entire thing in #ifndef EGL_WL_bind_wayland_display, then go * on to define both BindWaylandDisplay and QueryWaylandBuffer. * * Unfortunately, some implementations (particularly the version of Mesa shipped * in Ubuntu 12.04) define EGL_WL_bind_wayland_display, but then only provide * prototypes for (Un)BindWaylandDisplay, completely omitting * QueryWaylandBuffer. * * Detect this, and provide our own definitions if necessary. */ #ifndef EGL_WAYLAND_BUFFER_WL #define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */ #define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */ #define EGL_TEXTURE_Y_U_V_WL 0x31D7 #define EGL_TEXTURE_Y_UV_WL 0x31D8 #define EGL_TEXTURE_Y_XUXV_WL 0x31D9 #define EGL_TEXTURE_EXTERNAL_WL 0x31DA struct wl_resource; #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); #endif typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); #endif #ifndef EGL_WL_create_wayland_buffer_from_image #define EGL_WL_create_wayland_buffer_from_image 1 #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); #endif typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); #endif #ifndef EGL_TEXTURE_EXTERNAL_WL #define EGL_TEXTURE_EXTERNAL_WL 0x31DA #endif #ifndef EGL_BUFFER_AGE_EXT #define EGL_BUFFER_AGE_EXT 0x313D #endif #ifndef EGL_WAYLAND_Y_INVERTED_WL #define EGL_WAYLAND_Y_INVERTED_WL 0x31DB /* eglQueryWaylandBufferWL attribute */ #endif /* Mesas gl2ext.h and probably Khronos upstream defined * GL_EXT_unpack_subimage with non _EXT suffixed GL_UNPACK_* tokens. * In case we're using that mess, manually define the _EXT versions * of the tokens here.*/ #if defined(GL_EXT_unpack_subimage) && !defined(GL_UNPACK_ROW_LENGTH_EXT) #define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 #define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 #define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 #endif /* Define needed tokens from EGL_EXT_image_dma_buf_import extension * here to avoid having to add ifdefs everywhere.*/ #ifndef EGL_EXT_image_dma_buf_import #define EGL_LINUX_DMA_BUF_EXT 0x3270 #define EGL_LINUX_DRM_FOURCC_EXT 0x3271 #define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272 #define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273 #define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274 #define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275 #define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276 #define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277 #define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278 #define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279 #define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A #endif #endif weston-1.9.0/src/screenshooter.c0000664000175000017500000003674112552061177013622 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "compositor.h" #include "screenshooter-server-protocol.h" #include "shared/helpers.h" #include "wcap/wcap-decode.h" struct screenshooter { struct weston_compositor *ec; struct wl_global *global; struct wl_client *client; struct weston_process process; struct wl_listener destroy_listener; }; struct screenshooter_frame_listener { struct wl_listener listener; struct weston_buffer *buffer; weston_screenshooter_done_func_t done; void *data; }; static void copy_bgra_yflip(uint8_t *dst, uint8_t *src, int height, int stride) { uint8_t *end; end = dst + height * stride; while (dst < end) { memcpy(dst, src, stride); dst += stride; src -= stride; } } static void copy_bgra(uint8_t *dst, uint8_t *src, int height, int stride) { /* TODO: optimize this out */ memcpy(dst, src, height * stride); } static void copy_row_swap_RB(void *vdst, void *vsrc, int bytes) { uint32_t *dst = vdst; uint32_t *src = vsrc; uint32_t *end = dst + bytes / 4; while (dst < end) { uint32_t v = *src++; /* A R G B */ uint32_t tmp = v & 0xff00ff00; tmp |= (v >> 16) & 0x000000ff; tmp |= (v << 16) & 0x00ff0000; *dst++ = tmp; } } static void copy_rgba_yflip(uint8_t *dst, uint8_t *src, int height, int stride) { uint8_t *end; end = dst + height * stride; while (dst < end) { copy_row_swap_RB(dst, src, stride); dst += stride; src -= stride; } } static void copy_rgba(uint8_t *dst, uint8_t *src, int height, int stride) { uint8_t *end; end = dst + height * stride; while (dst < end) { copy_row_swap_RB(dst, src, stride); dst += stride; src += stride; } } static void screenshooter_frame_notify(struct wl_listener *listener, void *data) { struct screenshooter_frame_listener *l = container_of(listener, struct screenshooter_frame_listener, listener); struct weston_output *output = data; struct weston_compositor *compositor = output->compositor; int32_t stride; uint8_t *pixels, *d, *s; output->disable_planes--; wl_list_remove(&listener->link); stride = l->buffer->width * (PIXMAN_FORMAT_BPP(compositor->read_format) / 8); pixels = malloc(stride * l->buffer->height); if (pixels == NULL) { l->done(l->data, WESTON_SCREENSHOOTER_NO_MEMORY); free(l); return; } compositor->renderer->read_pixels(output, compositor->read_format, pixels, 0, 0, output->current_mode->width, output->current_mode->height); stride = wl_shm_buffer_get_stride(l->buffer->shm_buffer); d = wl_shm_buffer_get_data(l->buffer->shm_buffer); s = pixels + stride * (l->buffer->height - 1); wl_shm_buffer_begin_access(l->buffer->shm_buffer); switch (compositor->read_format) { case PIXMAN_a8r8g8b8: case PIXMAN_x8r8g8b8: if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP) copy_bgra_yflip(d, s, output->current_mode->height, stride); else copy_bgra(d, pixels, output->current_mode->height, stride); break; case PIXMAN_x8b8g8r8: case PIXMAN_a8b8g8r8: if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP) copy_rgba_yflip(d, s, output->current_mode->height, stride); else copy_rgba(d, pixels, output->current_mode->height, stride); break; default: break; } wl_shm_buffer_end_access(l->buffer->shm_buffer); l->done(l->data, WESTON_SCREENSHOOTER_SUCCESS); free(pixels); free(l); } WL_EXPORT int weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer, weston_screenshooter_done_func_t done, void *data) { struct screenshooter_frame_listener *l; if (!wl_shm_buffer_get(buffer->resource)) { done(data, WESTON_SCREENSHOOTER_BAD_BUFFER); return -1; } buffer->shm_buffer = wl_shm_buffer_get(buffer->resource); buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer); buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer); if (buffer->width < output->current_mode->width || buffer->height < output->current_mode->height) { done(data, WESTON_SCREENSHOOTER_BAD_BUFFER); return -1; } l = malloc(sizeof *l); if (l == NULL) { done(data, WESTON_SCREENSHOOTER_NO_MEMORY); return -1; } l->buffer = buffer; l->done = done; l->data = data; l->listener.notify = screenshooter_frame_notify; wl_signal_add(&output->frame_signal, &l->listener); output->disable_planes++; weston_output_schedule_repaint(output); return 0; } static void screenshooter_done(void *data, enum weston_screenshooter_outcome outcome) { struct wl_resource *resource = data; switch (outcome) { case WESTON_SCREENSHOOTER_SUCCESS: screenshooter_send_done(resource); break; case WESTON_SCREENSHOOTER_NO_MEMORY: wl_resource_post_no_memory(resource); break; default: break; } } static void screenshooter_shoot(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource, struct wl_resource *buffer_resource) { struct weston_output *output = wl_resource_get_user_data(output_resource); struct weston_buffer *buffer = weston_buffer_from_resource(buffer_resource); if (buffer == NULL) { wl_resource_post_no_memory(resource); return; } weston_screenshooter_shoot(output, buffer, screenshooter_done, resource); } struct screenshooter_interface screenshooter_implementation = { screenshooter_shoot }; static void bind_shooter(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct screenshooter *shooter = data; struct wl_resource *resource; resource = wl_resource_create(client, &screenshooter_interface, 1, id); if (client != shooter->client) { wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "screenshooter failed: permission denied"); return; } wl_resource_set_implementation(resource, &screenshooter_implementation, data, NULL); } static void screenshooter_sigchld(struct weston_process *process, int status) { struct screenshooter *shooter = container_of(process, struct screenshooter, process); shooter->client = NULL; } static void screenshooter_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct screenshooter *shooter = data; char *screenshooter_exe; int ret; ret = asprintf(&screenshooter_exe, "%s/%s", weston_config_get_libexec_dir(), "/weston-screenshooter"); if (ret < 0) { weston_log("Could not construct screenshooter path.\n"); return; } if (!shooter->client) shooter->client = weston_client_launch(shooter->ec, &shooter->process, screenshooter_exe, screenshooter_sigchld); free(screenshooter_exe); } struct weston_recorder { struct weston_output *output; uint32_t *frame, *rect; uint32_t *tmpbuf; uint32_t total; int fd; struct wl_listener frame_listener; int count, destroying; }; static uint32_t * output_run(uint32_t *p, uint32_t delta, int run) { int i; while (run > 0) { if (run <= 0xe0) { *p++ = delta | ((run - 1) << 24); break; } i = 24 - __builtin_clz(run); *p++ = delta | ((i + 0xe0) << 24); run -= 1 << (7 + i); } return p; } static uint32_t component_delta(uint32_t next, uint32_t prev) { unsigned char dr, dg, db; dr = (next >> 16) - (prev >> 16); dg = (next >> 8) - (prev >> 8); db = (next >> 0) - (prev >> 0); return (dr << 16) | (dg << 8) | (db << 0); } static void weston_recorder_destroy(struct weston_recorder *recorder); static void weston_recorder_frame_notify(struct wl_listener *listener, void *data) { struct weston_recorder *recorder = container_of(listener, struct weston_recorder, frame_listener); struct weston_output *output = data; struct weston_compositor *compositor = output->compositor; uint32_t msecs = output->frame_time; pixman_box32_t *r; pixman_region32_t damage, transformed_damage; int i, j, k, n, width, height, run, stride; uint32_t delta, prev, *d, *s, *p, next; struct { uint32_t msecs; uint32_t nrects; } header; struct iovec v[2]; int do_yflip; int y_orig; uint32_t *outbuf; do_yflip = !!(compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP); if (do_yflip) outbuf = recorder->rect; else outbuf = recorder->tmpbuf; pixman_region32_init(&damage); pixman_region32_init(&transformed_damage); pixman_region32_intersect(&damage, &output->region, &output->previous_damage); pixman_region32_translate(&damage, -output->x, -output->y); weston_transformed_region(output->width, output->height, output->transform, output->current_scale, &damage, &transformed_damage); pixman_region32_fini(&damage); r = pixman_region32_rectangles(&transformed_damage, &n); if (n == 0) { pixman_region32_fini(&transformed_damage); return; } header.msecs = msecs; header.nrects = n; v[0].iov_base = &header; v[0].iov_len = sizeof header; v[1].iov_base = r; v[1].iov_len = n * sizeof *r; recorder->total += writev(recorder->fd, v, 2); stride = output->current_mode->width; for (i = 0; i < n; i++) { width = r[i].x2 - r[i].x1; height = r[i].y2 - r[i].y1; if (do_yflip) y_orig = output->current_mode->height - r[i].y2; else y_orig = r[i].y1; compositor->renderer->read_pixels(output, compositor->read_format, recorder->rect, r[i].x1, y_orig, width, height); s = recorder->rect; p = outbuf; run = prev = 0; /* quiet gcc */ for (j = 0; j < height; j++) { if (do_yflip) y_orig = r[i].y2 - j - 1; else y_orig = r[i].y1 + j; d = recorder->frame + stride * y_orig + r[i].x1; for (k = 0; k < width; k++) { next = *s++; delta = component_delta(next, *d); *d++ = next; if (run == 0 || delta == prev) { run++; } else { p = output_run(p, prev, run); run = 1; } prev = delta; } } p = output_run(p, prev, run); recorder->total += write(recorder->fd, outbuf, (p - outbuf) * 4); #if 0 fprintf(stderr, "%dx%d at %d,%d rle from %d to %d bytes (%f) total %dM\n", width, height, r[i].x1, r[i].y1, width * height * 4, (int) (p - outbuf) * 4, (float) (p - outbuf) / (width * height), recorder->total / 1024 / 1024); #endif } pixman_region32_fini(&transformed_damage); recorder->count++; if (recorder->destroying) weston_recorder_destroy(recorder); } static void weston_recorder_free(struct weston_recorder *recorder) { if (recorder == NULL) return; free(recorder->tmpbuf); free(recorder->rect); free(recorder->frame); free(recorder); } static void weston_recorder_create(struct weston_output *output, const char *filename) { struct weston_compositor *compositor = output->compositor; struct weston_recorder *recorder; int stride, size; struct { uint32_t magic, format, width, height; } header; int do_yflip; do_yflip = !!(compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP); recorder = zalloc(sizeof *recorder); if (recorder == NULL) { weston_log("%s: out of memory\n", __func__); return; } stride = output->current_mode->width; size = stride * 4 * output->current_mode->height; recorder->frame = zalloc(size); recorder->rect = malloc(size); recorder->output = output; if ((recorder->frame == NULL) || (recorder->rect == NULL)) { weston_log("%s: out of memory\n", __func__); goto err_recorder; } if (!do_yflip) { recorder->tmpbuf = malloc(size); if (recorder->tmpbuf == NULL) { weston_log("%s: out of memory\n", __func__); goto err_recorder; } } header.magic = WCAP_HEADER_MAGIC; switch (compositor->read_format) { case PIXMAN_x8r8g8b8: case PIXMAN_a8r8g8b8: header.format = WCAP_FORMAT_XRGB8888; break; case PIXMAN_a8b8g8r8: header.format = WCAP_FORMAT_XBGR8888; break; default: weston_log("unknown recorder format\n"); goto err_recorder; } recorder->fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644); if (recorder->fd < 0) { weston_log("problem opening output file %s: %m\n", filename); goto err_recorder; } header.width = output->current_mode->width; header.height = output->current_mode->height; recorder->total += write(recorder->fd, &header, sizeof header); recorder->frame_listener.notify = weston_recorder_frame_notify; wl_signal_add(&output->frame_signal, &recorder->frame_listener); output->disable_planes++; weston_output_damage(output); return; err_recorder: weston_recorder_free(recorder); return; } static void weston_recorder_destroy(struct weston_recorder *recorder) { wl_list_remove(&recorder->frame_listener.link); close(recorder->fd); recorder->output->disable_planes--; weston_recorder_free(recorder); } static void recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *ec = keyboard->seat->compositor; struct weston_output *output; struct wl_listener *listener = NULL; struct weston_recorder *recorder; static const char filename[] = "capture.wcap"; wl_list_for_each(output, &ec->output_list, link) { listener = wl_signal_get(&output->frame_signal, weston_recorder_frame_notify); if (listener) break; } if (listener) { recorder = container_of(listener, struct weston_recorder, frame_listener); weston_log( "stopping recorder, total file size %dM, %d frames\n", recorder->total / (1024 * 1024), recorder->count); recorder->destroying = 1; weston_output_schedule_repaint(recorder->output); } else { if (keyboard->focus && keyboard->focus->output) output = keyboard->focus->output; else output = container_of(ec->output_list.next, struct weston_output, link); weston_log("starting recorder for output %s, file %s\n", output->name, filename); weston_recorder_create(output, filename); } } static void screenshooter_destroy(struct wl_listener *listener, void *data) { struct screenshooter *shooter = container_of(listener, struct screenshooter, destroy_listener); wl_global_destroy(shooter->global); free(shooter); } WL_EXPORT void screenshooter_create(struct weston_compositor *ec) { struct screenshooter *shooter; shooter = malloc(sizeof *shooter); if (shooter == NULL) return; shooter->ec = ec; shooter->client = NULL; shooter->global = wl_global_create(ec->wl_display, &screenshooter_interface, 1, shooter, bind_shooter); weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_SUPER, screenshooter_binding, shooter); weston_compositor_add_key_binding(ec, KEY_R, MODIFIER_SUPER, recorder_binding, shooter); shooter->destroy_listener.notify = screenshooter_destroy; wl_signal_add(&ec->destroy_signal, &shooter->destroy_listener); } weston-1.9.0/src/zoom.c0000664000175000017500000001274212556771651011727 00000000000000/* * Copyright © 2012 Scott Moreau * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include "compositor.h" #include "text-cursor-position-server-protocol.h" #include "shared/helpers.h" static void weston_zoom_frame_z(struct weston_animation *animation, struct weston_output *output, uint32_t msecs) { if (animation->frame_counter <= 1) output->zoom.spring_z.timestamp = msecs; weston_spring_update(&output->zoom.spring_z, msecs); if (output->zoom.spring_z.current > output->zoom.max_level) output->zoom.spring_z.current = output->zoom.max_level; else if (output->zoom.spring_z.current < 0.0) output->zoom.spring_z.current = 0.0; if (weston_spring_done(&output->zoom.spring_z)) { if (output->zoom.active && output->zoom.level <= 0.0) { output->zoom.active = false; output->zoom.seat = NULL; output->disable_planes--; wl_list_remove(&output->zoom.motion_listener.link); } output->zoom.spring_z.current = output->zoom.level; wl_list_remove(&animation->link); wl_list_init(&animation->link); } output->dirty = 1; weston_output_damage(output); } static void zoom_area_center_from_point(struct weston_output *output, wl_fixed_t *x, wl_fixed_t *y) { float level = output->zoom.spring_z.current; wl_fixed_t offset_x = wl_fixed_from_int(output->x); wl_fixed_t offset_y = wl_fixed_from_int(output->y); wl_fixed_t w = wl_fixed_from_int(output->width); wl_fixed_t h = wl_fixed_from_int(output->height); *x = (*x - offset_x) * level + w / 2; *y = (*y - offset_y) * level + h / 2; } static void weston_output_update_zoom_transform(struct weston_output *output) { float global_x, global_y; wl_fixed_t x = output->zoom.current.x; /* global pointer coords */ wl_fixed_t y = output->zoom.current.y; float level; level = output->zoom.spring_z.current; if (!output->zoom.active || level > output->zoom.max_level || level == 0.0f) return; zoom_area_center_from_point(output, &x, &y); global_x = wl_fixed_to_double(x); global_y = wl_fixed_to_double(y); output->zoom.trans_x = global_x - output->width / 2; output->zoom.trans_y = global_y - output->height / 2; if (output->zoom.trans_x < 0) output->zoom.trans_x = 0; if (output->zoom.trans_y < 0) output->zoom.trans_y = 0; if (output->zoom.trans_x > level * output->width) output->zoom.trans_x = level * output->width; if (output->zoom.trans_y > level * output->height) output->zoom.trans_y = level * output->height; } static void weston_zoom_transition(struct weston_output *output) { if (output->zoom.level != output->zoom.spring_z.current) { output->zoom.spring_z.target = output->zoom.level; if (wl_list_empty(&output->zoom.animation_z.link)) { output->zoom.animation_z.frame_counter = 0; wl_list_insert(output->animation_list.prev, &output->zoom.animation_z.link); } } output->dirty = 1; weston_output_damage(output); } WL_EXPORT void weston_output_update_zoom(struct weston_output *output) { struct weston_seat *seat = output->zoom.seat; struct weston_pointer *pointer = weston_seat_get_pointer(seat); assert(output->zoom.active); output->zoom.current.x = pointer->x; output->zoom.current.y = pointer->y; weston_zoom_transition(output); weston_output_update_zoom_transform(output); } static void motion(struct wl_listener *listener, void *data) { struct weston_output_zoom *zoom = container_of(listener, struct weston_output_zoom, motion_listener); struct weston_output *output = container_of(zoom, struct weston_output, zoom); weston_output_update_zoom(output); } WL_EXPORT void weston_output_activate_zoom(struct weston_output *output, struct weston_seat *seat) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (output->zoom.active) return; output->zoom.active = true; output->zoom.seat = seat; output->disable_planes++; wl_signal_add(&pointer->motion_signal, &output->zoom.motion_listener); } WL_EXPORT void weston_output_init_zoom(struct weston_output *output) { output->zoom.active = false; output->zoom.seat = NULL; output->zoom.increment = 0.07; output->zoom.max_level = 0.95; output->zoom.level = 0.0; output->zoom.trans_x = 0.0; output->zoom.trans_y = 0.0; weston_spring_init(&output->zoom.spring_z, 250.0, 0.0, 0.0); output->zoom.spring_z.friction = 1000; output->zoom.animation_z.frame = weston_zoom_frame_z; wl_list_init(&output->zoom.animation_z.link); output->zoom.motion_listener.notify = motion; } weston-1.9.0/src/libinput-device.c0000664000175000017500000003726112552301651014012 00000000000000/* * Copyright © 2010 Intel Corporation * Copyright © 2013 Jonas Ådahl * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "libinput-device.h" #include "shared/helpers.h" #define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int(10) void evdev_led_update(struct evdev_device *device, enum weston_led weston_leds) { enum libinput_led leds = 0; if (weston_leds & LED_NUM_LOCK) leds |= LIBINPUT_LED_NUM_LOCK; if (weston_leds & LED_CAPS_LOCK) leds |= LIBINPUT_LED_CAPS_LOCK; if (weston_leds & LED_SCROLL_LOCK) leds |= LIBINPUT_LED_SCROLL_LOCK; libinput_device_led_update(device->device, leds); } static void handle_keyboard_key(struct libinput_device *libinput_device, struct libinput_event_keyboard *keyboard_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); int key_state = libinput_event_keyboard_get_key_state(keyboard_event); int seat_key_count = libinput_event_keyboard_get_seat_key_count(keyboard_event); /* Ignore key events that are not seat wide state changes. */ if ((key_state == LIBINPUT_KEY_STATE_PRESSED && seat_key_count != 1) || (key_state == LIBINPUT_KEY_STATE_RELEASED && seat_key_count != 0)) return; notify_key(device->seat, libinput_event_keyboard_get_time(keyboard_event), libinput_event_keyboard_get_key(keyboard_event), libinput_event_keyboard_get_key_state(keyboard_event), STATE_UPDATE_AUTOMATIC); } static void handle_pointer_motion(struct libinput_device *libinput_device, struct libinput_event_pointer *pointer_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); wl_fixed_t dx, dy; dx = wl_fixed_from_double(libinput_event_pointer_get_dx(pointer_event)); dy = wl_fixed_from_double(libinput_event_pointer_get_dy(pointer_event)); notify_motion(device->seat, libinput_event_pointer_get_time(pointer_event), dx, dy); } static void handle_pointer_motion_absolute( struct libinput_device *libinput_device, struct libinput_event_pointer *pointer_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); struct weston_output *output = device->output; uint32_t time; wl_fixed_t x, y; uint32_t width, height; if (!output) return; time = libinput_event_pointer_get_time(pointer_event); width = device->output->current_mode->width; height = device->output->current_mode->height; x = wl_fixed_from_double( libinput_event_pointer_get_absolute_x_transformed(pointer_event, width)); y = wl_fixed_from_double( libinput_event_pointer_get_absolute_y_transformed(pointer_event, height)); weston_output_transform_coordinate(device->output, x, y, &x, &y); notify_motion_absolute(device->seat, time, x, y); } static void handle_pointer_button(struct libinput_device *libinput_device, struct libinput_event_pointer *pointer_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); int button_state = libinput_event_pointer_get_button_state(pointer_event); int seat_button_count = libinput_event_pointer_get_seat_button_count(pointer_event); /* Ignore button events that are not seat wide state changes. */ if ((button_state == LIBINPUT_BUTTON_STATE_PRESSED && seat_button_count != 1) || (button_state == LIBINPUT_BUTTON_STATE_RELEASED && seat_button_count != 0)) return; notify_button(device->seat, libinput_event_pointer_get_time(pointer_event), libinput_event_pointer_get_button(pointer_event), libinput_event_pointer_get_button_state(pointer_event)); } static double normalize_scroll(struct libinput_event_pointer *pointer_event, enum libinput_pointer_axis axis) { static int warned; enum libinput_pointer_axis_source source; double value; source = libinput_event_pointer_get_axis_source(pointer_event); /* libinput < 0.8 sent wheel click events with value 10. Since 0.8 the value is the angle of the click in degrees. To keep backwards-compat with existing clients, we just send multiples of the click count. */ switch (source) { case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL: value = 10 * libinput_event_pointer_get_axis_value_discrete( pointer_event, axis); break; case LIBINPUT_POINTER_AXIS_SOURCE_FINGER: case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS: value = libinput_event_pointer_get_axis_value(pointer_event, axis); break; default: value = 0; if (warned < 5) { weston_log("Unknown scroll source %d. Event discarded\n", source); warned++; } break; } return value; } static void handle_pointer_axis(struct libinput_device *libinput_device, struct libinput_event_pointer *pointer_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); double value; enum libinput_pointer_axis axis; axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; if (libinput_event_pointer_has_axis(pointer_event, axis)) { value = normalize_scroll(pointer_event, axis); notify_axis(device->seat, libinput_event_pointer_get_time(pointer_event), WL_POINTER_AXIS_VERTICAL_SCROLL, wl_fixed_from_double(value)); } axis = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL; if (libinput_event_pointer_has_axis(pointer_event, axis)) { value = normalize_scroll(pointer_event, axis); notify_axis(device->seat, libinput_event_pointer_get_time(pointer_event), WL_POINTER_AXIS_HORIZONTAL_SCROLL, wl_fixed_from_double(value)); } } static void handle_touch_with_coords(struct libinput_device *libinput_device, struct libinput_event_touch *touch_event, int touch_type) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); wl_fixed_t x; wl_fixed_t y; uint32_t width, height; uint32_t time; int32_t slot; if (!device->output) return; time = libinput_event_touch_get_time(touch_event); slot = libinput_event_touch_get_seat_slot(touch_event); width = device->output->current_mode->width; height = device->output->current_mode->height; x = wl_fixed_from_double( libinput_event_touch_get_x_transformed(touch_event, width)); y = wl_fixed_from_double( libinput_event_touch_get_y_transformed(touch_event, height)); weston_output_transform_coordinate(device->output, x, y, &x, &y); notify_touch(device->seat, time, slot, x, y, touch_type); } static void handle_touch_down(struct libinput_device *device, struct libinput_event_touch *touch_event) { handle_touch_with_coords(device, touch_event, WL_TOUCH_DOWN); } static void handle_touch_motion(struct libinput_device *device, struct libinput_event_touch *touch_event) { handle_touch_with_coords(device, touch_event, WL_TOUCH_MOTION); } static void handle_touch_up(struct libinput_device *libinput_device, struct libinput_event_touch *touch_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); uint32_t time = libinput_event_touch_get_time(touch_event); int32_t slot = libinput_event_touch_get_seat_slot(touch_event); notify_touch(device->seat, time, slot, 0, 0, WL_TOUCH_UP); } static void handle_touch_frame(struct libinput_device *libinput_device, struct libinput_event_touch *touch_event) { struct evdev_device *device = libinput_device_get_user_data(libinput_device); struct weston_seat *seat = device->seat; notify_touch_frame(seat); } int evdev_device_process_event(struct libinput_event *event) { struct libinput_device *libinput_device = libinput_event_get_device(event); int handled = 1; switch (libinput_event_get_type(event)) { case LIBINPUT_EVENT_KEYBOARD_KEY: handle_keyboard_key(libinput_device, libinput_event_get_keyboard_event(event)); break; case LIBINPUT_EVENT_POINTER_MOTION: handle_pointer_motion(libinput_device, libinput_event_get_pointer_event(event)); break; case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: handle_pointer_motion_absolute( libinput_device, libinput_event_get_pointer_event(event)); break; case LIBINPUT_EVENT_POINTER_BUTTON: handle_pointer_button(libinput_device, libinput_event_get_pointer_event(event)); break; case LIBINPUT_EVENT_POINTER_AXIS: handle_pointer_axis(libinput_device, libinput_event_get_pointer_event(event)); break; case LIBINPUT_EVENT_TOUCH_DOWN: handle_touch_down(libinput_device, libinput_event_get_touch_event(event)); break; case LIBINPUT_EVENT_TOUCH_MOTION: handle_touch_motion(libinput_device, libinput_event_get_touch_event(event)); break; case LIBINPUT_EVENT_TOUCH_UP: handle_touch_up(libinput_device, libinput_event_get_touch_event(event)); break; case LIBINPUT_EVENT_TOUCH_FRAME: handle_touch_frame(libinput_device, libinput_event_get_touch_event(event)); break; default: handled = 0; weston_log("unknown libinput event %d\n", libinput_event_get_type(event)); } return handled; } static void notify_output_destroy(struct wl_listener *listener, void *data) { struct evdev_device *device = container_of(listener, struct evdev_device, output_destroy_listener); struct weston_compositor *c = device->seat->compositor; struct weston_output *output; if (!device->output_name && !wl_list_empty(&c->output_list)) { output = container_of(c->output_list.next, struct weston_output, link); evdev_device_set_output(device, output); } else { device->output = NULL; } } /** * The WL_CALIBRATION property requires a pixel-specific matrix to be * applied after scaling device coordinates to screen coordinates. libinput * can't do that, so we need to convert the calibration to the normalized * format libinput expects. */ static void evdev_device_set_calibration(struct evdev_device *device) { struct udev *udev; struct udev_device *udev_device = NULL; const char *sysname = libinput_device_get_sysname(device->device); const char *calibration_values; uint32_t width, height; float calibration[6]; enum libinput_config_status status; if (!device->output) return; width = device->output->width; height = device->output->height; if (width == 0 || height == 0) return; /* If libinput has a pre-set calibration matrix, don't override it */ if (!libinput_device_config_calibration_has_matrix(device->device) || libinput_device_config_calibration_get_default_matrix( device->device, calibration) != 0) return; udev = udev_new(); if (!udev) return; udev_device = udev_device_new_from_subsystem_sysname(udev, "input", sysname); if (!udev_device) goto out; calibration_values = udev_device_get_property_value(udev_device, "WL_CALIBRATION"); if (!calibration_values || sscanf(calibration_values, "%f %f %f %f %f %f", &calibration[0], &calibration[1], &calibration[2], &calibration[3], &calibration[4], &calibration[5]) != 6) goto out; weston_log("Applying calibration: %f %f %f %f %f %f " "(normalized %f %f)\n", calibration[0], calibration[1], calibration[2], calibration[3], calibration[4], calibration[5], calibration[2] / width, calibration[5] / height); /* normalize to a format libinput can use. There is a chance of this being wrong if the width/height don't match the device width/height but I'm not sure how to fix that */ calibration[2] /= width; calibration[5] /= height; status = libinput_device_config_calibration_set_matrix(device->device, calibration); if (status != LIBINPUT_CONFIG_STATUS_SUCCESS) weston_log("Failed to apply calibration.\n"); out: if (udev_device) udev_device_unref(udev_device); udev_unref(udev); } void evdev_device_set_output(struct evdev_device *device, struct weston_output *output) { if (device->output_destroy_listener.notify) { wl_list_remove(&device->output_destroy_listener.link); device->output_destroy_listener.notify = NULL; } device->output = output; device->output_destroy_listener.notify = notify_output_destroy; wl_signal_add(&output->destroy_signal, &device->output_destroy_listener); evdev_device_set_calibration(device); } static void configure_device(struct evdev_device *device) { struct weston_compositor *compositor = device->seat->compositor; struct weston_config_section *s; int enable_tap; int enable_tap_default; s = weston_config_get_section(compositor->config, "libinput", NULL, NULL); if (libinput_device_config_tap_get_finger_count(device->device) > 0) { enable_tap_default = libinput_device_config_tap_get_default_enabled( device->device); weston_config_section_get_bool(s, "enable_tap", &enable_tap, enable_tap_default); libinput_device_config_tap_set_enabled(device->device, enable_tap); } evdev_device_set_calibration(device); } struct evdev_device * evdev_device_create(struct libinput_device *libinput_device, struct weston_seat *seat) { struct evdev_device *device; device = zalloc(sizeof *device); if (device == NULL) return NULL; device->seat = seat; wl_list_init(&device->link); device->device = libinput_device; if (libinput_device_has_capability(libinput_device, LIBINPUT_DEVICE_CAP_KEYBOARD)) { weston_seat_init_keyboard(seat, NULL); device->seat_caps |= EVDEV_SEAT_KEYBOARD; } if (libinput_device_has_capability(libinput_device, LIBINPUT_DEVICE_CAP_POINTER)) { weston_seat_init_pointer(seat); device->seat_caps |= EVDEV_SEAT_POINTER; } if (libinput_device_has_capability(libinput_device, LIBINPUT_DEVICE_CAP_TOUCH)) { weston_seat_init_touch(seat); device->seat_caps |= EVDEV_SEAT_TOUCH; } libinput_device_set_user_data(libinput_device, device); libinput_device_ref(libinput_device); configure_device(device); return device; } void evdev_device_destroy(struct evdev_device *device) { if (device->seat_caps & EVDEV_SEAT_POINTER) weston_seat_release_pointer(device->seat); if (device->seat_caps & EVDEV_SEAT_KEYBOARD) weston_seat_release_keyboard(device->seat); if (device->seat_caps & EVDEV_SEAT_TOUCH) weston_seat_release_touch(device->seat); if (device->output) wl_list_remove(&device->output_destroy_listener.link); wl_list_remove(&device->link); libinput_device_unref(device->device); free(device->devnode); free(device->output_name); free(device); } void evdev_notify_keyboard_focus(struct weston_seat *seat, struct wl_list *evdev_devices) { struct wl_array keys; if (seat->keyboard_device_count == 0) return; wl_array_init(&keys); notify_keyboard_focus_in(seat, &keys, STATE_UPDATE_AUTOMATIC); wl_array_release(&keys); } weston-1.9.0/src/compositor.h0000664000175000017500000013060112563431500013121 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_ #define _WAYLAND_SYSTEM_COMPOSITOR_H_ #ifdef __cplusplus extern "C" { #endif #include #include #include #include #define WL_HIDE_DEPRECATED #include #include "version.h" #include "matrix.h" #include "config-parser.h" #include "zalloc.h" #include "timeline-object.h" struct weston_transform { struct weston_matrix matrix; struct wl_list link; }; struct weston_surface; struct weston_buffer; struct shell_surface; struct weston_seat; struct weston_output; struct input_method; struct weston_pointer; struct linux_dmabuf_buffer; enum weston_keyboard_modifier { MODIFIER_CTRL = (1 << 0), MODIFIER_ALT = (1 << 1), MODIFIER_SUPER = (1 << 2), MODIFIER_SHIFT = (1 << 3), }; enum weston_keyboard_locks { WESTON_NUM_LOCK = (1 << 0), WESTON_CAPS_LOCK = (1 << 1), }; enum weston_led { LED_NUM_LOCK = (1 << 0), LED_CAPS_LOCK = (1 << 1), LED_SCROLL_LOCK = (1 << 2), }; struct weston_mode { uint32_t flags; int32_t width, height; uint32_t refresh; struct wl_list link; }; struct weston_shell_client { void (*send_configure)(struct weston_surface *surface, int32_t width, int32_t height); }; struct weston_shell_interface { void *shell; /* either desktop or tablet */ struct shell_surface *(*create_shell_surface)(void *shell, struct weston_surface *surface, const struct weston_shell_client *client); struct weston_view *(*get_primary_view)(void *shell, struct shell_surface *shsurf); void (*set_toplevel)(struct shell_surface *shsurf); void (*set_transient)(struct shell_surface *shsurf, struct weston_surface *parent, int x, int y, uint32_t flags); void (*set_fullscreen)(struct shell_surface *shsurf, uint32_t method, uint32_t framerate, struct weston_output *output); void (*set_xwayland)(struct shell_surface *shsurf, int x, int y, uint32_t flags); int (*move)(struct shell_surface *shsurf, struct weston_pointer *pointer); int (*resize)(struct shell_surface *shsurf, struct weston_pointer *pointer, uint32_t edges); void (*set_title)(struct shell_surface *shsurf, const char *title); void (*set_window_geometry)(struct shell_surface *shsurf, int32_t x, int32_t y, int32_t width, int32_t height); void (*set_maximized)(struct shell_surface *shsurf); void (*set_pid)(struct shell_surface *shsurf, pid_t pid); }; struct weston_animation { void (*frame)(struct weston_animation *animation, struct weston_output *output, uint32_t msecs); int frame_counter; struct wl_list link; }; enum { WESTON_SPRING_OVERSHOOT, WESTON_SPRING_CLAMP, WESTON_SPRING_BOUNCE }; struct weston_spring { double k; double friction; double current; double target; double previous; double min, max; uint32_t timestamp; uint32_t clip; }; struct weston_fixed_point { wl_fixed_t x, y; }; struct weston_output_zoom { bool active; float increment; float level; float max_level; float trans_x, trans_y; struct weston_seat *seat; struct weston_animation animation_z; struct weston_spring spring_z; struct weston_fixed_point current; struct wl_listener motion_listener; }; /* bit compatible with drm definitions. */ enum dpms_enum { WESTON_DPMS_ON, WESTON_DPMS_STANDBY, WESTON_DPMS_SUSPEND, WESTON_DPMS_OFF }; struct weston_output { uint32_t id; char *name; void *renderer_state; struct wl_list link; struct wl_list resource_list; struct wl_global *global; struct weston_compositor *compositor; /** From global to output buffer coordinates. */ struct weston_matrix matrix; /** From output buffer to global coordinates. */ struct weston_matrix inverse_matrix; struct wl_list animation_list; int32_t x, y, width, height; int32_t mm_width, mm_height; /** Output area in global coordinates, simple rect */ pixman_region32_t region; pixman_region32_t previous_damage; int repaint_needed; int repaint_scheduled; struct wl_event_source *repaint_timer; struct weston_output_zoom zoom; int dirty; struct wl_signal frame_signal; struct wl_signal destroy_signal; int move_x, move_y; uint32_t frame_time; /* presentation timestamp in milliseconds */ uint64_t msc; /* media stream counter */ int disable_planes; int destroying; struct wl_list feedback_list; char *make, *model, *serial_number; uint32_t subpixel; uint32_t transform; int32_t native_scale; int32_t current_scale; int32_t original_scale; struct weston_mode *native_mode; struct weston_mode *current_mode; struct weston_mode *original_mode; struct wl_list mode_list; void (*start_repaint_loop)(struct weston_output *output); int (*repaint)(struct weston_output *output, pixman_region32_t *damage); void (*destroy)(struct weston_output *output); void (*assign_planes)(struct weston_output *output); int (*switch_mode)(struct weston_output *output, struct weston_mode *mode); /* backlight values are on 0-255 range, where higher is brighter */ int32_t backlight_current; void (*set_backlight)(struct weston_output *output, uint32_t value); void (*set_dpms)(struct weston_output *output, enum dpms_enum level); int connection_internal; uint16_t gamma_size; void (*set_gamma)(struct weston_output *output, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b); struct weston_timeline_object timeline; }; struct weston_pointer_grab; struct weston_pointer_grab_interface { void (*focus)(struct weston_pointer_grab *grab); void (*motion)(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y); void (*button)(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state); void (*cancel)(struct weston_pointer_grab *grab); }; struct weston_pointer_grab { const struct weston_pointer_grab_interface *interface; struct weston_pointer *pointer; }; struct weston_keyboard_grab; struct weston_keyboard_grab_interface { void (*key)(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state); void (*modifiers)(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group); void (*cancel)(struct weston_keyboard_grab *grab); }; struct weston_keyboard_grab { const struct weston_keyboard_grab_interface *interface; struct weston_keyboard *keyboard; }; struct weston_touch_grab; struct weston_touch_grab_interface { void (*down)(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t sx, wl_fixed_t sy); void (*up)(struct weston_touch_grab *grab, uint32_t time, int touch_id); void (*motion)(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t sx, wl_fixed_t sy); void (*frame)(struct weston_touch_grab *grab); void (*cancel)(struct weston_touch_grab *grab); }; struct weston_touch_grab { const struct weston_touch_grab_interface *interface; struct weston_touch *touch; }; struct weston_data_offer { struct wl_resource *resource; struct weston_data_source *source; struct wl_listener source_destroy_listener; }; struct weston_data_source { struct wl_resource *resource; struct wl_signal destroy_signal; struct wl_array mime_types; void (*accept)(struct weston_data_source *source, uint32_t serial, const char *mime_type); void (*send)(struct weston_data_source *source, const char *mime_type, int32_t fd); void (*cancel)(struct weston_data_source *source); }; struct weston_pointer { struct weston_seat *seat; struct wl_list resource_list; struct wl_list focus_resource_list; struct weston_view *focus; uint32_t focus_serial; struct wl_listener focus_view_listener; struct wl_listener focus_resource_listener; struct wl_signal focus_signal; struct wl_signal motion_signal; struct weston_view *sprite; struct wl_listener sprite_destroy_listener; int32_t hotspot_x, hotspot_y; struct weston_pointer_grab *grab; struct weston_pointer_grab default_grab; wl_fixed_t grab_x, grab_y; uint32_t grab_button; uint32_t grab_serial; uint32_t grab_time; wl_fixed_t x, y; wl_fixed_t sx, sy; uint32_t button_count; struct wl_listener output_destroy_listener; }; struct weston_touch { struct weston_seat *seat; struct wl_list resource_list; struct wl_list focus_resource_list; struct weston_view *focus; struct wl_listener focus_view_listener; struct wl_listener focus_resource_listener; uint32_t focus_serial; struct wl_signal focus_signal; uint32_t num_tp; struct weston_touch_grab *grab; struct weston_touch_grab default_grab; int grab_touch_id; wl_fixed_t grab_x, grab_y; uint32_t grab_serial; uint32_t grab_time; }; struct weston_pointer * weston_pointer_create(struct weston_seat *seat); void weston_pointer_destroy(struct weston_pointer *pointer); void weston_pointer_set_focus(struct weston_pointer *pointer, struct weston_view *view, wl_fixed_t sx, wl_fixed_t sy); void weston_pointer_clear_focus(struct weston_pointer *pointer); void weston_pointer_start_grab(struct weston_pointer *pointer, struct weston_pointer_grab *grab); void weston_pointer_end_grab(struct weston_pointer *pointer); void weston_pointer_clamp(struct weston_pointer *pointer, wl_fixed_t *fx, wl_fixed_t *fy); void weston_pointer_move(struct weston_pointer *pointer, wl_fixed_t x, wl_fixed_t y); void weston_pointer_set_default_grab(struct weston_pointer *pointer, const struct weston_pointer_grab_interface *interface); struct weston_keyboard * weston_keyboard_create(void); void weston_keyboard_destroy(struct weston_keyboard *keyboard); void weston_keyboard_set_focus(struct weston_keyboard *keyboard, struct weston_surface *surface); void weston_keyboard_start_grab(struct weston_keyboard *device, struct weston_keyboard_grab *grab); void weston_keyboard_end_grab(struct weston_keyboard *keyboard); int /* * 'mask' and 'value' should be a bitwise mask of one or more * valued of the weston_keyboard_locks enum. */ weston_keyboard_set_locks(struct weston_keyboard *keyboard, uint32_t mask, uint32_t value); struct weston_touch * weston_touch_create(void); void weston_touch_destroy(struct weston_touch *touch); void weston_touch_set_focus(struct weston_touch *touch, struct weston_view *view); void weston_touch_start_grab(struct weston_touch *device, struct weston_touch_grab *grab); void weston_touch_end_grab(struct weston_touch *touch); void wl_data_device_set_keyboard_focus(struct weston_seat *seat); int wl_data_device_manager_init(struct wl_display *display); void weston_seat_set_selection(struct weston_seat *seat, struct weston_data_source *source, uint32_t serial); void weston_seat_send_selection(struct weston_seat *seat, struct wl_client *client); int weston_pointer_start_drag(struct weston_pointer *pointer, struct weston_data_source *source, struct weston_surface *icon, struct wl_client *client); int weston_touch_start_drag(struct weston_touch *touch, struct weston_data_source *source, struct weston_surface *icon, struct wl_client *client); struct weston_xkb_info { struct xkb_keymap *keymap; int keymap_fd; size_t keymap_size; char *keymap_area; int32_t ref_count; xkb_mod_index_t shift_mod; xkb_mod_index_t caps_mod; xkb_mod_index_t ctrl_mod; xkb_mod_index_t alt_mod; xkb_mod_index_t mod2_mod; xkb_mod_index_t mod3_mod; xkb_mod_index_t super_mod; xkb_mod_index_t mod5_mod; xkb_led_index_t num_led; xkb_led_index_t caps_led; xkb_led_index_t scroll_led; }; struct weston_keyboard { struct weston_seat *seat; struct wl_list resource_list; struct wl_list focus_resource_list; struct weston_surface *focus; struct wl_listener focus_resource_listener; uint32_t focus_serial; struct wl_signal focus_signal; struct weston_keyboard_grab *grab; struct weston_keyboard_grab default_grab; uint32_t grab_key; uint32_t grab_serial; uint32_t grab_time; struct wl_array keys; struct { uint32_t mods_depressed; uint32_t mods_latched; uint32_t mods_locked; uint32_t group; } modifiers; struct weston_keyboard_grab input_method_grab; struct wl_resource *input_method_resource; struct weston_xkb_info *xkb_info; struct { struct xkb_state *state; enum weston_led leds; } xkb_state; struct xkb_keymap *pending_keymap; }; struct weston_seat { struct wl_list base_resource_list; struct wl_global *global; struct weston_pointer *pointer_state; struct weston_keyboard *keyboard_state; struct weston_touch *touch_state; int pointer_device_count; int keyboard_device_count; int touch_device_count; struct weston_output *output; /* constraint */ struct wl_signal destroy_signal; struct wl_signal updated_caps_signal; struct weston_compositor *compositor; struct wl_list link; enum weston_keyboard_modifier modifier_state; struct weston_surface *saved_kbd_focus; struct wl_listener saved_kbd_focus_listener; struct wl_list drag_resource_list; uint32_t selection_serial; struct weston_data_source *selection_data_source; struct wl_listener selection_data_source_listener; struct wl_signal selection_signal; void (*led_update)(struct weston_seat *ws, enum weston_led leds); uint32_t slot_map; struct input_method *input_method; char *seat_name; }; enum { WESTON_COMPOSITOR_ACTIVE, WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */ WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */ WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dmps * to off */ }; struct weston_layer_entry { struct wl_list link; struct weston_layer *layer; }; struct weston_layer { struct weston_layer_entry view_list; struct wl_list link; pixman_box32_t mask; }; struct weston_plane { struct weston_compositor *compositor; pixman_region32_t damage; /**< in global coords */ pixman_region32_t clip; int32_t x, y; struct wl_list link; }; struct weston_renderer { int (*read_pixels)(struct weston_output *output, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, uint32_t width, uint32_t height); void (*repaint_output)(struct weston_output *output, pixman_region32_t *output_damage); void (*flush_damage)(struct weston_surface *surface); void (*attach)(struct weston_surface *es, struct weston_buffer *buffer); void (*surface_set_color)(struct weston_surface *surface, float red, float green, float blue, float alpha); void (*destroy)(struct weston_compositor *ec); /** See weston_surface_get_content_size() */ void (*surface_get_content_size)(struct weston_surface *surface, int *width, int *height); /** See weston_surface_copy_content() */ int (*surface_copy_content)(struct weston_surface *surface, void *target, size_t size, int src_x, int src_y, int width, int height); /** See weston_compositor_import_dmabuf() */ bool (*import_dmabuf)(struct weston_compositor *ec, struct linux_dmabuf_buffer *buffer); }; enum weston_capability { /* backend/renderer supports arbitrary rotation */ WESTON_CAP_ROTATION_ANY = 0x0001, /* screencaptures need to be y-flipped */ WESTON_CAP_CAPTURE_YFLIP = 0x0002, /* backend/renderer has a separate cursor plane */ WESTON_CAP_CURSOR_PLANE = 0x0004, /* backend supports setting arbitrary resolutions */ WESTON_CAP_ARBITRARY_MODES = 0x0008, /* renderer supports weston_view_set_mask() clipping */ WESTON_CAP_VIEW_CLIP_MASK = 0x0010, }; struct weston_backend { void (*destroy)(struct weston_compositor *ec); void (*restore)(struct weston_compositor *ec); }; struct weston_compositor { struct wl_signal destroy_signal; struct wl_display *wl_display; struct weston_shell_interface shell_interface; struct weston_config *config; /* surface signals */ struct wl_signal create_surface_signal; struct wl_signal activate_signal; struct wl_signal transform_signal; struct wl_signal kill_signal; struct wl_signal idle_signal; struct wl_signal wake_signal; struct wl_signal show_input_panel_signal; struct wl_signal hide_input_panel_signal; struct wl_signal update_input_panel_signal; struct wl_signal seat_created_signal; struct wl_signal output_created_signal; struct wl_signal output_destroyed_signal; struct wl_signal output_moved_signal; struct wl_event_loop *input_loop; struct wl_event_source *input_loop_source; struct wl_signal session_signal; int session_active; struct weston_layer fade_layer; struct weston_layer cursor_layer; struct wl_list output_list; struct wl_list seat_list; struct wl_list layer_list; struct wl_list view_list; struct wl_list plane_list; struct wl_list key_binding_list; struct wl_list modifier_binding_list; struct wl_list button_binding_list; struct wl_list touch_binding_list; struct wl_list axis_binding_list; struct wl_list debug_binding_list; uint32_t state; struct wl_event_source *idle_source; uint32_t idle_inhibit; int idle_time; /* timeout, s */ const struct weston_pointer_grab_interface *default_pointer_grab; /* Repaint state. */ struct weston_plane primary_plane; uint32_t capabilities; /* combination of enum weston_capability */ struct weston_renderer *renderer; pixman_format_code_t read_format; struct weston_backend *backend; struct weston_launcher *launcher; uint32_t output_id_pool; struct xkb_rule_names xkb_names; struct xkb_context *xkb_context; struct weston_xkb_info *xkb_info; /* Raw keyboard processing (no libxkbcommon initialization or handling) */ int use_xkbcommon; int32_t kb_repeat_rate; int32_t kb_repeat_delay; clockid_t presentation_clock; int32_t repaint_msec; int exit_code; void *user_data; void (*exit)(struct weston_compositor *c); }; struct weston_buffer { struct wl_resource *resource; struct wl_signal destroy_signal; struct wl_listener destroy_listener; union { struct wl_shm_buffer *shm_buffer; void *legacy_buffer; }; int32_t width, height; uint32_t busy_count; int y_inverted; }; struct weston_buffer_reference { struct weston_buffer *buffer; struct wl_listener destroy_listener; }; struct weston_buffer_viewport { struct { /* wl_surface.set_buffer_transform */ uint32_t transform; /* wl_surface.set_scaling_factor */ int32_t scale; /* * If src_width != wl_fixed_from_int(-1), * then and only then src_* are used. */ wl_fixed_t src_x, src_y; wl_fixed_t src_width, src_height; } buffer; struct { /* * If width == -1, the size is inferred from the buffer. */ int32_t width, height; } surface; int changed; }; struct weston_region { struct wl_resource *resource; pixman_region32_t region; }; /* Using weston_view transformations * * To add a transformation to a view, create a struct weston_transform, and * add it to the list view->geometry.transformation_list. Whenever you * change the list, anything under view->geometry, or anything in the * weston_transforms linked into the list, you must call * weston_view_geometry_dirty(). * * The order in the list defines the order of transformations. Let the list * contain the transformation matrices M1, ..., Mn as head to tail. The * transformation is applied to view-local coordinate vector p as * P = Mn * ... * M2 * M1 * p * to produce the global coordinate vector P. The total transform * Mn * ... * M2 * M1 * is cached in view->transform.matrix, and the inverse of it in * view->transform.inverse. * * The list always contains view->transform.position transformation, which * is the translation by view->geometry.x and y. * * If you want to apply a transformation in local coordinates, add your * weston_transform to the head of the list. If you want to apply a * transformation in global coordinates, add it to the tail of the list. * * If view->geometry.parent is set, the total transformation of this * view will be the parent's total transformation and this transformation * combined: * Mparent * Mn * ... * M2 * M1 */ struct weston_view { struct weston_surface *surface; struct wl_list surface_link; struct wl_signal destroy_signal; struct wl_list link; struct weston_layer_entry layer_link; /* part of geometry */ struct weston_plane *plane; /* For weston_layer inheritance from another view */ struct weston_view *parent_view; pixman_region32_t clip; /* See weston_view_damage_below() */ float alpha; /* part of geometry, see below */ void *renderer_state; /* Surface geometry state, mutable. * If you change anything, call weston_surface_geometry_dirty(). * That includes the transformations referenced from the list. */ struct { float x, y; /* surface translation on display */ /* struct weston_transform */ struct wl_list transformation_list; /* managed by weston_surface_set_transform_parent() */ struct weston_view *parent; struct wl_listener parent_destroy_listener; struct wl_list child_list; /* geometry.parent_link */ struct wl_list parent_link; /* managed by weston_view_set_mask() */ bool scissor_enabled; pixman_region32_t scissor; /* always a simple rect */ } geometry; /* State derived from geometry state, read-only. * This is updated by weston_view_update_transform(). */ struct { int dirty; /* Approximations in global coordinates: * - boundingbox is guaranteed to include the whole view in * the smallest possible single rectangle. * - opaque is guaranteed to be fully opaque, though not * necessarily include all opaque areas. */ pixman_region32_t boundingbox; pixman_region32_t opaque; /* matrix and inverse are used only if enabled = 1. * If enabled = 0, use x, y, width, height directly. */ int enabled; struct weston_matrix matrix; struct weston_matrix inverse; struct weston_transform position; /* matrix from x, y */ } transform; /* * Which output to vsync this surface to. * Used to determine, whether to send or queue frame events. * Must be NULL, if 'link' is not in weston_compositor::surface_list. */ struct weston_output *output; /* * A more complete representation of all outputs this surface is * displayed on. */ uint32_t output_mask; /* Per-surface Presentation feedback flags, controlled by backend. */ uint32_t psf_flags; }; struct weston_surface_state { /* wl_surface.attach */ int newly_attached; struct weston_buffer *buffer; struct wl_listener buffer_destroy_listener; int32_t sx; int32_t sy; /* wl_surface.damage */ pixman_region32_t damage; /* wl_surface.set_opaque_region */ pixman_region32_t opaque; /* wl_surface.set_input_region */ pixman_region32_t input; /* wl_surface.frame */ struct wl_list frame_callback_list; /* presentation.feedback */ struct wl_list feedback_list; /* wl_surface.set_buffer_transform */ /* wl_surface.set_scaling_factor */ /* wl_viewport.set */ struct weston_buffer_viewport buffer_viewport; }; struct weston_surface { struct wl_resource *resource; struct wl_signal destroy_signal; /* callback argument: this surface */ struct weston_compositor *compositor; /** Damage in local coordinates from the client, for tex upload. */ pixman_region32_t damage; pixman_region32_t opaque; /* part of geometry, see below */ pixman_region32_t input; int32_t width, height; int32_t ref_count; /* Not for long-term storage. This exists for book-keeping while * iterating over surfaces and views */ int32_t touched; void *renderer_state; struct wl_list views; /* * Which output to vsync this surface to. * Used to determine, whether to send or queue frame events. * Must be NULL, if 'link' is not in weston_compositor::surface_list. */ struct weston_output *output; /* * A more complete representation of all outputs this surface is * displayed on. */ uint32_t output_mask; struct wl_list frame_callback_list; struct wl_list feedback_list; struct weston_buffer_reference buffer_ref; struct weston_buffer_viewport buffer_viewport; int32_t width_from_buffer; /* before applying viewport */ int32_t height_from_buffer; bool keep_buffer; /* for backends to prevent early release */ /* wl_viewport resource for this surface */ struct wl_resource *viewport_resource; /* All the pending state, that wl_surface.commit will apply. */ struct weston_surface_state pending; /* Matrices representating of the full transformation between * buffer and surface coordinates. These matrices are updated * using the weston_surface_build_buffer_matrix function. */ struct weston_matrix buffer_to_surface_matrix; struct weston_matrix surface_to_buffer_matrix; /* * If non-NULL, this function will be called on * wl_surface::commit after a new buffer has been set up for * this surface. The integer params are the sx and sy * parameters supplied to wl_surface::attach. */ void (*configure)(struct weston_surface *es, int32_t sx, int32_t sy); void *configure_private; int (*get_label)(struct weston_surface *surface, char *buf, size_t len); /* Parent's list of its sub-surfaces, weston_subsurface:parent_link. * Contains also the parent itself as a dummy weston_subsurface, * if the list is not empty. */ struct wl_list subsurface_list; /* weston_subsurface::parent_link */ struct wl_list subsurface_list_pending; /* ...::parent_link_pending */ /* * For tracking protocol role assignments. Different roles may * have the same configure hook, e.g. in shell.c. Configure hook * may get reset, this will not. * XXX: map configure functions 1:1 to roles, and never reset it, * and replace role_name with configure. */ const char *role_name; struct weston_timeline_object timeline; }; struct weston_subsurface { struct wl_resource *resource; /* guaranteed to be valid and non-NULL */ struct weston_surface *surface; struct wl_listener surface_destroy_listener; /* can be NULL */ struct weston_surface *parent; struct wl_listener parent_destroy_listener; struct wl_list parent_link; struct wl_list parent_link_pending; struct { int32_t x; int32_t y; int set; } position; int has_cached_data; struct weston_surface_state cached; struct weston_buffer_reference cached_buffer_ref; int synchronized; /* Used for constructing the view tree */ struct wl_list unused_views; }; enum weston_key_state_update { STATE_UPDATE_AUTOMATIC, STATE_UPDATE_NONE, }; void weston_version(int *major, int *minor, int *micro); void weston_view_update_transform(struct weston_view *view); void weston_view_geometry_dirty(struct weston_view *view); void weston_view_to_global_fixed(struct weston_view *view, wl_fixed_t sx, wl_fixed_t sy, wl_fixed_t *x, wl_fixed_t *y); void weston_view_to_global_float(struct weston_view *view, float sx, float sy, float *x, float *y); void weston_view_from_global_float(struct weston_view *view, float x, float y, float *vx, float *vy); void weston_view_from_global(struct weston_view *view, int32_t x, int32_t y, int32_t *vx, int32_t *vy); void weston_view_from_global_fixed(struct weston_view *view, wl_fixed_t x, wl_fixed_t y, wl_fixed_t *vx, wl_fixed_t *vy); void weston_surface_to_buffer_float(struct weston_surface *surface, float x, float y, float *bx, float *by); void weston_surface_to_buffer(struct weston_surface *surface, int sx, int sy, int *bx, int *by); pixman_box32_t weston_surface_to_buffer_rect(struct weston_surface *surface, pixman_box32_t rect); void weston_surface_to_buffer_region(struct weston_surface *surface, pixman_region32_t *surface_region, pixman_region32_t *buffer_region); void weston_spring_init(struct weston_spring *spring, double k, double current, double target); void weston_spring_update(struct weston_spring *spring, uint32_t msec); int weston_spring_done(struct weston_spring *spring); void weston_surface_activate(struct weston_surface *surface, struct weston_seat *seat); void notify_motion(struct weston_seat *seat, uint32_t time, wl_fixed_t dx, wl_fixed_t dy); void notify_motion_absolute(struct weston_seat *seat, uint32_t time, wl_fixed_t x, wl_fixed_t y); void notify_button(struct weston_seat *seat, uint32_t time, int32_t button, enum wl_pointer_button_state state); void notify_axis(struct weston_seat *seat, uint32_t time, uint32_t axis, wl_fixed_t value); void notify_key(struct weston_seat *seat, uint32_t time, uint32_t key, enum wl_keyboard_key_state state, enum weston_key_state_update update_state); void notify_modifiers(struct weston_seat *seat, uint32_t serial); void notify_pointer_focus(struct weston_seat *seat, struct weston_output *output, wl_fixed_t x, wl_fixed_t y); void notify_keyboard_focus_in(struct weston_seat *seat, struct wl_array *keys, enum weston_key_state_update update_state); void notify_keyboard_focus_out(struct weston_seat *seat); void notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y, int touch_type); void notify_touch_frame(struct weston_seat *seat); void weston_layer_entry_insert(struct weston_layer_entry *list, struct weston_layer_entry *entry); void weston_layer_entry_remove(struct weston_layer_entry *entry); void weston_layer_init(struct weston_layer *layer, struct wl_list *below); void weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height); void weston_layer_set_mask_infinite(struct weston_layer *layer); void weston_plane_init(struct weston_plane *plane, struct weston_compositor *ec, int32_t x, int32_t y); void weston_plane_release(struct weston_plane *plane); void weston_compositor_stack_plane(struct weston_compositor *ec, struct weston_plane *plane, struct weston_plane *above); /* An invalid flag in presented_flags to catch logic errors. */ #define PRESENTATION_FEEDBACK_INVALID (1U << 31) void weston_output_finish_frame(struct weston_output *output, const struct timespec *stamp, uint32_t presented_flags); void weston_output_schedule_repaint(struct weston_output *output); void weston_output_damage(struct weston_output *output); void weston_compositor_schedule_repaint(struct weston_compositor *compositor); void weston_compositor_fade(struct weston_compositor *compositor, float tint); void weston_compositor_damage_all(struct weston_compositor *compositor); void weston_compositor_unlock(struct weston_compositor *compositor); void weston_compositor_wake(struct weston_compositor *compositor); void weston_compositor_offscreen(struct weston_compositor *compositor); void weston_compositor_sleep(struct weston_compositor *compositor); struct weston_view * weston_compositor_pick_view(struct weston_compositor *compositor, wl_fixed_t x, wl_fixed_t y, wl_fixed_t *sx, wl_fixed_t *sy); struct weston_binding; typedef void (*weston_key_binding_handler_t)(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data); struct weston_binding * weston_compositor_add_key_binding(struct weston_compositor *compositor, uint32_t key, enum weston_keyboard_modifier modifier, weston_key_binding_handler_t binding, void *data); typedef void (*weston_modifier_binding_handler_t)(struct weston_keyboard *keyboard, enum weston_keyboard_modifier modifier, void *data); struct weston_binding * weston_compositor_add_modifier_binding(struct weston_compositor *compositor, enum weston_keyboard_modifier modifier, weston_modifier_binding_handler_t binding, void *data); typedef void (*weston_button_binding_handler_t)(struct weston_pointer *pointer, uint32_t time, uint32_t button, void *data); struct weston_binding * weston_compositor_add_button_binding(struct weston_compositor *compositor, uint32_t button, enum weston_keyboard_modifier modifier, weston_button_binding_handler_t binding, void *data); typedef void (*weston_touch_binding_handler_t)(struct weston_touch *touch, uint32_t time, void *data); struct weston_binding * weston_compositor_add_touch_binding(struct weston_compositor *compositor, enum weston_keyboard_modifier modifier, weston_touch_binding_handler_t binding, void *data); typedef void (*weston_axis_binding_handler_t)(struct weston_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value, void *data); struct weston_binding * weston_compositor_add_axis_binding(struct weston_compositor *compositor, uint32_t axis, enum weston_keyboard_modifier modifier, weston_axis_binding_handler_t binding, void *data); struct weston_binding * weston_compositor_add_debug_binding(struct weston_compositor *compositor, uint32_t key, weston_key_binding_handler_t binding, void *data); void weston_binding_destroy(struct weston_binding *binding); void weston_install_debug_key_binding(struct weston_compositor *compositor, uint32_t mod); void weston_binding_list_destroy_all(struct wl_list *list); void weston_compositor_run_key_binding(struct weston_compositor *compositor, struct weston_keyboard *keyboard, uint32_t time, uint32_t key, enum wl_keyboard_key_state state); void weston_compositor_run_modifier_binding(struct weston_compositor *compositor, struct weston_keyboard *keyboard, enum weston_keyboard_modifier modifier, enum wl_keyboard_key_state state); void weston_compositor_run_button_binding(struct weston_compositor *compositor, struct weston_pointer *pointer, uint32_t time, uint32_t button, enum wl_pointer_button_state value); void weston_compositor_run_touch_binding(struct weston_compositor *compositor, struct weston_touch *touch, uint32_t time, int touch_type); int weston_compositor_run_axis_binding(struct weston_compositor *compositor, struct weston_pointer *pointer, uint32_t time, uint32_t axis, int32_t value); int weston_compositor_run_debug_binding(struct weston_compositor *compositor, struct weston_keyboard *keyboard, uint32_t time, uint32_t key, enum wl_keyboard_key_state state); void weston_compositor_set_default_pointer_grab(struct weston_compositor *compositor, const struct weston_pointer_grab_interface *interface); int weston_environment_get_fd(const char *env); struct wl_list * weston_compositor_top(struct weston_compositor *compositor); struct weston_surface * weston_surface_create(struct weston_compositor *compositor); struct weston_view * weston_view_create(struct weston_surface *surface); void weston_view_destroy(struct weston_view *view); void weston_view_set_position(struct weston_view *view, float x, float y); void weston_view_set_transform_parent(struct weston_view *view, struct weston_view *parent); void weston_view_set_mask(struct weston_view *view, int x, int y, int width, int height); void weston_view_set_mask_infinite(struct weston_view *view); bool weston_view_is_mapped(struct weston_view *view); void weston_view_schedule_repaint(struct weston_view *view); bool weston_surface_is_mapped(struct weston_surface *surface); void weston_surface_set_size(struct weston_surface *surface, int32_t width, int32_t height); void weston_surface_schedule_repaint(struct weston_surface *surface); void weston_surface_damage(struct weston_surface *surface); void weston_view_damage_below(struct weston_view *view); void weston_view_move_to_plane(struct weston_view *view, struct weston_plane *plane); void weston_view_unmap(struct weston_view *view); void weston_surface_unmap(struct weston_surface *surface); struct weston_surface * weston_surface_get_main_surface(struct weston_surface *surface); int weston_surface_set_role(struct weston_surface *surface, const char *role_name, struct wl_resource *error_resource, uint32_t error_code); void weston_surface_set_label_func(struct weston_surface *surface, int (*desc)(struct weston_surface *, char *, size_t)); void weston_surface_get_content_size(struct weston_surface *surface, int *width, int *height); int weston_surface_copy_content(struct weston_surface *surface, void *target, size_t size, int src_x, int src_y, int width, int height); struct weston_buffer * weston_buffer_from_resource(struct wl_resource *resource); void weston_buffer_reference(struct weston_buffer_reference *ref, struct weston_buffer *buffer); uint32_t weston_compositor_get_time(void); void weston_compositor_destroy(struct weston_compositor *ec); struct weston_compositor * weston_compositor_create(struct wl_display *display, void *user_data); void weston_compositor_exit(struct weston_compositor *ec); void * weston_compositor_get_user_data(struct weston_compositor *compositor); int weston_compositor_set_presentation_clock(struct weston_compositor *compositor, clockid_t clk_id); int weston_compositor_set_presentation_clock_software( struct weston_compositor *compositor); void weston_compositor_read_presentation_clock( const struct weston_compositor *compositor, struct timespec *ts); bool weston_compositor_import_dmabuf(struct weston_compositor *compositor, struct linux_dmabuf_buffer *buffer); void weston_compositor_shutdown(struct weston_compositor *ec); void weston_compositor_exit_with_code(struct weston_compositor *compositor, int exit_code); void weston_output_init_zoom(struct weston_output *output); void weston_output_update_zoom(struct weston_output *output); void weston_output_activate_zoom(struct weston_output *output, struct weston_seat *seat); void weston_output_update_matrix(struct weston_output *output); void weston_output_move(struct weston_output *output, int x, int y); void weston_output_init(struct weston_output *output, struct weston_compositor *c, int x, int y, int width, int height, uint32_t transform, int32_t scale); void weston_compositor_add_output(struct weston_compositor *compositor, struct weston_output *output); void weston_output_destroy(struct weston_output *output); void weston_output_transform_coordinate(struct weston_output *output, wl_fixed_t device_x, wl_fixed_t device_y, wl_fixed_t *x, wl_fixed_t *y); void weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec, const char *seat_name); void weston_seat_init_pointer(struct weston_seat *seat); void weston_seat_release_pointer(struct weston_seat *seat); int weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap); void weston_seat_release_keyboard(struct weston_seat *seat); void weston_seat_init_touch(struct weston_seat *seat); void weston_seat_release_touch(struct weston_seat *seat); void weston_seat_repick(struct weston_seat *seat); void weston_seat_update_keymap(struct weston_seat *seat, struct xkb_keymap *keymap); void weston_seat_release(struct weston_seat *seat); int weston_compositor_xkb_init(struct weston_compositor *ec, struct xkb_rule_names *names); void weston_compositor_xkb_destroy(struct weston_compositor *ec); /* String literal of spaces, the same width as the timestamp. */ #define STAMP_SPACE " " void weston_log_file_open(const char *filename); void weston_log_file_close(void); int weston_vlog(const char *fmt, va_list ap); int weston_vlog_continue(const char *fmt, va_list ap); int weston_log(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); int weston_log_continue(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); enum { TTY_ENTER_VT, TTY_LEAVE_VT }; struct tty * tty_create(struct weston_compositor *compositor, int tty_nr); void tty_destroy(struct tty *tty); void tty_reset(struct tty *tty); int tty_activate_vt(struct tty *tty, int vt); void screenshooter_create(struct weston_compositor *ec); enum weston_screenshooter_outcome { WESTON_SCREENSHOOTER_SUCCESS, WESTON_SCREENSHOOTER_NO_MEMORY, WESTON_SCREENSHOOTER_BAD_BUFFER }; typedef void (*weston_screenshooter_done_func_t)(void *data, enum weston_screenshooter_outcome outcome); int weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer, weston_screenshooter_done_func_t done, void *data); struct clipboard * clipboard_create(struct weston_seat *seat); struct text_backend; struct text_backend * text_backend_init(struct weston_compositor *ec); void text_backend_destroy(struct text_backend *text_backend); struct weston_process; typedef void (*weston_process_cleanup_func_t)(struct weston_process *process, int status); struct weston_process { pid_t pid; weston_process_cleanup_func_t cleanup; struct wl_list link; }; struct wl_client * weston_client_launch(struct weston_compositor *compositor, struct weston_process *proc, const char *path, weston_process_cleanup_func_t cleanup); struct wl_client * weston_client_start(struct weston_compositor *compositor, const char *path); void weston_watch_process(struct weston_process *process); struct weston_view_animation; typedef void (*weston_view_animation_done_func_t)(struct weston_view_animation *animation, void *data); void weston_view_animation_destroy(struct weston_view_animation *animation); struct weston_view_animation * weston_zoom_run(struct weston_view *view, float start, float stop, weston_view_animation_done_func_t done, void *data); struct weston_view_animation * weston_fade_run(struct weston_view *view, float start, float end, float k, weston_view_animation_done_func_t done, void *data); struct weston_view_animation * weston_move_scale_run(struct weston_view *view, int dx, int dy, float start, float end, int reverse, weston_view_animation_done_func_t done, void *data); void weston_fade_update(struct weston_view_animation *fade, float target); struct weston_view_animation * weston_stable_fade_run(struct weston_view *front_view, float start, struct weston_view *back_view, float end, weston_view_animation_done_func_t done, void *data); struct weston_view_animation * weston_slide_run(struct weston_view *view, float start, float stop, weston_view_animation_done_func_t done, void *data); void weston_surface_set_color(struct weston_surface *surface, float red, float green, float blue, float alpha); void weston_surface_destroy(struct weston_surface *surface); int weston_output_mode_set_native(struct weston_output *output, struct weston_mode *mode, int32_t scale); int weston_output_mode_switch_to_temporary(struct weston_output *output, struct weston_mode *mode, int32_t scale); int weston_output_mode_switch_to_native(struct weston_output *output); int noop_renderer_init(struct weston_compositor *ec); int backend_init(struct weston_compositor *c, int *argc, char *argv[], struct weston_config *config); int module_init(struct weston_compositor *compositor, int *argc, char *argv[]); void weston_transformed_coord(int width, int height, enum wl_output_transform transform, int32_t scale, float sx, float sy, float *bx, float *by); pixman_box32_t weston_transformed_rect(int width, int height, enum wl_output_transform transform, int32_t scale, pixman_box32_t rect); void weston_transformed_region(int width, int height, enum wl_output_transform transform, int32_t scale, pixman_region32_t *src, pixman_region32_t *dest); void * weston_load_module(const char *name, const char *entrypoint); int weston_parse_transform(const char *transform, uint32_t *out); const char * weston_transform_to_string(uint32_t output_transform); struct weston_keyboard * weston_seat_get_keyboard(struct weston_seat *seat); struct weston_pointer * weston_seat_get_pointer(struct weston_seat *seat); struct weston_touch * weston_seat_get_touch(struct weston_seat *seat); #ifdef __cplusplus } #endif #endif weston-1.9.0/src/rpi-bcm-stubs.h0000664000175000017500000002020012456345006013411 00000000000000/* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * This file provides just enough types and stubs, so that the rpi-backend * can be built without the real headers and libraries of the Raspberry Pi. * * This file CANNOT be used to build a working rpi-backend, it is intended * only for build-testing, when the proper headers are not available. */ #ifndef RPI_BCM_STUBS #define RPI_BCM_STUBS #include /* from /opt/vc/include/bcm_host.h */ static inline void bcm_host_init(void) {} static inline void bcm_host_deinit(void) {} /* from /opt/vc/include/interface/vmcs_host/vc_dispservice_defs.h */ #define TRANSFORM_HFLIP (1<<0) #define TRANSFORM_VFLIP (1<<1) #define TRANSFORM_TRANSPOSE (1<<2) /* from /opt/vc/include/interface/vctypes/vc_display_types.h */ typedef enum { VCOS_DISPLAY_INPUT_FORMAT_INVALID = 0, } DISPLAY_INPUT_FORMAT_T; /* from /opt/vc/include/interface/vctypes/vc_image_types.h */ typedef struct tag_VC_RECT_T { int32_t x; int32_t y; int32_t width; int32_t height; } VC_RECT_T; typedef enum { VC_IMAGE_ROT0, /* these are not the right values: */ VC_IMAGE_ROT90, VC_IMAGE_ROT180, VC_IMAGE_ROT270, VC_IMAGE_MIRROR_ROT0, VC_IMAGE_MIRROR_ROT90, VC_IMAGE_MIRROR_ROT180, VC_IMAGE_MIRROR_ROT270, } VC_IMAGE_TRANSFORM_T; typedef enum { VC_IMAGE_MIN = 0, /* these are not the right values: */ VC_IMAGE_ARGB8888, VC_IMAGE_XRGB8888, VC_IMAGE_RGB565, } VC_IMAGE_TYPE_T; /* from /opt/vc/include/interface/vmcs_host/vc_dispmanx_types.h */ typedef uint32_t DISPMANX_DISPLAY_HANDLE_T; typedef uint32_t DISPMANX_UPDATE_HANDLE_T; typedef uint32_t DISPMANX_ELEMENT_HANDLE_T; typedef uint32_t DISPMANX_RESOURCE_HANDLE_T; typedef uint32_t DISPMANX_PROTECTION_T; #define DISPMANX_NO_HANDLE 0 #define DISPMANX_PROTECTION_NONE 0 #define DISPMANX_ID_HDMI 2 typedef enum { /* Bottom 2 bits sets the alpha mode */ DISPMANX_FLAGS_ALPHA_FROM_SOURCE = 0, DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS = 1, DISPMANX_FLAGS_ALPHA_FIXED_NON_ZERO = 2, DISPMANX_FLAGS_ALPHA_FIXED_EXCEED_0X07 = 3, DISPMANX_FLAGS_ALPHA_PREMULT = 1 << 16, DISPMANX_FLAGS_ALPHA_MIX = 1 << 17 } DISPMANX_FLAGS_ALPHA_T; typedef struct { DISPMANX_FLAGS_ALPHA_T flags; uint32_t opacity; DISPMANX_RESOURCE_HANDLE_T mask; } VC_DISPMANX_ALPHA_T; typedef struct { int32_t width; int32_t height; VC_IMAGE_TRANSFORM_T transform; DISPLAY_INPUT_FORMAT_T input_format; } DISPMANX_MODEINFO_T; typedef enum { DISPMANX_NO_ROTATE = 0, DISPMANX_ROTATE_90 = 1, DISPMANX_ROTATE_180 = 2, DISPMANX_ROTATE_270 = 3, DISPMANX_FLIP_HRIZ = 1 << 16, DISPMANX_FLIP_VERT = 1 << 17 } DISPMANX_TRANSFORM_T; typedef struct { uint32_t dummy; } DISPMANX_CLAMP_T; typedef void (*DISPMANX_CALLBACK_FUNC_T)(DISPMANX_UPDATE_HANDLE_T u, void *arg); /* from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h */ static inline int vc_dispmanx_rect_set(VC_RECT_T *rect, uint32_t x_offset, uint32_t y_offset, uint32_t width, uint32_t height) { rect->x = x_offset; rect->y = y_offset; rect->width = width; rect->height = height; return 0; } static inline DISPMANX_RESOURCE_HANDLE_T vc_dispmanx_resource_create(VC_IMAGE_TYPE_T type, uint32_t width, uint32_t height, uint32_t *native_image_handle) { return DISPMANX_NO_HANDLE; } static inline int vc_dispmanx_resource_write_data(DISPMANX_RESOURCE_HANDLE_T res, VC_IMAGE_TYPE_T src_type, int src_pitch, void *src_address, const VC_RECT_T *rect) { return -1; } static inline int vc_dispmanx_resource_write_data_rect(DISPMANX_RESOURCE_HANDLE_T handle, VC_IMAGE_TYPE_T src_type, int src_pitch, void *src_address, const VC_RECT_T *src_rect, uint32_t dst_x, uint32_t dst_y) { return -1; } static inline int vc_dispmanx_resource_read_data(DISPMANX_RESOURCE_HANDLE_T handle, const VC_RECT_T *p_rect, void *dst_address, uint32_t dst_pitch) { return -1; } static inline int vc_dispmanx_resource_delete(DISPMANX_RESOURCE_HANDLE_T res) { return -1; } static inline DISPMANX_DISPLAY_HANDLE_T vc_dispmanx_display_open(uint32_t device) { return DISPMANX_NO_HANDLE; } static inline int vc_dispmanx_display_close(DISPMANX_DISPLAY_HANDLE_T display) { return -1; } static inline int vc_dispmanx_display_get_info(DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_MODEINFO_T *pinfo) { return -1; } static inline DISPMANX_UPDATE_HANDLE_T vc_dispmanx_update_start(int32_t priority) { return DISPMANX_NO_HANDLE; } static inline DISPMANX_ELEMENT_HANDLE_T vc_dispmanx_element_add(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_DISPLAY_HANDLE_T display, int32_t layer, const VC_RECT_T *dest_rect, DISPMANX_RESOURCE_HANDLE_T src, const VC_RECT_T *src_rect, DISPMANX_PROTECTION_T protection, VC_DISPMANX_ALPHA_T *alpha, DISPMANX_CLAMP_T *clamp, DISPMANX_TRANSFORM_T transform) { return DISPMANX_NO_HANDLE; } static inline int vc_dispmanx_element_change_source(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, DISPMANX_RESOURCE_HANDLE_T src) { return -1; } static inline int vc_dispmanx_element_modified(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, const VC_RECT_T *rect) { return -1; } static inline int vc_dispmanx_element_remove(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element) { return -1; } static inline int vc_dispmanx_update_submit(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg) { return -1; } static inline int vc_dispmanx_update_submit_sync(DISPMANX_UPDATE_HANDLE_T update) { return -1; } static inline int vc_dispmanx_element_change_attributes(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, uint32_t change_flags, int32_t layer, uint8_t opacity, const VC_RECT_T *dest_rect, const VC_RECT_T *src_rect, DISPMANX_RESOURCE_HANDLE_T mask, VC_IMAGE_TRANSFORM_T transform) { return -1; } static inline int vc_dispmanx_snapshot(DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_RESOURCE_HANDLE_T snapshot_resource, VC_IMAGE_TRANSFORM_T transform) { return -1; } struct wl_resource; static inline DISPMANX_RESOURCE_HANDLE_T vc_dispmanx_get_handle_from_wl_buffer(struct wl_resource *_buffer) { return DISPMANX_NO_HANDLE; } static inline void vc_dispmanx_set_wl_buffer_in_use(struct wl_resource *_buffer, int in_use) { } static inline int vc_dispmanx_element_set_opaque_rect(DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, const VC_RECT_T *opaque_rect) { return -1; } /* from /opt/vc/include/EGL/eglplatform.h */ typedef struct { DISPMANX_ELEMENT_HANDLE_T element; int width; int height; } EGL_DISPMANX_WINDOW_T; #endif /* RPI_BCM_STUBS */ weston-1.9.0/src/clipboard.c0000664000175000017500000001677512537664716012716 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "compositor.h" #include "shared/helpers.h" struct clipboard_source { struct weston_data_source base; struct wl_array contents; struct clipboard *clipboard; struct wl_event_source *event_source; uint32_t serial; int refcount; int fd; }; struct clipboard { struct weston_seat *seat; struct wl_listener selection_listener; struct wl_listener destroy_listener; struct clipboard_source *source; }; static void clipboard_client_create(struct clipboard_source *source, int fd); static void clipboard_source_unref(struct clipboard_source *source) { char **s; source->refcount--; if (source->refcount > 0) return; if (source->event_source) { wl_event_source_remove(source->event_source); close(source->fd); } wl_signal_emit(&source->base.destroy_signal, &source->base); s = source->base.mime_types.data; free(*s); wl_array_release(&source->base.mime_types); wl_array_release(&source->contents); free(source); } static int clipboard_source_data(int fd, uint32_t mask, void *data) { struct clipboard_source *source = data; struct clipboard *clipboard = source->clipboard; char *p; int len, size; if (source->contents.alloc - source->contents.size < 1024) { wl_array_add(&source->contents, 1024); source->contents.size -= 1024; } p = source->contents.data + source->contents.size; size = source->contents.alloc - source->contents.size; len = read(fd, p, size); if (len == 0) { wl_event_source_remove(source->event_source); close(fd); source->event_source = NULL; } else if (len < 0) { clipboard_source_unref(source); clipboard->source = NULL; } else { source->contents.size += len; } return 1; } static void clipboard_source_accept(struct weston_data_source *source, uint32_t time, const char *mime_type) { } static void clipboard_source_send(struct weston_data_source *base, const char *mime_type, int32_t fd) { struct clipboard_source *source = container_of(base, struct clipboard_source, base); char **s; s = source->base.mime_types.data; if (strcmp(mime_type, s[0]) == 0) clipboard_client_create(source, fd); else close(fd); } static void clipboard_source_cancel(struct weston_data_source *source) { } static struct clipboard_source * clipboard_source_create(struct clipboard *clipboard, const char *mime_type, uint32_t serial, int fd) { struct wl_display *display = clipboard->seat->compositor->wl_display; struct wl_event_loop *loop = wl_display_get_event_loop(display); struct clipboard_source *source; char **s; source = malloc(sizeof *source); if (source == NULL) return NULL; wl_array_init(&source->contents); wl_array_init(&source->base.mime_types); source->base.resource = NULL; source->base.accept = clipboard_source_accept; source->base.send = clipboard_source_send; source->base.cancel = clipboard_source_cancel; wl_signal_init(&source->base.destroy_signal); source->refcount = 1; source->clipboard = clipboard; source->serial = serial; source->fd = fd; s = wl_array_add(&source->base.mime_types, sizeof *s); if (s == NULL) goto err_add; *s = strdup(mime_type); if (*s == NULL) goto err_strdup; source->event_source = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, clipboard_source_data, source); if (source->event_source == NULL) goto err_source; return source; err_source: free(*s); err_strdup: wl_array_release(&source->base.mime_types); err_add: free(source); return NULL; } struct clipboard_client { struct wl_event_source *event_source; size_t offset; struct clipboard_source *source; }; static int clipboard_client_data(int fd, uint32_t mask, void *data) { struct clipboard_client *client = data; char *p; size_t size; int len; size = client->source->contents.size; p = client->source->contents.data; len = write(fd, p + client->offset, size - client->offset); if (len > 0) client->offset += len; if (client->offset == size || len <= 0) { close(fd); wl_event_source_remove(client->event_source); clipboard_source_unref(client->source); free(client); } return 1; } static void clipboard_client_create(struct clipboard_source *source, int fd) { struct weston_seat *seat = source->clipboard->seat; struct clipboard_client *client; struct wl_event_loop *loop = wl_display_get_event_loop(seat->compositor->wl_display); client = zalloc(sizeof *client); if (client == NULL) return; client->source = source; source->refcount++; client->event_source = wl_event_loop_add_fd(loop, fd, WL_EVENT_WRITABLE, clipboard_client_data, client); } static void clipboard_set_selection(struct wl_listener *listener, void *data) { struct clipboard *clipboard = container_of(listener, struct clipboard, selection_listener); struct weston_seat *seat = data; struct weston_data_source *source = seat->selection_data_source; const char **mime_types; int p[2]; if (source == NULL) { if (clipboard->source) weston_seat_set_selection(seat, &clipboard->source->base, clipboard->source->serial); return; } else if (source->accept == clipboard_source_accept) { /* Callback for our data source. */ return; } if (clipboard->source) clipboard_source_unref(clipboard->source); clipboard->source = NULL; mime_types = source->mime_types.data; if (!mime_types || pipe2(p, O_CLOEXEC) == -1) return; source->send(source, mime_types[0], p[1]); clipboard->source = clipboard_source_create(clipboard, mime_types[0], seat->selection_serial, p[0]); if (clipboard->source == NULL) { close(p[0]); return; } } static void clipboard_destroy(struct wl_listener *listener, void *data) { struct clipboard *clipboard = container_of(listener, struct clipboard, destroy_listener); wl_list_remove(&clipboard->selection_listener.link); wl_list_remove(&clipboard->destroy_listener.link); free(clipboard); } struct clipboard * clipboard_create(struct weston_seat *seat) { struct clipboard *clipboard; clipboard = zalloc(sizeof *clipboard); if (clipboard == NULL) return NULL; clipboard->seat = seat; clipboard->selection_listener.notify = clipboard_set_selection; clipboard->destroy_listener.notify = clipboard_destroy; wl_signal_add(&seat->selection_signal, &clipboard->selection_listener); wl_signal_add(&seat->destroy_signal, &clipboard->destroy_listener); return clipboard; } weston-1.9.0/src/noop-renderer.c0000664000175000017500000000671412537627702013520 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include "compositor.h" static int noop_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { return 0; } static void noop_renderer_repaint_output(struct weston_output *output, pixman_region32_t *output_damage) { } static void noop_renderer_flush_damage(struct weston_surface *surface) { } static void noop_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) { struct wl_shm_buffer *shm_buffer; uint8_t *data; uint32_t size, i, width, height, stride; volatile unsigned char unused = 0; /* volatile so it's not optimized out */ if (!buffer) return; shm_buffer = wl_shm_buffer_get(buffer->resource); if (!shm_buffer) { weston_log("No-op renderer supports only SHM buffers\n"); return; } data = wl_shm_buffer_get_data(shm_buffer); stride = wl_shm_buffer_get_stride(shm_buffer); width = wl_shm_buffer_get_width(shm_buffer); height = wl_shm_buffer_get_height(shm_buffer); size = stride * height; /* Access the buffer data to make sure the buffer's client gets killed * if the buffer size is invalid. This makes the bad_buffer test pass. * This can be removed if we start reading the buffer contents * somewhere else, e.g. in repaint_output(). */ wl_shm_buffer_begin_access(shm_buffer); for (i = 0; i < size; i++) unused ^= data[i]; wl_shm_buffer_end_access(shm_buffer); buffer->shm_buffer = shm_buffer; buffer->width = width; buffer->height = height; } static void noop_renderer_surface_set_color(struct weston_surface *surface, float red, float green, float blue, float alpha) { } static void noop_renderer_destroy(struct weston_compositor *ec) { free(ec->renderer); ec->renderer = NULL; } WL_EXPORT int noop_renderer_init(struct weston_compositor *ec) { struct weston_renderer *renderer; renderer = malloc(sizeof *renderer); if (renderer == NULL) return -1; renderer->read_pixels = noop_renderer_read_pixels; renderer->repaint_output = noop_renderer_repaint_output; renderer->flush_damage = noop_renderer_flush_damage; renderer->attach = noop_renderer_attach; renderer->surface_set_color = noop_renderer_surface_set_color; renderer->destroy = noop_renderer_destroy; ec->renderer = renderer; return 0; } weston-1.9.0/src/compositor-fbdev.c0000664000175000017500000006372512575610243014222 00000000000000/* * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2011 Intel Corporation * Copyright © 2012 Raspberry Pi Foundation * Copyright © 2013 Philip Withnall * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "compositor.h" #include "launcher-util.h" #include "pixman-renderer.h" #include "libinput-seat.h" #include "gl-renderer.h" #include "presentation_timing-server-protocol.h" struct fbdev_backend { struct weston_backend base; struct weston_compositor *compositor; uint32_t prev_state; struct udev *udev; struct udev_input input; int use_pixman; struct wl_listener session_listener; }; struct fbdev_screeninfo { unsigned int x_resolution; /* pixels, visible area */ unsigned int y_resolution; /* pixels, visible area */ unsigned int width_mm; /* visible screen width in mm */ unsigned int height_mm; /* visible screen height in mm */ unsigned int bits_per_pixel; size_t buffer_length; /* length of frame buffer memory in bytes */ size_t line_length; /* length of a line in bytes */ char id[16]; /* screen identifier */ pixman_format_code_t pixel_format; /* frame buffer pixel format */ unsigned int refresh_rate; /* Hertz */ }; struct fbdev_output { struct fbdev_backend *backend; struct weston_output base; struct weston_mode mode; struct wl_event_source *finish_frame_timer; /* Frame buffer details. */ const char *device; /* ownership shared with fbdev_parameters */ struct fbdev_screeninfo fb_info; void *fb; /* length is fb_info.buffer_length */ /* pixman details. */ pixman_image_t *hw_surface; pixman_image_t *shadow_surface; void *shadow_buf; uint8_t depth; }; struct fbdev_parameters { int tty; char *device; int use_gl; }; struct gl_renderer_interface *gl_renderer; static const char default_seat[] = "seat0"; static inline struct fbdev_output * to_fbdev_output(struct weston_output *base) { return container_of(base, struct fbdev_output, base); } static inline struct fbdev_backend * to_fbdev_backend(struct weston_compositor *base) { return container_of(base->backend, struct fbdev_backend, base); } static void fbdev_output_start_repaint_loop(struct weston_output *output) { struct timespec ts; weston_compositor_read_presentation_clock(output->compositor, &ts); weston_output_finish_frame(output, &ts, PRESENTATION_FEEDBACK_INVALID); } static void fbdev_output_repaint_pixman(struct weston_output *base, pixman_region32_t *damage) { struct fbdev_output *output = to_fbdev_output(base); struct weston_compositor *ec = output->base.compositor; pixman_box32_t *rects; int nrects, i; /* Repaint the damaged region onto the back buffer. */ pixman_renderer_output_set_buffer(base, output->shadow_surface); ec->renderer->repaint_output(base, damage); /* Transform and composite onto the frame buffer. */ rects = pixman_region32_rectangles(damage, &nrects); for (i = 0; i < nrects; i++) { pixman_box32_t transformed_rect; int width, height; transformed_rect = weston_transformed_rect(base->width, base->height, base->transform, 1, rects[i]); width = transformed_rect.x2 - transformed_rect.x1; height = transformed_rect.y2 - transformed_rect.y1; pixman_image_composite32(PIXMAN_OP_SRC, output->shadow_surface, /* src */ NULL /* mask */, output->hw_surface, /* dest */ transformed_rect.x1, /* src_x */ transformed_rect.y1, /* src_y */ 0, 0, /* mask_x, mask_y */ transformed_rect.x1, /* dest_x */ transformed_rect.y1, /* dest_y */ width, /* width */ height /* height */); } /* Update the damage region. */ pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); /* Schedule the end of the frame. We do not sync this to the frame * buffer clock because users who want that should be using the DRM * compositor. FBIO_WAITFORVSYNC blocks and FB_ACTIVATE_VBL requires * panning, which is broken in most kernel drivers. * * Finish the frame synchronised to the specified refresh rate. The * refresh rate is given in mHz and the interval in ms. */ wl_event_source_timer_update(output->finish_frame_timer, 1000000 / output->mode.refresh); } static int fbdev_output_repaint(struct weston_output *base, pixman_region32_t *damage) { struct fbdev_output *output = to_fbdev_output(base); struct fbdev_backend *fbb = output->backend; struct weston_compositor *ec = fbb->compositor; if (fbb->use_pixman) { fbdev_output_repaint_pixman(base,damage); } else { ec->renderer->repaint_output(base, damage); /* Update the damage region. */ pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); wl_event_source_timer_update(output->finish_frame_timer, 1000000 / output->mode.refresh); } return 0; } static int finish_frame_handler(void *data) { struct fbdev_output *output = data; struct timespec ts; weston_compositor_read_presentation_clock(output->base.compositor, &ts); weston_output_finish_frame(&output->base, &ts, 0); return 1; } static pixman_format_code_t calculate_pixman_format(struct fb_var_screeninfo *vinfo, struct fb_fix_screeninfo *finfo) { /* Calculate the pixman format supported by the frame buffer from the * buffer's metadata. Return 0 if no known pixman format is supported * (since this has depth 0 it's guaranteed to not conflict with any * actual pixman format). * * Documentation on the vinfo and finfo structures: * http://www.mjmwired.net/kernel/Documentation/fb/api.txt * * TODO: Try a bit harder to support other formats, including setting * the preferred format in the hardware. */ int type; weston_log("Calculating pixman format from:\n" STAMP_SPACE " - type: %i (aux: %i)\n" STAMP_SPACE " - visual: %i\n" STAMP_SPACE " - bpp: %i (grayscale: %i)\n" STAMP_SPACE " - red: offset: %i, length: %i, MSB: %i\n" STAMP_SPACE " - green: offset: %i, length: %i, MSB: %i\n" STAMP_SPACE " - blue: offset: %i, length: %i, MSB: %i\n" STAMP_SPACE " - transp: offset: %i, length: %i, MSB: %i\n", finfo->type, finfo->type_aux, finfo->visual, vinfo->bits_per_pixel, vinfo->grayscale, vinfo->red.offset, vinfo->red.length, vinfo->red.msb_right, vinfo->green.offset, vinfo->green.length, vinfo->green.msb_right, vinfo->blue.offset, vinfo->blue.length, vinfo->blue.msb_right, vinfo->transp.offset, vinfo->transp.length, vinfo->transp.msb_right); /* We only handle packed formats at the moment. */ if (finfo->type != FB_TYPE_PACKED_PIXELS) return 0; /* We only handle true-colour frame buffers at the moment. */ switch(finfo->visual) { case FB_VISUAL_TRUECOLOR: case FB_VISUAL_DIRECTCOLOR: if (vinfo->grayscale != 0) return 0; break; default: return 0; } /* We only support formats with MSBs on the left. */ if (vinfo->red.msb_right != 0 || vinfo->green.msb_right != 0 || vinfo->blue.msb_right != 0) return 0; /* Work out the format type from the offsets. We only support RGBA and * ARGB at the moment. */ type = PIXMAN_TYPE_OTHER; if ((vinfo->transp.offset >= vinfo->red.offset || vinfo->transp.length == 0) && vinfo->red.offset >= vinfo->green.offset && vinfo->green.offset >= vinfo->blue.offset) type = PIXMAN_TYPE_ARGB; else if (vinfo->red.offset >= vinfo->green.offset && vinfo->green.offset >= vinfo->blue.offset && vinfo->blue.offset >= vinfo->transp.offset) type = PIXMAN_TYPE_RGBA; if (type == PIXMAN_TYPE_OTHER) return 0; /* Build the format. */ return PIXMAN_FORMAT(vinfo->bits_per_pixel, type, vinfo->transp.length, vinfo->red.length, vinfo->green.length, vinfo->blue.length); } static int calculate_refresh_rate(struct fb_var_screeninfo *vinfo) { uint64_t quot; /* Calculate monitor refresh rate. Default is 60 Hz. Units are mHz. */ quot = (vinfo->upper_margin + vinfo->lower_margin + vinfo->yres); quot *= (vinfo->left_margin + vinfo->right_margin + vinfo->xres); quot *= vinfo->pixclock; if (quot > 0) { uint64_t refresh_rate; refresh_rate = 1000000000000000LLU / quot; if (refresh_rate > 200000) refresh_rate = 200000; /* cap at 200 Hz */ return refresh_rate; } return 60 * 1000; /* default to 60 Hz */ } static int fbdev_query_screen_info(struct fbdev_output *output, int fd, struct fbdev_screeninfo *info) { struct fb_var_screeninfo varinfo; struct fb_fix_screeninfo fixinfo; /* Probe the device for screen information. */ if (ioctl(fd, FBIOGET_FSCREENINFO, &fixinfo) < 0 || ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) < 0) { return -1; } /* Store the pertinent data. */ info->x_resolution = varinfo.xres; info->y_resolution = varinfo.yres; info->width_mm = varinfo.width; info->height_mm = varinfo.height; info->bits_per_pixel = varinfo.bits_per_pixel; info->buffer_length = fixinfo.smem_len; info->line_length = fixinfo.line_length; strncpy(info->id, fixinfo.id, sizeof(info->id)); info->pixel_format = calculate_pixman_format(&varinfo, &fixinfo); info->refresh_rate = calculate_refresh_rate(&varinfo); if (info->pixel_format == 0) { weston_log("Frame buffer uses an unsupported format.\n"); return -1; } return 1; } static int fbdev_set_screen_info(struct fbdev_output *output, int fd, struct fbdev_screeninfo *info) { struct fb_var_screeninfo varinfo; /* Grab the current screen information. */ if (ioctl(fd, FBIOGET_VSCREENINFO, &varinfo) < 0) { return -1; } /* Update the information. */ varinfo.xres = info->x_resolution; varinfo.yres = info->y_resolution; varinfo.width = info->width_mm; varinfo.height = info->height_mm; varinfo.bits_per_pixel = info->bits_per_pixel; /* Try to set up an ARGB (x8r8g8b8) pixel format. */ varinfo.grayscale = 0; varinfo.transp.offset = 24; varinfo.transp.length = 0; varinfo.transp.msb_right = 0; varinfo.red.offset = 16; varinfo.red.length = 8; varinfo.red.msb_right = 0; varinfo.green.offset = 8; varinfo.green.length = 8; varinfo.green.msb_right = 0; varinfo.blue.offset = 0; varinfo.blue.length = 8; varinfo.blue.msb_right = 0; /* Set the device's screen information. */ if (ioctl(fd, FBIOPUT_VSCREENINFO, &varinfo) < 0) { return -1; } return 1; } static void fbdev_frame_buffer_destroy(struct fbdev_output *output); /* Returns an FD for the frame buffer device. */ static int fbdev_frame_buffer_open(struct fbdev_output *output, const char *fb_dev, struct fbdev_screeninfo *screen_info) { int fd = -1; weston_log("Opening fbdev frame buffer.\n"); /* Open the frame buffer device. */ fd = open(fb_dev, O_RDWR | O_CLOEXEC); if (fd < 0) { weston_log("Failed to open frame buffer device ‘%s’: %s\n", fb_dev, strerror(errno)); return -1; } /* Grab the screen info. */ if (fbdev_query_screen_info(output, fd, screen_info) < 0) { weston_log("Failed to get frame buffer info: %s\n", strerror(errno)); close(fd); return -1; } return fd; } /* Closes the FD on success or failure. */ static int fbdev_frame_buffer_map(struct fbdev_output *output, int fd) { int retval = -1; weston_log("Mapping fbdev frame buffer.\n"); /* Map the frame buffer. Write-only mode, since we don't want to read * anything back (because it's slow). */ output->fb = mmap(NULL, output->fb_info.buffer_length, PROT_WRITE, MAP_SHARED, fd, 0); if (output->fb == MAP_FAILED) { weston_log("Failed to mmap frame buffer: %s\n", strerror(errno)); goto out_close; } /* Create a pixman image to wrap the memory mapped frame buffer. */ output->hw_surface = pixman_image_create_bits(output->fb_info.pixel_format, output->fb_info.x_resolution, output->fb_info.y_resolution, output->fb, output->fb_info.line_length); if (output->hw_surface == NULL) { weston_log("Failed to create surface for frame buffer.\n"); goto out_unmap; } /* Success! */ retval = 0; out_unmap: if (retval != 0 && output->fb != NULL) fbdev_frame_buffer_destroy(output); out_close: if (fd >= 0) close(fd); return retval; } static void fbdev_frame_buffer_destroy(struct fbdev_output *output) { weston_log("Destroying fbdev frame buffer.\n"); if (munmap(output->fb, output->fb_info.buffer_length) < 0) weston_log("Failed to munmap frame buffer: %s\n", strerror(errno)); output->fb = NULL; } static void fbdev_output_destroy(struct weston_output *base); static void fbdev_output_disable(struct weston_output *base); static int fbdev_output_create(struct fbdev_backend *backend, const char *device) { struct fbdev_output *output; struct weston_config_section *section; int fb_fd; int width, height; unsigned int bytes_per_pixel; struct wl_event_loop *loop; uint32_t config_transform; char *s; weston_log("Creating fbdev output.\n"); output = zalloc(sizeof *output); if (output == NULL) return -1; output->backend = backend; output->device = device; /* Create the frame buffer. */ fb_fd = fbdev_frame_buffer_open(output, device, &output->fb_info); if (fb_fd < 0) { weston_log("Creating frame buffer failed.\n"); goto out_free; } if (backend->use_pixman) { if (fbdev_frame_buffer_map(output, fb_fd) < 0) { weston_log("Mapping frame buffer failed.\n"); goto out_free; } } else { close(fb_fd); } output->base.start_repaint_loop = fbdev_output_start_repaint_loop; output->base.repaint = fbdev_output_repaint; output->base.destroy = fbdev_output_destroy; /* only one static mode in list */ output->mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; output->mode.width = output->fb_info.x_resolution; output->mode.height = output->fb_info.y_resolution; output->mode.refresh = output->fb_info.refresh_rate; wl_list_init(&output->base.mode_list); wl_list_insert(&output->base.mode_list, &output->mode.link); output->base.current_mode = &output->mode; output->base.subpixel = WL_OUTPUT_SUBPIXEL_UNKNOWN; output->base.make = "unknown"; output->base.model = output->fb_info.id; output->base.name = strdup("fbdev"); section = weston_config_get_section(backend->compositor->config, "output", "name", output->base.name); weston_config_section_get_string(section, "transform", &s, "normal"); if (weston_parse_transform(s, &config_transform) < 0) weston_log("Invalid transform \"%s\" for output %s\n", s, output->base.name); free(s); weston_output_init(&output->base, backend->compositor, 0, 0, output->fb_info.width_mm, output->fb_info.height_mm, config_transform, 1); width = output->mode.width; height = output->mode.height; bytes_per_pixel = output->fb_info.bits_per_pixel / 8; output->shadow_buf = malloc(width * height * bytes_per_pixel); output->shadow_surface = pixman_image_create_bits(output->fb_info.pixel_format, width, height, output->shadow_buf, width * bytes_per_pixel); if (output->shadow_buf == NULL || output->shadow_surface == NULL) { weston_log("Failed to create surface for frame buffer.\n"); goto out_hw_surface; } if (backend->use_pixman) { if (pixman_renderer_output_create(&output->base) < 0) goto out_shadow_surface; } else { setenv("HYBRIS_EGLPLATFORM", "wayland", 1); if (gl_renderer->output_create(&output->base, (EGLNativeWindowType)NULL, NULL, gl_renderer->opaque_attribs, NULL, 0) < 0) { weston_log("gl_renderer_output_create failed.\n"); goto out_shadow_surface; } } loop = wl_display_get_event_loop(backend->compositor->wl_display); output->finish_frame_timer = wl_event_loop_add_timer(loop, finish_frame_handler, output); weston_compositor_add_output(backend->compositor, &output->base); weston_log("fbdev output %d×%d px\n", output->mode.width, output->mode.height); weston_log_continue(STAMP_SPACE "guessing %d Hz and 96 dpi\n", output->mode.refresh / 1000); return 0; out_shadow_surface: pixman_image_unref(output->shadow_surface); output->shadow_surface = NULL; out_hw_surface: free(output->shadow_buf); pixman_image_unref(output->hw_surface); output->hw_surface = NULL; weston_output_destroy(&output->base); fbdev_frame_buffer_destroy(output); out_free: free(output); return -1; } static void fbdev_output_destroy(struct weston_output *base) { struct fbdev_output *output = to_fbdev_output(base); struct fbdev_backend *backend = output->backend; weston_log("Destroying fbdev output.\n"); /* Close the frame buffer. */ fbdev_output_disable(base); if (backend->use_pixman) { if (base->renderer_state != NULL) pixman_renderer_output_destroy(base); if (output->shadow_surface != NULL) { pixman_image_unref(output->shadow_surface); output->shadow_surface = NULL; } if (output->shadow_buf != NULL) { free(output->shadow_buf); output->shadow_buf = NULL; } } else { gl_renderer->output_destroy(base); } /* Remove the output. */ weston_output_destroy(&output->base); free(output); } /* strcmp()-style return values. */ static int compare_screen_info (const struct fbdev_screeninfo *a, const struct fbdev_screeninfo *b) { if (a->x_resolution == b->x_resolution && a->y_resolution == b->y_resolution && a->width_mm == b->width_mm && a->height_mm == b->height_mm && a->bits_per_pixel == b->bits_per_pixel && a->pixel_format == b->pixel_format && a->refresh_rate == b->refresh_rate) return 0; return 1; } static int fbdev_output_reenable(struct fbdev_backend *backend, struct weston_output *base) { struct fbdev_output *output = to_fbdev_output(base); struct fbdev_screeninfo new_screen_info; int fb_fd; const char *device; weston_log("Re-enabling fbdev output.\n"); /* Create the frame buffer. */ fb_fd = fbdev_frame_buffer_open(output, output->device, &new_screen_info); if (fb_fd < 0) { weston_log("Creating frame buffer failed.\n"); goto err; } /* Check whether the frame buffer details have changed since we were * disabled. */ if (compare_screen_info (&output->fb_info, &new_screen_info) != 0) { /* Perform a mode-set to restore the old mode. */ if (fbdev_set_screen_info(output, fb_fd, &output->fb_info) < 0) { weston_log("Failed to restore mode settings. " "Attempting to re-open output anyway.\n"); } close(fb_fd); /* Remove and re-add the output so that resources depending on * the frame buffer X/Y resolution (such as the shadow buffer) * are re-initialised. */ device = output->device; fbdev_output_destroy(base); fbdev_output_create(backend, device); return 0; } /* Map the device if it has the same details as before. */ if (backend->use_pixman) { if (fbdev_frame_buffer_map(output, fb_fd) < 0) { weston_log("Mapping frame buffer failed.\n"); goto err; } } return 0; err: return -1; } /* NOTE: This leaves output->fb_info populated, caching data so that if * fbdev_output_reenable() is called again, it can determine whether a mode-set * is needed. */ static void fbdev_output_disable(struct weston_output *base) { struct fbdev_output *output = to_fbdev_output(base); struct fbdev_backend *backend = output->backend; weston_log("Disabling fbdev output.\n"); if ( ! backend->use_pixman) return; if (output->hw_surface != NULL) { pixman_image_unref(output->hw_surface); output->hw_surface = NULL; } fbdev_frame_buffer_destroy(output); } static void fbdev_backend_destroy(struct weston_compositor *base) { struct fbdev_backend *backend = to_fbdev_backend(base); udev_input_destroy(&backend->input); /* Destroy the output. */ weston_compositor_shutdown(base); /* Chain up. */ weston_launcher_destroy(base->launcher); free(backend); } static void session_notify(struct wl_listener *listener, void *data) { struct weston_compositor *compositor = data; struct fbdev_backend *backend = to_fbdev_backend(compositor); struct weston_output *output; if (compositor->session_active) { weston_log("entering VT\n"); compositor->state = backend->prev_state; wl_list_for_each(output, &compositor->output_list, link) { fbdev_output_reenable(backend, output); } weston_compositor_damage_all(compositor); udev_input_enable(&backend->input); } else { weston_log("leaving VT\n"); udev_input_disable(&backend->input); wl_list_for_each(output, &compositor->output_list, link) { fbdev_output_disable(output); } backend->prev_state = compositor->state; weston_compositor_offscreen(compositor); /* If we have a repaint scheduled (from the idle handler), make * sure we cancel that so we don't try to pageflip when we're * vt switched away. The OFFSCREEN state will prevent * further attemps at repainting. When we switch * back, we schedule a repaint, which will process * pending frame callbacks. */ wl_list_for_each(output, &compositor->output_list, link) { output->repaint_needed = 0; } } } static void fbdev_restore(struct weston_compositor *compositor) { weston_launcher_restore(compositor->launcher); } static void switch_vt_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; weston_launcher_activate_vt(compositor->launcher, key - KEY_F1 + 1); } static struct fbdev_backend * fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config, struct fbdev_parameters *param) { struct fbdev_backend *backend; const char *seat_id = default_seat; uint32_t key; weston_log("initializing fbdev backend\n"); backend = zalloc(sizeof *backend); if (backend == NULL) return NULL; backend->compositor = compositor; if (weston_compositor_set_presentation_clock_software( compositor) < 0) goto out_compositor; backend->udev = udev_new(); if (backend->udev == NULL) { weston_log("Failed to initialize udev context.\n"); goto out_compositor; } /* Set up the TTY. */ backend->session_listener.notify = session_notify; wl_signal_add(&compositor->session_signal, &backend->session_listener); compositor->launcher = weston_launcher_connect(compositor, param->tty, "seat0", false); if (!compositor->launcher) { weston_log("fatal: fbdev backend should be run " "using weston-launch binary or as root\n"); goto out_udev; } backend->base.destroy = fbdev_backend_destroy; backend->base.restore = fbdev_restore; backend->prev_state = WESTON_COMPOSITOR_ACTIVE; backend->use_pixman = !param->use_gl; for (key = KEY_F1; key < KEY_F9; key++) weston_compositor_add_key_binding(compositor, key, MODIFIER_CTRL | MODIFIER_ALT, switch_vt_binding, compositor); if (backend->use_pixman) { if (pixman_renderer_init(compositor) < 0) goto out_launcher; } else { gl_renderer = weston_load_module("gl-renderer.so", "gl_renderer_interface"); if (!gl_renderer) { weston_log("could not load gl renderer\n"); goto out_launcher; } if (gl_renderer->create(compositor, NO_EGL_PLATFORM, EGL_DEFAULT_DISPLAY, gl_renderer->opaque_attribs, NULL, 0) < 0) { weston_log("gl_renderer_create failed.\n"); goto out_launcher; } } if (fbdev_output_create(backend, param->device) < 0) goto out_launcher; udev_input_init(&backend->input, compositor, backend->udev, seat_id); compositor->backend = &backend->base; return backend; out_launcher: weston_launcher_destroy(compositor->launcher); out_udev: udev_unref(backend->udev); out_compositor: weston_compositor_shutdown(compositor); free(backend); return NULL; } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config) { struct fbdev_backend *b; /* TODO: Ideally, available frame buffers should be enumerated using * udev, rather than passing a device node in as a parameter. */ struct fbdev_parameters param = { .tty = 0, /* default to current tty */ .device = "/dev/fb0", /* default frame buffer */ .use_gl = 0, }; const struct weston_option fbdev_options[] = { { WESTON_OPTION_INTEGER, "tty", 0, ¶m.tty }, { WESTON_OPTION_STRING, "device", 0, ¶m.device }, { WESTON_OPTION_BOOLEAN, "use-gl", 0, ¶m.use_gl }, }; parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv); b = fbdev_backend_create(compositor, argc, argv, config, ¶m); if (b == NULL) return -1; return 0; } weston-1.9.0/src/log.c0000664000175000017500000000637512552064071011514 00000000000000/* * Copyright © 2012 Martin Minarik * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "compositor.h" #include "os-compatibility.h" static FILE *weston_logfile = NULL; static int cached_tm_mday = -1; static int weston_log_timestamp(void) { struct timeval tv; struct tm *brokendown_time; char string[128]; gettimeofday(&tv, NULL); brokendown_time = localtime(&tv.tv_sec); if (brokendown_time == NULL) return fprintf(weston_logfile, "[(NULL)localtime] "); if (brokendown_time->tm_mday != cached_tm_mday) { strftime(string, sizeof string, "%Y-%m-%d %Z", brokendown_time); fprintf(weston_logfile, "Date: %s\n", string); cached_tm_mday = brokendown_time->tm_mday; } strftime(string, sizeof string, "%H:%M:%S", brokendown_time); return fprintf(weston_logfile, "[%s.%03li] ", string, tv.tv_usec/1000); } static void custom_handler(const char *fmt, va_list arg) { weston_log_timestamp(); fprintf(weston_logfile, "libwayland: "); vfprintf(weston_logfile, fmt, arg); } void weston_log_file_open(const char *filename) { wl_log_set_handler_server(custom_handler); if (filename != NULL) { weston_logfile = fopen(filename, "a"); if (weston_logfile) os_fd_set_cloexec(fileno(weston_logfile)); } if (weston_logfile == NULL) weston_logfile = stderr; else setvbuf(weston_logfile, NULL, _IOLBF, 256); } void weston_log_file_close() { if ((weston_logfile != stderr) && (weston_logfile != NULL)) fclose(weston_logfile); weston_logfile = stderr; } WL_EXPORT int weston_vlog(const char *fmt, va_list ap) { int l; l = weston_log_timestamp(); l += vfprintf(weston_logfile, fmt, ap); return l; } WL_EXPORT int weston_log(const char *fmt, ...) { int l; va_list argp; va_start(argp, fmt); l = weston_vlog(fmt, argp); va_end(argp); return l; } WL_EXPORT int weston_vlog_continue(const char *fmt, va_list argp) { return vfprintf(weston_logfile, fmt, argp); } WL_EXPORT int weston_log_continue(const char *fmt, ...) { int l; va_list argp; va_start(argp, fmt); l = weston_vlog_continue(fmt, argp); va_end(argp); return l; } weston-1.9.0/src/dbus.h0000664000175000017500000000774612537627702011711 00000000000000/* * Copyright © 2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_DBUS_H_ #define _WESTON_DBUS_H_ #include "config.h" #include #include #include "compositor.h" #ifdef HAVE_DBUS #include /* * weston_dbus_open() - Open new dbus connection * * Opens a new dbus connection to the bus given as @bus. It automatically * integrates the new connection into the main-loop @loop. The connection * itself is returned in @out. * This also returns a context source used for dbus dispatching. It is * returned on success in @ctx_out and must be passed to weston_dbus_close() * unchanged. You must not access it from outside of a dbus helper! * * Returns 0 on success, negative error code on failure. */ int weston_dbus_open(struct wl_event_loop *loop, DBusBusType bus, DBusConnection **out, struct wl_event_source **ctx_out); /* * weston_dbus_close() - Close dbus connection * * Closes a dbus connection that was previously opened via weston_dbus_open(). * It unbinds the connection from the main-loop it was previously bound to, * closes the dbus connection and frees all resources. If you want to access * @c after this call returns, you must hold a dbus-reference to it. But * notice that the connection is closed after this returns so it cannot be * used to spawn new dbus requests. * You must pass the context source returns by weston_dbus_open() as @ctx. */ void weston_dbus_close(DBusConnection *c, struct wl_event_source *ctx); /* * weston_dbus_add_match() - Add dbus match * * Configure a dbus-match on the given dbus-connection. This match is saved * on the dbus-server as long as the connection is open. See dbus-manual * for information. Compared to the dbus_bus_add_match() this allows a * var-arg formatted match-string. */ int weston_dbus_add_match(DBusConnection *c, const char *format, ...); /* * weston_dbus_add_match_signal() - Add dbus signal match * * Same as weston_dbus_add_match() but does the dbus-match formatting for * signals internally. */ int weston_dbus_add_match_signal(DBusConnection *c, const char *sender, const char *iface, const char *member, const char *path); /* * weston_dbus_remove_match() - Remove dbus match * * Remove a previously configured dbus-match from the dbus server. There is * no need to remove dbus-matches if you close the connection, anyway. * Compared to dbus_bus_remove_match() this allows a var-arg formatted * match string. */ void weston_dbus_remove_match(DBusConnection *c, const char *format, ...); /* * weston_dbus_remove_match_signal() - Remove dbus signal match * * Same as weston_dbus_remove_match() but does the dbus-match formatting for * signals internally. */ void weston_dbus_remove_match_signal(DBusConnection *c, const char *sender, const char *iface, const char *member, const char *path); #endif /* HAVE_DBUS */ #endif // _WESTON_DBUS_H_ weston-1.9.0/src/linux-dmabuf.h0000664000175000017500000000576712563431500013334 00000000000000/* * Copyright © 2014, 2015 Collabora, Ltd. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of the copyright holders not be used in * advertising or publicity pertaining to distribution of the software * without specific, written prior permission. The copyright holders make * no representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef WESTON_LINUX_DMABUF_H #define WESTON_LINUX_DMABUF_H #include #define MAX_DMABUF_PLANES 4 struct linux_dmabuf_buffer; typedef void (*dmabuf_user_data_destroy_func)( struct linux_dmabuf_buffer *buffer); struct linux_dmabuf_buffer { struct wl_resource *buffer_resource; struct wl_resource *params_resource; struct weston_compositor *compositor; int32_t width; int32_t height; uint32_t format; uint32_t flags; /* enum zlinux_buffer_params_flags */ int n_planes; int dmabuf_fd[MAX_DMABUF_PLANES]; uint32_t offset[MAX_DMABUF_PLANES]; uint32_t stride[MAX_DMABUF_PLANES]; uint64_t modifier[MAX_DMABUF_PLANES]; void *user_data; dmabuf_user_data_destroy_func user_data_destroy_func; /* XXX: * * Add backend private data. This would be for the backend * to do all additional imports it might ever use in advance. * The basic principle, even if not implemented in drivers today, * is that dmabufs are first attached, but the actual allocation * is deferred to first use. This would allow the exporter and all * attachers to agree on how to allocate. * * The DRM backend would use this to create drmFBs for each * dmabuf_buffer, just in case at some point it would become * feasible to scan it out directly. This would improve the * possibilities to successfully scan out, avoiding compositing. */ }; int linux_dmabuf_setup(struct weston_compositor *compositor); struct linux_dmabuf_buffer * linux_dmabuf_buffer_get(struct wl_resource *resource); void linux_dmabuf_buffer_set_user_data(struct linux_dmabuf_buffer *buffer, void *data, dmabuf_user_data_destroy_func func); void * linux_dmabuf_buffer_get_user_data(struct linux_dmabuf_buffer *buffer); void linux_dmabuf_buffer_send_server_error(struct linux_dmabuf_buffer *buffer, const char *msg); #endif /* WESTON_LINUX_DMABUF_H */ weston-1.9.0/src/compositor-rdp.c0000664000175000017500000011116412561200202013671 00000000000000/* * Copyright © 2013 Hardening * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #if HAVE_FREERDP_VERSION_H #include #else /* assume it's a early 1.1 version */ #define FREERDP_VERSION_MAJOR 1 #define FREERDP_VERSION_MINOR 1 #define FREERDP_VERSION_REVISION 0 #endif #define FREERDP_VERSION_NUMBER ((FREERDP_VERSION_MAJOR * 0x10000) + \ (FREERDP_VERSION_MINOR * 0x100) + FREERDP_VERSION_REVISION) #if FREERDP_VERSION_NUMBER >= 0x10201 #define HAVE_SKIP_COMPRESSION #endif #if FREERDP_VERSION_NUMBER < 0x10202 #define FREERDP_CB_RET_TYPE void #define FREERDP_CB_RETURN(V) return #else #define HAVE_NSC_RESET #define FREERDP_CB_RET_TYPE BOOL #define FREERDP_CB_RETURN(V) return TRUE #endif #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "compositor.h" #include "pixman-renderer.h" #define MAX_FREERDP_FDS 32 #define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int(10) #define RDP_MODE_FREQ 60 * 1000 struct rdp_backend_config { int width; int height; char *bind_address; int port; char *rdp_key; char *server_cert; char *server_key; int env_socket; int no_clients_resize; }; struct rdp_output; struct rdp_backend { struct weston_backend base; struct weston_compositor *compositor; freerdp_listener *listener; struct wl_event_source *listener_events[MAX_FREERDP_FDS]; struct rdp_output *output; char *server_cert; char *server_key; char *rdp_key; int tls_enabled; int no_clients_resize; }; enum peer_item_flags { RDP_PEER_ACTIVATED = (1 << 0), RDP_PEER_OUTPUT_ENABLED = (1 << 1), }; struct rdp_peers_item { int flags; freerdp_peer *peer; struct weston_seat seat; struct wl_list link; }; struct rdp_output { struct weston_output base; struct wl_event_source *finish_frame_timer; pixman_image_t *shadow_surface; struct wl_list peers; }; struct rdp_peer_context { rdpContext _p; struct rdp_backend *rdpBackend; struct wl_event_source *events[MAX_FREERDP_FDS]; RFX_CONTEXT *rfx_context; wStream *encode_stream; RFX_RECT *rfx_rects; NSC_CONTEXT *nsc_context; struct rdp_peers_item item; }; typedef struct rdp_peer_context RdpPeerContext; static void rdp_backend_config_init(struct rdp_backend_config *config) { config->width = 640; config->height = 480; config->bind_address = NULL; config->port = 3389; config->rdp_key = NULL; config->server_cert = NULL; config->server_key = NULL; config->env_socket = 0; config->no_clients_resize = 0; } static void rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, freerdp_peer *peer) { int width, height, nrects, i; pixman_box32_t *region, *rects; uint32_t *ptr; RFX_RECT *rfxRect; rdpUpdate *update = peer->update; SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command; RdpPeerContext *context = (RdpPeerContext *)peer->context; Stream_Clear(context->encode_stream); Stream_SetPosition(context->encode_stream, 0); width = (damage->extents.x2 - damage->extents.x1); height = (damage->extents.y2 - damage->extents.y1); #ifdef HAVE_SKIP_COMPRESSION cmd->skipCompression = TRUE; #else memset(cmd, 0, sizeof(*cmd)); #endif cmd->destLeft = damage->extents.x1; cmd->destTop = damage->extents.y1; cmd->destRight = damage->extents.x2; cmd->destBottom = damage->extents.y2; cmd->bpp = 32; cmd->codecID = peer->settings->RemoteFxCodecId; cmd->width = width; cmd->height = height; ptr = pixman_image_get_data(image) + damage->extents.x1 + damage->extents.y1 * (pixman_image_get_stride(image) / sizeof(uint32_t)); rects = pixman_region32_rectangles(damage, &nrects); context->rfx_rects = realloc(context->rfx_rects, nrects * sizeof *rfxRect); for (i = 0; i < nrects; i++) { region = &rects[i]; rfxRect = &context->rfx_rects[i]; rfxRect->x = (region->x1 - damage->extents.x1); rfxRect->y = (region->y1 - damage->extents.y1); rfxRect->width = (region->x2 - region->x1); rfxRect->height = (region->y2 - region->y1); } rfx_compose_message(context->rfx_context, context->encode_stream, context->rfx_rects, nrects, (BYTE *)ptr, width, height, pixman_image_get_stride(image) ); cmd->bitmapDataLength = Stream_GetPosition(context->encode_stream); cmd->bitmapData = Stream_Buffer(context->encode_stream); update->SurfaceBits(update->context, cmd); } static void rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_peer *peer) { int width, height; uint32_t *ptr; rdpUpdate *update = peer->update; SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command; RdpPeerContext *context = (RdpPeerContext *)peer->context; Stream_Clear(context->encode_stream); Stream_SetPosition(context->encode_stream, 0); width = (damage->extents.x2 - damage->extents.x1); height = (damage->extents.y2 - damage->extents.y1); #ifdef HAVE_SKIP_COMPRESSION cmd->skipCompression = TRUE; #else memset(cmd, 0, sizeof(*cmd)); #endif cmd->destLeft = damage->extents.x1; cmd->destTop = damage->extents.y1; cmd->destRight = damage->extents.x2; cmd->destBottom = damage->extents.y2; cmd->bpp = 32; cmd->codecID = peer->settings->NSCodecId; cmd->width = width; cmd->height = height; ptr = pixman_image_get_data(image) + damage->extents.x1 + damage->extents.y1 * (pixman_image_get_stride(image) / sizeof(uint32_t)); nsc_compose_message(context->nsc_context, context->encode_stream, (BYTE *)ptr, cmd->width, cmd->height, pixman_image_get_stride(image)); cmd->bitmapDataLength = Stream_GetPosition(context->encode_stream); cmd->bitmapData = Stream_Buffer(context->encode_stream); update->SurfaceBits(update->context, cmd); } static void pixman_image_flipped_subrect(const pixman_box32_t *rect, pixman_image_t *img, BYTE *dest) { int stride = pixman_image_get_stride(img); int h; int toCopy = (rect->x2 - rect->x1) * 4; int height = (rect->y2 - rect->y1); const BYTE *src = (const BYTE *)pixman_image_get_data(img); src += ((rect->y2-1) * stride) + (rect->x1 * 4); for (h = 0; h < height; h++, src -= stride, dest += toCopy) memcpy(dest, src, toCopy); } static void rdp_peer_refresh_raw(pixman_region32_t *region, pixman_image_t *image, freerdp_peer *peer) { rdpUpdate *update = peer->update; SURFACE_BITS_COMMAND *cmd = &update->surface_bits_command; SURFACE_FRAME_MARKER *marker = &update->surface_frame_marker; pixman_box32_t *rect, subrect; int nrects, i; int heightIncrement, remainingHeight, top; rect = pixman_region32_rectangles(region, &nrects); if (!nrects) return; marker->frameId++; marker->frameAction = SURFACECMD_FRAMEACTION_BEGIN; update->SurfaceFrameMarker(peer->context, marker); memset(cmd, 0, sizeof(*cmd)); cmd->bpp = 32; cmd->codecID = 0; for (i = 0; i < nrects; i++, rect++) { /*weston_log("rect(%d,%d, %d,%d)\n", rect->x1, rect->y1, rect->x2, rect->y2);*/ cmd->destLeft = rect->x1; cmd->destRight = rect->x2; cmd->width = rect->x2 - rect->x1; heightIncrement = peer->settings->MultifragMaxRequestSize / (16 + cmd->width * 4); remainingHeight = rect->y2 - rect->y1; top = rect->y1; subrect.x1 = rect->x1; subrect.x2 = rect->x2; while (remainingHeight) { cmd->height = (remainingHeight > heightIncrement) ? heightIncrement : remainingHeight; cmd->destTop = top; cmd->destBottom = top + cmd->height; cmd->bitmapDataLength = cmd->width * cmd->height * 4; cmd->bitmapData = (BYTE *)realloc(cmd->bitmapData, cmd->bitmapDataLength); subrect.y1 = top; subrect.y2 = top + cmd->height; pixman_image_flipped_subrect(&subrect, image, cmd->bitmapData); /*weston_log("* sending (%d,%d, %d,%d)\n", subrect.x1, subrect.y1, subrect.x2, subrect.y2); */ update->SurfaceBits(peer->context, cmd); remainingHeight -= cmd->height; top += cmd->height; } } marker->frameAction = SURFACECMD_FRAMEACTION_END; update->SurfaceFrameMarker(peer->context, marker); } static void rdp_peer_refresh_region(pixman_region32_t *region, freerdp_peer *peer) { RdpPeerContext *context = (RdpPeerContext *)peer->context; struct rdp_output *output = context->rdpBackend->output; rdpSettings *settings = peer->settings; if (settings->RemoteFxCodec) rdp_peer_refresh_rfx(region, output->shadow_surface, peer); else if (settings->NSCodec) rdp_peer_refresh_nsc(region, output->shadow_surface, peer); else rdp_peer_refresh_raw(region, output->shadow_surface, peer); } static void rdp_output_start_repaint_loop(struct weston_output *output) { struct timespec ts; weston_compositor_read_presentation_clock(output->compositor, &ts); weston_output_finish_frame(output, &ts, PRESENTATION_FEEDBACK_INVALID); } static int rdp_output_repaint(struct weston_output *output_base, pixman_region32_t *damage) { struct rdp_output *output = container_of(output_base, struct rdp_output, base); struct weston_compositor *ec = output->base.compositor; struct rdp_peers_item *outputPeer; pixman_renderer_output_set_buffer(output_base, output->shadow_surface); ec->renderer->repaint_output(&output->base, damage); if (pixman_region32_not_empty(damage)) { wl_list_for_each(outputPeer, &output->peers, link) { if ((outputPeer->flags & RDP_PEER_ACTIVATED) && (outputPeer->flags & RDP_PEER_OUTPUT_ENABLED)) { rdp_peer_refresh_region(damage, outputPeer->peer); } } } pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); wl_event_source_timer_update(output->finish_frame_timer, 16); return 0; } static void rdp_output_destroy(struct weston_output *output_base) { struct rdp_output *output = (struct rdp_output *)output_base; wl_event_source_remove(output->finish_frame_timer); free(output); } static int finish_frame_handler(void *data) { struct rdp_output *output = data; struct timespec ts; weston_compositor_read_presentation_clock(output->base.compositor, &ts); weston_output_finish_frame(&output->base, &ts, 0); return 1; } static struct weston_mode * rdp_insert_new_mode(struct weston_output *output, int width, int height, int rate) { struct weston_mode *ret; ret = zalloc(sizeof *ret); if (!ret) return NULL; ret->width = width; ret->height = height; ret->refresh = rate; wl_list_insert(&output->mode_list, &ret->link); return ret; } static struct weston_mode * ensure_matching_mode(struct weston_output *output, struct weston_mode *target) { struct weston_mode *local; wl_list_for_each(local, &output->mode_list, link) { if ((local->width == target->width) && (local->height == target->height)) return local; } return rdp_insert_new_mode(output, target->width, target->height, RDP_MODE_FREQ); } static int rdp_switch_mode(struct weston_output *output, struct weston_mode *target_mode) { struct rdp_output *rdpOutput = container_of(output, struct rdp_output, base); struct rdp_peers_item *rdpPeer; rdpSettings *settings; pixman_image_t *new_shadow_buffer; struct weston_mode *local_mode; local_mode = ensure_matching_mode(output, target_mode); if (!local_mode) { weston_log("mode %dx%d not available\n", target_mode->width, target_mode->height); return -ENOENT; } if (local_mode == output->current_mode) return 0; output->current_mode->flags &= ~WL_OUTPUT_MODE_CURRENT; output->current_mode = local_mode; output->current_mode->flags |= WL_OUTPUT_MODE_CURRENT; pixman_renderer_output_destroy(output); pixman_renderer_output_create(output); new_shadow_buffer = pixman_image_create_bits(PIXMAN_x8r8g8b8, target_mode->width, target_mode->height, 0, target_mode->width * 4); pixman_image_composite32(PIXMAN_OP_SRC, rdpOutput->shadow_surface, 0, new_shadow_buffer, 0, 0, 0, 0, 0, 0, target_mode->width, target_mode->height); pixman_image_unref(rdpOutput->shadow_surface); rdpOutput->shadow_surface = new_shadow_buffer; wl_list_for_each(rdpPeer, &rdpOutput->peers, link) { settings = rdpPeer->peer->settings; if (settings->DesktopWidth == (UINT32)target_mode->width && settings->DesktopHeight == (UINT32)target_mode->height) continue; if (!settings->DesktopResize) { /* too bad this peer does not support desktop resize */ rdpPeer->peer->Close(rdpPeer->peer); } else { settings->DesktopWidth = target_mode->width; settings->DesktopHeight = target_mode->height; rdpPeer->peer->update->DesktopResize(rdpPeer->peer->context); } } return 0; } static int rdp_backend_create_output(struct rdp_backend *b, int width, int height) { struct rdp_output *output; struct wl_event_loop *loop; struct weston_mode *currentMode; struct weston_mode initMode; output = zalloc(sizeof *output); if (output == NULL) return -1; wl_list_init(&output->peers); wl_list_init(&output->base.mode_list); initMode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; initMode.width = width; initMode.height = height; initMode.refresh = RDP_MODE_FREQ; currentMode = ensure_matching_mode(&output->base, &initMode); if (!currentMode) goto out_free_output; output->base.current_mode = output->base.native_mode = currentMode; weston_output_init(&output->base, b->compositor, 0, 0, width, height, WL_OUTPUT_TRANSFORM_NORMAL, 1); output->base.make = "weston"; output->base.model = "rdp"; output->shadow_surface = pixman_image_create_bits(PIXMAN_x8r8g8b8, width, height, NULL, width * 4); if (output->shadow_surface == NULL) { weston_log("Failed to create surface for frame buffer.\n"); goto out_output; } if (pixman_renderer_output_create(&output->base) < 0) goto out_shadow_surface; loop = wl_display_get_event_loop(b->compositor->wl_display); output->finish_frame_timer = wl_event_loop_add_timer(loop, finish_frame_handler, output); output->base.start_repaint_loop = rdp_output_start_repaint_loop; output->base.repaint = rdp_output_repaint; output->base.destroy = rdp_output_destroy; output->base.assign_planes = NULL; output->base.set_backlight = NULL; output->base.set_dpms = NULL; output->base.switch_mode = rdp_switch_mode; b->output = output; weston_compositor_add_output(b->compositor, &output->base); return 0; out_shadow_surface: pixman_image_unref(output->shadow_surface); out_output: weston_output_destroy(&output->base); out_free_output: free(output); return -1; } static void rdp_restore(struct weston_compositor *ec) { } static void rdp_destroy(struct weston_compositor *ec) { struct rdp_backend *b = (struct rdp_backend *) ec->backend; int i; weston_compositor_shutdown(ec); for (i = 0; i < MAX_FREERDP_FDS; i++) if (b->listener_events[i]) wl_event_source_remove(b->listener_events[i]); freerdp_listener_free(b->listener); free(b->server_cert); free(b->server_key); free(b->rdp_key); free(b); } static int rdp_listener_activity(int fd, uint32_t mask, void *data) { freerdp_listener* instance = (freerdp_listener *)data; if (!(mask & WL_EVENT_READABLE)) return 0; if (!instance->CheckFileDescriptor(instance)) { weston_log("failed to check FreeRDP file descriptor\n"); return -1; } return 0; } static int rdp_implant_listener(struct rdp_backend *b, freerdp_listener* instance) { int i, fd; int rcount = 0; void* rfds[MAX_FREERDP_FDS]; struct wl_event_loop *loop; if (!instance->GetFileDescriptor(instance, rfds, &rcount)) { weston_log("Failed to get FreeRDP file descriptor\n"); return -1; } loop = wl_display_get_event_loop(b->compositor->wl_display); for (i = 0; i < rcount; i++) { fd = (int)(long)(rfds[i]); b->listener_events[i] = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, rdp_listener_activity, instance); } for ( ; i < MAX_FREERDP_FDS; i++) b->listener_events[i] = 0; return 0; } static void rdp_peer_context_new(freerdp_peer* client, RdpPeerContext* context) { context->item.peer = client; context->item.flags = RDP_PEER_OUTPUT_ENABLED; #if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR == 1 context->rfx_context = rfx_context_new(); #else context->rfx_context = rfx_context_new(TRUE); #endif context->rfx_context->mode = RLGR3; context->rfx_context->width = client->settings->DesktopWidth; context->rfx_context->height = client->settings->DesktopHeight; rfx_context_set_pixel_format(context->rfx_context, RDP_PIXEL_FORMAT_B8G8R8A8); context->nsc_context = nsc_context_new(); nsc_context_set_pixel_format(context->nsc_context, RDP_PIXEL_FORMAT_B8G8R8A8); context->encode_stream = Stream_New(NULL, 65536); } static void rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context) { int i; if (!context) return; wl_list_remove(&context->item.link); for (i = 0; i < MAX_FREERDP_FDS; i++) { if (context->events[i]) wl_event_source_remove(context->events[i]); } if (context->item.flags & RDP_PEER_ACTIVATED) { weston_seat_release_keyboard(&context->item.seat); weston_seat_release_pointer(&context->item.seat); weston_seat_release(&context->item.seat); } Stream_Free(context->encode_stream, TRUE); nsc_context_free(context->nsc_context); rfx_context_free(context->rfx_context); free(context->rfx_rects); } static int rdp_client_activity(int fd, uint32_t mask, void *data) { freerdp_peer* client = (freerdp_peer *)data; if (!client->CheckFileDescriptor(client)) { weston_log("unable to checkDescriptor for %p\n", client); goto out_clean; } return 0; out_clean: freerdp_peer_context_free(client); freerdp_peer_free(client); return 0; } static BOOL xf_peer_capabilities(freerdp_peer* client) { return TRUE; } struct rdp_to_xkb_keyboard_layout { UINT32 rdpLayoutCode; const char *xkbLayout; const char *xkbVariant; }; /* table reversed from https://github.com/awakecoding/FreeRDP/blob/master/libfreerdp/locale/xkb_layout_ids.c#L811 */ static struct rdp_to_xkb_keyboard_layout rdp_keyboards[] = { {KBD_ARABIC_101, "ara", 0}, {KBD_BULGARIAN, 0, 0}, {KBD_CHINESE_TRADITIONAL_US, 0}, {KBD_CZECH, "cz", 0}, {KBD_CZECH_PROGRAMMERS, "cz", "bksl"}, {KBD_CZECH_QWERTY, "cz", "qwerty"}, {KBD_DANISH, "dk", 0}, {KBD_GERMAN, "de", 0}, {KBD_GERMAN_NEO, "de", "neo"}, {KBD_GERMAN_IBM, "de", "qwerty"}, {KBD_GREEK, "gr", 0}, {KBD_GREEK_220, "gr", "simple"}, {KBD_GREEK_319, "gr", "extended"}, {KBD_GREEK_POLYTONIC, "gr", "polytonic"}, {KBD_US, "us", 0}, {KBD_US_ENGLISH_TABLE_FOR_IBM_ARABIC_238_L, "ara", "buckwalter"}, {KBD_SPANISH, "es", 0}, {KBD_SPANISH_VARIATION, "es", "nodeadkeys"}, {KBD_FINNISH, "fi", 0}, {KBD_FRENCH, "fr", 0}, {KBD_HEBREW, "il", 0}, {KBD_HUNGARIAN, "hu", 0}, {KBD_HUNGARIAN_101_KEY, "hu", "standard"}, {KBD_ICELANDIC, "is", 0}, {KBD_ITALIAN, "it", 0}, {KBD_ITALIAN_142, "it", "nodeadkeys"}, {KBD_JAPANESE, "jp", 0}, {KBD_JAPANESE_INPUT_SYSTEM_MS_IME2002, "jp", "kana"}, {KBD_KOREAN, "kr", 0}, {KBD_KOREAN_INPUT_SYSTEM_IME_2000, "kr", "kr104"}, {KBD_DUTCH, "nl", 0}, {KBD_NORWEGIAN, "no", 0}, {KBD_POLISH_PROGRAMMERS, "pl", 0}, {KBD_POLISH_214, "pl", "qwertz"}, // {KBD_PORTUGUESE_BRAZILIAN_ABN0416, 0}, {KBD_ROMANIAN, "ro", 0}, {KBD_RUSSIAN, "ru", 0}, {KBD_RUSSIAN_TYPEWRITER, "ru", "typewriter"}, {KBD_CROATIAN, "hr", 0}, {KBD_SLOVAK, "sk", 0}, {KBD_SLOVAK_QWERTY, "sk", "qwerty"}, {KBD_ALBANIAN, 0, 0}, {KBD_SWEDISH, "se", 0}, {KBD_THAI_KEDMANEE, "th", 0}, {KBD_THAI_KEDMANEE_NON_SHIFTLOCK, "th", "tis"}, {KBD_TURKISH_Q, "tr", 0}, {KBD_TURKISH_F, "tr", "f"}, {KBD_URDU, "in", "urd-phonetic3"}, {KBD_UKRAINIAN, "ua", 0}, {KBD_BELARUSIAN, "by", 0}, {KBD_SLOVENIAN, "si", 0}, {KBD_ESTONIAN, "ee", 0}, {KBD_LATVIAN, "lv", 0}, {KBD_LITHUANIAN_IBM, "lt", "ibm"}, {KBD_FARSI, "af", 0}, {KBD_VIETNAMESE, "vn", 0}, {KBD_ARMENIAN_EASTERN, "am", 0}, {KBD_AZERI_LATIN, 0, 0}, {KBD_FYRO_MACEDONIAN, "mk", 0}, {KBD_GEORGIAN, "ge", 0}, {KBD_FAEROESE, 0, 0}, {KBD_DEVANAGARI_INSCRIPT, 0, 0}, {KBD_MALTESE_47_KEY, 0, 0}, {KBD_NORWEGIAN_WITH_SAMI, "no", "smi"}, {KBD_KAZAKH, "kz", 0}, {KBD_KYRGYZ_CYRILLIC, "kg", "phonetic"}, {KBD_TATAR, "ru", "tt"}, {KBD_BENGALI, "bd", 0}, {KBD_BENGALI_INSCRIPT, "bd", "probhat"}, {KBD_PUNJABI, 0, 0}, {KBD_GUJARATI, "in", "guj"}, {KBD_TAMIL, "in", "tam"}, {KBD_TELUGU, "in", "tel"}, {KBD_KANNADA, "in", "kan"}, {KBD_MALAYALAM, "in", "mal"}, {KBD_HINDI_TRADITIONAL, "in", 0}, {KBD_MARATHI, 0, 0}, {KBD_MONGOLIAN_CYRILLIC, "mn", 0}, {KBD_UNITED_KINGDOM_EXTENDED, "gb", "intl"}, {KBD_SYRIAC, "syc", 0}, {KBD_SYRIAC_PHONETIC, "syc", "syc_phonetic"}, {KBD_NEPALI, "np", 0}, {KBD_PASHTO, "af", "ps"}, {KBD_DIVEHI_PHONETIC, 0, 0}, {KBD_LUXEMBOURGISH, 0, 0}, {KBD_MAORI, "mao", 0}, {KBD_CHINESE_SIMPLIFIED_US, 0, 0}, {KBD_SWISS_GERMAN, "ch", "de_nodeadkeys"}, {KBD_UNITED_KINGDOM, "gb", 0}, {KBD_LATIN_AMERICAN, "latam", 0}, {KBD_BELGIAN_FRENCH, "be", 0}, {KBD_BELGIAN_PERIOD, "be", "oss_sundeadkeys"}, {KBD_PORTUGUESE, "pt", 0}, {KBD_SERBIAN_LATIN, "rs", 0}, {KBD_AZERI_CYRILLIC, "az", "cyrillic"}, {KBD_SWEDISH_WITH_SAMI, "se", "smi"}, {KBD_UZBEK_CYRILLIC, "af", "uz"}, {KBD_INUKTITUT_LATIN, "ca", "ike"}, {KBD_CANADIAN_FRENCH_LEGACY, "ca", "fr-legacy"}, {KBD_SERBIAN_CYRILLIC, "rs", 0}, {KBD_CANADIAN_FRENCH, "ca", "fr-legacy"}, {KBD_SWISS_FRENCH, "ch", "fr"}, {KBD_BOSNIAN, "ba", 0}, {KBD_IRISH, 0, 0}, {KBD_BOSNIAN_CYRILLIC, "ba", "us"}, {KBD_UNITED_STATES_DVORAK, "us", "dvorak"}, {KBD_PORTUGUESE_BRAZILIAN_ABNT2, "br", "nativo"}, {KBD_CANADIAN_MULTILINGUAL_STANDARD, "ca", "multix"}, {KBD_GAELIC, "ie", "CloGaelach"}, {0x00000000, 0, 0}, }; /* taken from 2.2.7.1.6 Input Capability Set (TS_INPUT_CAPABILITYSET) */ static char *rdp_keyboard_types[] = { "", /* 0: unused */ "", /* 1: IBM PC/XT or compatible (83-key) keyboard */ "", /* 2: Olivetti "ICO" (102-key) keyboard */ "", /* 3: IBM PC/AT (84-key) or similar keyboard */ "pc102",/* 4: IBM enhanced (101- or 102-key) keyboard */ "", /* 5: Nokia 1050 and similar keyboards */ "", /* 6: Nokia 9140 and similar keyboards */ "" /* 7: Japanese keyboard */ }; static BOOL xf_peer_activate(freerdp_peer* client) { RdpPeerContext *peerCtx; struct rdp_backend *b; struct rdp_output *output; rdpSettings *settings; rdpPointerUpdate *pointer; struct rdp_peers_item *peersItem; struct xkb_context *xkbContext; struct xkb_rule_names xkbRuleNames; struct xkb_keymap *keymap; int i; pixman_box32_t box; pixman_region32_t damage; char seat_name[50]; peerCtx = (RdpPeerContext *)client->context; b = peerCtx->rdpBackend; peersItem = &peerCtx->item; output = b->output; settings = client->settings; if (!settings->SurfaceCommandsEnabled) { weston_log("client doesn't support required SurfaceCommands\n"); return FALSE; } if (output->base.width != (int)settings->DesktopWidth || output->base.height != (int)settings->DesktopHeight) { if (b->no_clients_resize) { /* RDP peers don't dictate their resolution to weston */ if (!settings->DesktopResize) { /* peer does not support desktop resize */ weston_log("%s: client doesn't support resizing, closing connection\n", __FUNCTION__); return FALSE; } else { settings->DesktopWidth = output->base.width; settings->DesktopHeight = output->base.height; client->update->DesktopResize(client->context); } } else { /* ask weston to adjust size */ struct weston_mode new_mode; struct weston_mode *target_mode; new_mode.width = (int)settings->DesktopWidth; new_mode.height = (int)settings->DesktopHeight; target_mode = ensure_matching_mode(&output->base, &new_mode); if (!target_mode) { weston_log("client mode not found\n"); return FALSE; } weston_output_mode_set_native(&output->base, target_mode, 1); output->base.width = new_mode.width; output->base.height = new_mode.height; } } rfx_context_reset(peerCtx->rfx_context); #ifdef HAVE_NSC_RESET nsc_context_reset(peerCtx->nsc_context); #endif if (peersItem->flags & RDP_PEER_ACTIVATED) return TRUE; /* when here it's the first reactivation, we need to setup a little more */ weston_log("kbd_layout:0x%x kbd_type:0x%x kbd_subType:0x%x kbd_functionKeys:0x%x\n", settings->KeyboardLayout, settings->KeyboardType, settings->KeyboardSubType, settings->KeyboardFunctionKey); memset(&xkbRuleNames, 0, sizeof(xkbRuleNames)); if (settings->KeyboardType <= 7) xkbRuleNames.model = rdp_keyboard_types[settings->KeyboardType]; for (i = 0; rdp_keyboards[i].rdpLayoutCode; i++) { if (rdp_keyboards[i].rdpLayoutCode == settings->KeyboardLayout) { xkbRuleNames.layout = rdp_keyboards[i].xkbLayout; xkbRuleNames.variant = rdp_keyboards[i].xkbVariant; weston_log("%s: matching layout=%s variant=%s\n", __FUNCTION__, xkbRuleNames.layout, xkbRuleNames.variant); break; } } keymap = NULL; if (xkbRuleNames.layout) { xkbContext = xkb_context_new(0); if (!xkbContext) { weston_log("unable to create a xkb_context\n"); return FALSE; } keymap = xkb_keymap_new_from_names(xkbContext, &xkbRuleNames, 0); } if (settings->ClientHostname) snprintf(seat_name, sizeof(seat_name), "RDP %s", settings->ClientHostname); else snprintf(seat_name, sizeof(seat_name), "RDP peer @%s", settings->ClientAddress); weston_seat_init(&peersItem->seat, b->compositor, seat_name); weston_seat_init_keyboard(&peersItem->seat, keymap); weston_seat_init_pointer(&peersItem->seat); peersItem->flags |= RDP_PEER_ACTIVATED; /* disable pointer on the client side */ pointer = client->update->pointer; pointer->pointer_system.type = SYSPTR_NULL; pointer->PointerSystem(client->context, &pointer->pointer_system); /* sends a full refresh */ box.x1 = 0; box.y1 = 0; box.x2 = output->base.width; box.y2 = output->base.height; pixman_region32_init_with_extents(&damage, &box); rdp_peer_refresh_region(&damage, client); pixman_region32_fini(&damage); return TRUE; } static BOOL xf_peer_post_connect(freerdp_peer *client) { return TRUE; } static FREERDP_CB_RET_TYPE xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) { wl_fixed_t wl_x, wl_y, axis; RdpPeerContext *peerContext = (RdpPeerContext *)input->context; struct rdp_output *output; uint32_t button = 0; if (flags & PTR_FLAGS_MOVE) { output = peerContext->rdpBackend->output; if (x < output->base.width && y < output->base.height) { wl_x = wl_fixed_from_int((int)x); wl_y = wl_fixed_from_int((int)y); notify_motion_absolute(&peerContext->item.seat, weston_compositor_get_time(), wl_x, wl_y); } } if (flags & PTR_FLAGS_BUTTON1) button = BTN_LEFT; else if (flags & PTR_FLAGS_BUTTON2) button = BTN_RIGHT; else if (flags & PTR_FLAGS_BUTTON3) button = BTN_MIDDLE; if (button) { notify_button(&peerContext->item.seat, weston_compositor_get_time(), button, (flags & PTR_FLAGS_DOWN) ? WL_POINTER_BUTTON_STATE_PRESSED : WL_POINTER_BUTTON_STATE_RELEASED ); } if (flags & PTR_FLAGS_WHEEL) { /* DEFAULT_AXIS_STEP_DISTANCE is stolen from compositor-x11.c * The RDP specs says the lower bits of flags contains the "the number of rotation * units the mouse wheel was rotated". * * http://blogs.msdn.com/b/oldnewthing/archive/2013/01/23/10387366.aspx explains the 120 value */ axis = (DEFAULT_AXIS_STEP_DISTANCE * (flags & 0xff)) / 120; if (flags & PTR_FLAGS_WHEEL_NEGATIVE) axis = -axis; notify_axis(&peerContext->item.seat, weston_compositor_get_time(), WL_POINTER_AXIS_VERTICAL_SCROLL, axis); } FREERDP_CB_RETURN(TRUE); } static FREERDP_CB_RET_TYPE xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) { wl_fixed_t wl_x, wl_y; RdpPeerContext *peerContext = (RdpPeerContext *)input->context; struct rdp_output *output; output = peerContext->rdpBackend->output; if (x < output->base.width && y < output->base.height) { wl_x = wl_fixed_from_int((int)x); wl_y = wl_fixed_from_int((int)y); notify_motion_absolute(&peerContext->item.seat, weston_compositor_get_time(), wl_x, wl_y); } FREERDP_CB_RETURN(TRUE); } static FREERDP_CB_RET_TYPE xf_input_synchronize_event(rdpInput *input, UINT32 flags) { freerdp_peer *client = input->context->peer; RdpPeerContext *peerCtx = (RdpPeerContext *)input->context; struct rdp_output *output = peerCtx->rdpBackend->output; pixman_box32_t box; pixman_region32_t damage; /* sends a full refresh */ box.x1 = 0; box.y1 = 0; box.x2 = output->base.width; box.y2 = output->base.height; pixman_region32_init_with_extents(&damage, &box); rdp_peer_refresh_region(&damage, client); pixman_region32_fini(&damage); FREERDP_CB_RETURN(TRUE); } static FREERDP_CB_RET_TYPE xf_input_keyboard_event(rdpInput *input, UINT16 flags, UINT16 code) { uint32_t scan_code, vk_code, full_code; enum wl_keyboard_key_state keyState; RdpPeerContext *peerContext = (RdpPeerContext *)input->context; int notify = 0; if (!(peerContext->item.flags & RDP_PEER_ACTIVATED)) FREERDP_CB_RETURN(TRUE); if (flags & KBD_FLAGS_DOWN) { keyState = WL_KEYBOARD_KEY_STATE_PRESSED; notify = 1; } else if (flags & KBD_FLAGS_RELEASE) { keyState = WL_KEYBOARD_KEY_STATE_RELEASED; notify = 1; } if (notify) { full_code = code; if (flags & KBD_FLAGS_EXTENDED) full_code |= KBD_FLAGS_EXTENDED; vk_code = GetVirtualKeyCodeFromVirtualScanCode(full_code, 4); if (flags & KBD_FLAGS_EXTENDED) vk_code |= KBDEXT; scan_code = GetKeycodeFromVirtualKeyCode(vk_code, KEYCODE_TYPE_EVDEV); /*weston_log("code=%x ext=%d vk_code=%x scan_code=%x\n", code, (flags & KBD_FLAGS_EXTENDED) ? 1 : 0, vk_code, scan_code);*/ notify_key(&peerContext->item.seat, weston_compositor_get_time(), scan_code - 8, keyState, STATE_UPDATE_AUTOMATIC); } FREERDP_CB_RETURN(TRUE); } static FREERDP_CB_RET_TYPE xf_input_unicode_keyboard_event(rdpInput *input, UINT16 flags, UINT16 code) { weston_log("Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code); FREERDP_CB_RETURN(TRUE); } static FREERDP_CB_RET_TYPE xf_suppress_output(rdpContext *context, BYTE allow, RECTANGLE_16 *area) { RdpPeerContext *peerContext = (RdpPeerContext *)context; if (allow) peerContext->item.flags |= RDP_PEER_OUTPUT_ENABLED; else peerContext->item.flags &= (~RDP_PEER_OUTPUT_ENABLED); FREERDP_CB_RETURN(TRUE); } static int rdp_peer_init(freerdp_peer *client, struct rdp_backend *b) { int rcount = 0; void *rfds[MAX_FREERDP_FDS]; int i, fd; struct wl_event_loop *loop; rdpSettings *settings; rdpInput *input; RdpPeerContext *peerCtx; client->ContextSize = sizeof(RdpPeerContext); client->ContextNew = (psPeerContextNew)rdp_peer_context_new; client->ContextFree = (psPeerContextFree)rdp_peer_context_free; freerdp_peer_context_new(client); peerCtx = (RdpPeerContext *) client->context; peerCtx->rdpBackend = b; settings = client->settings; /* configure security settings */ if (b->rdp_key) settings->RdpKeyFile = strdup(b->rdp_key); if (b->tls_enabled) { settings->CertificateFile = strdup(b->server_cert); settings->PrivateKeyFile = strdup(b->server_key); } else { settings->TlsSecurity = FALSE; } settings->NlaSecurity = FALSE; if (!client->Initialize(client)) { weston_log("peer initialization failed\n"); goto error_initialize; } settings->OsMajorType = OSMAJORTYPE_UNIX; settings->OsMinorType = OSMINORTYPE_PSEUDO_XSERVER; settings->ColorDepth = 32; settings->RefreshRect = TRUE; settings->RemoteFxCodec = TRUE; settings->NSCodec = TRUE; settings->FrameMarkerCommandEnabled = TRUE; settings->SurfaceFrameMarkerEnabled = TRUE; client->Capabilities = xf_peer_capabilities; client->PostConnect = xf_peer_post_connect; client->Activate = xf_peer_activate; client->update->SuppressOutput = xf_suppress_output; input = client->input; input->SynchronizeEvent = xf_input_synchronize_event; input->MouseEvent = xf_mouseEvent; input->ExtendedMouseEvent = xf_extendedMouseEvent; input->KeyboardEvent = xf_input_keyboard_event; input->UnicodeKeyboardEvent = xf_input_unicode_keyboard_event; if (!client->GetFileDescriptor(client, rfds, &rcount)) { weston_log("unable to retrieve client fds\n"); goto error_initialize; } loop = wl_display_get_event_loop(b->compositor->wl_display); for (i = 0; i < rcount; i++) { fd = (int)(long)(rfds[i]); peerCtx->events[i] = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, rdp_client_activity, client); } for ( ; i < MAX_FREERDP_FDS; i++) peerCtx->events[i] = 0; wl_list_insert(&b->output->peers, &peerCtx->item.link); return 0; error_initialize: client->Close(client); return -1; } static FREERDP_CB_RET_TYPE rdp_incoming_peer(freerdp_listener *instance, freerdp_peer *client) { struct rdp_backend *b = (struct rdp_backend *)instance->param4; if (rdp_peer_init(client, b) < 0) { weston_log("error when treating incoming peer\n"); FREERDP_CB_RETURN(FALSE); } FREERDP_CB_RETURN(TRUE); } static struct rdp_backend * rdp_backend_create(struct weston_compositor *compositor, struct rdp_backend_config *config, int *argc, char *argv[], struct weston_config *wconfig) { struct rdp_backend *b; char *fd_str; int fd; b = zalloc(sizeof *b); if (b == NULL) return NULL; b->compositor = compositor; b->base.destroy = rdp_destroy; b->base.restore = rdp_restore; b->rdp_key = config->rdp_key ? strdup(config->rdp_key) : NULL; b->no_clients_resize = config->no_clients_resize; /* activate TLS only if certificate/key are available */ if (config->server_cert && config->server_key) { weston_log("TLS support activated\n"); b->server_cert = strdup(config->server_cert); b->server_key = strdup(config->server_key); if (!b->server_cert || !b->server_key) goto err_free_strings; b->tls_enabled = 1; } if (weston_compositor_set_presentation_clock_software(compositor) < 0) goto err_compositor; if (pixman_renderer_init(compositor) < 0) goto err_compositor; if (rdp_backend_create_output(b, config->width, config->height) < 0) goto err_compositor; compositor->capabilities |= WESTON_CAP_ARBITRARY_MODES; if (!config->env_socket) { b->listener = freerdp_listener_new(); b->listener->PeerAccepted = rdp_incoming_peer; b->listener->param4 = b; if (!b->listener->Open(b->listener, config->bind_address, config->port)) { weston_log("unable to bind rdp socket\n"); goto err_listener; } if (rdp_implant_listener(b, b->listener) < 0) goto err_compositor; } else { /* get the socket from RDP_FD var */ fd_str = getenv("RDP_FD"); if (!fd_str) { weston_log("RDP_FD env variable not set"); goto err_output; } fd = strtoul(fd_str, NULL, 10); if (rdp_peer_init(freerdp_peer_new(fd), b)) goto err_output; } compositor->backend = &b->base; return b; err_listener: freerdp_listener_free(b->listener); err_output: weston_output_destroy(&b->output->base); err_compositor: weston_compositor_shutdown(compositor); err_free_strings: free(b->rdp_key); free(b->server_cert); free(b->server_key); free(b); return NULL; } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *wconfig) { struct rdp_backend *b; struct rdp_backend_config config; rdp_backend_config_init(&config); int major, minor, revision; freerdp_get_version(&major, &minor, &revision); weston_log("using FreeRDP version %d.%d.%d\n", major, minor, revision); const struct weston_option rdp_options[] = { { WESTON_OPTION_BOOLEAN, "env-socket", 0, &config.env_socket }, { WESTON_OPTION_INTEGER, "width", 0, &config.width }, { WESTON_OPTION_INTEGER, "height", 0, &config.height }, { WESTON_OPTION_STRING, "address", 0, &config.bind_address }, { WESTON_OPTION_INTEGER, "port", 0, &config.port }, { WESTON_OPTION_BOOLEAN, "no-clients-resize", 0, &config.no_clients_resize }, { WESTON_OPTION_STRING, "rdp4-key", 0, &config.rdp_key }, { WESTON_OPTION_STRING, "rdp-tls-cert", 0, &config.server_cert }, { WESTON_OPTION_STRING, "rdp-tls-key", 0, &config.server_key } }; parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv); if (!config.rdp_key && (!config.server_cert || !config.server_key)) { weston_log("the RDP compositor requires keys and an optional certificate for RDP or TLS security (" "--rdp4-key or --rdp-tls-cert/--rdp-tls-key)\n"); return -1; } b = rdp_backend_create(compositor, &config, argc, argv, wconfig); if (b == NULL) return -1; return 0; } weston-1.9.0/src/cms-colord.c0000664000175000017500000003575612554240162013001 00000000000000/* * Copyright © 2013 Richard Hughes * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "compositor.h" #include "cms-helper.h" #include "shared/helpers.h" struct cms_colord { struct weston_compositor *ec; CdClient *client; GHashTable *devices; /* key = device-id, value = cms_output */ GHashTable *pnp_ids; /* key = pnp-id, value = vendor */ gchar *pnp_ids_data; GMainLoop *loop; GThread *thread; GList *pending; GMutex pending_mutex; struct wl_event_source *source; int readfd; int writefd; struct wl_listener destroy_listener; struct wl_listener output_created_listener; }; struct cms_output { CdDevice *device; guint32 backlight_value; struct cms_colord *cms; struct weston_color_profile *p; struct weston_output *o; struct wl_listener destroy_listener; }; static gint colord_idle_find_output_cb(gconstpointer a, gconstpointer b) { struct cms_output *ocms = (struct cms_output *) a; struct weston_output *o = (struct weston_output *) b; return ocms->o == o ? 0 : -1; } static void colord_idle_cancel_for_output(struct cms_colord *cms, struct weston_output *o) { GList *l; /* cancel and remove any helpers that match the output */ g_mutex_lock(&cms->pending_mutex); l = g_list_find_custom (cms->pending, o, colord_idle_find_output_cb); if (l) { struct cms_output *ocms = l->data; cms->pending = g_list_remove (cms->pending, ocms); } g_mutex_unlock(&cms->pending_mutex); } static bool edid_value_valid(const char *str) { if (str == NULL) return false; if (str[0] == '\0') return false; if (strcmp(str, "unknown") == 0) return false; return true; } static gchar * get_output_id(struct cms_colord *cms, struct weston_output *o) { const gchar *tmp; GString *device_id; /* see https://github.com/hughsie/colord/blob/master/doc/device-and-profile-naming-spec.txt * for format and allowed values */ device_id = g_string_new("xrandr"); if (edid_value_valid(o->make)) { tmp = g_hash_table_lookup(cms->pnp_ids, o->make); if (tmp == NULL) tmp = o->make; g_string_append_printf(device_id, "-%s", tmp); } if (edid_value_valid(o->model)) g_string_append_printf(device_id, "-%s", o->model); if (edid_value_valid(o->serial_number)) g_string_append_printf(device_id, "-%s", o->serial_number); /* no EDID data, so use fallback */ if (strcmp(device_id->str, "xrandr") == 0) g_string_append_printf(device_id, "-drm-%i", o->id); return g_string_free(device_id, FALSE); } static void update_device_with_profile_in_idle(struct cms_output *ocms) { gboolean signal_write = FALSE; ssize_t rc; struct cms_colord *cms = ocms->cms; colord_idle_cancel_for_output(cms, ocms->o); g_mutex_lock(&cms->pending_mutex); if (cms->pending == NULL) signal_write = TRUE; cms->pending = g_list_prepend(cms->pending, ocms); g_mutex_unlock(&cms->pending_mutex); /* signal we've got updates to do */ if (signal_write) { gchar tmp = '\0'; rc = write(cms->writefd, &tmp, 1); if (rc == 0) weston_log("colord: failed to write to pending fd"); } } static void colord_update_output_from_device (struct cms_output *ocms) { CdProfile *profile; const gchar *tmp; gboolean ret; GError *error = NULL; gint percentage; /* old profile is no longer valid */ weston_cms_destroy_profile(ocms->p); ocms->p = NULL; ret = cd_device_connect_sync(ocms->device, NULL, &error); if (!ret) { weston_log("colord: failed to connect to device %s: %s\n", cd_device_get_object_path (ocms->device), error->message); g_error_free(error); goto out; } profile = cd_device_get_default_profile(ocms->device); if (!profile) { weston_log("colord: no assigned color profile for %s\n", cd_device_get_id (ocms->device)); goto out; } ret = cd_profile_connect_sync(profile, NULL, &error); if (!ret) { weston_log("colord: failed to connect to profile %s: %s\n", cd_profile_get_object_path (profile), error->message); g_error_free(error); goto out; } /* get the calibration brightness level (only set for some profiles) */ tmp = cd_profile_get_metadata_item(profile, CD_PROFILE_METADATA_SCREEN_BRIGHTNESS); if (tmp != NULL) { percentage = atoi(tmp); if (percentage > 0 && percentage <= 100) ocms->backlight_value = percentage * 255 / 100; } ocms->p = weston_cms_load_profile(cd_profile_get_filename(profile)); if (ocms->p == NULL) { weston_log("colord: warning failed to load profile %s: %s\n", cd_profile_get_object_path (profile), error->message); g_error_free(error); goto out; } out: update_device_with_profile_in_idle(ocms); } static void colord_device_changed_cb(CdDevice *device, struct cms_output *ocms) { weston_log("colord: device %s changed, update output\n", cd_device_get_object_path (ocms->device)); colord_update_output_from_device(ocms); } static void colord_notifier_output_destroy(struct wl_listener *listener, void *data) { struct cms_output *ocms = container_of(listener, struct cms_output, destroy_listener); struct weston_output *o = (struct weston_output *) data; struct cms_colord *cms = ocms->cms; gchar *device_id; device_id = get_output_id(cms, o); g_hash_table_remove (cms->devices, device_id); g_free (device_id); } static void colord_output_created(struct cms_colord *cms, struct weston_output *o) { CdDevice *device; const gchar *tmp; gchar *device_id; GError *error = NULL; GHashTable *device_props; struct cms_output *ocms; /* create device */ device_id = get_output_id(cms, o); weston_log("colord: output added %s\n", device_id); device_props = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); g_hash_table_insert (device_props, g_strdup(CD_DEVICE_PROPERTY_KIND), g_strdup(cd_device_kind_to_string (CD_DEVICE_KIND_DISPLAY))); g_hash_table_insert (device_props, g_strdup(CD_DEVICE_PROPERTY_FORMAT), g_strdup("ColorModel.OutputMode.OutputResolution")); g_hash_table_insert (device_props, g_strdup(CD_DEVICE_PROPERTY_COLORSPACE), g_strdup(cd_colorspace_to_string(CD_COLORSPACE_RGB))); if (edid_value_valid(o->make)) { tmp = g_hash_table_lookup(cms->pnp_ids, o->make); if (tmp == NULL) tmp = o->make; g_hash_table_insert (device_props, g_strdup(CD_DEVICE_PROPERTY_VENDOR), g_strdup(tmp)); } if (edid_value_valid(o->model)) { g_hash_table_insert (device_props, g_strdup(CD_DEVICE_PROPERTY_MODEL), g_strdup(o->model)); } if (edid_value_valid(o->serial_number)) { g_hash_table_insert (device_props, g_strdup(CD_DEVICE_PROPERTY_SERIAL), g_strdup(o->serial_number)); } if (o->connection_internal) { g_hash_table_insert (device_props, g_strdup (CD_DEVICE_PROPERTY_EMBEDDED), NULL); } device = cd_client_create_device_sync(cms->client, device_id, CD_OBJECT_SCOPE_TEMP, device_props, NULL, &error); if (g_error_matches (error, CD_CLIENT_ERROR, CD_CLIENT_ERROR_ALREADY_EXISTS)) { g_clear_error(&error); device = cd_client_find_device_sync (cms->client, device_id, NULL, &error); } if (!device) { weston_log("colord: failed to create new or " "find existing device: %s\n", error->message); g_error_free(error); goto out; } /* create object and watch for the output to be destroyed */ ocms = g_slice_new0(struct cms_output); ocms->cms = cms; ocms->o = o; ocms->device = g_object_ref(device); ocms->destroy_listener.notify = colord_notifier_output_destroy; wl_signal_add(&o->destroy_signal, &ocms->destroy_listener); /* add to local cache */ g_hash_table_insert (cms->devices, g_strdup(device_id), ocms); g_signal_connect (ocms->device, "changed", G_CALLBACK (colord_device_changed_cb), ocms); /* get profiles */ colord_update_output_from_device (ocms); out: g_hash_table_unref (device_props); if (device) g_object_unref (device); g_free (device_id); } static void colord_notifier_output_created(struct wl_listener *listener, void *data) { struct weston_output *o = (struct weston_output *) data; struct cms_colord *cms = container_of(listener, struct cms_colord, destroy_listener); weston_log("colord: output %s created\n", o->name); colord_output_created(cms, o); } static gpointer colord_run_loop_thread(gpointer data) { struct cms_colord *cms = (struct cms_colord *) data; struct weston_output *o; /* coldplug outputs */ wl_list_for_each(o, &cms->ec->output_list, link) { weston_log("colord: output %s coldplugged\n", o->name); colord_output_created(cms, o); } g_main_loop_run(cms->loop); return NULL; } static int colord_dispatch_all_pending(int fd, uint32_t mask, void *data) { gchar tmp; GList *l; ssize_t rc; struct cms_colord *cms = data; struct cms_output *ocms; weston_log("colord: dispatching events\n"); g_mutex_lock(&cms->pending_mutex); for (l = cms->pending; l != NULL; l = l->next) { ocms = l->data; /* optionally set backlight to calibration value */ if (ocms->o->set_backlight && ocms->backlight_value != 0) { weston_log("colord: profile calibration backlight to %i/255\n", ocms->backlight_value); ocms->o->set_backlight(ocms->o, ocms->backlight_value); } weston_cms_set_color_profile(ocms->o, ocms->p); } g_list_free (cms->pending); cms->pending = NULL; g_mutex_unlock(&cms->pending_mutex); /* done */ rc = read(cms->readfd, &tmp, 1); if (rc == 0) weston_log("colord: failed to read from pending fd"); return 1; } static void colord_load_pnp_ids(struct cms_colord *cms) { gboolean ret = FALSE; gchar *tmp; GError *error = NULL; guint i; const gchar *pnp_ids_fn[] = { "/usr/share/hwdata/pnp.ids", "/usr/share/misc/pnp.ids", NULL }; /* find and load file */ for (i = 0; pnp_ids_fn[i] != NULL; i++) { if (!g_file_test(pnp_ids_fn[i], G_FILE_TEST_EXISTS)) continue; ret = g_file_get_contents(pnp_ids_fn[i], &cms->pnp_ids_data, NULL, &error); if (!ret) { weston_log("colord: failed to load %s: %s\n", pnp_ids_fn[i], error->message); g_error_free(error); return; } break; } if (!ret) { weston_log("colord: no pnp.ids found\n"); return; } /* parse fixed offsets into lines */ tmp = cms->pnp_ids_data; for (i = 0; cms->pnp_ids_data[i] != '\0'; i++) { if (cms->pnp_ids_data[i] != '\n') continue; cms->pnp_ids_data[i] = '\0'; if (tmp[0] && tmp[1] && tmp[2] && tmp[3] == '\t' && tmp[4]) { tmp[3] = '\0'; g_hash_table_insert(cms->pnp_ids, tmp, tmp+4); tmp = &cms->pnp_ids_data[i+1]; } } } static void colord_module_destroy(struct cms_colord *cms) { if (cms->loop) { g_main_loop_quit(cms->loop); g_main_loop_unref(cms->loop); } if (cms->thread) g_thread_join(cms->thread); /* cms->devices must be destroyed before other resources, as * the other resources are needed during output cleanup in * cms->devices unref. */ if (cms->devices) g_hash_table_unref(cms->devices); if (cms->client) g_object_unref(cms->client); if (cms->readfd) close(cms->readfd); if (cms->writefd) close(cms->writefd); g_free(cms->pnp_ids_data); g_hash_table_unref(cms->pnp_ids); free(cms); } static void colord_notifier_destroy(struct wl_listener *listener, void *data) { struct cms_colord *cms = container_of(listener, struct cms_colord, destroy_listener); colord_module_destroy(cms); } static void colord_cms_output_destroy(gpointer data) { struct cms_output *ocms = (struct cms_output *) data; struct cms_colord *cms = ocms->cms; struct weston_output *o = ocms->o; gboolean ret; gchar *device_id; GError *error = NULL; colord_idle_cancel_for_output(cms, o); device_id = get_output_id(cms, o); weston_log("colord: output unplugged %s\n", device_id); wl_list_remove(&ocms->destroy_listener.link); g_signal_handlers_disconnect_by_data(ocms->device, ocms); ret = cd_client_delete_device_sync (cms->client, ocms->device, NULL, &error); if (!ret) { weston_log("colord: failed to delete device: %s\n", error->message); g_error_free(error); } g_object_unref(ocms->device); g_slice_free(struct cms_output, ocms); g_free (device_id); } WL_EXPORT int module_init(struct weston_compositor *ec, int *argc, char *argv[]) { gboolean ret; GError *error = NULL; int fd[2]; struct cms_colord *cms; struct wl_event_loop *loop; weston_log("colord: initialized\n"); /* create local state object */ cms = zalloc(sizeof *cms); if (cms == NULL) return -1; cms->ec = ec; #if !GLIB_CHECK_VERSION(2,36,0) g_type_init(); #endif cms->client = cd_client_new(); ret = cd_client_connect_sync(cms->client, NULL, &error); if (!ret) { weston_log("colord: failed to contact daemon: %s\n", error->message); g_error_free(error); colord_module_destroy(cms); return -1; } g_mutex_init(&cms->pending_mutex); cms->devices = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, colord_cms_output_destroy); /* destroy */ cms->destroy_listener.notify = colord_notifier_destroy; wl_signal_add(&ec->destroy_signal, &cms->destroy_listener); /* devices added */ cms->output_created_listener.notify = colord_notifier_output_created; wl_signal_add(&ec->output_created_signal, &cms->output_created_listener); /* add all the PNP IDs */ cms->pnp_ids = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); colord_load_pnp_ids(cms); /* setup a thread for the GLib callbacks */ cms->loop = g_main_loop_new(NULL, FALSE); cms->thread = g_thread_new("colord CMS main loop", colord_run_loop_thread, cms); /* batch device<->profile updates */ if (pipe2(fd, O_CLOEXEC) == -1) { colord_module_destroy(cms); return -1; } cms->readfd = fd[0]; cms->writefd = fd[1]; loop = wl_display_get_event_loop(ec->wl_display); cms->source = wl_event_loop_add_fd (loop, cms->readfd, WL_EVENT_READABLE, colord_dispatch_all_pending, cms); if (!cms->source) { colord_module_destroy(cms); return -1; } return 0; } weston-1.9.0/src/rpi-renderer.h0000664000175000017500000000335512537627702013342 00000000000000/* * Copyright © 2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef RPI_RENDERER_H #define RPI_RENDERER_H struct rpi_renderer_parameters { int single_buffer; int opaque_regions; }; int rpi_renderer_create(struct weston_compositor *compositor, const struct rpi_renderer_parameters *params); int rpi_renderer_output_create(struct weston_output *base, DISPMANX_DISPLAY_HANDLE_T display); void rpi_renderer_output_destroy(struct weston_output *base); void rpi_renderer_set_update_handle(struct weston_output *base, DISPMANX_UPDATE_HANDLE_T handle); void rpi_renderer_finish_frame(struct weston_output *base); #endif /* RPI_RENDERER_H */ weston-1.9.0/src/weston-launch.h0000664000175000017500000000301012537627702013517 00000000000000/* * Copyright © 2012 Benjamin Franzke * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_LAUNCH_H_ #define _WESTON_LAUNCH_H_ enum weston_launcher_opcode { WESTON_LAUNCHER_OPEN, }; enum weston_launcher_event { WESTON_LAUNCHER_SUCCESS, WESTON_LAUNCHER_ACTIVATE, WESTON_LAUNCHER_DEACTIVATE }; struct weston_launcher_message { int opcode; }; struct weston_launcher_open { struct weston_launcher_message header; int flags; char path[0]; }; #endif weston-1.9.0/src/libinput-seat.c0000664000175000017500000002420312561201705013476 00000000000000/* * Copyright © 2013 Intel Corporation * Copyright © 2013 Jonas Ådahl * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "compositor.h" #include "launcher-util.h" #include "libinput-seat.h" #include "libinput-device.h" #include "shared/helpers.h" static const char default_seat[] = "seat0"; static const char default_seat_name[] = "default"; static void process_events(struct udev_input *input); static struct udev_seat * udev_seat_create(struct udev_input *input, const char *seat_name); static void udev_seat_destroy(struct udev_seat *seat); static void device_added(struct udev_input *input, struct libinput_device *libinput_device) { struct weston_compositor *c; struct evdev_device *device; struct weston_output *output; const char *seat_name; const char *output_name; struct libinput_seat *libinput_seat; struct weston_seat *seat; struct udev_seat *udev_seat; struct weston_pointer *pointer; c = input->compositor; libinput_seat = libinput_device_get_seat(libinput_device); seat_name = libinput_seat_get_logical_name(libinput_seat); udev_seat = udev_seat_get_named(input, seat_name); if (!udev_seat) return; seat = &udev_seat->base; device = evdev_device_create(libinput_device, seat); if (device == NULL) return; udev_seat = (struct udev_seat *) seat; wl_list_insert(udev_seat->devices_list.prev, &device->link); pointer = weston_seat_get_pointer(seat); if (seat->output && pointer) weston_pointer_clamp(pointer, &pointer->x, &pointer->y); output_name = libinput_device_get_output_name(libinput_device); if (output_name) { device->output_name = strdup(output_name); wl_list_for_each(output, &c->output_list, link) if (output->name && strcmp(output->name, device->output_name) == 0) evdev_device_set_output(device, output); } else if (device->output == NULL && !wl_list_empty(&c->output_list)) { output = container_of(c->output_list.next, struct weston_output, link); evdev_device_set_output(device, output); } if (!input->suspended) weston_seat_repick(seat); } static void device_removed(struct udev_input *input, struct libinput_device *libinput_device) { struct evdev_device *device; device = libinput_device_get_user_data(libinput_device); evdev_device_destroy(device); } static void udev_seat_remove_devices(struct udev_seat *seat) { struct evdev_device *device, *next; wl_list_for_each_safe(device, next, &seat->devices_list, link) { evdev_device_destroy(device); } } void udev_input_disable(struct udev_input *input) { if (input->suspended) return; libinput_suspend(input->libinput); process_events(input); input->suspended = 1; } static int udev_input_process_event(struct libinput_event *event) { struct libinput *libinput = libinput_event_get_context(event); struct libinput_device *libinput_device = libinput_event_get_device(event); struct udev_input *input = libinput_get_user_data(libinput); int handled = 1; switch (libinput_event_get_type(event)) { case LIBINPUT_EVENT_DEVICE_ADDED: device_added(input, libinput_device); break; case LIBINPUT_EVENT_DEVICE_REMOVED: device_removed(input, libinput_device); break; default: handled = 0; } return handled; } static void process_event(struct libinput_event *event) { if (udev_input_process_event(event)) return; if (evdev_device_process_event(event)) return; } static void process_events(struct udev_input *input) { struct libinput_event *event; while ((event = libinput_get_event(input->libinput))) { process_event(event); libinput_event_destroy(event); } } static int udev_input_dispatch(struct udev_input *input) { if (libinput_dispatch(input->libinput) != 0) weston_log("libinput: Failed to dispatch libinput\n"); process_events(input); return 0; } static int libinput_source_dispatch(int fd, uint32_t mask, void *data) { struct udev_input *input = data; return udev_input_dispatch(input) != 0; } static int open_restricted(const char *path, int flags, void *user_data) { struct udev_input *input = user_data; struct weston_launcher *launcher = input->compositor->launcher; return weston_launcher_open(launcher, path, flags); } static void close_restricted(int fd, void *user_data) { struct udev_input *input = user_data; struct weston_launcher *launcher = input->compositor->launcher; weston_launcher_close(launcher, fd); } const struct libinput_interface libinput_interface = { open_restricted, close_restricted, }; int udev_input_enable(struct udev_input *input) { struct wl_event_loop *loop; struct weston_compositor *c = input->compositor; int fd; struct udev_seat *seat; int devices_found = 0; loop = wl_display_get_event_loop(c->wl_display); fd = libinput_get_fd(input->libinput); input->libinput_source = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, libinput_source_dispatch, input); if (!input->libinput_source) { return -1; } if (input->suspended) { if (libinput_resume(input->libinput) != 0) { wl_event_source_remove(input->libinput_source); input->libinput_source = NULL; return -1; } input->suspended = 0; process_events(input); } wl_list_for_each(seat, &input->compositor->seat_list, base.link) { evdev_notify_keyboard_focus(&seat->base, &seat->devices_list); if (!wl_list_empty(&seat->devices_list)) devices_found = 1; } if (devices_found == 0) { weston_log( "warning: no input devices on entering Weston. " "Possible causes:\n" "\t- no permissions to read /dev/input/event*\n" "\t- seats misconfigured " "(Weston backend option 'seat', " "udev device property ID_SEAT)\n"); return -1; } return 0; } static void libinput_log_func(struct libinput *libinput, enum libinput_log_priority priority, const char *format, va_list args) { weston_vlog(format, args); } int udev_input_init(struct udev_input *input, struct weston_compositor *c, struct udev *udev, const char *seat_id) { enum libinput_log_priority priority = LIBINPUT_LOG_PRIORITY_INFO; const char *log_priority = NULL; memset(input, 0, sizeof *input); input->compositor = c; log_priority = getenv("WESTON_LIBINPUT_LOG_PRIORITY"); input->libinput = libinput_udev_create_context(&libinput_interface, input, udev); if (!input->libinput) { return -1; } libinput_log_set_handler(input->libinput, &libinput_log_func); if (log_priority) { if (strcmp(log_priority, "debug") == 0) { priority = LIBINPUT_LOG_PRIORITY_DEBUG; } else if (strcmp(log_priority, "info") == 0) { priority = LIBINPUT_LOG_PRIORITY_INFO; } else if (strcmp(log_priority, "error") == 0) { priority = LIBINPUT_LOG_PRIORITY_ERROR; } } libinput_log_set_priority(input->libinput, priority); if (libinput_udev_assign_seat(input->libinput, seat_id) != 0) { libinput_unref(input->libinput); return -1; } process_events(input); return udev_input_enable(input); } void udev_input_destroy(struct udev_input *input) { struct udev_seat *seat, *next; wl_event_source_remove(input->libinput_source); wl_list_for_each_safe(seat, next, &input->compositor->seat_list, base.link) udev_seat_destroy(seat); libinput_unref(input->libinput); } static void udev_seat_led_update(struct weston_seat *seat_base, enum weston_led leds) { struct udev_seat *seat = (struct udev_seat *) seat_base; struct evdev_device *device; wl_list_for_each(device, &seat->devices_list, link) evdev_led_update(device, leds); } static void notify_output_create(struct wl_listener *listener, void *data) { struct udev_seat *seat = container_of(listener, struct udev_seat, output_create_listener); struct evdev_device *device; struct weston_output *output = data; wl_list_for_each(device, &seat->devices_list, link) { if (device->output_name && strcmp(output->name, device->output_name) == 0) { evdev_device_set_output(device, output); } if (device->output_name == NULL && device->output == NULL) evdev_device_set_output(device, output); } } static struct udev_seat * udev_seat_create(struct udev_input *input, const char *seat_name) { struct weston_compositor *c = input->compositor; struct udev_seat *seat; seat = zalloc(sizeof *seat); if (!seat) return NULL; weston_seat_init(&seat->base, c, seat_name); seat->base.led_update = udev_seat_led_update; seat->output_create_listener.notify = notify_output_create; wl_signal_add(&c->output_created_signal, &seat->output_create_listener); wl_list_init(&seat->devices_list); return seat; } static void udev_seat_destroy(struct udev_seat *seat) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(&seat->base); if (keyboard) notify_keyboard_focus_out(&seat->base); udev_seat_remove_devices(seat); weston_seat_release(&seat->base); wl_list_remove(&seat->output_create_listener.link); free(seat); } struct udev_seat * udev_seat_get_named(struct udev_input *input, const char *seat_name) { struct udev_seat *seat; wl_list_for_each(seat, &input->compositor->seat_list, base.link) { if (strcmp(seat->base.seat_name, seat_name) == 0) return seat; } return udev_seat_create(input, seat_name); } weston-1.9.0/src/compositor-headless.c0000664000175000017500000001656412550056655014727 00000000000000/* * Copyright © 2010-2011 Benjamin Franzke * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include "shared/helpers.h" #include "compositor.h" #include "pixman-renderer.h" #include "presentation_timing-server-protocol.h" struct headless_backend { struct weston_backend base; struct weston_compositor *compositor; struct weston_seat fake_seat; bool use_pixman; }; struct headless_output { struct weston_output base; struct weston_mode mode; struct wl_event_source *finish_frame_timer; uint32_t *image_buf; pixman_image_t *image; }; struct headless_parameters { int width; int height; int use_pixman; uint32_t transform; }; static void headless_output_start_repaint_loop(struct weston_output *output) { struct timespec ts; weston_compositor_read_presentation_clock(output->compositor, &ts); weston_output_finish_frame(output, &ts, PRESENTATION_FEEDBACK_INVALID); } static int finish_frame_handler(void *data) { struct headless_output *output = data; struct timespec ts; weston_compositor_read_presentation_clock(output->base.compositor, &ts); weston_output_finish_frame(&output->base, &ts, 0); return 1; } static int headless_output_repaint(struct weston_output *output_base, pixman_region32_t *damage) { struct headless_output *output = (struct headless_output *) output_base; struct weston_compositor *ec = output->base.compositor; ec->renderer->repaint_output(&output->base, damage); pixman_region32_subtract(&ec->primary_plane.damage, &ec->primary_plane.damage, damage); wl_event_source_timer_update(output->finish_frame_timer, 16); return 0; } static void headless_output_destroy(struct weston_output *output_base) { struct headless_output *output = (struct headless_output *) output_base; struct headless_backend *b = (struct headless_backend *) output->base.compositor->backend; wl_event_source_remove(output->finish_frame_timer); if (b->use_pixman) { pixman_renderer_output_destroy(&output->base); pixman_image_unref(output->image); free(output->image_buf); } weston_output_destroy(&output->base); free(output); return; } static int headless_backend_create_output(struct headless_backend *b, struct headless_parameters *param) { struct weston_compositor *c = b->compositor; struct headless_output *output; struct wl_event_loop *loop; output = zalloc(sizeof *output); if (output == NULL) return -1; output->mode.flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED; output->mode.width = param->width; output->mode.height = param->height; output->mode.refresh = 60000; wl_list_init(&output->base.mode_list); wl_list_insert(&output->base.mode_list, &output->mode.link); output->base.current_mode = &output->mode; weston_output_init(&output->base, c, 0, 0, param->width, param->height, param->transform, 1); output->base.make = "weston"; output->base.model = "headless"; loop = wl_display_get_event_loop(c->wl_display); output->finish_frame_timer = wl_event_loop_add_timer(loop, finish_frame_handler, output); output->base.start_repaint_loop = headless_output_start_repaint_loop; output->base.repaint = headless_output_repaint; output->base.destroy = headless_output_destroy; output->base.assign_planes = NULL; output->base.set_backlight = NULL; output->base.set_dpms = NULL; output->base.switch_mode = NULL; if (b->use_pixman) { output->image_buf = malloc(param->width * param->height * 4); if (!output->image_buf) return -1; output->image = pixman_image_create_bits(PIXMAN_x8r8g8b8, param->width, param->height, output->image_buf, param->width * 4); if (pixman_renderer_output_create(&output->base) < 0) return -1; pixman_renderer_output_set_buffer(&output->base, output->image); } weston_compositor_add_output(c, &output->base); return 0; } static int headless_input_create(struct headless_backend *b) { weston_seat_init(&b->fake_seat, b->compositor, "default"); weston_seat_init_pointer(&b->fake_seat); if (weston_seat_init_keyboard(&b->fake_seat, NULL) < 0) return -1; return 0; } static void headless_input_destroy(struct headless_backend *b) { weston_seat_release(&b->fake_seat); } static void headless_restore(struct weston_compositor *ec) { } static void headless_destroy(struct weston_compositor *ec) { struct headless_backend *b = (struct headless_backend *) ec->backend; headless_input_destroy(b); weston_compositor_shutdown(ec); free(b); } static struct headless_backend * headless_backend_create(struct weston_compositor *compositor, struct headless_parameters *param, const char *display_name) { struct headless_backend *b; b = zalloc(sizeof *b); if (b == NULL) return NULL; b->compositor = compositor; if (weston_compositor_set_presentation_clock_software(compositor) < 0) goto err_free; if (headless_input_create(b) < 0) goto err_free; b->base.destroy = headless_destroy; b->base.restore = headless_restore; b->use_pixman = param->use_pixman; if (b->use_pixman) { pixman_renderer_init(compositor); } if (headless_backend_create_output(b, param) < 0) goto err_input; if (!b->use_pixman && noop_renderer_init(compositor) < 0) goto err_input; compositor->backend = &b->base; return b; err_input: weston_compositor_shutdown(compositor); headless_input_destroy(b); err_free: free(b); return NULL; } WL_EXPORT int backend_init(struct weston_compositor *compositor, int *argc, char *argv[], struct weston_config *config) { int width = 1024, height = 640; char *display_name = NULL; struct headless_parameters param = { 0, }; const char *transform = "normal"; struct headless_backend *b; const struct weston_option headless_options[] = { { WESTON_OPTION_INTEGER, "width", 0, &width }, { WESTON_OPTION_INTEGER, "height", 0, &height }, { WESTON_OPTION_BOOLEAN, "use-pixman", 0, ¶m.use_pixman }, { WESTON_OPTION_STRING, "transform", 0, &transform }, }; parse_options(headless_options, ARRAY_LENGTH(headless_options), argc, argv); param.width = width; param.height = height; if (weston_parse_transform(transform, ¶m.transform) < 0) weston_log("Invalid transform \"%s\"\n", transform); b = headless_backend_create(compositor, ¶m, display_name); if (b == NULL) return -1; return 0; } weston-1.9.0/src/gl-renderer.h0000664000175000017500000001007312537627702013145 00000000000000/* * Copyright © 2012 John Kåre Alsaker * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "compositor.h" #ifdef ENABLE_EGL #include #include #else typedef int EGLint; typedef int EGLenum; typedef void *EGLDisplay; typedef void *EGLSurface; typedef void *EGLConfig; typedef intptr_t EGLNativeDisplayType; typedef intptr_t EGLNativeWindowType; #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) #endif /* ENABLE_EGL */ #ifndef EGL_EXT_platform_base typedef EGLDisplay (*PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); typedef EGLSurface (*PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list); #endif #ifndef EGL_PLATFORM_GBM_KHR #define EGL_PLATFORM_GBM_KHR 0x31D7 #endif #ifndef EGL_PLATFORM_WAYLAND_KHR #define EGL_PLATFORM_WAYLAND_KHR 0x31D8 #endif #ifndef EGL_PLATFORM_X11_KHR #define EGL_PLATFORM_X11_KHR 0x31D5 #endif #define NO_EGL_PLATFORM 0 enum gl_renderer_border_side { GL_RENDERER_BORDER_TOP = 0, GL_RENDERER_BORDER_LEFT = 1, GL_RENDERER_BORDER_RIGHT = 2, GL_RENDERER_BORDER_BOTTOM = 3, }; struct gl_renderer_interface { const EGLint *opaque_attribs; const EGLint *alpha_attribs; int (*create)(struct weston_compositor *ec, EGLenum platform, void *native_window, const EGLint *attribs, const EGLint *visual_id, const int n_ids); EGLDisplay (*display)(struct weston_compositor *ec); int (*output_create)(struct weston_output *output, EGLNativeWindowType window_for_legacy, void *window_for_platform, const EGLint *attribs, const EGLint *visual_id, const int n_ids); void (*output_destroy)(struct weston_output *output); EGLSurface (*output_surface)(struct weston_output *output); /* Sets the output border. * * The side specifies the side for which we are setting the border. * The width and height are the width and height of the border. * The tex_width patemeter specifies the width of the actual * texture; this may be larger than width if the data is not * tightly packed. * * The top and bottom textures will extend over the sides to the * full width of the bordered window. The right and left edges, * however, will extend only to the top and bottom of the * compositor surface. This is demonstrated by the picture below: * * +-----------------------+ * | TOP | * +-+-------------------+-+ * | | | | * |L| |R| * |E| |I| * |F| |G| * |T| |H| * | | |T| * | | | | * +-+-------------------+-+ * | BOTTOM | * +-----------------------+ */ void (*output_set_border)(struct weston_output *output, enum gl_renderer_border_side side, int32_t width, int32_t height, int32_t tex_width, unsigned char *data); void (*print_egl_error_state)(void); }; weston-1.9.0/src/launcher-util.h0000664000175000017500000000343212537627702013514 00000000000000/* * Copyright © 2012 Benjamin Franzke * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_LAUNCHER_UTIL_H_ #define _WESTON_LAUNCHER_UTIL_H_ #include "config.h" #include "compositor.h" struct weston_launcher; struct weston_launcher * weston_launcher_connect(struct weston_compositor *compositor, int tty, const char *seat_id, bool sync_drm); void weston_launcher_destroy(struct weston_launcher *launcher); int weston_launcher_open(struct weston_launcher *launcher, const char *path, int flags); void weston_launcher_close(struct weston_launcher *launcher, int fd); int weston_launcher_activate_vt(struct weston_launcher *launcher, int vt); void weston_launcher_restore(struct weston_launcher *launcher); #endif weston-1.9.0/src/launcher-util.c0000664000175000017500000002601012537627702013504 00000000000000/* * Copyright © 2012 Benjamin Franzke * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "launcher-util.h" #include "logind-util.h" #include "weston-launch.h" #define DRM_MAJOR 226 #ifndef KDSKBMUTE #define KDSKBMUTE 0x4B51 #endif #ifdef HAVE_LIBDRM #include static inline int is_drm_master(int drm_fd) { drm_magic_t magic; return drmGetMagic(drm_fd, &magic) == 0 && drmAuthMagic(drm_fd, magic) == 0; } #else static inline int drmDropMaster(int drm_fd) { return 0; } static inline int drmSetMaster(int drm_fd) { return 0; } static inline int is_drm_master(int drm_fd) { return 0; } #endif union cmsg_data { unsigned char b[4]; int fd; }; struct weston_launcher { struct weston_compositor *compositor; struct weston_logind *logind; struct wl_event_loop *loop; int fd; struct wl_event_source *source; int kb_mode, tty, drm_fd; struct wl_event_source *vt_source; }; int weston_launcher_open(struct weston_launcher *launcher, const char *path, int flags) { int n, fd, ret = -1; struct msghdr msg; struct cmsghdr *cmsg; struct iovec iov; union cmsg_data *data; char control[CMSG_SPACE(sizeof data->fd)]; ssize_t len; struct weston_launcher_open *message; struct stat s; /* We really don't want to be leaking fds to child processes so * we force this flag here. If someone comes up with a legitimate * reason to not CLOEXEC they'll need to unset the flag manually. */ flags |= O_CLOEXEC; if (launcher->logind) return weston_logind_open(launcher->logind, path, flags); if (launcher->fd == -1) { fd = open(path, flags); if (fd == -1) return -1; if (fstat(fd, &s) == -1) { close(fd); return -1; } if (major(s.st_rdev) == DRM_MAJOR) { launcher->drm_fd = fd; if (!is_drm_master(fd)) { weston_log("drm fd not master\n"); close(fd); return -1; } } return fd; } n = sizeof(*message) + strlen(path) + 1; message = malloc(n); if (!message) return -1; message->header.opcode = WESTON_LAUNCHER_OPEN; message->flags = flags; strcpy(message->path, path); do { len = send(launcher->fd, message, n, 0); } while (len < 0 && errno == EINTR); free(message); memset(&msg, 0, sizeof msg); iov.iov_base = &ret; iov.iov_len = sizeof ret; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = control; msg.msg_controllen = sizeof control; do { len = recvmsg(launcher->fd, &msg, MSG_CMSG_CLOEXEC); } while (len < 0 && errno == EINTR); if (len != sizeof ret || ret < 0) return -1; cmsg = CMSG_FIRSTHDR(&msg); if (!cmsg || cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) { fprintf(stderr, "invalid control message\n"); return -1; } data = (union cmsg_data *) CMSG_DATA(cmsg); if (data->fd == -1) { fprintf(stderr, "missing drm fd in socket request\n"); return -1; } return data->fd; } void weston_launcher_close(struct weston_launcher *launcher, int fd) { if (launcher->logind) weston_logind_close(launcher->logind, fd); close(fd); } void weston_launcher_restore(struct weston_launcher *launcher) { struct vt_mode mode = { 0 }; if (launcher->logind) return weston_logind_restore(launcher->logind); if (ioctl(launcher->tty, KDSKBMUTE, 0) && ioctl(launcher->tty, KDSKBMODE, launcher->kb_mode)) weston_log("failed to restore kb mode: %m\n"); if (ioctl(launcher->tty, KDSETMODE, KD_TEXT)) weston_log("failed to set KD_TEXT mode on tty: %m\n"); /* We have to drop master before we switch the VT back in * VT_AUTO, so we don't risk switching to a VT with another * display server, that will then fail to set drm master. */ drmDropMaster(launcher->drm_fd); mode.mode = VT_AUTO; if (ioctl(launcher->tty, VT_SETMODE, &mode) < 0) weston_log("could not reset vt handling\n"); } static int weston_launcher_data(int fd, uint32_t mask, void *data) { struct weston_launcher *launcher = data; int len, ret; if (mask & (WL_EVENT_HANGUP | WL_EVENT_ERROR)) { weston_log("launcher socket closed, exiting\n"); /* Normally the weston-launch will reset the tty, but * in this case it died or something, so do it here so * we don't end up with a stuck vt. */ weston_launcher_restore(launcher); exit(-1); } do { len = recv(launcher->fd, &ret, sizeof ret, 0); } while (len < 0 && errno == EINTR); switch (ret) { case WESTON_LAUNCHER_ACTIVATE: launcher->compositor->session_active = 1; wl_signal_emit(&launcher->compositor->session_signal, launcher->compositor); break; case WESTON_LAUNCHER_DEACTIVATE: launcher->compositor->session_active = 0; wl_signal_emit(&launcher->compositor->session_signal, launcher->compositor); break; default: weston_log("unexpected event from weston-launch\n"); break; } return 1; } static int vt_handler(int signal_number, void *data) { struct weston_launcher *launcher = data; struct weston_compositor *compositor = launcher->compositor; if (compositor->session_active) { compositor->session_active = 0; wl_signal_emit(&compositor->session_signal, compositor); drmDropMaster(launcher->drm_fd); ioctl(launcher->tty, VT_RELDISP, 1); } else { ioctl(launcher->tty, VT_RELDISP, VT_ACKACQ); drmSetMaster(launcher->drm_fd); compositor->session_active = 1; wl_signal_emit(&compositor->session_signal, compositor); } return 1; } static int setup_tty(struct weston_launcher *launcher, int tty) { struct wl_event_loop *loop; struct vt_mode mode = { 0 }; struct stat buf; char tty_device[32] =""; int ret, kd_mode; if (tty == 0) { launcher->tty = dup(tty); if (launcher->tty == -1) { weston_log("couldn't dup stdin: %m\n"); return -1; } } else { snprintf(tty_device, sizeof tty_device, "/dev/tty%d", tty); launcher->tty = open(tty_device, O_RDWR | O_CLOEXEC); if (launcher->tty == -1) { weston_log("couldn't open tty %s: %m\n", tty_device); return -1; } } if (fstat(launcher->tty, &buf) == -1 || major(buf.st_rdev) != TTY_MAJOR || minor(buf.st_rdev) == 0) { weston_log("%s not a vt\n", tty_device); weston_log("if running weston from ssh, " "use --tty to specify a tty\n"); goto err_close; } ret = ioctl(launcher->tty, KDGETMODE, &kd_mode); if (ret) { weston_log("failed to get VT mode: %m\n"); return -1; } if (kd_mode != KD_TEXT) { weston_log("%s is already in graphics mode, " "is another display server running?\n", tty_device); goto err_close; } ioctl(launcher->tty, VT_ACTIVATE, minor(buf.st_rdev)); ioctl(launcher->tty, VT_WAITACTIVE, minor(buf.st_rdev)); if (ioctl(launcher->tty, KDGKBMODE, &launcher->kb_mode)) { weston_log("failed to read keyboard mode: %m\n"); goto err_close; } if (ioctl(launcher->tty, KDSKBMUTE, 1) && ioctl(launcher->tty, KDSKBMODE, K_OFF)) { weston_log("failed to set K_OFF keyboard mode: %m\n"); goto err_close; } ret = ioctl(launcher->tty, KDSETMODE, KD_GRAPHICS); if (ret) { weston_log("failed to set KD_GRAPHICS mode on tty: %m\n"); goto err_close; } /* * SIGRTMIN is used as global VT-acquire+release signal. Note that * SIGRT* must be tested on runtime, as their exact values are not * known at compile-time. POSIX requires 32 of them to be available. */ if (SIGRTMIN > SIGRTMAX) { weston_log("not enough RT signals available: %u-%u\n", SIGRTMIN, SIGRTMAX); ret = -EINVAL; goto err_close; } mode.mode = VT_PROCESS; mode.relsig = SIGRTMIN; mode.acqsig = SIGRTMIN; if (ioctl(launcher->tty, VT_SETMODE, &mode) < 0) { weston_log("failed to take control of vt handling\n"); goto err_close; } loop = wl_display_get_event_loop(launcher->compositor->wl_display); launcher->vt_source = wl_event_loop_add_signal(loop, SIGRTMIN, vt_handler, launcher); if (!launcher->vt_source) goto err_close; return 0; err_close: close(launcher->tty); return -1; } int weston_launcher_activate_vt(struct weston_launcher *launcher, int vt) { if (launcher->logind) return weston_logind_activate_vt(launcher->logind, vt); return ioctl(launcher->tty, VT_ACTIVATE, vt); } struct weston_launcher * weston_launcher_connect(struct weston_compositor *compositor, int tty, const char *seat_id, bool sync_drm) { struct weston_launcher *launcher; struct wl_event_loop *loop; int r; launcher = malloc(sizeof *launcher); if (launcher == NULL) return NULL; launcher->logind = NULL; launcher->compositor = compositor; launcher->drm_fd = -1; launcher->fd = weston_environment_get_fd("WESTON_LAUNCHER_SOCK"); if (launcher->fd != -1) { launcher->tty = weston_environment_get_fd("WESTON_TTY_FD"); /* We don't get a chance to read out the original kb * mode for the tty, so just hard code K_UNICODE here * in case we have to clean if weston-launch dies. */ launcher->kb_mode = K_UNICODE; loop = wl_display_get_event_loop(compositor->wl_display); launcher->source = wl_event_loop_add_fd(loop, launcher->fd, WL_EVENT_READABLE, weston_launcher_data, launcher); if (launcher->source == NULL) { free(launcher); return NULL; } } else { r = weston_logind_connect(&launcher->logind, compositor, seat_id, tty, sync_drm); if (r < 0) { launcher->logind = NULL; if (geteuid() == 0) { if (setup_tty(launcher, tty) == -1) { free(launcher); return NULL; } } else { free(launcher); return NULL; } } } return launcher; } void weston_launcher_destroy(struct weston_launcher *launcher) { if (launcher->logind) { weston_logind_destroy(launcher->logind); } else if (launcher->fd != -1) { close(launcher->fd); wl_event_source_remove(launcher->source); } else { weston_launcher_restore(launcher); wl_event_source_remove(launcher->vt_source); } if (launcher->tty >= 0) close(launcher->tty); free(launcher); } weston-1.9.0/src/vertex-clipping.h0000664000175000017500000000326012537627702014057 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_VERTEX_CLIPPING_H #define _WESTON_VERTEX_CLIPPING_H struct polygon8 { float x[8]; float y[8]; int n; }; struct clip_context { struct { float x; float y; } prev; struct { float x1, y1; float x2, y2; } clip; struct { float *x; float *y; } vertices; }; float float_difference(float a, float b); int clip_simple(struct clip_context *ctx, struct polygon8 *surf, float *ex, float *ey); int clip_transformed(struct clip_context *ctx, struct polygon8 *surf, float *ex, float *ey);\ #endif weston-1.9.0/src/animation.c0000664000175000017500000003140212537664716012716 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "compositor.h" #include "shared/helpers.h" WL_EXPORT void weston_spring_init(struct weston_spring *spring, double k, double current, double target) { spring->k = k; spring->friction = 400.0; spring->current = current; spring->previous = current; spring->target = target; spring->clip = WESTON_SPRING_OVERSHOOT; spring->min = 0.0; spring->max = 1.0; } WL_EXPORT void weston_spring_update(struct weston_spring *spring, uint32_t msec) { double force, v, current, step; /* Limit the number of executions of the loop below by ensuring that * the timestamp for last update of the spring is no more than 1s ago. * This handles the case where time moves backwards or forwards in * large jumps. */ if (msec - spring->timestamp > 1000) { weston_log("unexpectedly large timestamp jump (from %u to %u)\n", spring->timestamp, msec); spring->timestamp = msec - 1000; } step = 0.01; while (4 < msec - spring->timestamp) { current = spring->current; v = current - spring->previous; force = spring->k * (spring->target - current) / 10.0 + (spring->previous - current) - v * spring->friction; spring->current = current + (current - spring->previous) + force * step * step; spring->previous = current; switch (spring->clip) { case WESTON_SPRING_OVERSHOOT: break; case WESTON_SPRING_CLAMP: if (spring->current > spring->max) { spring->current = spring->max; spring->previous = spring->max; } else if (spring->current < 0.0) { spring->current = spring->min; spring->previous = spring->min; } break; case WESTON_SPRING_BOUNCE: if (spring->current > spring->max) { spring->current = 2 * spring->max - spring->current; spring->previous = 2 * spring->max - spring->previous; } else if (spring->current < spring->min) { spring->current = 2 * spring->min - spring->current; spring->previous = 2 * spring->min - spring->previous; } break; } spring->timestamp += 4; } } WL_EXPORT int weston_spring_done(struct weston_spring *spring) { return fabs(spring->previous - spring->target) < 0.002 && fabs(spring->current - spring->target) < 0.002; } typedef void (*weston_view_animation_frame_func_t)(struct weston_view_animation *animation); struct weston_view_animation { struct weston_view *view; struct weston_animation animation; struct weston_spring spring; struct weston_transform transform; struct wl_listener listener; float start, stop; weston_view_animation_frame_func_t frame; weston_view_animation_frame_func_t reset; weston_view_animation_done_func_t done; void *data; void *private; }; WL_EXPORT void weston_view_animation_destroy(struct weston_view_animation *animation) { wl_list_remove(&animation->animation.link); wl_list_remove(&animation->listener.link); wl_list_remove(&animation->transform.link); if (animation->reset) animation->reset(animation); weston_view_geometry_dirty(animation->view); if (animation->done) animation->done(animation, animation->data); free(animation); } static void handle_animation_view_destroy(struct wl_listener *listener, void *data) { struct weston_view_animation *animation = container_of(listener, struct weston_view_animation, listener); weston_view_animation_destroy(animation); } static void weston_view_animation_frame(struct weston_animation *base, struct weston_output *output, uint32_t msecs) { struct weston_view_animation *animation = container_of(base, struct weston_view_animation, animation); struct weston_compositor *compositor = animation->view->surface->compositor; if (base->frame_counter <= 1) animation->spring.timestamp = msecs; weston_spring_update(&animation->spring, msecs); if (weston_spring_done(&animation->spring)) { weston_view_schedule_repaint(animation->view); weston_view_animation_destroy(animation); return; } if (animation->frame) animation->frame(animation); weston_view_geometry_dirty(animation->view); weston_view_schedule_repaint(animation->view); /* The view's output_mask will be zero if its position is * offscreen. Animations should always run but as they are also * run off the repaint cycle, if there's nothing to repaint * the animation stops running. Therefore if we catch this situation * and schedule a repaint on all outputs it will be avoided. */ if (animation->view->output_mask == 0) weston_compositor_schedule_repaint(compositor); } static struct weston_view_animation * weston_view_animation_create(struct weston_view *view, float start, float stop, weston_view_animation_frame_func_t frame, weston_view_animation_frame_func_t reset, weston_view_animation_done_func_t done, void *data, void *private) { struct weston_view_animation *animation; animation = malloc(sizeof *animation); if (!animation) return NULL; animation->view = view; animation->frame = frame; animation->reset = reset; animation->done = done; animation->data = data; animation->start = start; animation->stop = stop; animation->private = private; weston_matrix_init(&animation->transform.matrix); wl_list_insert(&view->geometry.transformation_list, &animation->transform.link); animation->animation.frame = weston_view_animation_frame; animation->listener.notify = handle_animation_view_destroy; wl_signal_add(&view->destroy_signal, &animation->listener); wl_list_insert(&view->output->animation_list, &animation->animation.link); return animation; } static void weston_view_animation_run(struct weston_view_animation *animation) { animation->animation.frame_counter = 0; weston_view_animation_frame(&animation->animation, NULL, 0); } static void reset_alpha(struct weston_view_animation *animation) { struct weston_view *view = animation->view; view->alpha = animation->stop; } static void zoom_frame(struct weston_view_animation *animation) { struct weston_view *es = animation->view; float scale; scale = animation->start + (animation->stop - animation->start) * animation->spring.current; weston_matrix_init(&animation->transform.matrix); weston_matrix_translate(&animation->transform.matrix, -0.5f * es->surface->width, -0.5f * es->surface->height, 0); weston_matrix_scale(&animation->transform.matrix, scale, scale, scale); weston_matrix_translate(&animation->transform.matrix, 0.5f * es->surface->width, 0.5f * es->surface->height, 0); es->alpha = animation->spring.current; if (es->alpha > 1.0) es->alpha = 1.0; } WL_EXPORT struct weston_view_animation * weston_zoom_run(struct weston_view *view, float start, float stop, weston_view_animation_done_func_t done, void *data) { struct weston_view_animation *zoom; zoom = weston_view_animation_create(view, start, stop, zoom_frame, reset_alpha, done, data, NULL); if (zoom == NULL) return NULL; weston_spring_init(&zoom->spring, 300.0, start, stop); zoom->spring.friction = 1400; zoom->spring.previous = start - (stop - start) * 0.03; weston_view_animation_run(zoom); return zoom; } static void fade_frame(struct weston_view_animation *animation) { if (animation->spring.current > 0.999) animation->view->alpha = 1; else if (animation->spring.current < 0.001 ) animation->view->alpha = 0; else animation->view->alpha = animation->spring.current; } WL_EXPORT struct weston_view_animation * weston_fade_run(struct weston_view *view, float start, float end, float k, weston_view_animation_done_func_t done, void *data) { struct weston_view_animation *fade; fade = weston_view_animation_create(view, start, end, fade_frame, reset_alpha, done, data, NULL); if (fade == NULL) return NULL; weston_spring_init(&fade->spring, 1000.0, start, end); fade->spring.friction = 4000; fade->spring.previous = start - (end - start) * 0.1; view->alpha = start; weston_view_animation_run(fade); return fade; } WL_EXPORT void weston_fade_update(struct weston_view_animation *fade, float target) { fade->spring.target = target; fade->stop = target; } static void stable_fade_frame(struct weston_view_animation *animation) { struct weston_view *back_view; if (animation->spring.current > 0.999) animation->view->alpha = 1; else if (animation->spring.current < 0.001 ) animation->view->alpha = 0; else animation->view->alpha = animation->spring.current; back_view = (struct weston_view *) animation->private; back_view->alpha = (animation->spring.target - animation->view->alpha) / (1.0 - animation->view->alpha); weston_view_geometry_dirty(back_view); } WL_EXPORT struct weston_view_animation * weston_stable_fade_run(struct weston_view *front_view, float start, struct weston_view *back_view, float end, weston_view_animation_done_func_t done, void *data) { struct weston_view_animation *fade; fade = weston_view_animation_create(front_view, 0, 0, stable_fade_frame, NULL, done, data, back_view); if (fade == NULL) return NULL; weston_spring_init(&fade->spring, 400, start, end); fade->spring.friction = 1150; front_view->alpha = start; back_view->alpha = end; weston_view_animation_run(fade); return fade; } static void slide_frame(struct weston_view_animation *animation) { float scale; scale = animation->start + (animation->stop - animation->start) * animation->spring.current; weston_matrix_init(&animation->transform.matrix); weston_matrix_translate(&animation->transform.matrix, 0, scale, 0); } WL_EXPORT struct weston_view_animation * weston_slide_run(struct weston_view *view, float start, float stop, weston_view_animation_done_func_t done, void *data) { struct weston_view_animation *animation; animation = weston_view_animation_create(view, start, stop, slide_frame, NULL, done, data, NULL); if (!animation) return NULL; weston_spring_init(&animation->spring, 400.0, 0.0, 1.0); animation->spring.friction = 600; animation->spring.clip = WESTON_SPRING_BOUNCE; weston_view_animation_run(animation); return animation; } struct weston_move_animation { int dx; int dy; int reverse; weston_view_animation_done_func_t done; }; static void move_frame(struct weston_view_animation *animation) { struct weston_move_animation *move = animation->private; float scale; float progress = animation->spring.current; if (move->reverse) progress = 1.0 - progress; scale = animation->start + (animation->stop - animation->start) * progress; weston_matrix_init(&animation->transform.matrix); weston_matrix_scale(&animation->transform.matrix, scale, scale, 1.0f); weston_matrix_translate(&animation->transform.matrix, move->dx * progress, move->dy * progress, 0); } static void move_done(struct weston_view_animation *animation, void *data) { struct weston_move_animation *move = animation->private; if (move->done) move->done(animation, data); free(move); } WL_EXPORT struct weston_view_animation * weston_move_scale_run(struct weston_view *view, int dx, int dy, float start, float end, int reverse, weston_view_animation_done_func_t done, void *data) { struct weston_move_animation *move; struct weston_view_animation *animation; move = malloc(sizeof(*move)); if (!move) return NULL; move->dx = dx; move->dy = dy; move->reverse = reverse; move->done = done; animation = weston_view_animation_create(view, start, end, move_frame, NULL, move_done, data, move); if (animation == NULL) return NULL; weston_spring_init(&animation->spring, 400.0, 0.0, 1.0); animation->spring.friction = 1150; weston_view_animation_run(animation); return animation; } weston-1.9.0/src/text-backend.c0000664000175000017500000007055412556771651013321 00000000000000/* * Copyright © 2012 Openismus GmbH * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "compositor.h" #include "text-server-protocol.h" #include "input-method-server-protocol.h" #include "shared/helpers.h" struct text_input_manager; struct input_method; struct input_method_context; struct text_backend; struct text_input { struct wl_resource *resource; struct weston_compositor *ec; struct wl_list input_methods; struct weston_surface *surface; pixman_box32_t cursor_rectangle; bool input_panel_visible; struct text_input_manager *manager; }; struct text_input_manager { struct wl_global *text_input_manager_global; struct wl_listener destroy_listener; struct text_input *current_panel; struct weston_compositor *ec; }; struct input_method { struct wl_resource *input_method_binding; struct wl_global *input_method_global; struct wl_listener destroy_listener; struct weston_seat *seat; struct text_input *input; struct wl_list link; struct wl_listener keyboard_focus_listener; bool focus_listener_initialized; struct input_method_context *context; struct text_backend *text_backend; }; struct input_method_context { struct wl_resource *resource; struct text_input *input; struct input_method *input_method; struct wl_resource *keyboard; }; struct text_backend { struct weston_compositor *compositor; struct { char *path; struct wl_resource *binding; struct weston_process process; struct wl_client *client; unsigned deathcount; uint32_t deathstamp; } input_method; struct wl_listener seat_created_listener; }; static void input_method_context_create(struct text_input *input, struct input_method *input_method); static void input_method_context_end_keyboard_grab(struct input_method_context *context); static void input_method_init_seat(struct weston_seat *seat); static void deactivate_input_method(struct input_method *input_method) { struct text_input *text_input = input_method->input; struct weston_compositor *ec = text_input->ec; if (input_method->context && input_method->input_method_binding) { input_method_context_end_keyboard_grab(input_method->context); wl_input_method_send_deactivate( input_method->input_method_binding, input_method->context->resource); } wl_list_remove(&input_method->link); input_method->input = NULL; input_method->context = NULL; if (wl_list_empty(&text_input->input_methods) && text_input->input_panel_visible) { wl_signal_emit(&ec->hide_input_panel_signal, ec); text_input->input_panel_visible = false; text_input->manager->current_panel = NULL; } wl_text_input_send_leave(text_input->resource); } static void destroy_text_input(struct wl_resource *resource) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) deactivate_input_method(input_method); free(text_input); } static void text_input_set_surrounding_text(struct wl_client *client, struct wl_resource *resource, const char *text, uint32_t cursor, uint32_t anchor) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) { if (!input_method->context) continue; wl_input_method_context_send_surrounding_text( input_method->context->resource, text, cursor, anchor); } } static void text_input_activate(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat, struct wl_resource *surface) { struct text_input *text_input = wl_resource_get_user_data(resource); struct weston_seat *weston_seat = wl_resource_get_user_data(seat); struct input_method *input_method = weston_seat->input_method; struct weston_compositor *ec = text_input->ec; struct text_input *current; if (input_method->input == text_input) return; if (input_method->input) deactivate_input_method(input_method); input_method->input = text_input; wl_list_insert(&text_input->input_methods, &input_method->link); input_method_init_seat(weston_seat); text_input->surface = wl_resource_get_user_data(surface); input_method_context_create(text_input, input_method); current = text_input->manager->current_panel; if (current && current != text_input) { current->input_panel_visible = false; wl_signal_emit(&ec->hide_input_panel_signal, ec); text_input->manager->current_panel = NULL; } if (text_input->input_panel_visible) { wl_signal_emit(&ec->show_input_panel_signal, text_input->surface); wl_signal_emit(&ec->update_input_panel_signal, &text_input->cursor_rectangle); text_input->manager->current_panel = text_input; } wl_text_input_send_enter(text_input->resource, text_input->surface->resource); } static void text_input_deactivate(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat) { struct weston_seat *weston_seat = wl_resource_get_user_data(seat); if (weston_seat->input_method->input) deactivate_input_method(weston_seat->input_method); } static void text_input_reset(struct wl_client *client, struct wl_resource *resource) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) { if (!input_method->context) continue; wl_input_method_context_send_reset( input_method->context->resource); } } static void text_input_set_cursor_rectangle(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct text_input *text_input = wl_resource_get_user_data(resource); struct weston_compositor *ec = text_input->ec; text_input->cursor_rectangle.x1 = x; text_input->cursor_rectangle.y1 = y; text_input->cursor_rectangle.x2 = x + width; text_input->cursor_rectangle.y2 = y + height; wl_signal_emit(&ec->update_input_panel_signal, &text_input->cursor_rectangle); } static void text_input_set_content_type(struct wl_client *client, struct wl_resource *resource, uint32_t hint, uint32_t purpose) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) { if (!input_method->context) continue; wl_input_method_context_send_content_type( input_method->context->resource, hint, purpose); } } static void text_input_invoke_action(struct wl_client *client, struct wl_resource *resource, uint32_t button, uint32_t index) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) { if (!input_method->context) continue; wl_input_method_context_send_invoke_action( input_method->context->resource, button, index); } } static void text_input_commit_state(struct wl_client *client, struct wl_resource *resource, uint32_t serial) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) { if (!input_method->context) continue; wl_input_method_context_send_commit_state( input_method->context->resource, serial); } } static void text_input_show_input_panel(struct wl_client *client, struct wl_resource *resource) { struct text_input *text_input = wl_resource_get_user_data(resource); struct weston_compositor *ec = text_input->ec; text_input->input_panel_visible = true; if (!wl_list_empty(&text_input->input_methods)) { wl_signal_emit(&ec->show_input_panel_signal, text_input->surface); wl_signal_emit(&ec->update_input_panel_signal, &text_input->cursor_rectangle); } } static void text_input_hide_input_panel(struct wl_client *client, struct wl_resource *resource) { struct text_input *text_input = wl_resource_get_user_data(resource); struct weston_compositor *ec = text_input->ec; text_input->input_panel_visible = false; if (!wl_list_empty(&text_input->input_methods) && text_input == text_input->manager->current_panel) { text_input->manager->current_panel = NULL; wl_signal_emit(&ec->hide_input_panel_signal, ec); } } static void text_input_set_preferred_language(struct wl_client *client, struct wl_resource *resource, const char *language) { struct text_input *text_input = wl_resource_get_user_data(resource); struct input_method *input_method, *next; wl_list_for_each_safe(input_method, next, &text_input->input_methods, link) { if (!input_method->context) continue; wl_input_method_context_send_preferred_language( input_method->context->resource, language); } } static const struct wl_text_input_interface text_input_implementation = { text_input_activate, text_input_deactivate, text_input_show_input_panel, text_input_hide_input_panel, text_input_reset, text_input_set_surrounding_text, text_input_set_content_type, text_input_set_cursor_rectangle, text_input_set_preferred_language, text_input_commit_state, text_input_invoke_action }; static void text_input_manager_create_text_input(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct text_input_manager *text_input_manager = wl_resource_get_user_data(resource); struct text_input *text_input; text_input = zalloc(sizeof *text_input); if (text_input == NULL) return; text_input->resource = wl_resource_create(client, &wl_text_input_interface, 1, id); wl_resource_set_implementation(text_input->resource, &text_input_implementation, text_input, destroy_text_input); text_input->ec = text_input_manager->ec; text_input->manager = text_input_manager; wl_list_init(&text_input->input_methods); }; static const struct wl_text_input_manager_interface manager_implementation = { text_input_manager_create_text_input }; static void bind_text_input_manager(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct text_input_manager *text_input_manager = data; struct wl_resource *resource; /* No checking for duplicate binding necessary. */ resource = wl_resource_create(client, &wl_text_input_manager_interface, 1, id); if (resource) wl_resource_set_implementation(resource, &manager_implementation, text_input_manager, NULL); } static void text_input_manager_notifier_destroy(struct wl_listener *listener, void *data) { struct text_input_manager *text_input_manager = container_of(listener, struct text_input_manager, destroy_listener); wl_global_destroy(text_input_manager->text_input_manager_global); free(text_input_manager); } static void text_input_manager_create(struct weston_compositor *ec) { struct text_input_manager *text_input_manager; text_input_manager = zalloc(sizeof *text_input_manager); if (text_input_manager == NULL) return; text_input_manager->ec = ec; text_input_manager->text_input_manager_global = wl_global_create(ec->wl_display, &wl_text_input_manager_interface, 1, text_input_manager, bind_text_input_manager); text_input_manager->destroy_listener.notify = text_input_manager_notifier_destroy; wl_signal_add(&ec->destroy_signal, &text_input_manager->destroy_listener); } static void input_method_context_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void input_method_context_commit_string(struct wl_client *client, struct wl_resource *resource, uint32_t serial, const char *text) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_commit_string(context->input->resource, serial, text); } static void input_method_context_preedit_string(struct wl_client *client, struct wl_resource *resource, uint32_t serial, const char *text, const char *commit) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_preedit_string(context->input->resource, serial, text, commit); } static void input_method_context_preedit_styling(struct wl_client *client, struct wl_resource *resource, uint32_t index, uint32_t length, uint32_t style) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_preedit_styling(context->input->resource, index, length, style); } static void input_method_context_preedit_cursor(struct wl_client *client, struct wl_resource *resource, int32_t cursor) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_preedit_cursor(context->input->resource, cursor); } static void input_method_context_delete_surrounding_text(struct wl_client *client, struct wl_resource *resource, int32_t index, uint32_t length) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_delete_surrounding_text( context->input->resource, index, length); } static void input_method_context_cursor_position(struct wl_client *client, struct wl_resource *resource, int32_t index, int32_t anchor) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_cursor_position(context->input->resource, index, anchor); } static void input_method_context_modifiers_map(struct wl_client *client, struct wl_resource *resource, struct wl_array *map) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_modifiers_map(context->input->resource, map); } static void input_method_context_keysym(struct wl_client *client, struct wl_resource *resource, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_keysym(context->input->resource, serial, time, sym, state, modifiers); } static void unbind_keyboard(struct wl_resource *resource) { struct input_method_context *context = wl_resource_get_user_data(resource); input_method_context_end_keyboard_grab(context); context->keyboard = NULL; } static void input_method_context_grab_key(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state_w) { struct weston_keyboard *keyboard = grab->keyboard; struct wl_display *display; uint32_t serial; if (!keyboard->input_method_resource) return; display = wl_client_get_display( wl_resource_get_client(keyboard->input_method_resource)); serial = wl_display_next_serial(display); wl_keyboard_send_key(keyboard->input_method_resource, serial, time, key, state_w); } static void input_method_context_grab_modifier(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct weston_keyboard *keyboard = grab->keyboard; if (!keyboard->input_method_resource) return; wl_keyboard_send_modifiers(keyboard->input_method_resource, serial, mods_depressed, mods_latched, mods_locked, group); } static void input_method_context_grab_cancel(struct weston_keyboard_grab *grab) { weston_keyboard_end_grab(grab->keyboard); } static const struct weston_keyboard_grab_interface input_method_context_grab = { input_method_context_grab_key, input_method_context_grab_modifier, input_method_context_grab_cancel, }; static void input_method_context_grab_keyboard(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct input_method_context *context = wl_resource_get_user_data(resource); struct wl_resource *cr; struct weston_seat *seat = context->input_method->seat; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); cr = wl_resource_create(client, &wl_keyboard_interface, 1, id); wl_resource_set_implementation(cr, NULL, context, unbind_keyboard); context->keyboard = cr; wl_keyboard_send_keymap(cr, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, keyboard->xkb_info->keymap_fd, keyboard->xkb_info->keymap_size); if (keyboard->grab != &keyboard->default_grab) { weston_keyboard_end_grab(keyboard); } weston_keyboard_start_grab(keyboard, &keyboard->input_method_grab); keyboard->input_method_resource = cr; } static void input_method_context_key(struct wl_client *client, struct wl_resource *resource, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w) { struct input_method_context *context = wl_resource_get_user_data(resource); struct weston_seat *seat = context->input_method->seat; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_keyboard_grab *default_grab = &keyboard->default_grab; default_grab->interface->key(default_grab, time, key, state_w); } static void input_method_context_modifiers(struct wl_client *client, struct wl_resource *resource, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct input_method_context *context = wl_resource_get_user_data(resource); struct weston_seat *seat = context->input_method->seat; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_keyboard_grab *default_grab = &keyboard->default_grab; default_grab->interface->modifiers(default_grab, serial, mods_depressed, mods_latched, mods_locked, group); } static void input_method_context_language(struct wl_client *client, struct wl_resource *resource, uint32_t serial, const char *language) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_language(context->input->resource, serial, language); } static void input_method_context_text_direction(struct wl_client *client, struct wl_resource *resource, uint32_t serial, uint32_t direction) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->input) wl_text_input_send_text_direction(context->input->resource, serial, direction); } static const struct wl_input_method_context_interface context_implementation = { input_method_context_destroy, input_method_context_commit_string, input_method_context_preedit_string, input_method_context_preedit_styling, input_method_context_preedit_cursor, input_method_context_delete_surrounding_text, input_method_context_cursor_position, input_method_context_modifiers_map, input_method_context_keysym, input_method_context_grab_keyboard, input_method_context_key, input_method_context_modifiers, input_method_context_language, input_method_context_text_direction }; static void destroy_input_method_context(struct wl_resource *resource) { struct input_method_context *context = wl_resource_get_user_data(resource); if (context->keyboard) wl_resource_destroy(context->keyboard); if (context->input_method && context->input_method->context == context) context->input_method->context = NULL; free(context); } static void input_method_context_create(struct text_input *input, struct input_method *input_method) { struct input_method_context *context; struct wl_resource *binding; if (!input_method->input_method_binding) return; context = zalloc(sizeof *context); if (context == NULL) return; binding = input_method->input_method_binding; context->resource = wl_resource_create(wl_resource_get_client(binding), &wl_input_method_context_interface, 1, 0); wl_resource_set_implementation(context->resource, &context_implementation, context, destroy_input_method_context); context->input = input; context->input_method = input_method; input_method->context = context; wl_input_method_send_activate(binding, context->resource); } static void input_method_context_end_keyboard_grab(struct input_method_context *context) { struct weston_keyboard_grab *grab; struct weston_keyboard *keyboard; keyboard = weston_seat_get_keyboard(context->input_method->seat); if (!keyboard) return; grab = &keyboard->input_method_grab; keyboard = grab->keyboard; if (!keyboard) return; if (keyboard->grab == grab) weston_keyboard_end_grab(keyboard); keyboard->input_method_resource = NULL; } static void unbind_input_method(struct wl_resource *resource) { struct input_method *input_method = wl_resource_get_user_data(resource); struct text_backend *text_backend = input_method->text_backend; input_method->input_method_binding = NULL; input_method->context = NULL; text_backend->input_method.binding = NULL; } static void bind_input_method(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct input_method *input_method = data; struct text_backend *text_backend = input_method->text_backend; struct wl_resource *resource; resource = wl_resource_create(client, &wl_input_method_interface, 1, id); if (input_method->input_method_binding != NULL) { wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "interface object already bound"); return; } if (text_backend->input_method.client != client) { wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "permission to bind " "input_method denied"); return; } wl_resource_set_implementation(resource, NULL, input_method, unbind_input_method); input_method->input_method_binding = resource; text_backend->input_method.binding = resource; } static void input_method_notifier_destroy(struct wl_listener *listener, void *data) { struct input_method *input_method = container_of(listener, struct input_method, destroy_listener); if (input_method->input) deactivate_input_method(input_method); wl_global_destroy(input_method->input_method_global); wl_list_remove(&input_method->destroy_listener.link); free(input_method); } static void handle_keyboard_focus(struct wl_listener *listener, void *data) { struct weston_keyboard *keyboard = data; struct input_method *input_method = container_of(listener, struct input_method, keyboard_focus_listener); struct weston_surface *surface = keyboard->focus; if (!input_method->input) return; if (!surface || input_method->input->surface != surface) deactivate_input_method(input_method); } static void input_method_init_seat(struct weston_seat *seat) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (seat->input_method->focus_listener_initialized) return; if (keyboard) { seat->input_method->keyboard_focus_listener.notify = handle_keyboard_focus; wl_signal_add(&keyboard->focus_signal, &seat->input_method->keyboard_focus_listener); keyboard->input_method_grab.interface = &input_method_context_grab; } seat->input_method->focus_listener_initialized = true; } static void launch_input_method(struct text_backend *text_backend); static void handle_input_method_sigchld(struct weston_process *process, int status) { uint32_t time; struct text_backend *text_backend = container_of(process, struct text_backend, input_method.process); text_backend->input_method.process.pid = 0; text_backend->input_method.client = NULL; /* if input_method dies more than 5 times in 10 seconds, give up */ time = weston_compositor_get_time(); if (time - text_backend->input_method.deathstamp > 10000) { text_backend->input_method.deathstamp = time; text_backend->input_method.deathcount = 0; } text_backend->input_method.deathcount++; if (text_backend->input_method.deathcount > 5) { weston_log("input_method died, giving up.\n"); return; } weston_log("input_method died, respawning...\n"); launch_input_method(text_backend); } static void launch_input_method(struct text_backend *text_backend) { if (text_backend->input_method.binding) return; if (!text_backend->input_method.path) return; if (strcmp(text_backend->input_method.path, "") == 0) return; if (text_backend->input_method.process.pid != 0) return; text_backend->input_method.client = weston_client_launch(text_backend->compositor, &text_backend->input_method.process, text_backend->input_method.path, handle_input_method_sigchld); if (!text_backend->input_method.client) weston_log("not able to start %s\n", text_backend->input_method.path); } static void text_backend_seat_created(struct text_backend *text_backend, struct weston_seat *seat) { struct input_method *input_method; struct weston_compositor *ec = seat->compositor; input_method = zalloc(sizeof *input_method); if (input_method == NULL) return; input_method->seat = seat; input_method->input = NULL; input_method->focus_listener_initialized = false; input_method->context = NULL; input_method->text_backend = text_backend; input_method->input_method_global = wl_global_create(ec->wl_display, &wl_input_method_interface, 1, input_method, bind_input_method); input_method->destroy_listener.notify = input_method_notifier_destroy; wl_signal_add(&seat->destroy_signal, &input_method->destroy_listener); seat->input_method = input_method; launch_input_method(text_backend); } static void handle_seat_created(struct wl_listener *listener, void *data) { struct weston_seat *seat = data; struct text_backend *text_backend = container_of(listener, struct text_backend, seat_created_listener); text_backend_seat_created(text_backend, seat); } static void text_backend_configuration(struct text_backend *text_backend) { struct weston_config_section *section; char *client; int ret; section = weston_config_get_section(text_backend->compositor->config, "input-method", NULL, NULL); ret = asprintf(&client, "%s/weston-keyboard", weston_config_get_libexec_dir()); if (ret < 0) client = NULL; weston_config_section_get_string(section, "path", &text_backend->input_method.path, client); free(client); } WL_EXPORT void text_backend_destroy(struct text_backend *text_backend) { if (text_backend->input_method.client) wl_client_destroy(text_backend->input_method.client); free(text_backend->input_method.path); free(text_backend); } WL_EXPORT struct text_backend * text_backend_init(struct weston_compositor *ec) { struct text_backend *text_backend; struct weston_seat *seat; text_backend = zalloc(sizeof(*text_backend)); if (text_backend == NULL) return NULL; text_backend->compositor = ec; text_backend_configuration(text_backend); wl_list_for_each(seat, &ec->seat_list, link) text_backend_seat_created(text_backend, seat); text_backend->seat_created_listener.notify = handle_seat_created; wl_signal_add(&ec->seat_created_signal, &text_backend->seat_created_listener); text_input_manager_create(ec); return text_backend; } weston-1.9.0/src/weston-launch.c0000664000175000017500000004041312562222636013515 00000000000000/* * Copyright © 2012 Benjamin Franzke * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_SYSTEMD_LOGIN #include #endif #include "weston-launch.h" #define DRM_MAJOR 226 #ifndef KDSKBMUTE #define KDSKBMUTE 0x4B51 #endif #ifndef EVIOCREVOKE #define EVIOCREVOKE _IOW('E', 0x91, int) #endif #define MAX_ARGV_SIZE 256 #ifdef HAVE_LIBDRM #include #else static inline int drmDropMaster(int drm_fd) { return 0; } static inline int drmSetMaster(int drm_fd) { return 0; } #endif struct weston_launch { struct pam_conv pc; pam_handle_t *ph; int tty; int ttynr; int sock[2]; int drm_fd; int last_input_fd; int kb_mode; struct passwd *pw; int signalfd; pid_t child; int verbose; char *new_user; }; union cmsg_data { unsigned char b[4]; int fd; }; static gid_t * read_groups(void) { int n; gid_t *groups; n = getgroups(0, NULL); if (n < 0) { fprintf(stderr, "Unable to retrieve groups: %m\n"); return NULL; } groups = malloc(n * sizeof(gid_t)); if (!groups) return NULL; if (getgroups(n, groups) < 0) { fprintf(stderr, "Unable to retrieve groups: %m\n"); free(groups); return NULL; } return groups; } static bool weston_launch_allowed(struct weston_launch *wl) { struct group *gr; gid_t *groups; int i; #ifdef HAVE_SYSTEMD_LOGIN char *session, *seat; int err; #endif if (getuid() == 0) return true; gr = getgrnam("weston-launch"); if (gr) { groups = read_groups(); if (groups) { for (i = 0; groups[i]; ++i) { if (groups[i] == gr->gr_gid) { free(groups); return true; } } free(groups); } } #ifdef HAVE_SYSTEMD_LOGIN err = sd_pid_get_session(getpid(), &session); if (err == 0 && session) { if (sd_session_is_active(session) && sd_session_get_seat(session, &seat) == 0) { free(seat); free(session); return true; } free(session); } #endif return false; } static int pam_conversation_fn(int msg_count, const struct pam_message **messages, struct pam_response **responses, void *user_data) { return PAM_SUCCESS; } static int setup_pam(struct weston_launch *wl) { int err; wl->pc.conv = pam_conversation_fn; wl->pc.appdata_ptr = wl; err = pam_start("login", wl->pw->pw_name, &wl->pc, &wl->ph); if (err != PAM_SUCCESS) { fprintf(stderr, "failed to start pam transaction: %d: %s\n", err, pam_strerror(wl->ph, err)); return -1; } err = pam_set_item(wl->ph, PAM_TTY, ttyname(wl->tty)); if (err != PAM_SUCCESS) { fprintf(stderr, "failed to set PAM_TTY item: %d: %s\n", err, pam_strerror(wl->ph, err)); return -1; } err = pam_open_session(wl->ph, 0); if (err != PAM_SUCCESS) { fprintf(stderr, "failed to open pam session: %d: %s\n", err, pam_strerror(wl->ph, err)); return -1; } return 0; } static int setup_launcher_socket(struct weston_launch *wl) { if (socketpair(AF_LOCAL, SOCK_SEQPACKET, 0, wl->sock) < 0) error(1, errno, "socketpair failed"); if (fcntl(wl->sock[0], F_SETFD, FD_CLOEXEC) < 0) error(1, errno, "fcntl failed"); return 0; } static int setup_signals(struct weston_launch *wl) { int ret; sigset_t mask; struct sigaction sa; memset(&sa, 0, sizeof sa); sa.sa_handler = SIG_DFL; sa.sa_flags = SA_NOCLDSTOP | SA_RESTART; ret = sigaction(SIGCHLD, &sa, NULL); assert(ret == 0); sa.sa_handler = SIG_IGN; sa.sa_flags = 0; sigaction(SIGHUP, &sa, NULL); ret = sigemptyset(&mask); assert(ret == 0); sigaddset(&mask, SIGCHLD); sigaddset(&mask, SIGINT); sigaddset(&mask, SIGTERM); sigaddset(&mask, SIGUSR1); sigaddset(&mask, SIGUSR2); ret = sigprocmask(SIG_BLOCK, &mask, NULL); assert(ret == 0); wl->signalfd = signalfd(-1, &mask, SFD_NONBLOCK | SFD_CLOEXEC); if (wl->signalfd < 0) return -errno; return 0; } static void setenv_fd(const char *env, int fd) { char buf[32]; snprintf(buf, sizeof buf, "%d", fd); setenv(env, buf, 1); } static int send_reply(struct weston_launch *wl, int reply) { int len; do { len = send(wl->sock[0], &reply, sizeof reply, 0); } while (len < 0 && errno == EINTR); return len; } static int handle_open(struct weston_launch *wl, struct msghdr *msg, ssize_t len) { int fd = -1, ret = -1; char control[CMSG_SPACE(sizeof(fd))]; struct cmsghdr *cmsg; struct stat s; struct msghdr nmsg; struct iovec iov; struct weston_launcher_open *message; union cmsg_data *data; message = msg->msg_iov->iov_base; if ((size_t)len < sizeof(*message)) goto err0; /* Ensure path is null-terminated */ ((char *) message)[len-1] = '\0'; fd = open(message->path, message->flags); if (fd < 0) { fprintf(stderr, "Error opening device %s: %m\n", message->path); goto err0; } if (fstat(fd, &s) < 0) { close(fd); fd = -1; fprintf(stderr, "Failed to stat %s\n", message->path); goto err0; } if (major(s.st_rdev) != INPUT_MAJOR && major(s.st_rdev) != DRM_MAJOR) { close(fd); fd = -1; fprintf(stderr, "Device %s is not an input or drm device\n", message->path); goto err0; } err0: memset(&nmsg, 0, sizeof nmsg); nmsg.msg_iov = &iov; nmsg.msg_iovlen = 1; if (fd != -1) { nmsg.msg_control = control; nmsg.msg_controllen = sizeof control; cmsg = CMSG_FIRSTHDR(&nmsg); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); data = (union cmsg_data *) CMSG_DATA(cmsg); data->fd = fd; nmsg.msg_controllen = cmsg->cmsg_len; ret = 0; } iov.iov_base = &ret; iov.iov_len = sizeof ret; if (wl->verbose) fprintf(stderr, "weston-launch: opened %s: ret: %d, fd: %d\n", message->path, ret, fd); do { len = sendmsg(wl->sock[0], &nmsg, 0); } while (len < 0 && errno == EINTR); if (len < 0) return -1; if (fd != -1 && major(s.st_rdev) == DRM_MAJOR) wl->drm_fd = fd; if (fd != -1 && major(s.st_rdev) == INPUT_MAJOR && wl->last_input_fd < fd) wl->last_input_fd = fd; return 0; } static int handle_socket_msg(struct weston_launch *wl) { char control[CMSG_SPACE(sizeof(int))]; char buf[BUFSIZ]; struct msghdr msg; struct iovec iov; int ret = -1; ssize_t len; struct weston_launcher_message *message; memset(&msg, 0, sizeof(msg)); iov.iov_base = buf; iov.iov_len = sizeof buf; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = control; msg.msg_controllen = sizeof control; do { len = recvmsg(wl->sock[0], &msg, 0); } while (len < 0 && errno == EINTR); if (len < 1) return -1; message = (void *) buf; switch (message->opcode) { case WESTON_LAUNCHER_OPEN: ret = handle_open(wl, &msg, len); break; } return ret; } static void quit(struct weston_launch *wl, int status) { struct vt_mode mode = { 0 }; int err; close(wl->signalfd); close(wl->sock[0]); if (wl->new_user) { err = pam_close_session(wl->ph, 0); if (err) fprintf(stderr, "pam_close_session failed: %d: %s\n", err, pam_strerror(wl->ph, err)); pam_end(wl->ph, err); } if (ioctl(wl->tty, KDSKBMUTE, 0) && ioctl(wl->tty, KDSKBMODE, wl->kb_mode)) fprintf(stderr, "failed to restore keyboard mode: %m\n"); if (ioctl(wl->tty, KDSETMODE, KD_TEXT)) fprintf(stderr, "failed to set KD_TEXT mode on tty: %m\n"); /* We have to drop master before we switch the VT back in * VT_AUTO, so we don't risk switching to a VT with another * display server, that will then fail to set drm master. */ drmDropMaster(wl->drm_fd); mode.mode = VT_AUTO; if (ioctl(wl->tty, VT_SETMODE, &mode) < 0) fprintf(stderr, "could not reset vt handling\n"); exit(status); } static void close_input_fds(struct weston_launch *wl) { struct stat s; int fd; for (fd = 3; fd <= wl->last_input_fd; fd++) { if (fstat(fd, &s) == 0 && major(s.st_rdev) == INPUT_MAJOR) { /* EVIOCREVOKE may fail if the kernel doesn't * support it, but all we can do is ignore it. */ ioctl(fd, EVIOCREVOKE, 0); close(fd); } } } static int handle_signal(struct weston_launch *wl) { struct signalfd_siginfo sig; int pid, status, ret; if (read(wl->signalfd, &sig, sizeof sig) != sizeof sig) { error(0, errno, "reading signalfd failed"); return -1; } switch (sig.ssi_signo) { case SIGCHLD: pid = waitpid(-1, &status, 0); if (pid == wl->child) { wl->child = 0; if (WIFEXITED(status)) ret = WEXITSTATUS(status); else if (WIFSIGNALED(status)) /* * If weston dies because of signal N, we * return 10+N. This is distinct from * weston-launch dying because of a signal * (128+N). */ ret = 10 + WTERMSIG(status); else ret = 0; quit(wl, ret); } break; case SIGTERM: case SIGINT: if (wl->child) kill(wl->child, sig.ssi_signo); break; case SIGUSR1: send_reply(wl, WESTON_LAUNCHER_DEACTIVATE); close_input_fds(wl); drmDropMaster(wl->drm_fd); ioctl(wl->tty, VT_RELDISP, 1); break; case SIGUSR2: ioctl(wl->tty, VT_RELDISP, VT_ACKACQ); drmSetMaster(wl->drm_fd); send_reply(wl, WESTON_LAUNCHER_ACTIVATE); break; default: return -1; } return 0; } static int setup_tty(struct weston_launch *wl, const char *tty) { struct stat buf; struct vt_mode mode = { 0 }; char *t; if (!wl->new_user) { wl->tty = STDIN_FILENO; } else if (tty) { t = ttyname(STDIN_FILENO); if (t && strcmp(t, tty) == 0) wl->tty = STDIN_FILENO; else wl->tty = open(tty, O_RDWR | O_NOCTTY); } else { int tty0 = open("/dev/tty0", O_WRONLY | O_CLOEXEC); char filename[16]; if (tty0 < 0) error(1, errno, "could not open tty0"); if (ioctl(tty0, VT_OPENQRY, &wl->ttynr) < 0 || wl->ttynr == -1) error(1, errno, "failed to find non-opened console"); snprintf(filename, sizeof filename, "/dev/tty%d", wl->ttynr); wl->tty = open(filename, O_RDWR | O_NOCTTY); close(tty0); } if (wl->tty < 0) error(1, errno, "failed to open tty"); if (fstat(wl->tty, &buf) == -1 || major(buf.st_rdev) != TTY_MAJOR || minor(buf.st_rdev) == 0) error(1, 0, "weston-launch must be run from a virtual terminal"); if (tty) { if (fstat(wl->tty, &buf) < 0) error(1, errno, "stat %s failed", tty); if (major(buf.st_rdev) != TTY_MAJOR) error(1, 0, "invalid tty device: %s", tty); wl->ttynr = minor(buf.st_rdev); } if (ioctl(wl->tty, KDGKBMODE, &wl->kb_mode)) error(1, errno, "failed to get current keyboard mode: %m\n"); if (ioctl(wl->tty, KDSKBMUTE, 1) && ioctl(wl->tty, KDSKBMODE, K_OFF)) error(1, errno, "failed to set K_OFF keyboard mode: %m\n"); if (ioctl(wl->tty, KDSETMODE, KD_GRAPHICS)) error(1, errno, "failed to set KD_GRAPHICS mode on tty: %m\n"); mode.mode = VT_PROCESS; mode.relsig = SIGUSR1; mode.acqsig = SIGUSR2; if (ioctl(wl->tty, VT_SETMODE, &mode) < 0) error(1, errno, "failed to take control of vt handling\n"); return 0; } static void setup_session(struct weston_launch *wl) { char **env; char *term; int i; if (wl->tty != STDIN_FILENO) { if (setsid() < 0) error(1, errno, "setsid failed"); if (ioctl(wl->tty, TIOCSCTTY, 0) < 0) error(1, errno, "TIOCSCTTY failed - tty is in use"); } term = getenv("TERM"); clearenv(); if (term) setenv("TERM", term, 1); setenv("USER", wl->pw->pw_name, 1); setenv("LOGNAME", wl->pw->pw_name, 1); setenv("HOME", wl->pw->pw_dir, 1); setenv("SHELL", wl->pw->pw_shell, 1); env = pam_getenvlist(wl->ph); if (env) { for (i = 0; env[i]; ++i) { if (putenv(env[i]) != 0) error(0, 0, "putenv %s failed", env[i]); } free(env); } } static void drop_privileges(struct weston_launch *wl) { if (setgid(wl->pw->pw_gid) < 0 || #ifdef HAVE_INITGROUPS initgroups(wl->pw->pw_name, wl->pw->pw_gid) < 0 || #endif setuid(wl->pw->pw_uid) < 0) error(1, errno, "dropping privileges failed"); } static void launch_compositor(struct weston_launch *wl, int argc, char *argv[]) { char *child_argv[MAX_ARGV_SIZE]; sigset_t mask; int i; if (wl->verbose) printf("weston-launch: spawned weston with pid: %d\n", getpid()); if (wl->new_user) setup_session(wl); if (geteuid() == 0) drop_privileges(wl); setenv_fd("WESTON_TTY_FD", wl->tty); setenv_fd("WESTON_LAUNCHER_SOCK", wl->sock[1]); unsetenv("DISPLAY"); /* Do not give our signal mask to the new process. */ sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigaddset(&mask, SIGCHLD); sigaddset(&mask, SIGINT); sigprocmask(SIG_UNBLOCK, &mask, NULL); child_argv[0] = "/bin/sh"; child_argv[1] = "-l"; child_argv[2] = "-c"; child_argv[3] = BINDIR "/weston \"$@\""; child_argv[4] = "weston"; for (i = 0; i < argc; ++i) child_argv[5 + i] = argv[i]; child_argv[5 + i] = NULL; execv(child_argv[0], child_argv); error(1, errno, "exec failed"); } static void help(const char *name) { fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); fprintf(stderr, " -u, --user Start session as specified username\n"); fprintf(stderr, " -t, --tty Start session on alternative tty\n"); fprintf(stderr, " -v, --verbose Be verbose\n"); fprintf(stderr, " -h, --help Display this help message\n"); } int main(int argc, char *argv[]) { struct weston_launch wl; int i, c; char *tty = NULL; struct option opts[] = { { "user", required_argument, NULL, 'u' }, { "tty", required_argument, NULL, 't' }, { "verbose", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { 0, 0, NULL, 0 } }; memset(&wl, 0, sizeof wl); while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) { switch (c) { case 'u': wl.new_user = optarg; if (getuid() != 0) error(1, 0, "Permission denied. -u allowed for root only"); break; case 't': tty = optarg; break; case 'v': wl.verbose = 1; break; case 'h': help("weston-launch"); exit(EXIT_FAILURE); } } if ((argc - optind) > (MAX_ARGV_SIZE - 6)) error(1, E2BIG, "Too many arguments to pass to weston"); if (wl.new_user) wl.pw = getpwnam(wl.new_user); else wl.pw = getpwuid(getuid()); if (wl.pw == NULL) error(1, errno, "failed to get username"); if (!weston_launch_allowed(&wl)) error(1, 0, "Permission denied. You should either:\n" #ifdef HAVE_SYSTEMD_LOGIN " - run from an active and local (systemd) session.\n" #else " - enable systemd session support for weston-launch.\n" #endif " - or add yourself to the 'weston-launch' group."); if (setup_tty(&wl, tty) < 0) exit(EXIT_FAILURE); if (wl.new_user && setup_pam(&wl) < 0) exit(EXIT_FAILURE); if (setup_launcher_socket(&wl) < 0) exit(EXIT_FAILURE); if (setup_signals(&wl) < 0) exit(EXIT_FAILURE); wl.child = fork(); if (wl.child == -1) error(EXIT_FAILURE, errno, "fork failed"); if (wl.child == 0) launch_compositor(&wl, argc - optind, argv + optind); close(wl.sock[1]); if (wl.tty != STDIN_FILENO) close(wl.tty); while (1) { struct pollfd fds[2]; int n; fds[0].fd = wl.sock[0]; fds[0].events = POLLIN; fds[1].fd = wl.signalfd; fds[1].events = POLLIN; n = poll(fds, 2, -1); if (n < 0) error(0, errno, "poll failed"); if (fds[0].revents & POLLIN) handle_socket_msg(&wl); if (fds[1].revents) handle_signal(&wl); } return 0; } weston-1.9.0/src/compositor.c0000664000175000017500000037033612563431500013127 00000000000000/* * Copyright © 2010-2011 Intel Corporation * Copyright © 2008-2011 Kristian Høgsberg * Copyright © 2012-2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "timeline.h" #include "compositor.h" #include "scaler-server-protocol.h" #include "presentation_timing-server-protocol.h" #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "shared/timespec-util.h" #include "git-version.h" #include "version.h" #define DEFAULT_REPAINT_WINDOW 7 /* milliseconds */ static void weston_output_transform_scale_init(struct weston_output *output, uint32_t transform, uint32_t scale); static void weston_compositor_build_view_list(struct weston_compositor *compositor); static void weston_mode_switch_finish(struct weston_output *output, int mode_changed, int scale_changed) { struct weston_seat *seat; struct wl_resource *resource; pixman_region32_t old_output_region; int version; pixman_region32_init(&old_output_region); pixman_region32_copy(&old_output_region, &output->region); /* Update output region and transformation matrix */ weston_output_transform_scale_init(output, output->transform, output->current_scale); pixman_region32_init(&output->previous_damage); pixman_region32_init_rect(&output->region, output->x, output->y, output->width, output->height); weston_output_update_matrix(output); /* If a pointer falls outside the outputs new geometry, move it to its * lower-right corner */ wl_list_for_each(seat, &output->compositor->seat_list, link) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); int32_t x, y; if (!pointer) continue; x = wl_fixed_to_int(pointer->x); y = wl_fixed_to_int(pointer->y); if (!pixman_region32_contains_point(&old_output_region, x, y, NULL) || pixman_region32_contains_point(&output->region, x, y, NULL)) continue; if (x >= output->x + output->width) x = output->x + output->width - 1; if (y >= output->y + output->height) y = output->y + output->height - 1; pointer->x = wl_fixed_from_int(x); pointer->y = wl_fixed_from_int(y); } pixman_region32_fini(&old_output_region); if (!mode_changed && !scale_changed) return; /* notify clients of the changes */ wl_resource_for_each(resource, &output->resource_list) { if (mode_changed) { wl_output_send_mode(resource, output->current_mode->flags, output->current_mode->width, output->current_mode->height, output->current_mode->refresh); } version = wl_resource_get_version(resource); if (version >= WL_OUTPUT_SCALE_SINCE_VERSION && scale_changed) wl_output_send_scale(resource, output->current_scale); if (version >= WL_OUTPUT_DONE_SINCE_VERSION) wl_output_send_done(resource); } } WL_EXPORT int weston_output_mode_set_native(struct weston_output *output, struct weston_mode *mode, int32_t scale) { int ret; int mode_changed = 0, scale_changed = 0; if (!output->switch_mode) return -1; if (!output->original_mode) { mode_changed = 1; ret = output->switch_mode(output, mode); if (ret < 0) return ret; if (output->current_scale != scale) { scale_changed = 1; output->current_scale = scale; } } output->native_mode = mode; output->native_scale = scale; weston_mode_switch_finish(output, mode_changed, scale_changed); return 0; } WL_EXPORT int weston_output_mode_switch_to_native(struct weston_output *output) { int ret; int mode_changed = 0, scale_changed = 0; if (!output->switch_mode) return -1; if (!output->original_mode) { weston_log("already in the native mode\n"); return -1; } /* the non fullscreen clients haven't seen a mode set since we * switched into a temporary, so we need to notify them if the * mode at that time is different from the native mode now. */ mode_changed = (output->original_mode != output->native_mode); scale_changed = (output->original_scale != output->native_scale); ret = output->switch_mode(output, output->native_mode); if (ret < 0) return ret; output->current_scale = output->native_scale; output->original_mode = NULL; output->original_scale = 0; weston_mode_switch_finish(output, mode_changed, scale_changed); return 0; } WL_EXPORT int weston_output_mode_switch_to_temporary(struct weston_output *output, struct weston_mode *mode, int32_t scale) { int ret; if (!output->switch_mode) return -1; /* original_mode is the last mode non full screen clients have seen, * so we shouldn't change it if we already have one set. */ if (!output->original_mode) { output->original_mode = output->native_mode; output->original_scale = output->native_scale; } ret = output->switch_mode(output, mode); if (ret < 0) return ret; output->current_scale = scale; weston_mode_switch_finish(output, 0, 0); return 0; } static void child_client_exec(int sockfd, const char *path) { int clientfd; char s[32]; sigset_t allsigs; /* do not give our signal mask to the new process */ sigfillset(&allsigs); sigprocmask(SIG_UNBLOCK, &allsigs, NULL); /* Launch clients as the user. Do not lauch clients with wrong euid.*/ if (seteuid(getuid()) == -1) { weston_log("compositor: failed seteuid\n"); return; } /* SOCK_CLOEXEC closes both ends, so we dup the fd to get a * non-CLOEXEC fd to pass through exec. */ clientfd = dup(sockfd); if (clientfd == -1) { weston_log("compositor: dup failed: %m\n"); return; } snprintf(s, sizeof s, "%d", clientfd); setenv("WAYLAND_SOCKET", s, 1); if (execl(path, path, NULL) < 0) weston_log("compositor: executing '%s' failed: %m\n", path); } WL_EXPORT struct wl_client * weston_client_launch(struct weston_compositor *compositor, struct weston_process *proc, const char *path, weston_process_cleanup_func_t cleanup) { int sv[2]; pid_t pid; struct wl_client *client; weston_log("launching '%s'\n", path); if (os_socketpair_cloexec(AF_UNIX, SOCK_STREAM, 0, sv) < 0) { weston_log("weston_client_launch: " "socketpair failed while launching '%s': %m\n", path); return NULL; } pid = fork(); if (pid == -1) { close(sv[0]); close(sv[1]); weston_log("weston_client_launch: " "fork failed while launching '%s': %m\n", path); return NULL; } if (pid == 0) { child_client_exec(sv[1], path); _exit(-1); } close(sv[1]); client = wl_client_create(compositor->wl_display, sv[0]); if (!client) { close(sv[0]); weston_log("weston_client_launch: " "wl_client_create failed while launching '%s'.\n", path); return NULL; } proc->pid = pid; proc->cleanup = cleanup; weston_watch_process(proc); return client; } struct process_info { struct weston_process proc; char *path; }; static void process_handle_sigchld(struct weston_process *process, int status) { struct process_info *pinfo = container_of(process, struct process_info, proc); /* * There are no guarantees whether this runs before or after * the wl_client destructor. */ if (WIFEXITED(status)) { weston_log("%s exited with status %d\n", pinfo->path, WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { weston_log("%s died on signal %d\n", pinfo->path, WTERMSIG(status)); } else { weston_log("%s disappeared\n", pinfo->path); } free(pinfo->path); free(pinfo); } WL_EXPORT struct wl_client * weston_client_start(struct weston_compositor *compositor, const char *path) { struct process_info *pinfo; struct wl_client *client; pinfo = zalloc(sizeof *pinfo); if (!pinfo) return NULL; pinfo->path = strdup(path); if (!pinfo->path) goto out_free; client = weston_client_launch(compositor, &pinfo->proc, path, process_handle_sigchld); if (!client) goto out_str; return client; out_str: free(pinfo->path); out_free: free(pinfo); return NULL; } static void region_init_infinite(pixman_region32_t *region) { pixman_region32_init_rect(region, INT32_MIN, INT32_MIN, UINT32_MAX, UINT32_MAX); } static struct weston_subsurface * weston_surface_to_subsurface(struct weston_surface *surface); WL_EXPORT struct weston_view * weston_view_create(struct weston_surface *surface) { struct weston_view *view; view = zalloc(sizeof *view); if (view == NULL) return NULL; view->surface = surface; /* Assign to surface */ wl_list_insert(&surface->views, &view->surface_link); wl_signal_init(&view->destroy_signal); wl_list_init(&view->link); wl_list_init(&view->layer_link.link); pixman_region32_init(&view->clip); view->alpha = 1.0; pixman_region32_init(&view->transform.opaque); wl_list_init(&view->geometry.transformation_list); wl_list_insert(&view->geometry.transformation_list, &view->transform.position.link); weston_matrix_init(&view->transform.position.matrix); wl_list_init(&view->geometry.child_list); pixman_region32_init(&view->geometry.scissor); pixman_region32_init(&view->transform.boundingbox); view->transform.dirty = 1; return view; } struct weston_frame_callback { struct wl_resource *resource; struct wl_list link; }; struct weston_presentation_feedback { struct wl_resource *resource; /* XXX: could use just wl_resource_get_link() instead */ struct wl_list link; /* The per-surface feedback flags */ uint32_t psf_flags; }; static void weston_presentation_feedback_discard( struct weston_presentation_feedback *feedback) { presentation_feedback_send_discarded(feedback->resource); wl_resource_destroy(feedback->resource); } static void weston_presentation_feedback_discard_list(struct wl_list *list) { struct weston_presentation_feedback *feedback, *tmp; wl_list_for_each_safe(feedback, tmp, list, link) weston_presentation_feedback_discard(feedback); } static void weston_presentation_feedback_present( struct weston_presentation_feedback *feedback, struct weston_output *output, uint32_t refresh_nsec, const struct timespec *ts, uint64_t seq, uint32_t flags) { struct wl_client *client = wl_resource_get_client(feedback->resource); struct wl_resource *o; uint64_t secs; wl_resource_for_each(o, &output->resource_list) { if (wl_resource_get_client(o) != client) continue; presentation_feedback_send_sync_output(feedback->resource, o); } secs = ts->tv_sec; presentation_feedback_send_presented(feedback->resource, secs >> 32, secs & 0xffffffff, ts->tv_nsec, refresh_nsec, seq >> 32, seq & 0xffffffff, flags | feedback->psf_flags); wl_resource_destroy(feedback->resource); } static void weston_presentation_feedback_present_list(struct wl_list *list, struct weston_output *output, uint32_t refresh_nsec, const struct timespec *ts, uint64_t seq, uint32_t flags) { struct weston_presentation_feedback *feedback, *tmp; assert(!(flags & PRESENTATION_FEEDBACK_INVALID) || wl_list_empty(list)); wl_list_for_each_safe(feedback, tmp, list, link) weston_presentation_feedback_present(feedback, output, refresh_nsec, ts, seq, flags); } static void surface_state_handle_buffer_destroy(struct wl_listener *listener, void *data) { struct weston_surface_state *state = container_of(listener, struct weston_surface_state, buffer_destroy_listener); state->buffer = NULL; } static void weston_surface_state_init(struct weston_surface_state *state) { state->newly_attached = 0; state->buffer = NULL; state->buffer_destroy_listener.notify = surface_state_handle_buffer_destroy; state->sx = 0; state->sy = 0; pixman_region32_init(&state->damage); pixman_region32_init(&state->opaque); region_init_infinite(&state->input); wl_list_init(&state->frame_callback_list); wl_list_init(&state->feedback_list); state->buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL; state->buffer_viewport.buffer.scale = 1; state->buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); state->buffer_viewport.surface.width = -1; state->buffer_viewport.changed = 0; } static void weston_surface_state_fini(struct weston_surface_state *state) { struct weston_frame_callback *cb, *next; wl_list_for_each_safe(cb, next, &state->frame_callback_list, link) wl_resource_destroy(cb->resource); weston_presentation_feedback_discard_list(&state->feedback_list); pixman_region32_fini(&state->input); pixman_region32_fini(&state->opaque); pixman_region32_fini(&state->damage); if (state->buffer) wl_list_remove(&state->buffer_destroy_listener.link); state->buffer = NULL; } static void weston_surface_state_set_buffer(struct weston_surface_state *state, struct weston_buffer *buffer) { if (state->buffer == buffer) return; if (state->buffer) wl_list_remove(&state->buffer_destroy_listener.link); state->buffer = buffer; if (state->buffer) wl_signal_add(&state->buffer->destroy_signal, &state->buffer_destroy_listener); } WL_EXPORT struct weston_surface * weston_surface_create(struct weston_compositor *compositor) { struct weston_surface *surface; surface = zalloc(sizeof *surface); if (surface == NULL) return NULL; wl_signal_init(&surface->destroy_signal); surface->compositor = compositor; surface->ref_count = 1; surface->buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL; surface->buffer_viewport.buffer.scale = 1; surface->buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); surface->buffer_viewport.surface.width = -1; weston_surface_state_init(&surface->pending); pixman_region32_init(&surface->damage); pixman_region32_init(&surface->opaque); region_init_infinite(&surface->input); wl_list_init(&surface->views); wl_list_init(&surface->frame_callback_list); wl_list_init(&surface->feedback_list); wl_list_init(&surface->subsurface_list); wl_list_init(&surface->subsurface_list_pending); weston_matrix_init(&surface->buffer_to_surface_matrix); weston_matrix_init(&surface->surface_to_buffer_matrix); return surface; } WL_EXPORT void weston_surface_set_color(struct weston_surface *surface, float red, float green, float blue, float alpha) { surface->compositor->renderer->surface_set_color(surface, red, green, blue, alpha); } WL_EXPORT void weston_view_to_global_float(struct weston_view *view, float sx, float sy, float *x, float *y) { if (view->transform.enabled) { struct weston_vector v = { { sx, sy, 0.0f, 1.0f } }; weston_matrix_transform(&view->transform.matrix, &v); if (fabsf(v.f[3]) < 1e-6) { weston_log("warning: numerical instability in " "%s(), divisor = %g\n", __func__, v.f[3]); *x = 0; *y = 0; return; } *x = v.f[0] / v.f[3]; *y = v.f[1] / v.f[3]; } else { *x = sx + view->geometry.x; *y = sy + view->geometry.y; } } WL_EXPORT void weston_transformed_coord(int width, int height, enum wl_output_transform transform, int32_t scale, float sx, float sy, float *bx, float *by) { switch (transform) { case WL_OUTPUT_TRANSFORM_NORMAL: default: *bx = sx; *by = sy; break; case WL_OUTPUT_TRANSFORM_FLIPPED: *bx = width - sx; *by = sy; break; case WL_OUTPUT_TRANSFORM_90: *bx = height - sy; *by = sx; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: *bx = height - sy; *by = width - sx; break; case WL_OUTPUT_TRANSFORM_180: *bx = width - sx; *by = height - sy; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: *bx = sx; *by = height - sy; break; case WL_OUTPUT_TRANSFORM_270: *bx = sy; *by = width - sx; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: *bx = sy; *by = sx; break; } *bx *= scale; *by *= scale; } WL_EXPORT pixman_box32_t weston_transformed_rect(int width, int height, enum wl_output_transform transform, int32_t scale, pixman_box32_t rect) { float x1, x2, y1, y2; pixman_box32_t ret; weston_transformed_coord(width, height, transform, scale, rect.x1, rect.y1, &x1, &y1); weston_transformed_coord(width, height, transform, scale, rect.x2, rect.y2, &x2, &y2); if (x1 <= x2) { ret.x1 = x1; ret.x2 = x2; } else { ret.x1 = x2; ret.x2 = x1; } if (y1 <= y2) { ret.y1 = y1; ret.y2 = y2; } else { ret.y1 = y2; ret.y2 = y1; } return ret; } WL_EXPORT void weston_transformed_region(int width, int height, enum wl_output_transform transform, int32_t scale, pixman_region32_t *src, pixman_region32_t *dest) { pixman_box32_t *src_rects, *dest_rects; int nrects, i; if (transform == WL_OUTPUT_TRANSFORM_NORMAL && scale == 1) { if (src != dest) pixman_region32_copy(dest, src); return; } src_rects = pixman_region32_rectangles(src, &nrects); dest_rects = malloc(nrects * sizeof(*dest_rects)); if (!dest_rects) return; if (transform == WL_OUTPUT_TRANSFORM_NORMAL) { memcpy(dest_rects, src_rects, nrects * sizeof(*dest_rects)); } else { for (i = 0; i < nrects; i++) { switch (transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: dest_rects[i].x1 = src_rects[i].x1; dest_rects[i].y1 = src_rects[i].y1; dest_rects[i].x2 = src_rects[i].x2; dest_rects[i].y2 = src_rects[i].y2; break; case WL_OUTPUT_TRANSFORM_90: dest_rects[i].x1 = height - src_rects[i].y2; dest_rects[i].y1 = src_rects[i].x1; dest_rects[i].x2 = height - src_rects[i].y1; dest_rects[i].y2 = src_rects[i].x2; break; case WL_OUTPUT_TRANSFORM_180: dest_rects[i].x1 = width - src_rects[i].x2; dest_rects[i].y1 = height - src_rects[i].y2; dest_rects[i].x2 = width - src_rects[i].x1; dest_rects[i].y2 = height - src_rects[i].y1; break; case WL_OUTPUT_TRANSFORM_270: dest_rects[i].x1 = src_rects[i].y1; dest_rects[i].y1 = width - src_rects[i].x2; dest_rects[i].x2 = src_rects[i].y2; dest_rects[i].y2 = width - src_rects[i].x1; break; case WL_OUTPUT_TRANSFORM_FLIPPED: dest_rects[i].x1 = width - src_rects[i].x2; dest_rects[i].y1 = src_rects[i].y1; dest_rects[i].x2 = width - src_rects[i].x1; dest_rects[i].y2 = src_rects[i].y2; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: dest_rects[i].x1 = height - src_rects[i].y2; dest_rects[i].y1 = width - src_rects[i].x2; dest_rects[i].x2 = height - src_rects[i].y1; dest_rects[i].y2 = width - src_rects[i].x1; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: dest_rects[i].x1 = src_rects[i].x1; dest_rects[i].y1 = height - src_rects[i].y2; dest_rects[i].x2 = src_rects[i].x2; dest_rects[i].y2 = height - src_rects[i].y1; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: dest_rects[i].x1 = src_rects[i].y1; dest_rects[i].y1 = src_rects[i].x1; dest_rects[i].x2 = src_rects[i].y2; dest_rects[i].y2 = src_rects[i].x2; break; } } } if (scale != 1) { for (i = 0; i < nrects; i++) { dest_rects[i].x1 *= scale; dest_rects[i].x2 *= scale; dest_rects[i].y1 *= scale; dest_rects[i].y2 *= scale; } } pixman_region32_clear(dest); pixman_region32_init_rects(dest, dest_rects, nrects); free(dest_rects); } static void scaler_surface_to_buffer(struct weston_surface *surface, float sx, float sy, float *bx, float *by) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; double src_width, src_height; double src_x, src_y; if (vp->buffer.src_width == wl_fixed_from_int(-1)) { if (vp->surface.width == -1) { *bx = sx; *by = sy; return; } src_x = 0.0; src_y = 0.0; src_width = surface->width_from_buffer; src_height = surface->height_from_buffer; } else { src_x = wl_fixed_to_double(vp->buffer.src_x); src_y = wl_fixed_to_double(vp->buffer.src_y); src_width = wl_fixed_to_double(vp->buffer.src_width); src_height = wl_fixed_to_double(vp->buffer.src_height); } *bx = sx * src_width / surface->width + src_x; *by = sy * src_height / surface->height + src_y; } WL_EXPORT void weston_surface_to_buffer_float(struct weston_surface *surface, float sx, float sy, float *bx, float *by) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; /* first transform coordinates if the scaler is set */ scaler_surface_to_buffer(surface, sx, sy, bx, by); weston_transformed_coord(surface->width_from_buffer, surface->height_from_buffer, vp->buffer.transform, vp->buffer.scale, *bx, *by, bx, by); } WL_EXPORT void weston_surface_to_buffer(struct weston_surface *surface, int sx, int sy, int *bx, int *by) { float bxf, byf; weston_surface_to_buffer_float(surface, sx, sy, &bxf, &byf); *bx = floorf(bxf); *by = floorf(byf); } WL_EXPORT pixman_box32_t weston_surface_to_buffer_rect(struct weston_surface *surface, pixman_box32_t rect) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; float xf, yf; /* first transform box coordinates if the scaler is set */ scaler_surface_to_buffer(surface, rect.x1, rect.y1, &xf, &yf); rect.x1 = floorf(xf); rect.y1 = floorf(yf); scaler_surface_to_buffer(surface, rect.x2, rect.y2, &xf, &yf); rect.x2 = floorf(xf); rect.y2 = floorf(yf); return weston_transformed_rect(surface->width_from_buffer, surface->height_from_buffer, vp->buffer.transform, vp->buffer.scale, rect); } /** Transform a region from surface coordinates to buffer coordinates * * \param surface The surface to fetch wl_viewport and buffer transformation * from. * \param surface_region[in] The region in surface coordinates. * \param buffer_region[out] The region converted to buffer coordinates. * * Buffer_region must be init'd, but will be completely overwritten. * * Viewport and buffer transformations can only do translation, scaling, * and rotations in 90-degree steps. Therefore the only loss in the * conversion is coordinate flooring (rounding). */ WL_EXPORT void weston_surface_to_buffer_region(struct weston_surface *surface, pixman_region32_t *surface_region, pixman_region32_t *buffer_region) { pixman_box32_t *src_rects, *dest_rects; int nrects, i; src_rects = pixman_region32_rectangles(surface_region, &nrects); dest_rects = malloc(nrects * sizeof(*dest_rects)); if (!dest_rects) return; for (i = 0; i < nrects; i++) { dest_rects[i] = weston_surface_to_buffer_rect(surface, src_rects[i]); } pixman_region32_fini(buffer_region); pixman_region32_init_rects(buffer_region, dest_rects, nrects); free(dest_rects); } WL_EXPORT void weston_view_move_to_plane(struct weston_view *view, struct weston_plane *plane) { if (view->plane == plane) return; weston_view_damage_below(view); view->plane = plane; weston_surface_damage(view->surface); } /** Inflict damage on the plane where the view is visible. * * \param view The view that causes the damage. * * If the view is currently on a plane (including the primary plane), * take the view's boundingbox, subtract all the opaque views that cover it, * and add the remaining region as damage to the plane. This corresponds * to the damage inflicted to the plane if this view disappeared. * * A repaint is scheduled for this view. * * The region of all opaque views covering this view is stored in * weston_view::clip and updated by view_accumulate_damage() during * weston_output_repaint(). Specifically, that region matches the * scenegraph as it was last painted. */ WL_EXPORT void weston_view_damage_below(struct weston_view *view) { pixman_region32_t damage; pixman_region32_init(&damage); pixman_region32_subtract(&damage, &view->transform.boundingbox, &view->clip); if (view->plane) pixman_region32_union(&view->plane->damage, &view->plane->damage, &damage); pixman_region32_fini(&damage); weston_view_schedule_repaint(view); } static void weston_surface_update_output_mask(struct weston_surface *es, uint32_t mask) { uint32_t different = es->output_mask ^ mask; uint32_t entered = mask & different; uint32_t left = es->output_mask & different; struct weston_output *output; struct wl_resource *resource = NULL; struct wl_client *client; es->output_mask = mask; if (es->resource == NULL) return; if (different == 0) return; client = wl_resource_get_client(es->resource); wl_list_for_each(output, &es->compositor->output_list, link) { if (1 << output->id & different) resource = wl_resource_find_for_client(&output->resource_list, client); if (resource == NULL) continue; if (1 << output->id & entered) wl_surface_send_enter(es->resource, resource); if (1 << output->id & left) wl_surface_send_leave(es->resource, resource); } } static void weston_surface_assign_output(struct weston_surface *es) { struct weston_output *new_output; struct weston_view *view; pixman_region32_t region; uint32_t max, area, mask; pixman_box32_t *e; new_output = NULL; max = 0; mask = 0; pixman_region32_init(®ion); wl_list_for_each(view, &es->views, surface_link) { if (!view->output) continue; pixman_region32_intersect(®ion, &view->transform.boundingbox, &view->output->region); e = pixman_region32_extents(®ion); area = (e->x2 - e->x1) * (e->y2 - e->y1); mask |= view->output_mask; if (area >= max) { new_output = view->output; max = area; } } pixman_region32_fini(®ion); es->output = new_output; weston_surface_update_output_mask(es, mask); } static void weston_view_assign_output(struct weston_view *ev) { struct weston_compositor *ec = ev->surface->compositor; struct weston_output *output, *new_output; pixman_region32_t region; uint32_t max, area, mask; pixman_box32_t *e; new_output = NULL; max = 0; mask = 0; pixman_region32_init(®ion); wl_list_for_each(output, &ec->output_list, link) { if (output->destroying) continue; pixman_region32_intersect(®ion, &ev->transform.boundingbox, &output->region); e = pixman_region32_extents(®ion); area = (e->x2 - e->x1) * (e->y2 - e->y1); if (area > 0) mask |= 1 << output->id; if (area >= max) { new_output = output; max = area; } } pixman_region32_fini(®ion); ev->output = new_output; ev->output_mask = mask; weston_surface_assign_output(ev->surface); } static void weston_view_to_view_map(struct weston_view *from, struct weston_view *to, int from_x, int from_y, int *to_x, int *to_y) { float x, y; weston_view_to_global_float(from, from_x, from_y, &x, &y); weston_view_from_global_float(to, x, y, &x, &y); *to_x = round(x); *to_y = round(y); } static void weston_view_transfer_scissor(struct weston_view *from, struct weston_view *to) { pixman_box32_t *a; pixman_box32_t b; a = pixman_region32_extents(&from->geometry.scissor); weston_view_to_view_map(from, to, a->x1, a->y1, &b.x1, &b.y1); weston_view_to_view_map(from, to, a->x2, a->y2, &b.x2, &b.y2); pixman_region32_fini(&to->geometry.scissor); pixman_region32_init_with_extents(&to->geometry.scissor, &b); } static void view_compute_bbox(struct weston_view *view, const pixman_box32_t *inbox, pixman_region32_t *bbox) { float min_x = HUGE_VALF, min_y = HUGE_VALF; float max_x = -HUGE_VALF, max_y = -HUGE_VALF; int32_t s[4][2] = { { inbox->x1, inbox->y1 }, { inbox->x1, inbox->y2 }, { inbox->x2, inbox->y1 }, { inbox->x2, inbox->y2 }, }; float int_x, int_y; int i; if (inbox->x1 == inbox->x2 || inbox->y1 == inbox->y2) { /* avoid rounding empty bbox to 1x1 */ pixman_region32_init(bbox); return; } for (i = 0; i < 4; ++i) { float x, y; weston_view_to_global_float(view, s[i][0], s[i][1], &x, &y); if (x < min_x) min_x = x; if (x > max_x) max_x = x; if (y < min_y) min_y = y; if (y > max_y) max_y = y; } int_x = floorf(min_x); int_y = floorf(min_y); pixman_region32_init_rect(bbox, int_x, int_y, ceilf(max_x) - int_x, ceilf(max_y) - int_y); } static void weston_view_update_transform_disable(struct weston_view *view) { view->transform.enabled = 0; /* round off fractions when not transformed */ view->geometry.x = roundf(view->geometry.x); view->geometry.y = roundf(view->geometry.y); /* Otherwise identity matrix, but with x and y translation. */ view->transform.position.matrix.type = WESTON_MATRIX_TRANSFORM_TRANSLATE; view->transform.position.matrix.d[12] = view->geometry.x; view->transform.position.matrix.d[13] = view->geometry.y; view->transform.matrix = view->transform.position.matrix; view->transform.inverse = view->transform.position.matrix; view->transform.inverse.d[12] = -view->geometry.x; view->transform.inverse.d[13] = -view->geometry.y; pixman_region32_init_rect(&view->transform.boundingbox, 0, 0, view->surface->width, view->surface->height); if (view->geometry.scissor_enabled) pixman_region32_intersect(&view->transform.boundingbox, &view->transform.boundingbox, &view->geometry.scissor); pixman_region32_translate(&view->transform.boundingbox, view->geometry.x, view->geometry.y); if (view->alpha == 1.0) { pixman_region32_copy(&view->transform.opaque, &view->surface->opaque); pixman_region32_translate(&view->transform.opaque, view->geometry.x, view->geometry.y); } } static int weston_view_update_transform_enable(struct weston_view *view) { struct weston_view *parent = view->geometry.parent; struct weston_matrix *matrix = &view->transform.matrix; struct weston_matrix *inverse = &view->transform.inverse; struct weston_transform *tform; pixman_region32_t surfregion; const pixman_box32_t *surfbox; view->transform.enabled = 1; /* Otherwise identity matrix, but with x and y translation. */ view->transform.position.matrix.type = WESTON_MATRIX_TRANSFORM_TRANSLATE; view->transform.position.matrix.d[12] = view->geometry.x; view->transform.position.matrix.d[13] = view->geometry.y; weston_matrix_init(matrix); wl_list_for_each(tform, &view->geometry.transformation_list, link) weston_matrix_multiply(matrix, &tform->matrix); if (parent) weston_matrix_multiply(matrix, &parent->transform.matrix); if (weston_matrix_invert(inverse, matrix) < 0) { /* Oops, bad total transformation, not invertible */ weston_log("error: weston_view %p" " transformation not invertible.\n", view); return -1; } pixman_region32_init_rect(&surfregion, 0, 0, view->surface->width, view->surface->height); if (view->geometry.scissor_enabled) pixman_region32_intersect(&surfregion, &surfregion, &view->geometry.scissor); surfbox = pixman_region32_extents(&surfregion); view_compute_bbox(view, surfbox, &view->transform.boundingbox); pixman_region32_fini(&surfregion); return 0; } static struct weston_layer * get_view_layer(struct weston_view *view) { if (view->parent_view) return get_view_layer(view->parent_view); return view->layer_link.layer; } WL_EXPORT void weston_view_update_transform(struct weston_view *view) { struct weston_view *parent = view->geometry.parent; struct weston_layer *layer; pixman_region32_t mask; if (!view->transform.dirty) return; if (parent) weston_view_update_transform(parent); view->transform.dirty = 0; weston_view_damage_below(view); pixman_region32_fini(&view->transform.boundingbox); pixman_region32_fini(&view->transform.opaque); pixman_region32_init(&view->transform.opaque); /* transform.position is always in transformation_list */ if (view->geometry.transformation_list.next == &view->transform.position.link && view->geometry.transformation_list.prev == &view->transform.position.link && !parent) { weston_view_update_transform_disable(view); } else { if (weston_view_update_transform_enable(view) < 0) weston_view_update_transform_disable(view); } layer = get_view_layer(view); if (layer) { pixman_region32_init_with_extents(&mask, &layer->mask); pixman_region32_intersect(&view->transform.boundingbox, &view->transform.boundingbox, &mask); pixman_region32_intersect(&view->transform.opaque, &view->transform.opaque, &mask); pixman_region32_fini(&mask); } if (parent) { if (parent->geometry.scissor_enabled) { view->geometry.scissor_enabled = true; weston_view_transfer_scissor(parent, view); } else { view->geometry.scissor_enabled = false; } } weston_view_damage_below(view); weston_view_assign_output(view); wl_signal_emit(&view->surface->compositor->transform_signal, view->surface); } WL_EXPORT void weston_view_geometry_dirty(struct weston_view *view) { struct weston_view *child; /* * The invariant: if view->geometry.dirty, then all views * in view->geometry.child_list have geometry.dirty too. * Corollary: if not parent->geometry.dirty, then all ancestors * are not dirty. */ if (view->transform.dirty) return; view->transform.dirty = 1; wl_list_for_each(child, &view->geometry.child_list, geometry.parent_link) weston_view_geometry_dirty(child); } WL_EXPORT void weston_view_to_global_fixed(struct weston_view *view, wl_fixed_t vx, wl_fixed_t vy, wl_fixed_t *x, wl_fixed_t *y) { float xf, yf; weston_view_to_global_float(view, wl_fixed_to_double(vx), wl_fixed_to_double(vy), &xf, &yf); *x = wl_fixed_from_double(xf); *y = wl_fixed_from_double(yf); } WL_EXPORT void weston_view_from_global_float(struct weston_view *view, float x, float y, float *vx, float *vy) { if (view->transform.enabled) { struct weston_vector v = { { x, y, 0.0f, 1.0f } }; weston_matrix_transform(&view->transform.inverse, &v); if (fabsf(v.f[3]) < 1e-6) { weston_log("warning: numerical instability in " "weston_view_from_global(), divisor = %g\n", v.f[3]); *vx = 0; *vy = 0; return; } *vx = v.f[0] / v.f[3]; *vy = v.f[1] / v.f[3]; } else { *vx = x - view->geometry.x; *vy = y - view->geometry.y; } } WL_EXPORT void weston_view_from_global_fixed(struct weston_view *view, wl_fixed_t x, wl_fixed_t y, wl_fixed_t *vx, wl_fixed_t *vy) { float vxf, vyf; weston_view_from_global_float(view, wl_fixed_to_double(x), wl_fixed_to_double(y), &vxf, &vyf); *vx = wl_fixed_from_double(vxf); *vy = wl_fixed_from_double(vyf); } WL_EXPORT void weston_view_from_global(struct weston_view *view, int32_t x, int32_t y, int32_t *vx, int32_t *vy) { float vxf, vyf; weston_view_from_global_float(view, x, y, &vxf, &vyf); *vx = floorf(vxf); *vy = floorf(vyf); } WL_EXPORT void weston_surface_schedule_repaint(struct weston_surface *surface) { struct weston_output *output; wl_list_for_each(output, &surface->compositor->output_list, link) if (surface->output_mask & (1 << output->id)) weston_output_schedule_repaint(output); } WL_EXPORT void weston_view_schedule_repaint(struct weston_view *view) { struct weston_output *output; wl_list_for_each(output, &view->surface->compositor->output_list, link) if (view->output_mask & (1 << output->id)) weston_output_schedule_repaint(output); } /** * XXX: This function does it the wrong way. * surface->damage is the damage from the client, and causes * surface_flush_damage() to copy pixels. No window management action can * cause damage to the client-provided content, warranting re-upload! * * Instead of surface->damage, this function should record the damage * with all the views for this surface to avoid extraneous texture * uploads. */ WL_EXPORT void weston_surface_damage(struct weston_surface *surface) { pixman_region32_union_rect(&surface->damage, &surface->damage, 0, 0, surface->width, surface->height); weston_surface_schedule_repaint(surface); } WL_EXPORT void weston_view_set_position(struct weston_view *view, float x, float y) { if (view->geometry.x == x && view->geometry.y == y) return; view->geometry.x = x; view->geometry.y = y; weston_view_geometry_dirty(view); } static void transform_parent_handle_parent_destroy(struct wl_listener *listener, void *data) { struct weston_view *view = container_of(listener, struct weston_view, geometry.parent_destroy_listener); weston_view_set_transform_parent(view, NULL); } WL_EXPORT void weston_view_set_transform_parent(struct weston_view *view, struct weston_view *parent) { if (view->geometry.parent) { wl_list_remove(&view->geometry.parent_destroy_listener.link); wl_list_remove(&view->geometry.parent_link); if (!parent) view->geometry.scissor_enabled = false; } view->geometry.parent = parent; view->geometry.parent_destroy_listener.notify = transform_parent_handle_parent_destroy; if (parent) { wl_signal_add(&parent->destroy_signal, &view->geometry.parent_destroy_listener); wl_list_insert(&parent->geometry.child_list, &view->geometry.parent_link); } weston_view_geometry_dirty(view); } /** Set a clip mask rectangle on a view * * \param view The view to set the clip mask on. * \param x Top-left corner X coordinate of the clip rectangle. * \param y Top-left corner Y coordinate of the clip rectangle. * \param width Width of the clip rectangle, non-negative. * \param height Height of the clip rectangle, non-negative. * * A shell may set a clip mask rectangle on a view. Everything outside * the rectangle is cut away for input and output purposes: it is * not drawn and cannot be hit by hit-test based input like pointer * motion or touch-downs. Everything inside the rectangle will behave * normally. Clients are unaware of clipping. * * The rectangle is set in the surface local coordinates. Setting a clip * mask rectangle does not affect the view position, the view is positioned * as it would be without a clip. The clip also does not change * weston_surface::width,height. * * The clip mask rectangle is part of transformation inheritance * (weston_view_set_transform_parent()). A clip set in the root of the * transformation inheritance tree will affect all views in the tree. * A clip can be set only on the root view. Attempting to set a clip * on view that has a transformation parent will fail. Assigning a parent * to a view that has a clip set will cause the clip to be forgotten. * * Because the clip mask is an axis-aligned rectangle, it poses restrictions * on the additional transformations in the child views. These transformations * may not rotate the coordinate axes, i.e., only translation and scaling * are allowed. Violating this restriction causes the clipping to malfunction. * Furthermore, using scaling may cause rounding errors in child clipping. * * The clip mask rectangle is not automatically adjusted based on * wl_surface.attach dx and dy arguments. * * A clip mask rectangle can be set only if the compositor capability * WESTON_CAP_VIEW_CLIP_MASK is present. * * This function sets the clip mask rectangle and schedules a repaint for * the view. */ WL_EXPORT void weston_view_set_mask(struct weston_view *view, int x, int y, int width, int height) { struct weston_compositor *compositor = view->surface->compositor; if (!(compositor->capabilities & WESTON_CAP_VIEW_CLIP_MASK)) { weston_log("%s not allowed without capability!\n", __func__); return; } if (view->geometry.parent) { weston_log("view %p has a parent, clip forbidden!\n", view); return; } if (width < 0 || height < 0) { weston_log("%s: illegal args %d, %d, %d, %d\n", __func__, x, y, width, height); return; } pixman_region32_fini(&view->geometry.scissor); pixman_region32_init_rect(&view->geometry.scissor, x, y, width, height); view->geometry.scissor_enabled = true; weston_view_geometry_dirty(view); weston_view_schedule_repaint(view); } /** Remove the clip mask from a view * * \param view The view to remove the clip mask from. * * Removed the clip mask rectangle and schedules a repaint. * * \sa weston_view_set_mask */ WL_EXPORT void weston_view_set_mask_infinite(struct weston_view *view) { view->geometry.scissor_enabled = false; weston_view_geometry_dirty(view); weston_view_schedule_repaint(view); } WL_EXPORT bool weston_view_is_mapped(struct weston_view *view) { if (view->output) return true; else return false; } WL_EXPORT bool weston_surface_is_mapped(struct weston_surface *surface) { if (surface->output) return true; else return false; } static void surface_set_size(struct weston_surface *surface, int32_t width, int32_t height) { struct weston_view *view; if (surface->width == width && surface->height == height) return; surface->width = width; surface->height = height; wl_list_for_each(view, &surface->views, surface_link) weston_view_geometry_dirty(view); } WL_EXPORT void weston_surface_set_size(struct weston_surface *surface, int32_t width, int32_t height) { assert(!surface->resource); surface_set_size(surface, width, height); } static int fixed_round_up_to_int(wl_fixed_t f) { return wl_fixed_to_int(wl_fixed_from_int(1) - 1 + f); } static void weston_surface_calculate_size_from_buffer(struct weston_surface *surface) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; int32_t width, height; if (!surface->buffer_ref.buffer) { surface->width_from_buffer = 0; surface->height_from_buffer = 0; return; } switch (vp->buffer.transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: width = surface->buffer_ref.buffer->height / vp->buffer.scale; height = surface->buffer_ref.buffer->width / vp->buffer.scale; break; default: width = surface->buffer_ref.buffer->width / vp->buffer.scale; height = surface->buffer_ref.buffer->height / vp->buffer.scale; break; } surface->width_from_buffer = width; surface->height_from_buffer = height; } static void weston_surface_update_size(struct weston_surface *surface) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; int32_t width, height; width = surface->width_from_buffer; height = surface->height_from_buffer; if (width != 0 && vp->surface.width != -1) { surface_set_size(surface, vp->surface.width, vp->surface.height); return; } if (width != 0 && vp->buffer.src_width != wl_fixed_from_int(-1)) { int32_t w = fixed_round_up_to_int(vp->buffer.src_width); int32_t h = fixed_round_up_to_int(vp->buffer.src_height); surface_set_size(surface, w ?: 1, h ?: 1); return; } surface_set_size(surface, width, height); } WL_EXPORT uint32_t weston_compositor_get_time(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000 + tv.tv_usec / 1000; } WL_EXPORT struct weston_view * weston_compositor_pick_view(struct weston_compositor *compositor, wl_fixed_t x, wl_fixed_t y, wl_fixed_t *vx, wl_fixed_t *vy) { struct weston_view *view; wl_fixed_t view_x, view_y; int view_ix, view_iy; int ix = wl_fixed_to_int(x); int iy = wl_fixed_to_int(y); wl_list_for_each(view, &compositor->view_list, link) { if (!pixman_region32_contains_point( &view->transform.boundingbox, ix, iy, NULL)) continue; weston_view_from_global_fixed(view, x, y, &view_x, &view_y); view_ix = wl_fixed_to_int(view_x); view_iy = wl_fixed_to_int(view_y); if (!pixman_region32_contains_point(&view->surface->input, view_ix, view_iy, NULL)) continue; if (view->geometry.scissor_enabled && !pixman_region32_contains_point(&view->geometry.scissor, view_ix, view_iy, NULL)) continue; *vx = view_x; *vy = view_y; return view; } *vx = wl_fixed_from_int(-1000000); *vy = wl_fixed_from_int(-1000000); return NULL; } static void weston_compositor_repick(struct weston_compositor *compositor) { struct weston_seat *seat; if (!compositor->session_active) return; wl_list_for_each(seat, &compositor->seat_list, link) weston_seat_repick(seat); } WL_EXPORT void weston_view_unmap(struct weston_view *view) { struct weston_seat *seat; if (!weston_view_is_mapped(view)) return; weston_view_damage_below(view); view->output = NULL; view->plane = NULL; weston_layer_entry_remove(&view->layer_link); wl_list_remove(&view->link); wl_list_init(&view->link); view->output_mask = 0; weston_surface_assign_output(view->surface); if (weston_surface_is_mapped(view->surface)) return; wl_list_for_each(seat, &view->surface->compositor->seat_list, link) { struct weston_touch *touch = weston_seat_get_touch(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (keyboard && keyboard->focus == view->surface) weston_keyboard_set_focus(keyboard, NULL); if (pointer && pointer->focus == view) weston_pointer_clear_focus(pointer); if (touch && touch->focus == view) weston_touch_set_focus(touch, NULL); } } WL_EXPORT void weston_surface_unmap(struct weston_surface *surface) { struct weston_view *view; wl_list_for_each(view, &surface->views, surface_link) weston_view_unmap(view); surface->output = NULL; } static void weston_surface_reset_pending_buffer(struct weston_surface *surface) { weston_surface_state_set_buffer(&surface->pending, NULL); surface->pending.sx = 0; surface->pending.sy = 0; surface->pending.newly_attached = 0; surface->pending.buffer_viewport.changed = 0; } WL_EXPORT void weston_view_destroy(struct weston_view *view) { wl_signal_emit(&view->destroy_signal, view); assert(wl_list_empty(&view->geometry.child_list)); if (weston_view_is_mapped(view)) { weston_view_unmap(view); weston_compositor_build_view_list(view->surface->compositor); } wl_list_remove(&view->link); weston_layer_entry_remove(&view->layer_link); pixman_region32_fini(&view->clip); pixman_region32_fini(&view->geometry.scissor); pixman_region32_fini(&view->transform.boundingbox); pixman_region32_fini(&view->transform.opaque); weston_view_set_transform_parent(view, NULL); wl_list_remove(&view->surface_link); free(view); } WL_EXPORT void weston_surface_destroy(struct weston_surface *surface) { struct weston_frame_callback *cb, *next; struct weston_view *ev, *nv; if (--surface->ref_count > 0) return; assert(surface->resource == NULL); wl_signal_emit(&surface->destroy_signal, surface); assert(wl_list_empty(&surface->subsurface_list_pending)); assert(wl_list_empty(&surface->subsurface_list)); wl_list_for_each_safe(ev, nv, &surface->views, surface_link) weston_view_destroy(ev); weston_surface_state_fini(&surface->pending); weston_buffer_reference(&surface->buffer_ref, NULL); pixman_region32_fini(&surface->damage); pixman_region32_fini(&surface->opaque); pixman_region32_fini(&surface->input); wl_list_for_each_safe(cb, next, &surface->frame_callback_list, link) wl_resource_destroy(cb->resource); weston_presentation_feedback_discard_list(&surface->feedback_list); free(surface); } static void destroy_surface(struct wl_resource *resource) { struct weston_surface *surface = wl_resource_get_user_data(resource); assert(surface); /* Set the resource to NULL, since we don't want to leave a * dangling pointer if the surface was refcounted and survives * the weston_surface_destroy() call. */ surface->resource = NULL; weston_surface_destroy(surface); } static void weston_buffer_destroy_handler(struct wl_listener *listener, void *data) { struct weston_buffer *buffer = container_of(listener, struct weston_buffer, destroy_listener); wl_signal_emit(&buffer->destroy_signal, buffer); free(buffer); } WL_EXPORT struct weston_buffer * weston_buffer_from_resource(struct wl_resource *resource) { struct weston_buffer *buffer; struct wl_listener *listener; listener = wl_resource_get_destroy_listener(resource, weston_buffer_destroy_handler); if (listener) return container_of(listener, struct weston_buffer, destroy_listener); buffer = zalloc(sizeof *buffer); if (buffer == NULL) return NULL; buffer->resource = resource; wl_signal_init(&buffer->destroy_signal); buffer->destroy_listener.notify = weston_buffer_destroy_handler; buffer->y_inverted = 1; wl_resource_add_destroy_listener(resource, &buffer->destroy_listener); return buffer; } static void weston_buffer_reference_handle_destroy(struct wl_listener *listener, void *data) { struct weston_buffer_reference *ref = container_of(listener, struct weston_buffer_reference, destroy_listener); assert((struct weston_buffer *)data == ref->buffer); ref->buffer = NULL; } WL_EXPORT void weston_buffer_reference(struct weston_buffer_reference *ref, struct weston_buffer *buffer) { if (ref->buffer && buffer != ref->buffer) { ref->buffer->busy_count--; if (ref->buffer->busy_count == 0) { assert(wl_resource_get_client(ref->buffer->resource)); wl_resource_queue_event(ref->buffer->resource, WL_BUFFER_RELEASE); } wl_list_remove(&ref->destroy_listener.link); } if (buffer && buffer != ref->buffer) { buffer->busy_count++; wl_signal_add(&buffer->destroy_signal, &ref->destroy_listener); } ref->buffer = buffer; ref->destroy_listener.notify = weston_buffer_reference_handle_destroy; } static void weston_surface_attach(struct weston_surface *surface, struct weston_buffer *buffer) { weston_buffer_reference(&surface->buffer_ref, buffer); if (!buffer) { if (weston_surface_is_mapped(surface)) weston_surface_unmap(surface); } surface->compositor->renderer->attach(surface, buffer); weston_surface_calculate_size_from_buffer(surface); weston_presentation_feedback_discard_list(&surface->feedback_list); } WL_EXPORT void weston_compositor_damage_all(struct weston_compositor *compositor) { struct weston_output *output; wl_list_for_each(output, &compositor->output_list, link) weston_output_damage(output); } WL_EXPORT void weston_output_damage(struct weston_output *output) { struct weston_compositor *compositor = output->compositor; pixman_region32_union(&compositor->primary_plane.damage, &compositor->primary_plane.damage, &output->region); weston_output_schedule_repaint(output); } static void surface_flush_damage(struct weston_surface *surface) { if (surface->buffer_ref.buffer && wl_shm_buffer_get(surface->buffer_ref.buffer->resource)) surface->compositor->renderer->flush_damage(surface); if (weston_timeline_enabled_ && pixman_region32_not_empty(&surface->damage)) TL_POINT("core_flush_damage", TLP_SURFACE(surface), TLP_OUTPUT(surface->output), TLP_END); pixman_region32_clear(&surface->damage); } static void view_accumulate_damage(struct weston_view *view, pixman_region32_t *opaque) { pixman_region32_t damage; pixman_region32_init(&damage); if (view->transform.enabled) { pixman_box32_t *extents; extents = pixman_region32_extents(&view->surface->damage); view_compute_bbox(view, extents, &damage); } else { pixman_region32_copy(&damage, &view->surface->damage); pixman_region32_translate(&damage, view->geometry.x, view->geometry.y); } pixman_region32_intersect(&damage, &damage, &view->transform.boundingbox); pixman_region32_subtract(&damage, &damage, opaque); pixman_region32_union(&view->plane->damage, &view->plane->damage, &damage); pixman_region32_fini(&damage); pixman_region32_copy(&view->clip, opaque); pixman_region32_union(opaque, opaque, &view->transform.opaque); } static void compositor_accumulate_damage(struct weston_compositor *ec) { struct weston_plane *plane; struct weston_view *ev; pixman_region32_t opaque, clip; pixman_region32_init(&clip); wl_list_for_each(plane, &ec->plane_list, link) { pixman_region32_copy(&plane->clip, &clip); pixman_region32_init(&opaque); wl_list_for_each(ev, &ec->view_list, link) { if (ev->plane != plane) continue; view_accumulate_damage(ev, &opaque); } pixman_region32_union(&clip, &clip, &opaque); pixman_region32_fini(&opaque); } pixman_region32_fini(&clip); wl_list_for_each(ev, &ec->view_list, link) ev->surface->touched = 0; wl_list_for_each(ev, &ec->view_list, link) { if (ev->surface->touched) continue; ev->surface->touched = 1; surface_flush_damage(ev->surface); /* Both the renderer and the backend have seen the buffer * by now. If renderer needs the buffer, it has its own * reference set. If the backend wants to keep the buffer * around for migrating the surface into a non-primary plane * later, keep_buffer is true. Otherwise, drop the core * reference now, and allow early buffer release. This enables * clients to use single-buffering. */ if (!ev->surface->keep_buffer) weston_buffer_reference(&ev->surface->buffer_ref, NULL); } } static void surface_stash_subsurface_views(struct weston_surface *surface) { struct weston_subsurface *sub; wl_list_for_each(sub, &surface->subsurface_list, parent_link) { if (sub->surface == surface) continue; wl_list_insert_list(&sub->unused_views, &sub->surface->views); wl_list_init(&sub->surface->views); surface_stash_subsurface_views(sub->surface); } } static void surface_free_unused_subsurface_views(struct weston_surface *surface) { struct weston_subsurface *sub; struct weston_view *view, *nv; wl_list_for_each(sub, &surface->subsurface_list, parent_link) { if (sub->surface == surface) continue; wl_list_for_each_safe(view, nv, &sub->unused_views, surface_link) { weston_view_unmap (view); weston_view_destroy(view); } surface_free_unused_subsurface_views(sub->surface); } } static void view_list_add_subsurface_view(struct weston_compositor *compositor, struct weston_subsurface *sub, struct weston_view *parent) { struct weston_subsurface *child; struct weston_view *view = NULL, *iv; if (!weston_surface_is_mapped(sub->surface)) return; wl_list_for_each(iv, &sub->unused_views, surface_link) { if (iv->geometry.parent == parent) { view = iv; break; } } if (view) { /* Put it back in the surface's list of views */ wl_list_remove(&view->surface_link); wl_list_insert(&sub->surface->views, &view->surface_link); } else { view = weston_view_create(sub->surface); weston_view_set_position(view, sub->position.x, sub->position.y); weston_view_set_transform_parent(view, parent); } view->parent_view = parent; weston_view_update_transform(view); if (wl_list_empty(&sub->surface->subsurface_list)) { wl_list_insert(compositor->view_list.prev, &view->link); return; } wl_list_for_each(child, &sub->surface->subsurface_list, parent_link) { if (child->surface == sub->surface) wl_list_insert(compositor->view_list.prev, &view->link); else view_list_add_subsurface_view(compositor, child, view); } } static void view_list_add(struct weston_compositor *compositor, struct weston_view *view) { struct weston_subsurface *sub; weston_view_update_transform(view); if (wl_list_empty(&view->surface->subsurface_list)) { wl_list_insert(compositor->view_list.prev, &view->link); return; } wl_list_for_each(sub, &view->surface->subsurface_list, parent_link) { if (sub->surface == view->surface) wl_list_insert(compositor->view_list.prev, &view->link); else view_list_add_subsurface_view(compositor, sub, view); } } static void weston_compositor_build_view_list(struct weston_compositor *compositor) { struct weston_view *view; struct weston_layer *layer; wl_list_for_each(layer, &compositor->layer_list, link) wl_list_for_each(view, &layer->view_list.link, layer_link.link) surface_stash_subsurface_views(view->surface); wl_list_init(&compositor->view_list); wl_list_for_each(layer, &compositor->layer_list, link) { wl_list_for_each(view, &layer->view_list.link, layer_link.link) { view_list_add(compositor, view); } } wl_list_for_each(layer, &compositor->layer_list, link) wl_list_for_each(view, &layer->view_list.link, layer_link.link) surface_free_unused_subsurface_views(view->surface); } static void weston_output_take_feedback_list(struct weston_output *output, struct weston_surface *surface) { struct weston_view *view; struct weston_presentation_feedback *feedback; uint32_t flags = 0xffffffff; if (wl_list_empty(&surface->feedback_list)) return; /* All views must have the flag for the flag to survive. */ wl_list_for_each(view, &surface->views, surface_link) { /* ignore views that are not on this output at all */ if (view->output_mask & (1u << output->id)) flags &= view->psf_flags; } wl_list_for_each(feedback, &surface->feedback_list, link) feedback->psf_flags = flags; wl_list_insert_list(&output->feedback_list, &surface->feedback_list); wl_list_init(&surface->feedback_list); } static int weston_output_repaint(struct weston_output *output) { struct weston_compositor *ec = output->compositor; struct weston_view *ev; struct weston_animation *animation, *next; struct weston_frame_callback *cb, *cnext; struct wl_list frame_callback_list; pixman_region32_t output_damage; int r; if (output->destroying) return 0; TL_POINT("core_repaint_begin", TLP_OUTPUT(output), TLP_END); /* Rebuild the surface list and update surface transforms up front. */ weston_compositor_build_view_list(ec); if (output->assign_planes && !output->disable_planes) { output->assign_planes(output); } else { wl_list_for_each(ev, &ec->view_list, link) { weston_view_move_to_plane(ev, &ec->primary_plane); ev->psf_flags = 0; } } wl_list_init(&frame_callback_list); wl_list_for_each(ev, &ec->view_list, link) { /* Note: This operation is safe to do multiple times on the * same surface. */ if (ev->surface->output == output) { wl_list_insert_list(&frame_callback_list, &ev->surface->frame_callback_list); wl_list_init(&ev->surface->frame_callback_list); weston_output_take_feedback_list(output, ev->surface); } } compositor_accumulate_damage(ec); pixman_region32_init(&output_damage); pixman_region32_intersect(&output_damage, &ec->primary_plane.damage, &output->region); pixman_region32_subtract(&output_damage, &output_damage, &ec->primary_plane.clip); if (output->dirty) weston_output_update_matrix(output); r = output->repaint(output, &output_damage); pixman_region32_fini(&output_damage); output->repaint_needed = 0; weston_compositor_repick(ec); wl_event_loop_dispatch(ec->input_loop, 0); wl_list_for_each_safe(cb, cnext, &frame_callback_list, link) { wl_callback_send_done(cb->resource, output->frame_time); wl_resource_destroy(cb->resource); } wl_list_for_each_safe(animation, next, &output->animation_list, link) { animation->frame_counter++; animation->frame(animation, output, output->frame_time); } TL_POINT("core_repaint_posted", TLP_OUTPUT(output), TLP_END); return r; } static int weston_compositor_read_input(int fd, uint32_t mask, void *data) { struct weston_compositor *compositor = data; wl_event_loop_dispatch(compositor->input_loop, 0); return 1; } static void weston_output_schedule_repaint_reset(struct weston_output *output) { struct weston_compositor *compositor = output->compositor; struct wl_event_loop *loop; int fd; output->repaint_scheduled = 0; TL_POINT("core_repaint_exit_loop", TLP_OUTPUT(output), TLP_END); if (compositor->input_loop_source) return; loop = wl_display_get_event_loop(compositor->wl_display); fd = wl_event_loop_get_fd(compositor->input_loop); compositor->input_loop_source = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, weston_compositor_read_input, compositor); } static int output_repaint_timer_handler(void *data) { struct weston_output *output = data; struct weston_compositor *compositor = output->compositor; if (output->repaint_needed && compositor->state != WESTON_COMPOSITOR_SLEEPING && compositor->state != WESTON_COMPOSITOR_OFFSCREEN && weston_output_repaint(output) == 0) return 0; weston_output_schedule_repaint_reset(output); return 0; } WL_EXPORT void weston_output_finish_frame(struct weston_output *output, const struct timespec *stamp, uint32_t presented_flags) { struct weston_compositor *compositor = output->compositor; int32_t refresh_nsec; struct timespec now; struct timespec gone; int msec; TL_POINT("core_repaint_finished", TLP_OUTPUT(output), TLP_VBLANK(stamp), TLP_END); refresh_nsec = millihz_to_nsec(output->current_mode->refresh); weston_presentation_feedback_present_list(&output->feedback_list, output, refresh_nsec, stamp, output->msc, presented_flags); output->frame_time = stamp->tv_sec * 1000 + stamp->tv_nsec / 1000000; weston_compositor_read_presentation_clock(compositor, &now); timespec_sub(&gone, &now, stamp); msec = (refresh_nsec - timespec_to_nsec(&gone)) / 1000000; /* floor */ msec -= compositor->repaint_msec; if (msec < -1000 || msec > 1000) { static bool warned; if (!warned) weston_log("Warning: computed repaint delay is " "insane: %d msec\n", msec); warned = true; msec = 0; } /* Called from restart_repaint_loop and restart happens already after * the deadline given by repaint_msec? In that case we delay until * the deadline of the next frame, to give clients a more predictable * timing of the repaint cycle to lock on. */ if (presented_flags == PRESENTATION_FEEDBACK_INVALID && msec < 0) msec += refresh_nsec / 1000000; if (msec < 1) output_repaint_timer_handler(output); else wl_event_source_timer_update(output->repaint_timer, msec); } static void idle_repaint(void *data) { struct weston_output *output = data; output->start_repaint_loop(output); } WL_EXPORT void weston_layer_entry_insert(struct weston_layer_entry *list, struct weston_layer_entry *entry) { wl_list_insert(&list->link, &entry->link); entry->layer = list->layer; } WL_EXPORT void weston_layer_entry_remove(struct weston_layer_entry *entry) { wl_list_remove(&entry->link); wl_list_init(&entry->link); entry->layer = NULL; } WL_EXPORT void weston_layer_init(struct weston_layer *layer, struct wl_list *below) { wl_list_init(&layer->view_list.link); layer->view_list.layer = layer; weston_layer_set_mask_infinite(layer); if (below != NULL) wl_list_insert(below, &layer->link); } WL_EXPORT void weston_layer_set_mask(struct weston_layer *layer, int x, int y, int width, int height) { struct weston_view *view; layer->mask.x1 = x; layer->mask.x2 = x + width; layer->mask.y1 = y; layer->mask.y2 = y + height; wl_list_for_each(view, &layer->view_list.link, layer_link.link) { weston_view_geometry_dirty(view); } } WL_EXPORT void weston_layer_set_mask_infinite(struct weston_layer *layer) { weston_layer_set_mask(layer, INT32_MIN, INT32_MIN, UINT32_MAX, UINT32_MAX); } WL_EXPORT void weston_output_schedule_repaint(struct weston_output *output) { struct weston_compositor *compositor = output->compositor; struct wl_event_loop *loop; if (compositor->state == WESTON_COMPOSITOR_SLEEPING || compositor->state == WESTON_COMPOSITOR_OFFSCREEN) return; if (!output->repaint_needed) TL_POINT("core_repaint_req", TLP_OUTPUT(output), TLP_END); loop = wl_display_get_event_loop(compositor->wl_display); output->repaint_needed = 1; if (output->repaint_scheduled) return; wl_event_loop_add_idle(loop, idle_repaint, output); output->repaint_scheduled = 1; TL_POINT("core_repaint_enter_loop", TLP_OUTPUT(output), TLP_END); if (compositor->input_loop_source) { wl_event_source_remove(compositor->input_loop_source); compositor->input_loop_source = NULL; } } WL_EXPORT void weston_compositor_schedule_repaint(struct weston_compositor *compositor) { struct weston_output *output; wl_list_for_each(output, &compositor->output_list, link) weston_output_schedule_repaint(output); } static void surface_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void surface_attach(struct wl_client *client, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t sx, int32_t sy) { struct weston_surface *surface = wl_resource_get_user_data(resource); struct weston_buffer *buffer = NULL; if (buffer_resource) { buffer = weston_buffer_from_resource(buffer_resource); if (buffer == NULL) { wl_client_post_no_memory(client); return; } } /* Attach, attach, without commit in between does not send * wl_buffer.release. */ weston_surface_state_set_buffer(&surface->pending, buffer); surface->pending.sx = sx; surface->pending.sy = sy; surface->pending.newly_attached = 1; } static void surface_damage(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct weston_surface *surface = wl_resource_get_user_data(resource); pixman_region32_union_rect(&surface->pending.damage, &surface->pending.damage, x, y, width, height); } static void destroy_frame_callback(struct wl_resource *resource) { struct weston_frame_callback *cb = wl_resource_get_user_data(resource); wl_list_remove(&cb->link); free(cb); } static void surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t callback) { struct weston_frame_callback *cb; struct weston_surface *surface = wl_resource_get_user_data(resource); cb = malloc(sizeof *cb); if (cb == NULL) { wl_resource_post_no_memory(resource); return; } cb->resource = wl_resource_create(client, &wl_callback_interface, 1, callback); if (cb->resource == NULL) { free(cb); wl_resource_post_no_memory(resource); return; } wl_resource_set_implementation(cb->resource, NULL, cb, destroy_frame_callback); wl_list_insert(surface->pending.frame_callback_list.prev, &cb->link); } static void surface_set_opaque_region(struct wl_client *client, struct wl_resource *resource, struct wl_resource *region_resource) { struct weston_surface *surface = wl_resource_get_user_data(resource); struct weston_region *region; if (region_resource) { region = wl_resource_get_user_data(region_resource); pixman_region32_copy(&surface->pending.opaque, ®ion->region); } else { pixman_region32_clear(&surface->pending.opaque); } } static void surface_set_input_region(struct wl_client *client, struct wl_resource *resource, struct wl_resource *region_resource) { struct weston_surface *surface = wl_resource_get_user_data(resource); struct weston_region *region; if (region_resource) { region = wl_resource_get_user_data(region_resource); pixman_region32_copy(&surface->pending.input, ®ion->region); } else { pixman_region32_fini(&surface->pending.input); region_init_infinite(&surface->pending.input); } } static void weston_surface_commit_subsurface_order(struct weston_surface *surface) { struct weston_subsurface *sub; wl_list_for_each_reverse(sub, &surface->subsurface_list_pending, parent_link_pending) { wl_list_remove(&sub->parent_link); wl_list_insert(&surface->subsurface_list, &sub->parent_link); } } static void weston_surface_build_buffer_matrix(struct weston_surface *surface, struct weston_matrix *matrix) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; double src_width, src_height, dest_width, dest_height; weston_matrix_init(matrix); if (vp->buffer.src_width == wl_fixed_from_int(-1)) { src_width = surface->width_from_buffer; src_height = surface->height_from_buffer; } else { src_width = wl_fixed_to_double(vp->buffer.src_width); src_height = wl_fixed_to_double(vp->buffer.src_height); } if (vp->surface.width == -1) { dest_width = src_width; dest_height = src_height; } else { dest_width = vp->surface.width; dest_height = vp->surface.height; } if (src_width != dest_width || src_height != dest_height) weston_matrix_scale(matrix, src_width / dest_width, src_height / dest_height, 1); if (vp->buffer.src_width != wl_fixed_from_int(-1)) weston_matrix_translate(matrix, wl_fixed_to_double(vp->buffer.src_x), wl_fixed_to_double(vp->buffer.src_y), 0); switch (vp->buffer.transform) { case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_180: case WL_OUTPUT_TRANSFORM_FLIPPED_270: weston_matrix_scale(matrix, -1, 1, 1); weston_matrix_translate(matrix, surface->width_from_buffer, 0, 0); break; } switch (vp->buffer.transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_FLIPPED: break; case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_FLIPPED_90: weston_matrix_rotate_xy(matrix, 0, 1); weston_matrix_translate(matrix, surface->height_from_buffer, 0, 0); break; case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED_180: weston_matrix_rotate_xy(matrix, -1, 0); weston_matrix_translate(matrix, surface->width_from_buffer, surface->height_from_buffer, 0); break; case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_270: weston_matrix_rotate_xy(matrix, 0, -1); weston_matrix_translate(matrix, 0, surface->width_from_buffer, 0); break; } weston_matrix_scale(matrix, vp->buffer.scale, vp->buffer.scale, 1); } static void weston_surface_commit_state(struct weston_surface *surface, struct weston_surface_state *state) { struct weston_view *view; pixman_region32_t opaque; /* wl_surface.set_buffer_transform */ /* wl_surface.set_buffer_scale */ /* wl_viewport.set */ surface->buffer_viewport = state->buffer_viewport; /* wl_surface.attach */ if (state->newly_attached) weston_surface_attach(surface, state->buffer); weston_surface_state_set_buffer(state, NULL); weston_surface_build_buffer_matrix(surface, &surface->surface_to_buffer_matrix); weston_matrix_invert(&surface->buffer_to_surface_matrix, &surface->surface_to_buffer_matrix); if (state->newly_attached || state->buffer_viewport.changed) { weston_surface_update_size(surface); if (surface->configure) surface->configure(surface, state->sx, state->sy); } state->sx = 0; state->sy = 0; state->newly_attached = 0; state->buffer_viewport.changed = 0; /* wl_surface.damage */ if (weston_timeline_enabled_ && pixman_region32_not_empty(&state->damage)) TL_POINT("core_commit_damage", TLP_SURFACE(surface), TLP_END); pixman_region32_union(&surface->damage, &surface->damage, &state->damage); pixman_region32_intersect_rect(&surface->damage, &surface->damage, 0, 0, surface->width, surface->height); pixman_region32_clear(&state->damage); /* wl_surface.set_opaque_region */ pixman_region32_init(&opaque); pixman_region32_intersect_rect(&opaque, &state->opaque, 0, 0, surface->width, surface->height); if (!pixman_region32_equal(&opaque, &surface->opaque)) { pixman_region32_copy(&surface->opaque, &opaque); wl_list_for_each(view, &surface->views, surface_link) weston_view_geometry_dirty(view); } pixman_region32_fini(&opaque); /* wl_surface.set_input_region */ pixman_region32_intersect_rect(&surface->input, &state->input, 0, 0, surface->width, surface->height); /* wl_surface.frame */ wl_list_insert_list(&surface->frame_callback_list, &state->frame_callback_list); wl_list_init(&state->frame_callback_list); /* XXX: * What should happen with a feedback request, if there * is no wl_buffer attached for this commit? */ /* presentation.feedback */ wl_list_insert_list(&surface->feedback_list, &state->feedback_list); wl_list_init(&state->feedback_list); } static void weston_surface_commit(struct weston_surface *surface) { weston_surface_commit_state(surface, &surface->pending); weston_surface_commit_subsurface_order(surface); weston_surface_schedule_repaint(surface); } static void weston_subsurface_commit(struct weston_subsurface *sub); static void weston_subsurface_parent_commit(struct weston_subsurface *sub, int parent_is_synchronized); static void surface_commit(struct wl_client *client, struct wl_resource *resource) { struct weston_surface *surface = wl_resource_get_user_data(resource); struct weston_subsurface *sub = weston_surface_to_subsurface(surface); if (sub) { weston_subsurface_commit(sub); return; } weston_surface_commit(surface); wl_list_for_each(sub, &surface->subsurface_list, parent_link) { if (sub->surface != surface) weston_subsurface_parent_commit(sub, 0); } } static void surface_set_buffer_transform(struct wl_client *client, struct wl_resource *resource, int transform) { struct weston_surface *surface = wl_resource_get_user_data(resource); /* if wl_output.transform grows more members this will need to be updated. */ if (transform < 0 || transform > WL_OUTPUT_TRANSFORM_FLIPPED_270) { wl_resource_post_error(resource, WL_SURFACE_ERROR_INVALID_TRANSFORM, "buffer transform must be a valid transform " "('%d' specified)", transform); return; } surface->pending.buffer_viewport.buffer.transform = transform; surface->pending.buffer_viewport.changed = 1; } static void surface_set_buffer_scale(struct wl_client *client, struct wl_resource *resource, int32_t scale) { struct weston_surface *surface = wl_resource_get_user_data(resource); if (scale < 1) { wl_resource_post_error(resource, WL_SURFACE_ERROR_INVALID_SCALE, "buffer scale must be at least one " "('%d' specified)", scale); return; } surface->pending.buffer_viewport.buffer.scale = scale; surface->pending.buffer_viewport.changed = 1; } static const struct wl_surface_interface surface_interface = { surface_destroy, surface_attach, surface_damage, surface_frame, surface_set_opaque_region, surface_set_input_region, surface_commit, surface_set_buffer_transform, surface_set_buffer_scale }; static void compositor_create_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct weston_compositor *ec = wl_resource_get_user_data(resource); struct weston_surface *surface; surface = weston_surface_create(ec); if (surface == NULL) { wl_resource_post_no_memory(resource); return; } surface->resource = wl_resource_create(client, &wl_surface_interface, wl_resource_get_version(resource), id); if (surface->resource == NULL) { weston_surface_destroy(surface); wl_resource_post_no_memory(resource); return; } wl_resource_set_implementation(surface->resource, &surface_interface, surface, destroy_surface); wl_signal_emit(&ec->create_surface_signal, surface); } static void destroy_region(struct wl_resource *resource) { struct weston_region *region = wl_resource_get_user_data(resource); pixman_region32_fini(®ion->region); free(region); } static void region_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void region_add(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct weston_region *region = wl_resource_get_user_data(resource); pixman_region32_union_rect(®ion->region, ®ion->region, x, y, width, height); } static void region_subtract(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct weston_region *region = wl_resource_get_user_data(resource); pixman_region32_t rect; pixman_region32_init_rect(&rect, x, y, width, height); pixman_region32_subtract(®ion->region, ®ion->region, &rect); pixman_region32_fini(&rect); } static const struct wl_region_interface region_interface = { region_destroy, region_add, region_subtract }; static void compositor_create_region(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct weston_region *region; region = malloc(sizeof *region); if (region == NULL) { wl_resource_post_no_memory(resource); return; } pixman_region32_init(®ion->region); region->resource = wl_resource_create(client, &wl_region_interface, 1, id); if (region->resource == NULL) { free(region); wl_resource_post_no_memory(resource); return; } wl_resource_set_implementation(region->resource, ®ion_interface, region, destroy_region); } static const struct wl_compositor_interface compositor_interface = { compositor_create_surface, compositor_create_region }; static void weston_subsurface_commit_from_cache(struct weston_subsurface *sub) { struct weston_surface *surface = sub->surface; weston_surface_commit_state(surface, &sub->cached); weston_buffer_reference(&sub->cached_buffer_ref, NULL); weston_surface_commit_subsurface_order(surface); weston_surface_schedule_repaint(surface); sub->has_cached_data = 0; } static void weston_subsurface_commit_to_cache(struct weston_subsurface *sub) { struct weston_surface *surface = sub->surface; /* * If this commit would cause the surface to move by the * attach(dx, dy) parameters, the old damage region must be * translated to correspond to the new surface coordinate system * original_mode. */ pixman_region32_translate(&sub->cached.damage, -surface->pending.sx, -surface->pending.sy); pixman_region32_union(&sub->cached.damage, &sub->cached.damage, &surface->pending.damage); pixman_region32_clear(&surface->pending.damage); if (surface->pending.newly_attached) { sub->cached.newly_attached = 1; weston_surface_state_set_buffer(&sub->cached, surface->pending.buffer); weston_buffer_reference(&sub->cached_buffer_ref, surface->pending.buffer); weston_presentation_feedback_discard_list( &sub->cached.feedback_list); } sub->cached.sx += surface->pending.sx; sub->cached.sy += surface->pending.sy; sub->cached.buffer_viewport.changed |= surface->pending.buffer_viewport.changed; sub->cached.buffer_viewport.buffer = surface->pending.buffer_viewport.buffer; sub->cached.buffer_viewport.surface = surface->pending.buffer_viewport.surface; weston_surface_reset_pending_buffer(surface); pixman_region32_copy(&sub->cached.opaque, &surface->pending.opaque); pixman_region32_copy(&sub->cached.input, &surface->pending.input); wl_list_insert_list(&sub->cached.frame_callback_list, &surface->pending.frame_callback_list); wl_list_init(&surface->pending.frame_callback_list); wl_list_insert_list(&sub->cached.feedback_list, &surface->pending.feedback_list); wl_list_init(&surface->pending.feedback_list); sub->has_cached_data = 1; } static bool weston_subsurface_is_synchronized(struct weston_subsurface *sub) { while (sub) { if (sub->synchronized) return true; if (!sub->parent) return false; sub = weston_surface_to_subsurface(sub->parent); } return false; } static void weston_subsurface_commit(struct weston_subsurface *sub) { struct weston_surface *surface = sub->surface; struct weston_subsurface *tmp; /* Recursive check for effectively synchronized. */ if (weston_subsurface_is_synchronized(sub)) { weston_subsurface_commit_to_cache(sub); } else { if (sub->has_cached_data) { /* flush accumulated state from cache */ weston_subsurface_commit_to_cache(sub); weston_subsurface_commit_from_cache(sub); } else { weston_surface_commit(surface); } wl_list_for_each(tmp, &surface->subsurface_list, parent_link) { if (tmp->surface != surface) weston_subsurface_parent_commit(tmp, 0); } } } static void weston_subsurface_synchronized_commit(struct weston_subsurface *sub) { struct weston_surface *surface = sub->surface; struct weston_subsurface *tmp; /* From now on, commit_from_cache the whole sub-tree, regardless of * the synchronized mode of each child. This sub-surface or some * of its ancestors were synchronized, so we are synchronized * all the way down. */ if (sub->has_cached_data) weston_subsurface_commit_from_cache(sub); wl_list_for_each(tmp, &surface->subsurface_list, parent_link) { if (tmp->surface != surface) weston_subsurface_parent_commit(tmp, 1); } } static void weston_subsurface_parent_commit(struct weston_subsurface *sub, int parent_is_synchronized) { struct weston_view *view; if (sub->position.set) { wl_list_for_each(view, &sub->surface->views, surface_link) weston_view_set_position(view, sub->position.x, sub->position.y); sub->position.set = 0; } if (parent_is_synchronized || sub->synchronized) weston_subsurface_synchronized_commit(sub); } static int subsurface_get_label(struct weston_surface *surface, char *buf, size_t len) { return snprintf(buf, len, "sub-surface"); } static void subsurface_configure(struct weston_surface *surface, int32_t dx, int32_t dy) { struct weston_compositor *compositor = surface->compositor; struct weston_view *view; wl_list_for_each(view, &surface->views, surface_link) weston_view_set_position(view, view->geometry.x + dx, view->geometry.y + dy); /* No need to check parent mappedness, because if parent is not * mapped, parent is not in a visible layer, so this sub-surface * will not be drawn either. */ if (!weston_surface_is_mapped(surface)) { struct weston_output *output; /* Cannot call weston_view_update_transform(), * because that would call it also for the parent surface, * which might not be mapped yet. That would lead to * inconsistent state, where the window could never be * mapped. * * Instead just assign any output, to make * weston_surface_is_mapped() return true, so that when the * parent surface does get mapped, this one will get * included, too. See view_list_add(). */ assert(!wl_list_empty(&compositor->output_list)); output = container_of(compositor->output_list.next, struct weston_output, link); surface->output = output; weston_surface_update_output_mask(surface, 1 << output->id); } } static struct weston_subsurface * weston_surface_to_subsurface(struct weston_surface *surface) { if (surface->configure == subsurface_configure) return surface->configure_private; return NULL; } WL_EXPORT struct weston_surface * weston_surface_get_main_surface(struct weston_surface *surface) { struct weston_subsurface *sub; while (surface && (sub = weston_surface_to_subsurface(surface))) surface = sub->parent; return surface; } WL_EXPORT int weston_surface_set_role(struct weston_surface *surface, const char *role_name, struct wl_resource *error_resource, uint32_t error_code) { assert(role_name); if (surface->role_name == NULL || surface->role_name == role_name || strcmp(surface->role_name, role_name) == 0) { surface->role_name = role_name; return 0; } wl_resource_post_error(error_resource, error_code, "Cannot assign role %s to wl_surface@%d," " already has role %s\n", role_name, wl_resource_get_id(surface->resource), surface->role_name); return -1; } WL_EXPORT void weston_surface_set_label_func(struct weston_surface *surface, int (*desc)(struct weston_surface *, char *, size_t)) { surface->get_label = desc; surface->timeline.force_refresh = 1; } /** Get the size of surface contents * * \param surface The surface to query. * \param width Returns the width of raw contents. * \param height Returns the height of raw contents. * * Retrieves the raw surface content size in pixels for the given surface. * This is the whole content size in buffer pixels. If the surface * has no content or the renderer does not implement this feature, * zeroes are returned. * * This function is used to determine the buffer size needed for * a weston_surface_copy_content() call. */ WL_EXPORT void weston_surface_get_content_size(struct weston_surface *surface, int *width, int *height) { struct weston_renderer *rer = surface->compositor->renderer; if (!rer->surface_get_content_size) { *width = 0; *height = 0; return; } rer->surface_get_content_size(surface, width, height); } /** Copy surface contents to system memory. * * \param surface The surface to copy from. * \param target Pointer to the target memory buffer. * \param size Size of the target buffer in bytes. * \param src_x X location on contents to copy from. * \param src_y Y location on contents to copy from. * \param width Width in pixels of the area to copy. * \param height Height in pixels of the area to copy. * \return 0 for success, -1 for failure. * * Surface contents are maintained by the renderer. They can be in a * reserved weston_buffer or as a copy, e.g. a GL texture, or something * else. * * Surface contents are copied into memory pointed to by target, * which has size bytes of space available. The target memory * may be larger than needed, but being smaller returns an error. * The extra bytes in target may or may not be written; their content is * unspecified. Size must be large enough to hold the image. * * The image in the target memory will be arranged in rows from * top to bottom, and pixels on a row from left to right. The pixel * format is PIXMAN_a8b8g8r8, 4 bytes per pixel, and stride is exactly * width * 4. * * Parameters src_x and src_y define the upper-left corner in buffer * coordinates (pixels) to copy from. Parameters width and height * define the size of the area to copy in pixels. * * The rectangle defined by src_x, src_y, width, height must fit in * the surface contents. Otherwise an error is returned. * * Use surface_get_data_size to determine the content size; the * needed target buffer size and rectangle limits. * * CURRENT IMPLEMENTATION RESTRICTIONS: * - the machine must be little-endian due to Pixman formats. * * NOTE: Pixman formats are premultiplied. */ WL_EXPORT int weston_surface_copy_content(struct weston_surface *surface, void *target, size_t size, int src_x, int src_y, int width, int height) { struct weston_renderer *rer = surface->compositor->renderer; int cw, ch; const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ if (!rer->surface_copy_content) return -1; weston_surface_get_content_size(surface, &cw, &ch); if (src_x < 0 || src_y < 0) return -1; if (width <= 0 || height <= 0) return -1; if (src_x + width > cw || src_y + height > ch) return -1; if (width * bytespp * height > size) return -1; return rer->surface_copy_content(surface, target, size, src_x, src_y, width, height); } static void subsurface_set_position(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); if (!sub) return; sub->position.x = x; sub->position.y = y; sub->position.set = 1; } static struct weston_subsurface * subsurface_from_surface(struct weston_surface *surface) { struct weston_subsurface *sub; sub = weston_surface_to_subsurface(surface); if (sub) return sub; wl_list_for_each(sub, &surface->subsurface_list, parent_link) if (sub->surface == surface) return sub; return NULL; } static struct weston_subsurface * subsurface_sibling_check(struct weston_subsurface *sub, struct weston_surface *surface, const char *request) { struct weston_subsurface *sibling; sibling = subsurface_from_surface(surface); if (!sibling) { wl_resource_post_error(sub->resource, WL_SUBSURFACE_ERROR_BAD_SURFACE, "%s: wl_surface@%d is not a parent or sibling", request, wl_resource_get_id(surface->resource)); return NULL; } if (sibling->parent != sub->parent) { wl_resource_post_error(sub->resource, WL_SUBSURFACE_ERROR_BAD_SURFACE, "%s: wl_surface@%d has a different parent", request, wl_resource_get_id(surface->resource)); return NULL; } return sibling; } static void subsurface_place_above(struct wl_client *client, struct wl_resource *resource, struct wl_resource *sibling_resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(sibling_resource); struct weston_subsurface *sibling; if (!sub) return; sibling = subsurface_sibling_check(sub, surface, "place_above"); if (!sibling) return; wl_list_remove(&sub->parent_link_pending); wl_list_insert(sibling->parent_link_pending.prev, &sub->parent_link_pending); } static void subsurface_place_below(struct wl_client *client, struct wl_resource *resource, struct wl_resource *sibling_resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); struct weston_surface *surface = wl_resource_get_user_data(sibling_resource); struct weston_subsurface *sibling; if (!sub) return; sibling = subsurface_sibling_check(sub, surface, "place_below"); if (!sibling) return; wl_list_remove(&sub->parent_link_pending); wl_list_insert(&sibling->parent_link_pending, &sub->parent_link_pending); } static void subsurface_set_sync(struct wl_client *client, struct wl_resource *resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); if (sub) sub->synchronized = 1; } static void subsurface_set_desync(struct wl_client *client, struct wl_resource *resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); if (sub && sub->synchronized) { sub->synchronized = 0; /* If sub became effectively desynchronized, flush. */ if (!weston_subsurface_is_synchronized(sub)) weston_subsurface_synchronized_commit(sub); } } static void weston_subsurface_unlink_parent(struct weston_subsurface *sub) { wl_list_remove(&sub->parent_link); wl_list_remove(&sub->parent_link_pending); wl_list_remove(&sub->parent_destroy_listener.link); sub->parent = NULL; } static void weston_subsurface_destroy(struct weston_subsurface *sub); static void subsurface_handle_surface_destroy(struct wl_listener *listener, void *data) { struct weston_subsurface *sub = container_of(listener, struct weston_subsurface, surface_destroy_listener); assert(data == sub->surface); /* The protocol object (wl_resource) is left inert. */ if (sub->resource) wl_resource_set_user_data(sub->resource, NULL); weston_subsurface_destroy(sub); } static void subsurface_handle_parent_destroy(struct wl_listener *listener, void *data) { struct weston_subsurface *sub = container_of(listener, struct weston_subsurface, parent_destroy_listener); assert(data == sub->parent); assert(sub->surface != sub->parent); if (weston_surface_is_mapped(sub->surface)) weston_surface_unmap(sub->surface); weston_subsurface_unlink_parent(sub); } static void subsurface_resource_destroy(struct wl_resource *resource) { struct weston_subsurface *sub = wl_resource_get_user_data(resource); if (sub) weston_subsurface_destroy(sub); } static void subsurface_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void weston_subsurface_link_parent(struct weston_subsurface *sub, struct weston_surface *parent) { sub->parent = parent; sub->parent_destroy_listener.notify = subsurface_handle_parent_destroy; wl_signal_add(&parent->destroy_signal, &sub->parent_destroy_listener); wl_list_insert(&parent->subsurface_list, &sub->parent_link); wl_list_insert(&parent->subsurface_list_pending, &sub->parent_link_pending); } static void weston_subsurface_link_surface(struct weston_subsurface *sub, struct weston_surface *surface) { sub->surface = surface; sub->surface_destroy_listener.notify = subsurface_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &sub->surface_destroy_listener); } static void weston_subsurface_destroy(struct weston_subsurface *sub) { struct weston_view *view, *next; assert(sub->surface); if (sub->resource) { assert(weston_surface_to_subsurface(sub->surface) == sub); assert(sub->parent_destroy_listener.notify == subsurface_handle_parent_destroy); wl_list_for_each_safe(view, next, &sub->surface->views, surface_link) { weston_view_unmap(view); weston_view_destroy(view); } if (sub->parent) weston_subsurface_unlink_parent(sub); weston_surface_state_fini(&sub->cached); weston_buffer_reference(&sub->cached_buffer_ref, NULL); sub->surface->configure = NULL; sub->surface->configure_private = NULL; weston_surface_set_label_func(sub->surface, NULL); } else { /* the dummy weston_subsurface for the parent itself */ assert(sub->parent_destroy_listener.notify == NULL); wl_list_remove(&sub->parent_link); wl_list_remove(&sub->parent_link_pending); } wl_list_remove(&sub->surface_destroy_listener.link); free(sub); } static const struct wl_subsurface_interface subsurface_implementation = { subsurface_destroy, subsurface_set_position, subsurface_place_above, subsurface_place_below, subsurface_set_sync, subsurface_set_desync }; static struct weston_subsurface * weston_subsurface_create(uint32_t id, struct weston_surface *surface, struct weston_surface *parent) { struct weston_subsurface *sub; struct wl_client *client = wl_resource_get_client(surface->resource); sub = zalloc(sizeof *sub); if (sub == NULL) return NULL; wl_list_init(&sub->unused_views); sub->resource = wl_resource_create(client, &wl_subsurface_interface, 1, id); if (!sub->resource) { free(sub); return NULL; } wl_resource_set_implementation(sub->resource, &subsurface_implementation, sub, subsurface_resource_destroy); weston_subsurface_link_surface(sub, surface); weston_subsurface_link_parent(sub, parent); weston_surface_state_init(&sub->cached); sub->cached_buffer_ref.buffer = NULL; sub->synchronized = 1; return sub; } /* Create a dummy subsurface for having the parent itself in its * sub-surface lists. Makes stacking order manipulation easy. */ static struct weston_subsurface * weston_subsurface_create_for_parent(struct weston_surface *parent) { struct weston_subsurface *sub; sub = zalloc(sizeof *sub); if (sub == NULL) return NULL; weston_subsurface_link_surface(sub, parent); sub->parent = parent; wl_list_insert(&parent->subsurface_list, &sub->parent_link); wl_list_insert(&parent->subsurface_list_pending, &sub->parent_link_pending); return sub; } static void subcompositor_get_subsurface(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource, struct wl_resource *parent_resource) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct weston_surface *parent = wl_resource_get_user_data(parent_resource); struct weston_subsurface *sub; static const char where[] = "get_subsurface: wl_subsurface@"; if (surface == parent) { wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "%s%d: wl_surface@%d cannot be its own parent", where, id, wl_resource_get_id(surface_resource)); return; } if (weston_surface_to_subsurface(surface)) { wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "%s%d: wl_surface@%d is already a sub-surface", where, id, wl_resource_get_id(surface_resource)); return; } if (weston_surface_set_role(surface, "wl_subsurface", resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE) < 0) return; if (weston_surface_get_main_surface(parent) == surface) { wl_resource_post_error(resource, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, "%s%d: wl_surface@%d is an ancestor of parent", where, id, wl_resource_get_id(surface_resource)); return; } /* make sure the parent is in its own list */ if (wl_list_empty(&parent->subsurface_list)) { if (!weston_subsurface_create_for_parent(parent)) { wl_resource_post_no_memory(resource); return; } } sub = weston_subsurface_create(id, surface, parent); if (!sub) { wl_resource_post_no_memory(resource); return; } surface->configure = subsurface_configure; surface->configure_private = sub; weston_surface_set_label_func(surface, subsurface_get_label); } static void subcompositor_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static const struct wl_subcompositor_interface subcompositor_interface = { subcompositor_destroy, subcompositor_get_subsurface }; static void bind_subcompositor(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_compositor *compositor = data; struct wl_resource *resource; resource = wl_resource_create(client, &wl_subcompositor_interface, 1, id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &subcompositor_interface, compositor, NULL); } static void weston_compositor_dpms(struct weston_compositor *compositor, enum dpms_enum state) { struct weston_output *output; wl_list_for_each(output, &compositor->output_list, link) if (output->set_dpms) output->set_dpms(output, state); } WL_EXPORT void weston_compositor_wake(struct weston_compositor *compositor) { uint32_t old_state = compositor->state; /* The state needs to be changed before emitting the wake * signal because that may try to schedule a repaint which * will not work if the compositor is still sleeping */ compositor->state = WESTON_COMPOSITOR_ACTIVE; switch (old_state) { case WESTON_COMPOSITOR_SLEEPING: weston_compositor_dpms(compositor, WESTON_DPMS_ON); /* fall through */ case WESTON_COMPOSITOR_IDLE: case WESTON_COMPOSITOR_OFFSCREEN: wl_signal_emit(&compositor->wake_signal, compositor); /* fall through */ default: wl_event_source_timer_update(compositor->idle_source, compositor->idle_time * 1000); } } WL_EXPORT void weston_compositor_offscreen(struct weston_compositor *compositor) { switch (compositor->state) { case WESTON_COMPOSITOR_OFFSCREEN: return; case WESTON_COMPOSITOR_SLEEPING: weston_compositor_dpms(compositor, WESTON_DPMS_ON); /* fall through */ default: compositor->state = WESTON_COMPOSITOR_OFFSCREEN; wl_event_source_timer_update(compositor->idle_source, 0); } } WL_EXPORT void weston_compositor_sleep(struct weston_compositor *compositor) { if (compositor->state == WESTON_COMPOSITOR_SLEEPING) return; wl_event_source_timer_update(compositor->idle_source, 0); compositor->state = WESTON_COMPOSITOR_SLEEPING; weston_compositor_dpms(compositor, WESTON_DPMS_OFF); } static int idle_handler(void *data) { struct weston_compositor *compositor = data; if (compositor->idle_inhibit) return 1; compositor->state = WESTON_COMPOSITOR_IDLE; wl_signal_emit(&compositor->idle_signal, compositor); return 1; } WL_EXPORT void weston_plane_init(struct weston_plane *plane, struct weston_compositor *ec, int32_t x, int32_t y) { pixman_region32_init(&plane->damage); pixman_region32_init(&plane->clip); plane->x = x; plane->y = y; plane->compositor = ec; /* Init the link so that the call to wl_list_remove() when releasing * the plane without ever stacking doesn't lead to a crash */ wl_list_init(&plane->link); } WL_EXPORT void weston_plane_release(struct weston_plane *plane) { struct weston_view *view; pixman_region32_fini(&plane->damage); pixman_region32_fini(&plane->clip); wl_list_for_each(view, &plane->compositor->view_list, link) { if (view->plane == plane) view->plane = NULL; } wl_list_remove(&plane->link); } WL_EXPORT void weston_compositor_stack_plane(struct weston_compositor *ec, struct weston_plane *plane, struct weston_plane *above) { if (above) wl_list_insert(above->link.prev, &plane->link); else wl_list_insert(&ec->plane_list, &plane->link); } static void unbind_resource(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); } static void bind_output(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_output *output = data; struct weston_mode *mode; struct wl_resource *resource; resource = wl_resource_create(client, &wl_output_interface, MIN(version, 2), id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_list_insert(&output->resource_list, wl_resource_get_link(resource)); wl_resource_set_implementation(resource, NULL, data, unbind_resource); wl_output_send_geometry(resource, output->x, output->y, output->mm_width, output->mm_height, output->subpixel, output->make, output->model, output->transform); if (version >= WL_OUTPUT_SCALE_SINCE_VERSION) wl_output_send_scale(resource, output->current_scale); wl_list_for_each (mode, &output->mode_list, link) { wl_output_send_mode(resource, mode->flags, mode->width, mode->height, mode->refresh); } if (version >= WL_OUTPUT_DONE_SINCE_VERSION) wl_output_send_done(resource); } /* Move other outputs when one is removed so the space remains contiguos. */ static void weston_compositor_remove_output(struct weston_compositor *compositor, struct weston_output *remove_output) { struct weston_output *output; int offset = 0; wl_list_for_each(output, &compositor->output_list, link) { if (output == remove_output) { offset = output->width; continue; } if (offset > 0) { weston_output_move(output, output->x - offset, output->y); output->dirty = 1; } } } WL_EXPORT void weston_output_destroy(struct weston_output *output) { struct wl_resource *resource; struct weston_view *view; output->destroying = 1; wl_list_for_each(view, &output->compositor->view_list, link) { if (view->output_mask & (1 << output->id)) weston_view_assign_output(view); } wl_event_source_remove(output->repaint_timer); weston_presentation_feedback_discard_list(&output->feedback_list); weston_compositor_remove_output(output->compositor, output); wl_list_remove(&output->link); wl_signal_emit(&output->compositor->output_destroyed_signal, output); wl_signal_emit(&output->destroy_signal, output); free(output->name); pixman_region32_fini(&output->region); pixman_region32_fini(&output->previous_damage); output->compositor->output_id_pool &= ~(1 << output->id); wl_resource_for_each(resource, &output->resource_list) { wl_resource_set_destructor(resource, NULL); } wl_global_destroy(output->global); } WL_EXPORT void weston_output_update_matrix(struct weston_output *output) { float magnification; weston_matrix_init(&output->matrix); weston_matrix_translate(&output->matrix, -output->x, -output->y, 0); if (output->zoom.active) { magnification = 1 / (1 - output->zoom.spring_z.current); weston_output_update_zoom(output); weston_matrix_translate(&output->matrix, -output->zoom.trans_x, -output->zoom.trans_y, 0); weston_matrix_scale(&output->matrix, magnification, magnification, 1.0); } switch (output->transform) { case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_180: case WL_OUTPUT_TRANSFORM_FLIPPED_270: weston_matrix_translate(&output->matrix, -output->width, 0, 0); weston_matrix_scale(&output->matrix, -1, 1, 1); break; } switch (output->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_FLIPPED: break; case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_FLIPPED_90: weston_matrix_translate(&output->matrix, 0, -output->height, 0); weston_matrix_rotate_xy(&output->matrix, 0, 1); break; case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED_180: weston_matrix_translate(&output->matrix, -output->width, -output->height, 0); weston_matrix_rotate_xy(&output->matrix, -1, 0); break; case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_270: weston_matrix_translate(&output->matrix, -output->width, 0, 0); weston_matrix_rotate_xy(&output->matrix, 0, -1); break; } if (output->current_scale != 1) weston_matrix_scale(&output->matrix, output->current_scale, output->current_scale, 1); output->dirty = 0; weston_matrix_invert(&output->inverse_matrix, &output->matrix); } static void weston_output_transform_scale_init(struct weston_output *output, uint32_t transform, uint32_t scale) { output->transform = transform; switch (transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: /* Swap width and height */ output->width = output->current_mode->height; output->height = output->current_mode->width; break; case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_180: output->width = output->current_mode->width; output->height = output->current_mode->height; break; default: break; } output->native_scale = output->current_scale = scale; output->width /= scale; output->height /= scale; } static void weston_output_init_geometry(struct weston_output *output, int x, int y) { output->x = x; output->y = y; pixman_region32_init(&output->previous_damage); pixman_region32_init_rect(&output->region, x, y, output->width, output->height); } WL_EXPORT void weston_output_move(struct weston_output *output, int x, int y) { struct wl_resource *resource; output->move_x = x - output->x; output->move_y = y - output->y; if (output->move_x == 0 && output->move_y == 0) return; weston_output_init_geometry(output, x, y); output->dirty = 1; /* Move views on this output. */ wl_signal_emit(&output->compositor->output_moved_signal, output); /* Notify clients of the change for output position. */ wl_resource_for_each(resource, &output->resource_list) { wl_output_send_geometry(resource, output->x, output->y, output->mm_width, output->mm_height, output->subpixel, output->make, output->model, output->transform); if (wl_resource_get_version(resource) >= 2) wl_output_send_done(resource); } } WL_EXPORT void weston_output_init(struct weston_output *output, struct weston_compositor *c, int x, int y, int mm_width, int mm_height, uint32_t transform, int32_t scale) { struct wl_event_loop *loop; output->compositor = c; output->x = x; output->y = y; output->mm_width = mm_width; output->mm_height = mm_height; output->dirty = 1; output->original_scale = scale; weston_output_transform_scale_init(output, transform, scale); weston_output_init_zoom(output); weston_output_init_geometry(output, x, y); weston_output_damage(output); wl_signal_init(&output->frame_signal); wl_signal_init(&output->destroy_signal); wl_list_init(&output->animation_list); wl_list_init(&output->resource_list); wl_list_init(&output->feedback_list); wl_list_init(&output->link); loop = wl_display_get_event_loop(c->wl_display); output->repaint_timer = wl_event_loop_add_timer(loop, output_repaint_timer_handler, output); output->id = ffs(~output->compositor->output_id_pool) - 1; output->compositor->output_id_pool |= 1 << output->id; output->global = wl_global_create(c->wl_display, &wl_output_interface, 2, output, bind_output); } /** Adds an output to the compositor's output list and * send the compositor's output_created signal. * * \param compositor The compositor instance. * \param output The output to be added. */ WL_EXPORT void weston_compositor_add_output(struct weston_compositor *compositor, struct weston_output *output) { wl_list_insert(compositor->output_list.prev, &output->link); wl_signal_emit(&compositor->output_created_signal, output); } WL_EXPORT void weston_output_transform_coordinate(struct weston_output *output, wl_fixed_t device_x, wl_fixed_t device_y, wl_fixed_t *x, wl_fixed_t *y) { struct weston_vector p = { { wl_fixed_to_double(device_x), wl_fixed_to_double(device_y), 0.0, 1.0 } }; weston_matrix_transform(&output->inverse_matrix, &p); *x = wl_fixed_from_double(p.f[0] / p.f[3]); *y = wl_fixed_from_double(p.f[1] / p.f[3]); } static void destroy_viewport(struct wl_resource *resource) { struct weston_surface *surface = wl_resource_get_user_data(resource); surface->viewport_resource = NULL; surface->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); surface->pending.buffer_viewport.surface.width = -1; surface->pending.buffer_viewport.changed = 1; } static void viewport_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void viewport_set(struct wl_client *client, struct wl_resource *resource, wl_fixed_t src_x, wl_fixed_t src_y, wl_fixed_t src_width, wl_fixed_t src_height, int32_t dst_width, int32_t dst_height) { struct weston_surface *surface = wl_resource_get_user_data(resource); assert(surface->viewport_resource != NULL); if (wl_fixed_to_double(src_width) < 0 || wl_fixed_to_double(src_height) < 0) { wl_resource_post_error(resource, WL_VIEWPORT_ERROR_BAD_VALUE, "source dimensions must be non-negative (%fx%f)", wl_fixed_to_double(src_width), wl_fixed_to_double(src_height)); return; } if (dst_width <= 0 || dst_height <= 0) { wl_resource_post_error(resource, WL_VIEWPORT_ERROR_BAD_VALUE, "destination dimensions must be positive (%dx%d)", dst_width, dst_height); return; } surface->pending.buffer_viewport.buffer.src_x = src_x; surface->pending.buffer_viewport.buffer.src_y = src_y; surface->pending.buffer_viewport.buffer.src_width = src_width; surface->pending.buffer_viewport.buffer.src_height = src_height; surface->pending.buffer_viewport.surface.width = dst_width; surface->pending.buffer_viewport.surface.height = dst_height; surface->pending.buffer_viewport.changed = 1; } static void viewport_set_source(struct wl_client *client, struct wl_resource *resource, wl_fixed_t src_x, wl_fixed_t src_y, wl_fixed_t src_width, wl_fixed_t src_height) { struct weston_surface *surface = wl_resource_get_user_data(resource); assert(surface->viewport_resource != NULL); if (src_width == wl_fixed_from_int(-1) && src_height == wl_fixed_from_int(-1)) { /* unset source size */ surface->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1); surface->pending.buffer_viewport.changed = 1; return; } if (src_width <= 0 || src_height <= 0) { wl_resource_post_error(resource, WL_VIEWPORT_ERROR_BAD_VALUE, "source size must be positive (%fx%f)", wl_fixed_to_double(src_width), wl_fixed_to_double(src_height)); return; } surface->pending.buffer_viewport.buffer.src_x = src_x; surface->pending.buffer_viewport.buffer.src_y = src_y; surface->pending.buffer_viewport.buffer.src_width = src_width; surface->pending.buffer_viewport.buffer.src_height = src_height; surface->pending.buffer_viewport.changed = 1; } static void viewport_set_destination(struct wl_client *client, struct wl_resource *resource, int32_t dst_width, int32_t dst_height) { struct weston_surface *surface = wl_resource_get_user_data(resource); assert(surface->viewport_resource != NULL); if (dst_width == -1 && dst_height == -1) { /* unset destination size */ surface->pending.buffer_viewport.surface.width = -1; surface->pending.buffer_viewport.changed = 1; return; } if (dst_width <= 0 || dst_height <= 0) { wl_resource_post_error(resource, WL_VIEWPORT_ERROR_BAD_VALUE, "destination size must be positive (%dx%d)", dst_width, dst_height); return; } surface->pending.buffer_viewport.surface.width = dst_width; surface->pending.buffer_viewport.surface.height = dst_height; surface->pending.buffer_viewport.changed = 1; } static const struct wl_viewport_interface viewport_interface = { viewport_destroy, viewport_set, viewport_set_source, viewport_set_destination }; static void scaler_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void scaler_get_viewport(struct wl_client *client, struct wl_resource *scaler, uint32_t id, struct wl_resource *surface_resource) { int version = wl_resource_get_version(scaler); struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct wl_resource *resource; if (surface->viewport_resource) { wl_resource_post_error(scaler, WL_SCALER_ERROR_VIEWPORT_EXISTS, "a viewport for that surface already exists"); return; } resource = wl_resource_create(client, &wl_viewport_interface, version, id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &viewport_interface, surface, destroy_viewport); surface->viewport_resource = resource; } static const struct wl_scaler_interface scaler_interface = { scaler_destroy, scaler_get_viewport }; static void bind_scaler(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wl_resource *resource; resource = wl_resource_create(client, &wl_scaler_interface, MIN(version, 2), id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &scaler_interface, NULL, NULL); } static void destroy_presentation_feedback(struct wl_resource *feedback_resource) { struct weston_presentation_feedback *feedback; feedback = wl_resource_get_user_data(feedback_resource); wl_list_remove(&feedback->link); free(feedback); } static void presentation_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void presentation_feedback(struct wl_client *client, struct wl_resource *presentation_resource, struct wl_resource *surface_resource, uint32_t callback) { struct weston_surface *surface; struct weston_presentation_feedback *feedback; surface = wl_resource_get_user_data(surface_resource); feedback = zalloc(sizeof *feedback); if (feedback == NULL) goto err_calloc; feedback->resource = wl_resource_create(client, &presentation_feedback_interface, 1, callback); if (!feedback->resource) goto err_create; wl_resource_set_implementation(feedback->resource, NULL, feedback, destroy_presentation_feedback); wl_list_insert(&surface->pending.feedback_list, &feedback->link); return; err_create: free(feedback); err_calloc: wl_client_post_no_memory(client); } static const struct presentation_interface presentation_implementation = { presentation_destroy, presentation_feedback }; static void bind_presentation(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_compositor *compositor = data; struct wl_resource *resource; resource = wl_resource_create(client, &presentation_interface, MIN(version, 1), id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &presentation_implementation, compositor, NULL); presentation_send_clock_id(resource, compositor->presentation_clock); } static void compositor_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_compositor *compositor = data; struct wl_resource *resource; resource = wl_resource_create(client, &wl_compositor_interface, MIN(version, 3), id); if (resource == NULL) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &compositor_interface, compositor, NULL); } WL_EXPORT int weston_environment_get_fd(const char *env) { char *e, *end; int fd, flags; e = getenv(env); if (!e) return -1; fd = strtol(e, &end, 0); if (*end != '\0') return -1; flags = fcntl(fd, F_GETFD); if (flags == -1) return -1; fcntl(fd, F_SETFD, flags | FD_CLOEXEC); unsetenv(env); return fd; } static void timeline_key_binding_handler(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; if (weston_timeline_enabled_) weston_timeline_close(); else weston_timeline_open(compositor); } /** Create the compositor. * * This functions creates and initializes a compositor instance. * * \param display The Wayland display to be used. * \param user_data A pointer to an object that can later be retrieved * using the \ref weston_compositor_get_user_data function. * \return The compositor instance on success or NULL on failure. */ WL_EXPORT struct weston_compositor * weston_compositor_create(struct wl_display *display, void *user_data) { struct weston_compositor *ec; struct wl_event_loop *loop; ec = zalloc(sizeof *ec); if (!ec) return NULL; ec->wl_display = display; ec->user_data = user_data; wl_signal_init(&ec->destroy_signal); wl_signal_init(&ec->create_surface_signal); wl_signal_init(&ec->activate_signal); wl_signal_init(&ec->transform_signal); wl_signal_init(&ec->kill_signal); wl_signal_init(&ec->idle_signal); wl_signal_init(&ec->wake_signal); wl_signal_init(&ec->show_input_panel_signal); wl_signal_init(&ec->hide_input_panel_signal); wl_signal_init(&ec->update_input_panel_signal); wl_signal_init(&ec->seat_created_signal); wl_signal_init(&ec->output_created_signal); wl_signal_init(&ec->output_destroyed_signal); wl_signal_init(&ec->output_moved_signal); wl_signal_init(&ec->session_signal); ec->session_active = 1; ec->output_id_pool = 0; ec->repaint_msec = DEFAULT_REPAINT_WINDOW; if (!wl_global_create(ec->wl_display, &wl_compositor_interface, 3, ec, compositor_bind)) goto fail; if (!wl_global_create(ec->wl_display, &wl_subcompositor_interface, 1, ec, bind_subcompositor)) goto fail; if (!wl_global_create(ec->wl_display, &wl_scaler_interface, 2, ec, bind_scaler)) goto fail; if (!wl_global_create(ec->wl_display, &presentation_interface, 1, ec, bind_presentation)) goto fail; wl_list_init(&ec->view_list); wl_list_init(&ec->plane_list); wl_list_init(&ec->layer_list); wl_list_init(&ec->seat_list); wl_list_init(&ec->output_list); wl_list_init(&ec->key_binding_list); wl_list_init(&ec->modifier_binding_list); wl_list_init(&ec->button_binding_list); wl_list_init(&ec->touch_binding_list); wl_list_init(&ec->axis_binding_list); wl_list_init(&ec->debug_binding_list); weston_plane_init(&ec->primary_plane, ec, 0, 0); weston_compositor_stack_plane(ec, &ec->primary_plane, NULL); wl_data_device_manager_init(ec->wl_display); wl_display_init_shm(ec->wl_display); loop = wl_display_get_event_loop(ec->wl_display); ec->idle_source = wl_event_loop_add_timer(loop, idle_handler, ec); wl_event_source_timer_update(ec->idle_source, ec->idle_time * 1000); ec->input_loop = wl_event_loop_create(); weston_layer_init(&ec->fade_layer, &ec->layer_list); weston_layer_init(&ec->cursor_layer, &ec->fade_layer.link); weston_compositor_add_debug_binding(ec, KEY_T, timeline_key_binding_handler, ec); return ec; fail: free(ec); return NULL; } WL_EXPORT void weston_compositor_shutdown(struct weston_compositor *ec) { struct weston_output *output, *next; wl_event_source_remove(ec->idle_source); if (ec->input_loop_source) wl_event_source_remove(ec->input_loop_source); /* Destroy all outputs associated with this compositor */ wl_list_for_each_safe(output, next, &ec->output_list, link) output->destroy(output); if (ec->renderer) ec->renderer->destroy(ec); weston_binding_list_destroy_all(&ec->key_binding_list); weston_binding_list_destroy_all(&ec->modifier_binding_list); weston_binding_list_destroy_all(&ec->button_binding_list); weston_binding_list_destroy_all(&ec->touch_binding_list); weston_binding_list_destroy_all(&ec->axis_binding_list); weston_binding_list_destroy_all(&ec->debug_binding_list); weston_plane_release(&ec->primary_plane); wl_event_loop_destroy(ec->input_loop); } WL_EXPORT void weston_compositor_exit_with_code(struct weston_compositor *compositor, int exit_code) { if (compositor->exit_code == EXIT_SUCCESS) compositor->exit_code = exit_code; weston_compositor_exit(compositor); } WL_EXPORT void weston_compositor_set_default_pointer_grab(struct weston_compositor *ec, const struct weston_pointer_grab_interface *interface) { struct weston_seat *seat; ec->default_pointer_grab = interface; wl_list_for_each(seat, &ec->seat_list, link) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); if (pointer) weston_pointer_set_default_grab(pointer, interface); } } WL_EXPORT int weston_compositor_set_presentation_clock(struct weston_compositor *compositor, clockid_t clk_id) { struct timespec ts; if (clock_gettime(clk_id, &ts) < 0) return -1; compositor->presentation_clock = clk_id; return 0; } /* * For choosing the software clock, when the display hardware or API * does not expose a compatible presentation timestamp. */ WL_EXPORT int weston_compositor_set_presentation_clock_software( struct weston_compositor *compositor) { /* In order of preference */ static const clockid_t clocks[] = { CLOCK_MONOTONIC_RAW, /* no jumps, no crawling */ CLOCK_MONOTONIC_COARSE, /* no jumps, may crawl, fast & coarse */ CLOCK_MONOTONIC, /* no jumps, may crawl */ CLOCK_REALTIME_COARSE, /* may jump and crawl, fast & coarse */ CLOCK_REALTIME /* may jump and crawl */ }; unsigned i; for (i = 0; i < ARRAY_LENGTH(clocks); i++) if (weston_compositor_set_presentation_clock(compositor, clocks[i]) == 0) return 0; weston_log("Error: no suitable presentation clock available.\n"); return -1; } /** Read the current time from the Presentation clock * * \param compositor * \param ts[out] The current time. * * \note Reading the current time in user space is always imprecise to some * degree. * * This function is never meant to fail. If reading the clock does fail, * an error message is logged and a zero time is returned. Callers are not * supposed to detect or react to failures. */ WL_EXPORT void weston_compositor_read_presentation_clock( const struct weston_compositor *compositor, struct timespec *ts) { static bool warned; int ret; ret = clock_gettime(compositor->presentation_clock, ts); if (ret < 0) { ts->tv_sec = 0; ts->tv_nsec = 0; if (!warned) weston_log("Error: failure to read " "the presentation clock %#x: '%m' (%d)\n", compositor->presentation_clock, errno); warned = true; } } /** Import dmabuf buffer into current renderer * * \param compositor * \param buffer the dmabuf buffer to import * \return true on usable buffers, false otherwise * * This function tests that the linux_dmabuf_buffer is usable * for the current renderer. Returns false on unusable buffers. Usually * usability is tested by importing the dmabufs for composition. * * This hook is also used for detecting if the renderer supports * dmabufs at all. If the renderer hook is NULL, dmabufs are not * supported. * */ WL_EXPORT bool weston_compositor_import_dmabuf(struct weston_compositor *compositor, struct linux_dmabuf_buffer *buffer) { struct weston_renderer *renderer; renderer = compositor->renderer; if (renderer->import_dmabuf == NULL) return false; return renderer->import_dmabuf(compositor, buffer); } WL_EXPORT void weston_version(int *major, int *minor, int *micro) { *major = WESTON_VERSION_MAJOR; *minor = WESTON_VERSION_MINOR; *micro = WESTON_VERSION_MICRO; } WL_EXPORT void * weston_load_module(const char *name, const char *entrypoint) { const char *builddir = getenv("WESTON_BUILD_DIR"); char path[PATH_MAX]; void *module, *init; if (name == NULL) return NULL; if (name[0] != '/') { if (builddir) snprintf(path, sizeof path, "%s/.libs/%s", builddir, name); else snprintf(path, sizeof path, "%s/%s", MODULEDIR, name); } else { snprintf(path, sizeof path, "%s", name); } module = dlopen(path, RTLD_NOW | RTLD_NOLOAD); if (module) { weston_log("Module '%s' already loaded\n", path); dlclose(module); return NULL; } weston_log("Loading module '%s'\n", path); module = dlopen(path, RTLD_NOW); if (!module) { weston_log("Failed to load module: %s\n", dlerror()); return NULL; } init = dlsym(module, entrypoint); if (!init) { weston_log("Failed to lookup init function: %s\n", dlerror()); dlclose(module); return NULL; } return init; } /** Destroys the compositor. * * This function cleans up the compositor state and destroys it. * * \param compositor The compositor to be destroyed. */ WL_EXPORT void weston_compositor_destroy(struct weston_compositor *compositor) { /* prevent further rendering while shutting down */ compositor->state = WESTON_COMPOSITOR_OFFSCREEN; wl_signal_emit(&compositor->destroy_signal, compositor); weston_compositor_xkb_destroy(compositor); compositor->backend->destroy(compositor); free(compositor); } /** Instruct the compositor to exit. * * This functions does not directly destroy the compositor object, it merely * command it to start the tear down process. It is not guaranteed that the * tear down will happen immediately. * * \param compositor The compositor to tear down. */ WL_EXPORT void weston_compositor_exit(struct weston_compositor *compositor) { compositor->exit(compositor); } /** Return the user data stored in the compositor. * * This function returns the user data pointer set with user_data parameter * to the \ref weston_compositor_create function. */ WL_EXPORT void * weston_compositor_get_user_data(struct weston_compositor *compositor) { return compositor->user_data; } weston-1.9.0/src/weston.desktop0000664000175000017500000000017612516305154013472 00000000000000[Desktop Entry] Name=Weston Comment=The reference Wayland server Exec=dbus-launch --exit-with-session weston Type=Application weston-1.9.0/src/cms-helper.c0000664000175000017500000000667312537627702013004 00000000000000/* * Copyright © 2013 Richard Hughes * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #ifdef HAVE_LCMS #include #endif #include "compositor.h" #include "cms-helper.h" #ifdef HAVE_LCMS static void weston_cms_gamma_clear(struct weston_output *o) { int i; uint16_t *red; if (!o->set_gamma) return; red = calloc(o->gamma_size, sizeof(uint16_t)); for (i = 0; i < o->gamma_size; i++) red[i] = (uint32_t) 0xffff * (uint32_t) i / (uint32_t) (o->gamma_size - 1); o->set_gamma(o, o->gamma_size, red, red, red); free(red); } #endif void weston_cms_set_color_profile(struct weston_output *o, struct weston_color_profile *p) { #ifdef HAVE_LCMS cmsFloat32Number in; const cmsToneCurve **vcgt; int i; int size; uint16_t *red = NULL; uint16_t *green = NULL; uint16_t *blue = NULL; if (!o->set_gamma) return; if (!p) { weston_cms_gamma_clear(o); return; } weston_log("Using ICC profile %s\n", p->filename); vcgt = cmsReadTag (p->lcms_handle, cmsSigVcgtTag); if (vcgt == NULL || vcgt[0] == NULL) { weston_cms_gamma_clear(o); return; } size = o->gamma_size; red = calloc(size, sizeof(uint16_t)); green = calloc(size, sizeof(uint16_t)); blue = calloc(size, sizeof(uint16_t)); for (i = 0; i < size; i++) { in = (cmsFloat32Number) i / (cmsFloat32Number) (size - 1); red[i] = cmsEvalToneCurveFloat(vcgt[0], in) * (double) 0xffff; green[i] = cmsEvalToneCurveFloat(vcgt[1], in) * (double) 0xffff; blue[i] = cmsEvalToneCurveFloat(vcgt[2], in) * (double) 0xffff; } o->set_gamma(o, size, red, green, blue); free(red); free(green); free(blue); #endif } void weston_cms_destroy_profile(struct weston_color_profile *p) { if (!p) return; #ifdef HAVE_LCMS cmsCloseProfile(p->lcms_handle); #endif free(p->filename); free(p); } struct weston_color_profile * weston_cms_create_profile(const char *filename, void *lcms_profile) { struct weston_color_profile *p; p = zalloc(sizeof(struct weston_color_profile)); p->filename = strdup(filename); p->lcms_handle = lcms_profile; return p; } struct weston_color_profile * weston_cms_load_profile(const char *filename) { struct weston_color_profile *p = NULL; #ifdef HAVE_LCMS cmsHPROFILE lcms_profile; lcms_profile = cmsOpenProfileFromFile(filename, "r"); if (lcms_profile) p = weston_cms_create_profile(filename, lcms_profile); #endif return p; } weston-1.9.0/src/logind-util.c0000664000175000017500000005221712552266574013172 00000000000000/* * Copyright © 2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "dbus.h" #include "logind-util.h" #define DRM_MAJOR 226 #ifndef KDSKBMUTE #define KDSKBMUTE 0x4B51 #endif struct weston_logind { struct weston_compositor *compositor; bool sync_drm; char *seat; char *sid; unsigned int vtnr; int vt; int kb_mode; int sfd; struct wl_event_source *sfd_source; DBusConnection *dbus; struct wl_event_source *dbus_ctx; char *spath; DBusPendingCall *pending_active; }; static int weston_logind_take_device(struct weston_logind *wl, uint32_t major, uint32_t minor, bool *paused_out) { DBusMessage *m, *reply; bool b; int r, fd; dbus_bool_t paused; m = dbus_message_new_method_call("org.freedesktop.login1", wl->spath, "org.freedesktop.login1.Session", "TakeDevice"); if (!m) return -ENOMEM; b = dbus_message_append_args(m, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_INVALID); if (!b) { r = -ENOMEM; goto err_unref; } reply = dbus_connection_send_with_reply_and_block(wl->dbus, m, -1, NULL); if (!reply) { r = -ENODEV; goto err_unref; } b = dbus_message_get_args(reply, NULL, DBUS_TYPE_UNIX_FD, &fd, DBUS_TYPE_BOOLEAN, &paused, DBUS_TYPE_INVALID); if (!b) { r = -ENODEV; goto err_reply; } r = fd; if (paused_out) *paused_out = paused; err_reply: dbus_message_unref(reply); err_unref: dbus_message_unref(m); return r; } static void weston_logind_release_device(struct weston_logind *wl, uint32_t major, uint32_t minor) { DBusMessage *m; bool b; m = dbus_message_new_method_call("org.freedesktop.login1", wl->spath, "org.freedesktop.login1.Session", "ReleaseDevice"); if (m) { b = dbus_message_append_args(m, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_INVALID); if (b) dbus_connection_send(wl->dbus, m, NULL); dbus_message_unref(m); } } static void weston_logind_pause_device_complete(struct weston_logind *wl, uint32_t major, uint32_t minor) { DBusMessage *m; bool b; m = dbus_message_new_method_call("org.freedesktop.login1", wl->spath, "org.freedesktop.login1.Session", "PauseDeviceComplete"); if (m) { b = dbus_message_append_args(m, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_INVALID); if (b) dbus_connection_send(wl->dbus, m, NULL); dbus_message_unref(m); } } WL_EXPORT int weston_logind_open(struct weston_logind *wl, const char *path, int flags) { struct stat st; int fl, r, fd; r = stat(path, &st); if (r < 0) return -1; if (!S_ISCHR(st.st_mode)) { errno = ENODEV; return -1; } fd = weston_logind_take_device(wl, major(st.st_rdev), minor(st.st_rdev), NULL); if (fd < 0) return fd; /* Compared to weston_launcher_open() we cannot specify the open-mode * directly. Instead, logind passes us an fd with sane default modes. * For DRM and evdev this means O_RDWR | O_CLOEXEC. If we want * something else, we need to change it afterwards. We currently * only support setting O_NONBLOCK. Changing access-modes is not * possible so accept whatever logind passes us. */ fl = fcntl(fd, F_GETFL); if (fl < 0) { r = -errno; goto err_close; } if (flags & O_NONBLOCK) fl |= O_NONBLOCK; r = fcntl(fd, F_SETFL, fl); if (r < 0) { r = -errno; goto err_close; } return fd; err_close: close(fd); weston_logind_release_device(wl, major(st.st_rdev), minor(st.st_rdev)); errno = -r; return -1; } WL_EXPORT void weston_logind_close(struct weston_logind *wl, int fd) { struct stat st; int r; r = fstat(fd, &st); if (r < 0) { weston_log("logind: cannot fstat fd: %m\n"); return; } if (!S_ISCHR(st.st_mode)) { weston_log("logind: invalid device passed\n"); return; } weston_logind_release_device(wl, major(st.st_rdev), minor(st.st_rdev)); } WL_EXPORT void weston_logind_restore(struct weston_logind *wl) { struct vt_mode mode = { 0 }; ioctl(wl->vt, KDSETMODE, KD_TEXT); ioctl(wl->vt, KDSKBMUTE, 0); ioctl(wl->vt, KDSKBMODE, wl->kb_mode); mode.mode = VT_AUTO; ioctl(wl->vt, VT_SETMODE, &mode); } WL_EXPORT int weston_logind_activate_vt(struct weston_logind *wl, int vt) { int r; r = ioctl(wl->vt, VT_ACTIVATE, vt); if (r < 0) return -1; return 0; } static void weston_logind_set_active(struct weston_logind *wl, bool active) { if (!wl->compositor->session_active == !active) return; wl->compositor->session_active = active; wl_signal_emit(&wl->compositor->session_signal, wl->compositor); } static void parse_active(struct weston_logind *wl, DBusMessage *m, DBusMessageIter *iter) { DBusMessageIter sub; dbus_bool_t b; if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_VARIANT) return; dbus_message_iter_recurse(iter, &sub); if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_BOOLEAN) return; dbus_message_iter_get_basic(&sub, &b); /* If the backend requested DRM master-device synchronization, we only * wake-up the compositor once the master-device is up and running. For * other backends, we immediately forward the Active-change event. */ if (!wl->sync_drm || !b) weston_logind_set_active(wl, b); } static void get_active_cb(DBusPendingCall *pending, void *data) { struct weston_logind *wl = data; DBusMessageIter iter; DBusMessage *m; int type; dbus_pending_call_unref(wl->pending_active); wl->pending_active = NULL; m = dbus_pending_call_steal_reply(pending); if (!m) return; type = dbus_message_get_type(m); if (type == DBUS_MESSAGE_TYPE_METHOD_RETURN && dbus_message_iter_init(m, &iter)) parse_active(wl, m, &iter); dbus_message_unref(m); } static void weston_logind_get_active(struct weston_logind *wl) { DBusPendingCall *pending; DBusMessage *m; bool b; const char *iface, *name; m = dbus_message_new_method_call("org.freedesktop.login1", wl->spath, "org.freedesktop.DBus.Properties", "Get"); if (!m) return; iface = "org.freedesktop.login1.Session"; name = "Active"; b = dbus_message_append_args(m, DBUS_TYPE_STRING, &iface, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID); if (!b) goto err_unref; b = dbus_connection_send_with_reply(wl->dbus, m, &pending, -1); if (!b) goto err_unref; b = dbus_pending_call_set_notify(pending, get_active_cb, wl, NULL); if (!b) { dbus_pending_call_cancel(pending); dbus_pending_call_unref(pending); goto err_unref; } if (wl->pending_active) { dbus_pending_call_cancel(wl->pending_active); dbus_pending_call_unref(wl->pending_active); } wl->pending_active = pending; return; err_unref: dbus_message_unref(m); } static void disconnected_dbus(struct weston_logind *wl) { weston_log("logind: dbus connection lost, exiting..\n"); weston_logind_restore(wl); exit(-1); } static void session_removed(struct weston_logind *wl, DBusMessage *m) { const char *name, *obj; bool r; r = dbus_message_get_args(m, NULL, DBUS_TYPE_STRING, &name, DBUS_TYPE_OBJECT_PATH, &obj, DBUS_TYPE_INVALID); if (!r) { weston_log("logind: cannot parse SessionRemoved dbus signal\n"); return; } if (!strcmp(name, wl->sid)) { weston_log("logind: our session got closed, exiting..\n"); weston_logind_restore(wl); exit(-1); } } static void property_changed(struct weston_logind *wl, DBusMessage *m) { DBusMessageIter iter, sub, entry; const char *interface, *name; if (!dbus_message_iter_init(m, &iter) || dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) goto error; dbus_message_iter_get_basic(&iter, &interface); if (!dbus_message_iter_next(&iter) || dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) goto error; dbus_message_iter_recurse(&iter, &sub); while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_DICT_ENTRY) { dbus_message_iter_recurse(&sub, &entry); if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING) goto error; dbus_message_iter_get_basic(&entry, &name); if (!dbus_message_iter_next(&entry)) goto error; if (!strcmp(name, "Active")) { parse_active(wl, m, &entry); return; } dbus_message_iter_next(&sub); } if (!dbus_message_iter_next(&iter) || dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) goto error; dbus_message_iter_recurse(&iter, &sub); while (dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) { dbus_message_iter_get_basic(&sub, &name); if (!strcmp(name, "Active")) { weston_logind_get_active(wl); return; } dbus_message_iter_next(&sub); } return; error: weston_log("logind: cannot parse PropertiesChanged dbus signal\n"); } static void device_paused(struct weston_logind *wl, DBusMessage *m) { bool r; const char *type; uint32_t major, minor; r = dbus_message_get_args(m, NULL, DBUS_TYPE_UINT32, &major, DBUS_TYPE_UINT32, &minor, DBUS_TYPE_STRING, &type, DBUS_TYPE_INVALID); if (!r) { weston_log("logind: cannot parse PauseDevice dbus signal\n"); return; } /* "pause" means synchronous pausing. Acknowledge it unconditionally * as we support asynchronous device shutdowns, anyway. * "force" means asynchronous pausing. * "gone" means the device is gone. We handle it the same as "force" as * a following udev event will be caught, too. * * If it's our main DRM device, tell the compositor to go asleep. */ if (!strcmp(type, "pause")) weston_logind_pause_device_complete(wl, major, minor); if (wl->sync_drm && major == DRM_MAJOR) weston_logind_set_active(wl, false); } static void device_resumed(struct weston_logind *wl, DBusMessage *m) { bool r; uint32_t major; r = dbus_message_get_args(m, NULL, DBUS_TYPE_UINT32, &major, /*DBUS_TYPE_UINT32, &minor, DBUS_TYPE_UNIX_FD, &fd,*/ DBUS_TYPE_INVALID); if (!r) { weston_log("logind: cannot parse ResumeDevice dbus signal\n"); return; } /* DeviceResumed messages provide us a new file-descriptor for * resumed devices. For DRM devices it's the same as before, for evdev * devices it's a new open-file. As we reopen evdev devices, anyway, * there is no need for us to handle this event for evdev. For DRM, we * notify the compositor to wake up. */ if (wl->sync_drm && major == DRM_MAJOR) weston_logind_set_active(wl, true); } static DBusHandlerResult filter_dbus(DBusConnection *c, DBusMessage *m, void *data) { struct weston_logind *wl = data; if (dbus_message_is_signal(m, DBUS_INTERFACE_LOCAL, "Disconnected")) { disconnected_dbus(wl); } else if (dbus_message_is_signal(m, "org.freedesktop.login1.Manager", "SessionRemoved")) { session_removed(wl, m); } else if (dbus_message_is_signal(m, "org.freedesktop.DBus.Properties", "PropertiesChanged")) { property_changed(wl, m); } else if (dbus_message_is_signal(m, "org.freedesktop.login1.Session", "PauseDevice")) { device_paused(wl, m); } else if (dbus_message_is_signal(m, "org.freedesktop.login1.Session", "ResumeDevice")) { device_resumed(wl, m); } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static int weston_logind_setup_dbus(struct weston_logind *wl) { bool b; int r; r = asprintf(&wl->spath, "/org/freedesktop/login1/session/%s", wl->sid); if (r < 0) return -ENOMEM; b = dbus_connection_add_filter(wl->dbus, filter_dbus, wl, NULL); if (!b) { weston_log("logind: cannot add dbus filter\n"); r = -ENOMEM; goto err_spath; } r = weston_dbus_add_match_signal(wl->dbus, "org.freedesktop.login1", "org.freedesktop.login1.Manager", "SessionRemoved", "/org/freedesktop/login1"); if (r < 0) { weston_log("logind: cannot add dbus match\n"); goto err_spath; } r = weston_dbus_add_match_signal(wl->dbus, "org.freedesktop.login1", "org.freedesktop.login1.Session", "PauseDevice", wl->spath); if (r < 0) { weston_log("logind: cannot add dbus match\n"); goto err_spath; } r = weston_dbus_add_match_signal(wl->dbus, "org.freedesktop.login1", "org.freedesktop.login1.Session", "ResumeDevice", wl->spath); if (r < 0) { weston_log("logind: cannot add dbus match\n"); goto err_spath; } r = weston_dbus_add_match_signal(wl->dbus, "org.freedesktop.login1", "org.freedesktop.DBus.Properties", "PropertiesChanged", wl->spath); if (r < 0) { weston_log("logind: cannot add dbus match\n"); goto err_spath; } return 0; err_spath: /* don't remove any dbus-match as the connection is closed, anyway */ free(wl->spath); return r; } static void weston_logind_destroy_dbus(struct weston_logind *wl) { /* don't remove any dbus-match as the connection is closed, anyway */ free(wl->spath); } static int weston_logind_take_control(struct weston_logind *wl) { DBusError err; DBusMessage *m, *reply; dbus_bool_t force; bool b; int r; dbus_error_init(&err); m = dbus_message_new_method_call("org.freedesktop.login1", wl->spath, "org.freedesktop.login1.Session", "TakeControl"); if (!m) return -ENOMEM; force = false; b = dbus_message_append_args(m, DBUS_TYPE_BOOLEAN, &force, DBUS_TYPE_INVALID); if (!b) { r = -ENOMEM; goto err_unref; } reply = dbus_connection_send_with_reply_and_block(wl->dbus, m, -1, &err); if (!reply) { if (dbus_error_has_name(&err, DBUS_ERROR_UNKNOWN_METHOD)) weston_log("logind: old systemd version detected\n"); else weston_log("logind: cannot take control over session %s\n", wl->sid); dbus_error_free(&err); r = -EIO; goto err_unref; } dbus_message_unref(reply); dbus_message_unref(m); return 0; err_unref: dbus_message_unref(m); return r; } static void weston_logind_release_control(struct weston_logind *wl) { DBusMessage *m; m = dbus_message_new_method_call("org.freedesktop.login1", wl->spath, "org.freedesktop.login1.Session", "ReleaseControl"); if (m) { dbus_connection_send(wl->dbus, m, NULL); dbus_message_unref(m); } } static int signal_event(int fd, uint32_t mask, void *data) { struct weston_logind *wl = data; struct signalfd_siginfo sig; if (read(fd, &sig, sizeof sig) != sizeof sig) { weston_log("logind: cannot read signalfd: %m\n"); return 0; } if (sig.ssi_signo == (unsigned int)SIGRTMIN) ioctl(wl->vt, VT_RELDISP, 1); else if (sig.ssi_signo == (unsigned int)SIGRTMIN + 1) ioctl(wl->vt, VT_RELDISP, VT_ACKACQ); return 0; } static int weston_logind_setup_vt(struct weston_logind *wl) { struct stat st; char buf[64]; struct vt_mode mode = { 0 }; int r; sigset_t mask; struct wl_event_loop *loop; snprintf(buf, sizeof(buf), "/dev/tty%u", wl->vtnr); buf[sizeof(buf) - 1] = 0; wl->vt = open(buf, O_RDWR|O_CLOEXEC|O_NONBLOCK); if (wl->vt < 0) { r = -errno; weston_log("logind: cannot open VT %s: %m\n", buf); return r; } if (fstat(wl->vt, &st) == -1 || major(st.st_rdev) != TTY_MAJOR || minor(st.st_rdev) <= 0 || minor(st.st_rdev) >= 64) { r = -EINVAL; weston_log("logind: TTY %s is no virtual terminal\n", buf); goto err_close; } /*r = setsid(); if (r < 0 && errno != EPERM) { r = -errno; weston_log("logind: setsid() failed: %m\n"); goto err_close; } r = ioctl(wl->vt, TIOCSCTTY, 0); if (r < 0) weston_log("logind: VT %s already in use\n", buf);*/ if (ioctl(wl->vt, KDGKBMODE, &wl->kb_mode) < 0) { weston_log("logind: cannot read keyboard mode on %s: %m\n", buf); wl->kb_mode = K_UNICODE; } else if (wl->kb_mode == K_OFF) { wl->kb_mode = K_UNICODE; } if (ioctl(wl->vt, KDSKBMUTE, 1) < 0 && ioctl(wl->vt, KDSKBMODE, K_OFF) < 0) { r = -errno; weston_log("logind: cannot set K_OFF KB-mode on %s: %m\n", buf); goto err_close; } if (ioctl(wl->vt, KDSETMODE, KD_GRAPHICS) < 0) { r = -errno; weston_log("logind: cannot set KD_GRAPHICS mode on %s: %m\n", buf); goto err_kbmode; } /* * SIGRTMIN is used as global VT-release signal, SIGRTMIN + 1 is used * as VT-acquire signal. Note that SIGRT* must be tested on runtime, as * their exact values are not known at compile-time. POSIX requires 32 * of them to be available, though. */ if (SIGRTMIN + 1 > SIGRTMAX) { weston_log("logind: not enough RT signals available: %u-%u\n", SIGRTMIN, SIGRTMAX); return -EINVAL; } sigemptyset(&mask); sigaddset(&mask, SIGRTMIN); sigaddset(&mask, SIGRTMIN + 1); sigprocmask(SIG_BLOCK, &mask, NULL); wl->sfd = signalfd(-1, &mask, SFD_NONBLOCK | SFD_CLOEXEC); if (wl->sfd < 0) { r = -errno; weston_log("logind: cannot create signalfd: %m\n"); goto err_mode; } loop = wl_display_get_event_loop(wl->compositor->wl_display); wl->sfd_source = wl_event_loop_add_fd(loop, wl->sfd, WL_EVENT_READABLE, signal_event, wl); if (!wl->sfd_source) { r = -errno; weston_log("logind: cannot create signalfd source: %m\n"); goto err_sfd; } mode.mode = VT_PROCESS; mode.relsig = SIGRTMIN; mode.acqsig = SIGRTMIN + 1; if (ioctl(wl->vt, VT_SETMODE, &mode) < 0) { r = -errno; weston_log("logind: cannot take over VT: %m\n"); goto err_sfd_source; } weston_log("logind: using VT %s\n", buf); return 0; err_sfd_source: wl_event_source_remove(wl->sfd_source); err_sfd: close(wl->sfd); err_mode: ioctl(wl->vt, KDSETMODE, KD_TEXT); err_kbmode: ioctl(wl->vt, KDSKBMUTE, 0); ioctl(wl->vt, KDSKBMODE, wl->kb_mode); err_close: close(wl->vt); return r; } static void weston_logind_destroy_vt(struct weston_logind *wl) { weston_logind_restore(wl); wl_event_source_remove(wl->sfd_source); close(wl->sfd); close(wl->vt); } WL_EXPORT int weston_logind_connect(struct weston_logind **out, struct weston_compositor *compositor, const char *seat_id, int tty, bool sync_drm) { struct weston_logind *wl; struct wl_event_loop *loop; char *t; int r; wl = zalloc(sizeof(*wl)); if (wl == NULL) { r = -ENOMEM; goto err_out; } wl->compositor = compositor; wl->sync_drm = sync_drm; wl->seat = strdup(seat_id); if (!wl->seat) { r = -ENOMEM; goto err_wl; } r = sd_pid_get_session(getpid(), &wl->sid); if (r < 0) { weston_log("logind: not running in a systemd session\n"); goto err_seat; } t = NULL; r = sd_session_get_seat(wl->sid, &t); if (r < 0) { weston_log("logind: failed to get session seat\n"); free(t); goto err_session; } else if (strcmp(seat_id, t)) { weston_log("logind: weston's seat '%s' differs from session-seat '%s'\n", seat_id, t); r = -EINVAL; free(t); goto err_session; } free(t); r = weston_sd_session_get_vt(wl->sid, &wl->vtnr); if (r < 0) { weston_log("logind: session not running on a VT\n"); goto err_session; } else if (tty > 0 && wl->vtnr != (unsigned int )tty) { weston_log("logind: requested VT --tty=%d differs from real session VT %u\n", tty, wl->vtnr); r = -EINVAL; goto err_session; } loop = wl_display_get_event_loop(compositor->wl_display); r = weston_dbus_open(loop, DBUS_BUS_SYSTEM, &wl->dbus, &wl->dbus_ctx); if (r < 0) { weston_log("logind: cannot connect to system dbus\n"); goto err_session; } r = weston_logind_setup_dbus(wl); if (r < 0) goto err_dbus; r = weston_logind_take_control(wl); if (r < 0) goto err_dbus_cleanup; r = weston_logind_setup_vt(wl); if (r < 0) goto err_control; weston_log("logind: session control granted\n"); *out = wl; return 0; err_control: weston_logind_release_control(wl); err_dbus_cleanup: weston_logind_destroy_dbus(wl); err_dbus: weston_dbus_close(wl->dbus, wl->dbus_ctx); err_session: free(wl->sid); err_seat: free(wl->seat); err_wl: free(wl); err_out: weston_log("logind: cannot setup systemd-logind helper (%d), using legacy fallback\n", r); errno = -r; return -1; } WL_EXPORT void weston_logind_destroy(struct weston_logind *wl) { if (wl->pending_active) { dbus_pending_call_cancel(wl->pending_active); dbus_pending_call_unref(wl->pending_active); } weston_logind_destroy_vt(wl); weston_logind_release_control(wl); weston_logind_destroy_dbus(wl); weston_dbus_close(wl->dbus, wl->dbus_ctx); free(wl->sid); free(wl->seat); free(wl); } weston-1.9.0/src/pixman-renderer.c0000664000175000017500000006176412552061177014042 00000000000000/* * Copyright © 2012 Intel Corporation * Copyright © 2013 Vasily Khoruzhick * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include "pixman-renderer.h" #include "shared/helpers.h" #include struct pixman_output_state { void *shadow_buffer; pixman_image_t *shadow_image; pixman_image_t *hw_buffer; }; struct pixman_surface_state { struct weston_surface *surface; pixman_image_t *image; struct weston_buffer_reference buffer_ref; struct wl_listener buffer_destroy_listener; struct wl_listener surface_destroy_listener; struct wl_listener renderer_destroy_listener; }; struct pixman_renderer { struct weston_renderer base; int repaint_debug; pixman_image_t *debug_color; struct weston_binding *debug_binding; struct wl_signal destroy_signal; }; static inline struct pixman_output_state * get_output_state(struct weston_output *output) { return (struct pixman_output_state *)output->renderer_state; } static int pixman_renderer_create_surface(struct weston_surface *surface); static inline struct pixman_surface_state * get_surface_state(struct weston_surface *surface) { if (!surface->renderer_state) pixman_renderer_create_surface(surface); return (struct pixman_surface_state *)surface->renderer_state; } static inline struct pixman_renderer * get_renderer(struct weston_compositor *ec) { return (struct pixman_renderer *)ec->renderer; } static int pixman_renderer_read_pixels(struct weston_output *output, pixman_format_code_t format, void *pixels, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { struct pixman_output_state *po = get_output_state(output); pixman_transform_t transform; pixman_image_t *out_buf; if (!po->hw_buffer) { errno = ENODEV; return -1; } out_buf = pixman_image_create_bits(format, width, height, pixels, (PIXMAN_FORMAT_BPP(format) / 8) * width); /* Caller expects vflipped source image */ pixman_transform_init_translate(&transform, pixman_int_to_fixed (x), pixman_int_to_fixed (y - pixman_image_get_height (po->hw_buffer))); pixman_transform_scale(&transform, NULL, pixman_fixed_1, pixman_fixed_minus_1); pixman_image_set_transform(po->hw_buffer, &transform); pixman_image_composite32(PIXMAN_OP_SRC, po->hw_buffer, /* src */ NULL /* mask */, out_buf, /* dest */ 0, 0, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ pixman_image_get_width (po->hw_buffer), /* width */ pixman_image_get_height (po->hw_buffer) /* height */); pixman_image_set_transform(po->hw_buffer, NULL); pixman_image_unref(out_buf); return 0; } static void region_global_to_output(struct weston_output *output, pixman_region32_t *region) { pixman_region32_translate(region, -output->x, -output->y); weston_transformed_region(output->width, output->height, output->transform, output->current_scale, region, region); } #define D2F(v) pixman_double_to_fixed((double)v) static void weston_matrix_to_pixman_transform(pixman_transform_t *pt, const struct weston_matrix *wm) { /* Pixman supports only 2D transform matrix, but Weston uses 3D, * * so we're omitting Z coordinate here. */ pt->matrix[0][0] = pixman_double_to_fixed(wm->d[0]); pt->matrix[0][1] = pixman_double_to_fixed(wm->d[4]); pt->matrix[0][2] = pixman_double_to_fixed(wm->d[12]); pt->matrix[1][0] = pixman_double_to_fixed(wm->d[1]); pt->matrix[1][1] = pixman_double_to_fixed(wm->d[5]); pt->matrix[1][2] = pixman_double_to_fixed(wm->d[13]); pt->matrix[2][0] = pixman_double_to_fixed(wm->d[3]); pt->matrix[2][1] = pixman_double_to_fixed(wm->d[7]); pt->matrix[2][2] = pixman_double_to_fixed(wm->d[15]); } static void pixman_renderer_compute_transform(pixman_transform_t *transform_out, struct weston_view *ev, struct weston_output *output) { struct weston_matrix matrix; /* Set up the source transformation based on the surface position, the output position/transform/scale and the client specified buffer transform/scale */ matrix = output->inverse_matrix; if (ev->transform.enabled) { weston_matrix_multiply(&matrix, &ev->transform.inverse); } else { weston_matrix_translate(&matrix, -ev->geometry.x, -ev->geometry.y, 0); } weston_matrix_multiply(&matrix, &ev->surface->surface_to_buffer_matrix); weston_matrix_to_pixman_transform(transform_out, &matrix); } static bool view_transformation_is_translation(struct weston_view *view) { if (!view->transform.enabled) return true; if (view->transform.matrix.type <= WESTON_MATRIX_TRANSFORM_TRANSLATE) return true; return false; } static void region_intersect_only_translation(pixman_region32_t *result_global, pixman_region32_t *global, pixman_region32_t *surf, struct weston_view *view) { float view_x, view_y; assert(view_transformation_is_translation(view)); /* Convert from surface to global coordinates */ pixman_region32_copy(result_global, surf); weston_view_to_global_float(view, 0, 0, &view_x, &view_y); pixman_region32_translate(result_global, (int)view_x, (int)view_y); pixman_region32_intersect(result_global, result_global, global); } static void composite_whole(pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, pixman_image_t *dest, const pixman_transform_t *transform, pixman_filter_t filter) { int32_t dest_width; int32_t dest_height; dest_width = pixman_image_get_width(dest); dest_height = pixman_image_get_height(dest); pixman_image_set_transform(src, transform); pixman_image_set_filter(src, filter, NULL, 0); pixman_image_composite32(op, src, mask, dest, 0, 0, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ dest_width, dest_height); } static void composite_clipped(pixman_image_t *src, pixman_image_t *mask, pixman_image_t *dest, const pixman_transform_t *transform, pixman_filter_t filter, pixman_region32_t *src_clip) { int n_box; pixman_box32_t *boxes; int32_t dest_width; int32_t dest_height; int src_stride; int bitspp; pixman_format_code_t src_format; void *src_data; int i; /* Hardcoded to use PIXMAN_OP_OVER, because sampling outside of * a Pixman image produces (0,0,0,0) instead of discarding the * fragment. */ dest_width = pixman_image_get_width(dest); dest_height = pixman_image_get_height(dest); src_format = pixman_image_get_format(src); src_stride = pixman_image_get_stride(src); bitspp = PIXMAN_FORMAT_BPP(src_format); src_data = pixman_image_get_data(src); assert(src_format); /* This would be massive overdraw, except when n_box is 1. */ boxes = pixman_region32_rectangles(src_clip, &n_box); for (i = 0; i < n_box; i++) { uint8_t *ptr = src_data; pixman_image_t *boximg; pixman_transform_t adj = *transform; ptr += boxes[i].y1 * src_stride; ptr += boxes[i].x1 * bitspp / 8; boximg = pixman_image_create_bits_no_clear(src_format, boxes[i].x2 - boxes[i].x1, boxes[i].y2 - boxes[i].y1, (uint32_t *)ptr, src_stride); pixman_transform_translate(&adj, NULL, pixman_int_to_fixed(-boxes[i].x1), pixman_int_to_fixed(-boxes[i].y1)); pixman_image_set_transform(boximg, &adj); pixman_image_set_filter(boximg, filter, NULL, 0); pixman_image_composite32(PIXMAN_OP_OVER, boximg, mask, dest, 0, 0, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ dest_width, dest_height); pixman_image_unref(boximg); } if (n_box > 1) { static bool warned = false; if (!warned) weston_log("Pixman-renderer warning: %dx overdraw\n", n_box); warned = true; } } /** Paint an intersected region * * \param ev The view to be painted. * \param output The output being painted. * \param repaint_output The region to be painted in output coordinates. * \param source_clip The region of the source image to use, in source image * coordinates. If NULL, use the whole source image. * \param pixman_op Compositing operator, either SRC or OVER. */ static void repaint_region(struct weston_view *ev, struct weston_output *output, pixman_region32_t *repaint_output, pixman_region32_t *source_clip, pixman_op_t pixman_op) { struct pixman_renderer *pr = (struct pixman_renderer *) output->compositor->renderer; struct pixman_surface_state *ps = get_surface_state(ev->surface); struct pixman_output_state *po = get_output_state(output); struct weston_buffer_viewport *vp = &ev->surface->buffer_viewport; pixman_transform_t transform; pixman_filter_t filter; pixman_image_t *mask_image; pixman_color_t mask = { 0, }; /* Clip rendering to the damaged output region */ pixman_image_set_clip_region32(po->shadow_image, repaint_output); pixman_renderer_compute_transform(&transform, ev, output); if (ev->transform.enabled || output->current_scale != vp->buffer.scale) filter = PIXMAN_FILTER_BILINEAR; else filter = PIXMAN_FILTER_NEAREST; if (ps->buffer_ref.buffer) wl_shm_buffer_begin_access(ps->buffer_ref.buffer->shm_buffer); if (ev->alpha < 1.0) { mask.alpha = 0xffff * ev->alpha; mask_image = pixman_image_create_solid_fill(&mask); } else { mask_image = NULL; } if (source_clip) composite_clipped(ps->image, mask_image, po->shadow_image, &transform, filter, source_clip); else composite_whole(pixman_op, ps->image, mask_image, po->shadow_image, &transform, filter); if (mask_image) pixman_image_unref(mask_image); if (ps->buffer_ref.buffer) wl_shm_buffer_end_access(ps->buffer_ref.buffer->shm_buffer); if (pr->repaint_debug) pixman_image_composite32(PIXMAN_OP_OVER, pr->debug_color, /* src */ NULL /* mask */, po->shadow_image, /* dest */ 0, 0, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ pixman_image_get_width (po->shadow_image), /* width */ pixman_image_get_height (po->shadow_image) /* height */); pixman_image_set_clip_region32 (po->shadow_image, NULL); } static void draw_view_translated(struct weston_view *view, struct weston_output *output, pixman_region32_t *repaint_global) { struct weston_surface *surface = view->surface; /* non-opaque region in surface coordinates: */ pixman_region32_t surface_blend; /* region to be painted in output coordinates: */ pixman_region32_t repaint_output; pixman_region32_init(&repaint_output); /* Blended region is whole surface minus opaque region, * unless surface alpha forces us to blend all. */ pixman_region32_init_rect(&surface_blend, 0, 0, surface->width, surface->height); if (!(view->alpha < 1.0)) { pixman_region32_subtract(&surface_blend, &surface_blend, &surface->opaque); if (pixman_region32_not_empty(&surface->opaque)) { region_intersect_only_translation(&repaint_output, repaint_global, &surface->opaque, view); region_global_to_output(output, &repaint_output); repaint_region(view, output, &repaint_output, NULL, PIXMAN_OP_SRC); } } if (pixman_region32_not_empty(&surface_blend)) { region_intersect_only_translation(&repaint_output, repaint_global, &surface_blend, view); region_global_to_output(output, &repaint_output); repaint_region(view, output, &repaint_output, NULL, PIXMAN_OP_OVER); } pixman_region32_fini(&surface_blend); pixman_region32_fini(&repaint_output); } static void draw_view_source_clipped(struct weston_view *view, struct weston_output *output, pixman_region32_t *repaint_global) { struct weston_surface *surface = view->surface; pixman_region32_t surf_region; pixman_region32_t buffer_region; pixman_region32_t repaint_output; /* Do not bother separating the opaque region from non-opaque. * Source clipping requires PIXMAN_OP_OVER in all cases, so painting * opaque separately has no benefit. */ pixman_region32_init_rect(&surf_region, 0, 0, surface->width, surface->height); if (view->geometry.scissor_enabled) pixman_region32_intersect(&surf_region, &surf_region, &view->geometry.scissor); pixman_region32_init(&buffer_region); weston_surface_to_buffer_region(surface, &surf_region, &buffer_region); pixman_region32_init(&repaint_output); pixman_region32_copy(&repaint_output, repaint_global); region_global_to_output(output, &repaint_output); repaint_region(view, output, &repaint_output, &buffer_region, PIXMAN_OP_OVER); pixman_region32_fini(&repaint_output); pixman_region32_fini(&buffer_region); pixman_region32_fini(&surf_region); } static void draw_view(struct weston_view *ev, struct weston_output *output, pixman_region32_t *damage) /* in global coordinates */ { static int zoom_logged = 0; struct pixman_surface_state *ps = get_surface_state(ev->surface); /* repaint bounding region in global coordinates: */ pixman_region32_t repaint; /* No buffer attached */ if (!ps->image) return; pixman_region32_init(&repaint); pixman_region32_intersect(&repaint, &ev->transform.boundingbox, damage); pixman_region32_subtract(&repaint, &repaint, &ev->clip); if (!pixman_region32_not_empty(&repaint)) goto out; if (output->zoom.active && !zoom_logged) { weston_log("pixman renderer does not support zoom\n"); zoom_logged = 1; } if (view_transformation_is_translation(ev)) { /* The simple case: The surface regions opaque, non-opaque, * etc. are convertible to global coordinate space. * There is no need to use a source clip region. * It is possible to paint opaque region as PIXMAN_OP_SRC. * Also the boundingbox is accurate rather than an * approximation. */ draw_view_translated(ev, output, &repaint); } else { /* The complex case: the view transformation does not allow * converting opaque etc. regions into global coordinate space. * Therefore we need source clipping to avoid sampling from * unwanted source image areas, unless the source image is * to be used whole. Source clipping does not work with * PIXMAN_OP_SRC. */ draw_view_source_clipped(ev, output, &repaint); } out: pixman_region32_fini(&repaint); } static void repaint_surfaces(struct weston_output *output, pixman_region32_t *damage) { struct weston_compositor *compositor = output->compositor; struct weston_view *view; wl_list_for_each_reverse(view, &compositor->view_list, link) if (view->plane == &compositor->primary_plane) draw_view(view, output, damage); } static void copy_to_hw_buffer(struct weston_output *output, pixman_region32_t *region) { struct pixman_output_state *po = get_output_state(output); pixman_region32_t output_region; pixman_region32_init(&output_region); pixman_region32_copy(&output_region, region); region_global_to_output(output, &output_region); pixman_image_set_clip_region32 (po->hw_buffer, &output_region); pixman_region32_fini(&output_region); pixman_image_composite32(PIXMAN_OP_SRC, po->shadow_image, /* src */ NULL /* mask */, po->hw_buffer, /* dest */ 0, 0, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ pixman_image_get_width (po->hw_buffer), /* width */ pixman_image_get_height (po->hw_buffer) /* height */); pixman_image_set_clip_region32 (po->hw_buffer, NULL); } static void pixman_renderer_repaint_output(struct weston_output *output, pixman_region32_t *output_damage) { struct pixman_output_state *po = get_output_state(output); if (!po->hw_buffer) return; repaint_surfaces(output, output_damage); copy_to_hw_buffer(output, output_damage); pixman_region32_copy(&output->previous_damage, output_damage); wl_signal_emit(&output->frame_signal, output); /* Actual flip should be done by caller */ } static void pixman_renderer_flush_damage(struct weston_surface *surface) { /* No-op for pixman renderer */ } static void buffer_state_handle_buffer_destroy(struct wl_listener *listener, void *data) { struct pixman_surface_state *ps; ps = container_of(listener, struct pixman_surface_state, buffer_destroy_listener); if (ps->image) { pixman_image_unref(ps->image); ps->image = NULL; } ps->buffer_destroy_listener.notify = NULL; } static void pixman_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer) { struct pixman_surface_state *ps = get_surface_state(es); struct wl_shm_buffer *shm_buffer; pixman_format_code_t pixman_format; weston_buffer_reference(&ps->buffer_ref, buffer); if (ps->buffer_destroy_listener.notify) { wl_list_remove(&ps->buffer_destroy_listener.link); ps->buffer_destroy_listener.notify = NULL; } if (ps->image) { pixman_image_unref(ps->image); ps->image = NULL; } if (!buffer) return; shm_buffer = wl_shm_buffer_get(buffer->resource); if (! shm_buffer) { weston_log("Pixman renderer supports only SHM buffers\n"); weston_buffer_reference(&ps->buffer_ref, NULL); return; } switch (wl_shm_buffer_get_format(shm_buffer)) { case WL_SHM_FORMAT_XRGB8888: pixman_format = PIXMAN_x8r8g8b8; break; case WL_SHM_FORMAT_ARGB8888: pixman_format = PIXMAN_a8r8g8b8; break; case WL_SHM_FORMAT_RGB565: pixman_format = PIXMAN_r5g6b5; break; default: weston_log("Unsupported SHM buffer format\n"); weston_buffer_reference(&ps->buffer_ref, NULL); return; break; } buffer->shm_buffer = shm_buffer; buffer->width = wl_shm_buffer_get_width(shm_buffer); buffer->height = wl_shm_buffer_get_height(shm_buffer); ps->image = pixman_image_create_bits(pixman_format, buffer->width, buffer->height, wl_shm_buffer_get_data(shm_buffer), wl_shm_buffer_get_stride(shm_buffer)); ps->buffer_destroy_listener.notify = buffer_state_handle_buffer_destroy; wl_signal_add(&buffer->destroy_signal, &ps->buffer_destroy_listener); } static void pixman_renderer_surface_state_destroy(struct pixman_surface_state *ps) { wl_list_remove(&ps->surface_destroy_listener.link); wl_list_remove(&ps->renderer_destroy_listener.link); if (ps->buffer_destroy_listener.notify) { wl_list_remove(&ps->buffer_destroy_listener.link); ps->buffer_destroy_listener.notify = NULL; } ps->surface->renderer_state = NULL; if (ps->image) { pixman_image_unref(ps->image); ps->image = NULL; } weston_buffer_reference(&ps->buffer_ref, NULL); free(ps); } static void surface_state_handle_surface_destroy(struct wl_listener *listener, void *data) { struct pixman_surface_state *ps; ps = container_of(listener, struct pixman_surface_state, surface_destroy_listener); pixman_renderer_surface_state_destroy(ps); } static void surface_state_handle_renderer_destroy(struct wl_listener *listener, void *data) { struct pixman_surface_state *ps; ps = container_of(listener, struct pixman_surface_state, renderer_destroy_listener); pixman_renderer_surface_state_destroy(ps); } static int pixman_renderer_create_surface(struct weston_surface *surface) { struct pixman_surface_state *ps; struct pixman_renderer *pr = get_renderer(surface->compositor); ps = zalloc(sizeof *ps); if (ps == NULL) return -1; surface->renderer_state = ps; ps->surface = surface; ps->surface_destroy_listener.notify = surface_state_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &ps->surface_destroy_listener); ps->renderer_destroy_listener.notify = surface_state_handle_renderer_destroy; wl_signal_add(&pr->destroy_signal, &ps->renderer_destroy_listener); return 0; } static void pixman_renderer_surface_set_color(struct weston_surface *es, float red, float green, float blue, float alpha) { struct pixman_surface_state *ps = get_surface_state(es); pixman_color_t color; color.red = red * 0xffff; color.green = green * 0xffff; color.blue = blue * 0xffff; color.alpha = alpha * 0xffff; if (ps->image) { pixman_image_unref(ps->image); ps->image = NULL; } ps->image = pixman_image_create_solid_fill(&color); } static void pixman_renderer_destroy(struct weston_compositor *ec) { struct pixman_renderer *pr = get_renderer(ec); wl_signal_emit(&pr->destroy_signal, pr); weston_binding_destroy(pr->debug_binding); free(pr); ec->renderer = NULL; } static void pixman_renderer_surface_get_content_size(struct weston_surface *surface, int *width, int *height) { struct pixman_surface_state *ps = get_surface_state(surface); if (ps->image) { *width = pixman_image_get_width(ps->image); *height = pixman_image_get_height(ps->image); } else { *width = 0; *height = 0; } } static int pixman_renderer_surface_copy_content(struct weston_surface *surface, void *target, size_t size, int src_x, int src_y, int width, int height) { const pixman_format_code_t format = PIXMAN_a8b8g8r8; const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ struct pixman_surface_state *ps = get_surface_state(surface); pixman_image_t *out_buf; if (!ps->image) return -1; out_buf = pixman_image_create_bits(format, width, height, target, width * bytespp); pixman_image_set_transform(ps->image, NULL); pixman_image_composite32(PIXMAN_OP_SRC, ps->image, /* src */ NULL, /* mask */ out_buf, /* dest */ src_x, src_y, /* src_x, src_y */ 0, 0, /* mask_x, mask_y */ 0, 0, /* dest_x, dest_y */ width, height); pixman_image_unref(out_buf); return 0; } static void debug_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *ec = data; struct pixman_renderer *pr = (struct pixman_renderer *) ec->renderer; pr->repaint_debug ^= 1; if (pr->repaint_debug) { pixman_color_t red = { 0x3fff, 0x0000, 0x0000, 0x3fff }; pr->debug_color = pixman_image_create_solid_fill(&red); } else { pixman_image_unref(pr->debug_color); weston_compositor_damage_all(ec); } } WL_EXPORT int pixman_renderer_init(struct weston_compositor *ec) { struct pixman_renderer *renderer; renderer = zalloc(sizeof *renderer); if (renderer == NULL) return -1; renderer->repaint_debug = 0; renderer->debug_color = NULL; renderer->base.read_pixels = pixman_renderer_read_pixels; renderer->base.repaint_output = pixman_renderer_repaint_output; renderer->base.flush_damage = pixman_renderer_flush_damage; renderer->base.attach = pixman_renderer_attach; renderer->base.surface_set_color = pixman_renderer_surface_set_color; renderer->base.destroy = pixman_renderer_destroy; renderer->base.surface_get_content_size = pixman_renderer_surface_get_content_size; renderer->base.surface_copy_content = pixman_renderer_surface_copy_content; ec->renderer = &renderer->base; ec->capabilities |= WESTON_CAP_ROTATION_ANY; ec->capabilities |= WESTON_CAP_CAPTURE_YFLIP; ec->capabilities |= WESTON_CAP_VIEW_CLIP_MASK; renderer->debug_binding = weston_compositor_add_debug_binding(ec, KEY_R, debug_binding, ec); wl_display_add_shm_format(ec->wl_display, WL_SHM_FORMAT_RGB565); wl_signal_init(&renderer->destroy_signal); return 0; } WL_EXPORT void pixman_renderer_output_set_buffer(struct weston_output *output, pixman_image_t *buffer) { struct pixman_output_state *po = get_output_state(output); if (po->hw_buffer) pixman_image_unref(po->hw_buffer); po->hw_buffer = buffer; if (po->hw_buffer) { output->compositor->read_format = pixman_image_get_format(po->hw_buffer); pixman_image_ref(po->hw_buffer); } } WL_EXPORT int pixman_renderer_output_create(struct weston_output *output) { struct pixman_output_state *po; int w, h; po = zalloc(sizeof *po); if (po == NULL) return -1; /* set shadow image transformation */ w = output->current_mode->width; h = output->current_mode->height; po->shadow_buffer = malloc(w * h * 4); if (!po->shadow_buffer) { free(po); return -1; } po->shadow_image = pixman_image_create_bits(PIXMAN_x8r8g8b8, w, h, po->shadow_buffer, w * 4); if (!po->shadow_image) { free(po->shadow_buffer); free(po); return -1; } output->renderer_state = po; return 0; } WL_EXPORT void pixman_renderer_output_destroy(struct weston_output *output) { struct pixman_output_state *po = get_output_state(output); pixman_image_unref(po->shadow_image); if (po->hw_buffer) pixman_image_unref(po->hw_buffer); free(po->shadow_buffer); po->shadow_buffer = NULL; po->shadow_image = NULL; po->hw_buffer = NULL; free(po); } weston-1.9.0/src/version.h0000664000175000017500000000376612600133046012417 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef WESTON_VERSION_H #define WESTON_VERSION_H #define WESTON_VERSION_MAJOR 1 #define WESTON_VERSION_MINOR 9 #define WESTON_VERSION_MICRO 0 #define WESTON_VERSION "1.9.0" /* This macro may not do what you expect. Weston doesn't guarantee * a stable API between 1.X and 1.Y, and thus this macro will return * FALSE on any WESTON_VERSION_AT_LEAST(1,X,0) if the actual version * is 1.Y.0 and X != Y). In particular, it fails if X < Y, that is, * 1.3.0 is considered to not be "at least" 1.4.0. * * If you want to test for the version number being 1.3.0 or above or * maybe in a range (eg 1.2.0 to 1.4.0), just use the WESTON_VERSION_* * defines above directly. */ #define WESTON_VERSION_AT_LEAST(major, minor, micro) \ (WESTON_VERSION_MAJOR == (major) && \ WESTON_VERSION_MINOR == (minor) && \ WESTON_VERSION_MICRO >= (micro)) #endif weston-1.9.0/src/dbus.c0000664000175000017500000002317712537627702011700 00000000000000/* * Copyright © 2013 David Herrmann * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * DBus Helpers * This file contains the dbus mainloop integration and several helpers to * make lowlevel libdbus access easier. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "compositor.h" #include "dbus.h" /* * DBus Mainloop Integration * weston_dbus_bind() and weston_dbus_unbind() allow to bind an existing * DBusConnection to an existing wl_event_loop object. All dbus dispatching * is then nicely integrated into the wayland event loop. * Note that this only provides basic watch and timeout dispatching. No * remote thread wakeup, signal handling or other dbus insanity is supported. * This is fine as long as you don't use any of the deprecated libdbus * interfaces (like waking up remote threads..). There is really no rational * reason to support these. */ static int weston_dbus_dispatch_watch(int fd, uint32_t mask, void *data) { DBusWatch *watch = data; uint32_t flags = 0; if (dbus_watch_get_enabled(watch)) { if (mask & WL_EVENT_READABLE) flags |= DBUS_WATCH_READABLE; if (mask & WL_EVENT_WRITABLE) flags |= DBUS_WATCH_WRITABLE; if (mask & WL_EVENT_HANGUP) flags |= DBUS_WATCH_HANGUP; if (mask & WL_EVENT_ERROR) flags |= DBUS_WATCH_ERROR; dbus_watch_handle(watch, flags); } return 0; } static dbus_bool_t weston_dbus_add_watch(DBusWatch *watch, void *data) { struct wl_event_loop *loop = data; struct wl_event_source *s; int fd; uint32_t mask = 0, flags; if (dbus_watch_get_enabled(watch)) { flags = dbus_watch_get_flags(watch); if (flags & DBUS_WATCH_READABLE) mask |= WL_EVENT_READABLE; if (flags & DBUS_WATCH_WRITABLE) mask |= WL_EVENT_WRITABLE; } fd = dbus_watch_get_unix_fd(watch); s = wl_event_loop_add_fd(loop, fd, mask, weston_dbus_dispatch_watch, watch); if (!s) return FALSE; dbus_watch_set_data(watch, s, NULL); return TRUE; } static void weston_dbus_remove_watch(DBusWatch *watch, void *data) { struct wl_event_source *s; s = dbus_watch_get_data(watch); if (!s) return; wl_event_source_remove(s); } static void weston_dbus_toggle_watch(DBusWatch *watch, void *data) { struct wl_event_source *s; uint32_t mask = 0, flags; s = dbus_watch_get_data(watch); if (!s) return; if (dbus_watch_get_enabled(watch)) { flags = dbus_watch_get_flags(watch); if (flags & DBUS_WATCH_READABLE) mask |= WL_EVENT_READABLE; if (flags & DBUS_WATCH_WRITABLE) mask |= WL_EVENT_WRITABLE; } wl_event_source_fd_update(s, mask); } static int weston_dbus_dispatch_timeout(void *data) { DBusTimeout *timeout = data; if (dbus_timeout_get_enabled(timeout)) dbus_timeout_handle(timeout); return 0; } static int weston_dbus_adjust_timeout(DBusTimeout *timeout, struct wl_event_source *s) { int64_t t = 0; if (dbus_timeout_get_enabled(timeout)) t = dbus_timeout_get_interval(timeout); return wl_event_source_timer_update(s, t); } static dbus_bool_t weston_dbus_add_timeout(DBusTimeout *timeout, void *data) { struct wl_event_loop *loop = data; struct wl_event_source *s; int r; s = wl_event_loop_add_timer(loop, weston_dbus_dispatch_timeout, timeout); if (!s) return FALSE; r = weston_dbus_adjust_timeout(timeout, s); if (r < 0) { wl_event_source_remove(s); return FALSE; } dbus_timeout_set_data(timeout, s, NULL); return TRUE; } static void weston_dbus_remove_timeout(DBusTimeout *timeout, void *data) { struct wl_event_source *s; s = dbus_timeout_get_data(timeout); if (!s) return; wl_event_source_remove(s); } static void weston_dbus_toggle_timeout(DBusTimeout *timeout, void *data) { struct wl_event_source *s; s = dbus_timeout_get_data(timeout); if (!s) return; weston_dbus_adjust_timeout(timeout, s); } static int weston_dbus_dispatch(int fd, uint32_t mask, void *data) { DBusConnection *c = data; int r; do { r = dbus_connection_dispatch(c); if (r == DBUS_DISPATCH_COMPLETE) r = 0; else if (r == DBUS_DISPATCH_DATA_REMAINS) r = -EAGAIN; else if (r == DBUS_DISPATCH_NEED_MEMORY) r = -ENOMEM; else r = -EIO; } while (r == -EAGAIN); if (r) weston_log("cannot dispatch dbus events: %d\n", r); return 0; } static int weston_dbus_bind(struct wl_event_loop *loop, DBusConnection *c, struct wl_event_source **ctx_out) { bool b; int r, fd; /* Idle events cannot reschedule themselves, therefore we use a dummy * event-fd and mark it for post-dispatch. Hence, the dbus * dispatcher is called after every dispatch-round. * This is required as dbus doesn't allow dispatching events from * within its own event sources. */ fd = eventfd(0, EFD_CLOEXEC); if (fd < 0) return -errno; *ctx_out = wl_event_loop_add_fd(loop, fd, 0, weston_dbus_dispatch, c); close(fd); if (!*ctx_out) return -ENOMEM; wl_event_source_check(*ctx_out); b = dbus_connection_set_watch_functions(c, weston_dbus_add_watch, weston_dbus_remove_watch, weston_dbus_toggle_watch, loop, NULL); if (!b) { r = -ENOMEM; goto error; } b = dbus_connection_set_timeout_functions(c, weston_dbus_add_timeout, weston_dbus_remove_timeout, weston_dbus_toggle_timeout, loop, NULL); if (!b) { r = -ENOMEM; goto error; } dbus_connection_ref(c); return 0; error: dbus_connection_set_timeout_functions(c, NULL, NULL, NULL, NULL, NULL); dbus_connection_set_watch_functions(c, NULL, NULL, NULL, NULL, NULL); wl_event_source_remove(*ctx_out); *ctx_out = NULL; return r; } static void weston_dbus_unbind(DBusConnection *c, struct wl_event_source *ctx) { dbus_connection_set_timeout_functions(c, NULL, NULL, NULL, NULL, NULL); dbus_connection_set_watch_functions(c, NULL, NULL, NULL, NULL, NULL); dbus_connection_unref(c); wl_event_source_remove(ctx); } /* * Convenience Helpers * Several convenience helpers are provided to make using dbus in weston * easier. We don't use any of the gdbus or qdbus helpers as they pull in * huge dependencies and actually are quite awful to use. Instead, we only * use the basic low-level libdbus library. */ int weston_dbus_open(struct wl_event_loop *loop, DBusBusType bus, DBusConnection **out, struct wl_event_source **ctx_out) { DBusConnection *c; int r; /* Ihhh, global state.. stupid dbus. */ dbus_connection_set_change_sigpipe(FALSE); /* This is actually synchronous. It blocks for some authentication and * setup. We just trust the dbus-server here and accept this blocking * call. There is no real reason to complicate things further and make * this asynchronous/non-blocking. A context should be created during * thead/process/app setup, so blocking calls should be fine. */ c = dbus_bus_get_private(bus, NULL); if (!c) return -EIO; dbus_connection_set_exit_on_disconnect(c, FALSE); r = weston_dbus_bind(loop, c, ctx_out); if (r < 0) goto error; *out = c; return r; error: dbus_connection_close(c); dbus_connection_unref(c); return r; } void weston_dbus_close(DBusConnection *c, struct wl_event_source *ctx) { weston_dbus_unbind(c, ctx); dbus_connection_close(c); dbus_connection_unref(c); } int weston_dbus_add_match(DBusConnection *c, const char *format, ...) { DBusError err; int r; va_list list; char *str; va_start(list, format); r = vasprintf(&str, format, list); va_end(list); if (r < 0) return -ENOMEM; dbus_error_init(&err); dbus_bus_add_match(c, str, &err); free(str); if (dbus_error_is_set(&err)) { dbus_error_free(&err); return -EIO; } return 0; } int weston_dbus_add_match_signal(DBusConnection *c, const char *sender, const char *iface, const char *member, const char *path) { return weston_dbus_add_match(c, "type='signal'," "sender='%s'," "interface='%s'," "member='%s'," "path='%s'", sender, iface, member, path); } void weston_dbus_remove_match(DBusConnection *c, const char *format, ...) { int r; va_list list; char *str; va_start(list, format); r = vasprintf(&str, format, list); va_end(list); if (r < 0) return; dbus_bus_remove_match(c, str, NULL); free(str); } void weston_dbus_remove_match_signal(DBusConnection *c, const char *sender, const char *iface, const char *member, const char *path) { return weston_dbus_remove_match(c, "type='signal'," "sender='%s'," "interface='%s'," "member='%s'," "path='%s'", sender, iface, member, path); } weston-1.9.0/src/cms-helper.h0000664000175000017500000000554312537627702013004 00000000000000/* * Copyright © 2013 Richard Hughes * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_CMS_H_ #define _WESTON_CMS_H_ #include "config.h" #include "compositor.h" /* General overview on how to be a CMS plugin: * * First, some nomenclature: * * CMF: Color management framework, i.e. "Use foo.icc for device $bar" * CMM: Color management module that converts pixel colors, which is * usually lcms2 on any modern OS. * CMS: Color management system that encompasses both a CMF and CMM. * ICC: International Color Consortium, the people that define the * binary encoding of a .icc file. * VCGT: Video Card Gamma Tag. An Apple extension to the ICC specification * that allows the calibration state to be stored in the ICC profile * Output: Physical port with a display attached, e.g. LVDS1 * * As a CMF is probably something you don't want or need on an embedded install * these functions will not be called if the icc_profile key is set for a * specific [output] section in weston.ini * * Most desktop environments want the CMF to decide what profile to use in * different situations, so that displays can be profiled and also so that * the ICC profiles can be changed at runtime depending on the task or ambient * environment. * * The CMF can be selected using the 'modules' key in the [core] section. */ struct weston_color_profile { char *filename; void *lcms_handle; }; void weston_cms_set_color_profile(struct weston_output *o, struct weston_color_profile *p); struct weston_color_profile * weston_cms_create_profile(const char *filename, void *lcms_profile); struct weston_color_profile * weston_cms_load_profile(const char *filename); void weston_cms_destroy_profile(struct weston_color_profile *p); #endif weston-1.9.0/src/timeline.c0000664000175000017500000001447712537627702012554 00000000000000/* * Copyright © 2014 Pekka Paalanen * Copyright © 2014 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "timeline.h" #include "compositor.h" #include "file-util.h" struct timeline_log { clock_t clk_id; FILE *file; unsigned series; struct wl_listener compositor_destroy_listener; }; WL_EXPORT int weston_timeline_enabled_; static struct timeline_log timeline_ = { CLOCK_MONOTONIC, NULL, 0 }; static int weston_timeline_do_open(void) { const char *prefix = "weston-timeline-"; const char *suffix = ".log"; char fname[1000]; timeline_.file = file_create_dated(prefix, suffix, fname, sizeof(fname)); if (!timeline_.file) { const char *msg; switch (errno) { case ETIME: msg = "failure in datetime formatting"; break; default: msg = strerror(errno); } weston_log("Cannot open '%s*%s' for writing: %s\n", prefix, suffix, msg); return -1; } weston_log("Opened timeline file '%s'\n", fname); return 0; } static void timeline_notify_destroy(struct wl_listener *listener, void *data) { weston_timeline_close(); } void weston_timeline_open(struct weston_compositor *compositor) { if (weston_timeline_enabled_) return; if (weston_timeline_do_open() < 0) return; timeline_.compositor_destroy_listener.notify = timeline_notify_destroy; wl_signal_add(&compositor->destroy_signal, &timeline_.compositor_destroy_listener); if (++timeline_.series == 0) ++timeline_.series; weston_timeline_enabled_ = 1; } void weston_timeline_close(void) { if (!weston_timeline_enabled_) return; weston_timeline_enabled_ = 0; wl_list_remove(&timeline_.compositor_destroy_listener.link); fclose(timeline_.file); timeline_.file = NULL; weston_log("Timeline log file closed.\n"); } struct timeline_emit_context { FILE *cur; FILE *out; unsigned series; }; static unsigned timeline_new_id(void) { static unsigned idc; if (++idc == 0) ++idc; return idc; } static int check_series(struct timeline_emit_context *ctx, struct weston_timeline_object *to) { if (to->series == 0 || to->series != ctx->series) { to->series = ctx->series; to->id = timeline_new_id(); return 1; } if (to->force_refresh) { to->force_refresh = 0; return 1; } return 0; } static void fprint_quoted_string(FILE *fp, const char *str) { if (!str) { fprintf(fp, "null"); return; } fprintf(fp, "\"%s\"", str); } static int emit_weston_output(struct timeline_emit_context *ctx, void *obj) { struct weston_output *o = obj; if (check_series(ctx, &o->timeline)) { fprintf(ctx->out, "{ \"id\":%u, " "\"type\":\"weston_output\", \"name\":", o->timeline.id); fprint_quoted_string(ctx->out, o->name); fprintf(ctx->out, " }\n"); } fprintf(ctx->cur, "\"wo\":%u", o->timeline.id); return 1; } static void check_weston_surface_description(struct timeline_emit_context *ctx, struct weston_surface *s) { struct weston_surface *mains; char d[512]; char mainstr[32]; if (!check_series(ctx, &s->timeline)) return; mains = weston_surface_get_main_surface(s); if (mains != s) { check_weston_surface_description(ctx, mains); if (snprintf(mainstr, sizeof(mainstr), ", \"main_surface\":%u", mains->timeline.id) < 0) mainstr[0] = '\0'; } else { mainstr[0] = '\0'; } if (!s->get_label || s->get_label(s, d, sizeof(d)) < 0) d[0] = '\0'; fprintf(ctx->out, "{ \"id\":%u, " "\"type\":\"weston_surface\", \"desc\":", s->timeline.id); fprint_quoted_string(ctx->out, d[0] ? d : NULL); fprintf(ctx->out, "%s }\n", mainstr); } static int emit_weston_surface(struct timeline_emit_context *ctx, void *obj) { struct weston_surface *s = obj; check_weston_surface_description(ctx, s); fprintf(ctx->cur, "\"ws\":%u", s->timeline.id); return 1; } static int emit_vblank_timestamp(struct timeline_emit_context *ctx, void *obj) { struct timespec *ts = obj; fprintf(ctx->cur, "\"vblank\":[%" PRId64 ", %ld]", (int64_t)ts->tv_sec, ts->tv_nsec); return 1; } typedef int (*type_func)(struct timeline_emit_context *ctx, void *obj); static const type_func type_dispatch[] = { [TLT_OUTPUT] = emit_weston_output, [TLT_SURFACE] = emit_weston_surface, [TLT_VBLANK] = emit_vblank_timestamp, }; WL_EXPORT void weston_timeline_point(const char *name, ...) { va_list argp; struct timespec ts; enum timeline_type otype; void *obj; char buf[512]; struct timeline_emit_context ctx; clock_gettime(timeline_.clk_id, &ts); ctx.out = timeline_.file; ctx.cur = fmemopen(buf, sizeof(buf), "w"); ctx.series = timeline_.series; if (!ctx.cur) { weston_log("Timeline error in fmemopen, closing.\n"); weston_timeline_close(); return; } fprintf(ctx.cur, "{ \"T\":[%" PRId64 ", %ld], \"N\":\"%s\"", (int64_t)ts.tv_sec, ts.tv_nsec, name); va_start(argp, name); while (1) { otype = va_arg(argp, enum timeline_type); if (otype == TLT_END) break; obj = va_arg(argp, void *); if (type_dispatch[otype]) { fprintf(ctx.cur, ", "); type_dispatch[otype](&ctx, obj); } } va_end(argp); fprintf(ctx.cur, " }\n"); fflush(ctx.cur); if (ferror(ctx.cur)) { weston_log("Timeline error in constructing entry, closing.\n"); weston_timeline_close(); } else { fprintf(ctx.out, "%s", buf); } fclose(ctx.cur); } weston-1.9.0/src/libbacklight.c0000664000175000017500000001602412534646207013351 00000000000000/* * libbacklight - userspace interface to Linux backlight control * * Copyright © 2012 Intel Corporation * Copyright 2010 Red Hat * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Matthew Garrett * Tiago Vignatti */ #include "config.h" #include "libbacklight.h" #include #include #include #include #include #include #include #include #include #include static long backlight_get(struct backlight *backlight, char *node) { char buffer[100]; char *path; int fd; long value, ret; if (asprintf(&path, "%s/%s", backlight->path, node) < 0) return -ENOMEM; fd = open(path, O_RDONLY); if (fd < 0) { ret = -1; goto out; } ret = read(fd, &buffer, sizeof(buffer)); if (ret < 1) { ret = -1; goto out; } value = strtol(buffer, NULL, 10); ret = value; out: if (fd >= 0) close(fd); free(path); return ret; } long backlight_get_brightness(struct backlight *backlight) { return backlight_get(backlight, "brightness"); } long backlight_get_max_brightness(struct backlight *backlight) { return backlight_get(backlight, "max_brightness"); } long backlight_get_actual_brightness(struct backlight *backlight) { return backlight_get(backlight, "actual_brightness"); } long backlight_set_brightness(struct backlight *backlight, long brightness) { char *path; char *buffer = NULL; int fd; long ret; if (asprintf(&path, "%s/%s", backlight->path, "brightness") < 0) return -ENOMEM; fd = open(path, O_RDWR); if (fd < 0) { ret = -1; goto out; } ret = read(fd, &buffer, sizeof(buffer)); if (ret < 1) { ret = -1; goto out; } if (asprintf(&buffer, "%ld", brightness) < 0) { ret = -1; goto out; } ret = write(fd, buffer, strlen(buffer)); if (ret < 0) { ret = -1; goto out; } ret = backlight_get_brightness(backlight); backlight->brightness = ret; out: free(buffer); free(path); if (fd >= 0) close(fd); return ret; } void backlight_destroy(struct backlight *backlight) { if (!backlight) return; if (backlight->path) free(backlight->path); free(backlight); } struct backlight *backlight_init(struct udev_device *drm_device, uint32_t connector_type) { const char *syspath = NULL; char *pci_name = NULL; char *chosen_path = NULL; char *path = NULL; DIR *backlights = NULL; struct dirent *entry; enum backlight_type type = 0; char buffer[100]; struct backlight *backlight = NULL; int ret; if (!drm_device) return NULL; syspath = udev_device_get_syspath(drm_device); if (!syspath) return NULL; if (asprintf(&path, "%s/%s", syspath, "device") < 0) return NULL; ret = readlink(path, buffer, sizeof(buffer) - 1); free(path); if (ret < 0) return NULL; buffer[ret] = '\0'; pci_name = basename(buffer); if (connector_type <= 0) return NULL; backlights = opendir("/sys/class/backlight"); if (!backlights) return NULL; /* Find the "best" backlight for the device. Firmware interfaces are preferred over platform interfaces are preferred over raw interfaces. For raw interfaces we'll check if the device ID in the form of pci match, while for firmware interfaces we require the pci ID to match. It's assumed that platform interfaces always match, since we can't actually associate them with IDs. A further awkwardness is that, while it's theoretically possible for an ACPI interface to include support for changing the backlight of external devices, it's unlikely to ever be done. It's effectively impossible for a platform interface to do so. So if we get asked about anything that isn't LVDS or eDP, we pretty much have to require that the control be supplied via a raw interface */ while ((entry = readdir(backlights))) { char *backlight_path; char *parent; enum backlight_type entry_type; int fd; if (entry->d_name[0] == '.') continue; if (asprintf(&backlight_path, "%s/%s", "/sys/class/backlight", entry->d_name) < 0) goto err; if (asprintf(&path, "%s/%s", backlight_path, "type") < 0) { free(backlight_path); goto err; } fd = open(path, O_RDONLY); if (fd < 0) goto out; ret = read (fd, &buffer, sizeof(buffer)); close (fd); if (ret < 1) goto out; buffer[ret] = '\0'; if (!strncmp(buffer, "raw\n", sizeof(buffer))) entry_type = BACKLIGHT_RAW; else if (!strncmp(buffer, "platform\n", sizeof(buffer))) entry_type = BACKLIGHT_PLATFORM; else if (!strncmp(buffer, "firmware\n", sizeof(buffer))) entry_type = BACKLIGHT_FIRMWARE; else goto out; if (connector_type != DRM_MODE_CONNECTOR_LVDS && connector_type != DRM_MODE_CONNECTOR_eDP) { /* External displays are assumed to require gpu control at the moment */ if (entry_type != BACKLIGHT_RAW) goto out; } free (path); if (asprintf(&path, "%s/%s", backlight_path, "device") < 0) goto err; ret = readlink(path, buffer, sizeof(buffer) - 1); if (ret < 0) goto out; buffer[ret] = '\0'; parent = basename(buffer); /* Perform matching for raw and firmware backlights - platform backlights have to be assumed to match */ if (entry_type == BACKLIGHT_RAW || entry_type == BACKLIGHT_FIRMWARE) { if (!(pci_name && !strcmp(pci_name, parent))) goto out; } if (entry_type < type) goto out; type = entry_type; if (chosen_path) free(chosen_path); chosen_path = strdup(backlight_path); out: free(backlight_path); free(path); } if (!chosen_path) goto err; backlight = malloc(sizeof(struct backlight)); if (!backlight) goto err; backlight->path = chosen_path; backlight->type = type; backlight->max_brightness = backlight_get_max_brightness(backlight); if (backlight->max_brightness < 0) goto err; backlight->brightness = backlight_get_actual_brightness(backlight); if (backlight->brightness < 0) goto err; closedir(backlights); return backlight; err: closedir(backlights); free (chosen_path); free (backlight); return NULL; } weston-1.9.0/src/vaapi-recorder.h0000664000175000017500000000274212537627702013646 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _VAAPI_RECORDER_H_ #define _VAAPI_RECORDER_H_ struct vaapi_recorder; struct vaapi_recorder * vaapi_recorder_create(int drm_fd, int width, int height, const char *filename); void vaapi_recorder_destroy(struct vaapi_recorder *r); int vaapi_recorder_frame(struct vaapi_recorder *r, int fd, int stride); #endif /* _VAAPI_RECORDER_H_ */ weston-1.9.0/src/bindings.c0000664000175000017500000003671712552061270012531 00000000000000/* * Copyright © 2011-2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "compositor.h" #include "shared/helpers.h" struct weston_binding { uint32_t key; uint32_t button; uint32_t axis; uint32_t modifier; void *handler; void *data; struct wl_list link; }; static struct weston_binding * weston_compositor_add_binding(struct weston_compositor *compositor, uint32_t key, uint32_t button, uint32_t axis, uint32_t modifier, void *handler, void *data) { struct weston_binding *binding; binding = malloc(sizeof *binding); if (binding == NULL) return NULL; binding->key = key; binding->button = button; binding->axis = axis; binding->modifier = modifier; binding->handler = handler; binding->data = data; return binding; } WL_EXPORT struct weston_binding * weston_compositor_add_key_binding(struct weston_compositor *compositor, uint32_t key, uint32_t modifier, weston_key_binding_handler_t handler, void *data) { struct weston_binding *binding; binding = weston_compositor_add_binding(compositor, key, 0, 0, modifier, handler, data); if (binding == NULL) return NULL; wl_list_insert(compositor->key_binding_list.prev, &binding->link); return binding; } WL_EXPORT struct weston_binding * weston_compositor_add_modifier_binding(struct weston_compositor *compositor, uint32_t modifier, weston_modifier_binding_handler_t handler, void *data) { struct weston_binding *binding; binding = weston_compositor_add_binding(compositor, 0, 0, 0, modifier, handler, data); if (binding == NULL) return NULL; wl_list_insert(compositor->modifier_binding_list.prev, &binding->link); return binding; } WL_EXPORT struct weston_binding * weston_compositor_add_button_binding(struct weston_compositor *compositor, uint32_t button, uint32_t modifier, weston_button_binding_handler_t handler, void *data) { struct weston_binding *binding; binding = weston_compositor_add_binding(compositor, 0, button, 0, modifier, handler, data); if (binding == NULL) return NULL; wl_list_insert(compositor->button_binding_list.prev, &binding->link); return binding; } WL_EXPORT struct weston_binding * weston_compositor_add_touch_binding(struct weston_compositor *compositor, uint32_t modifier, weston_touch_binding_handler_t handler, void *data) { struct weston_binding *binding; binding = weston_compositor_add_binding(compositor, 0, 0, 0, modifier, handler, data); if (binding == NULL) return NULL; wl_list_insert(compositor->touch_binding_list.prev, &binding->link); return binding; } WL_EXPORT struct weston_binding * weston_compositor_add_axis_binding(struct weston_compositor *compositor, uint32_t axis, uint32_t modifier, weston_axis_binding_handler_t handler, void *data) { struct weston_binding *binding; binding = weston_compositor_add_binding(compositor, 0, 0, axis, modifier, handler, data); if (binding == NULL) return NULL; wl_list_insert(compositor->axis_binding_list.prev, &binding->link); return binding; } WL_EXPORT struct weston_binding * weston_compositor_add_debug_binding(struct weston_compositor *compositor, uint32_t key, weston_key_binding_handler_t handler, void *data) { struct weston_binding *binding; binding = weston_compositor_add_binding(compositor, key, 0, 0, 0, handler, data); wl_list_insert(compositor->debug_binding_list.prev, &binding->link); return binding; } WL_EXPORT void weston_binding_destroy(struct weston_binding *binding) { wl_list_remove(&binding->link); free(binding); } void weston_binding_list_destroy_all(struct wl_list *list) { struct weston_binding *binding, *tmp; wl_list_for_each_safe(binding, tmp, list, link) weston_binding_destroy(binding); } struct binding_keyboard_grab { uint32_t key; struct weston_keyboard_grab grab; }; static void binding_key(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state_w) { struct binding_keyboard_grab *b = container_of(grab, struct binding_keyboard_grab, grab); struct wl_resource *resource; enum wl_keyboard_key_state state = state_w; uint32_t serial; struct weston_keyboard *keyboard = grab->keyboard; struct wl_display *display = keyboard->seat->compositor->wl_display; if (key == b->key) { if (state == WL_KEYBOARD_KEY_STATE_RELEASED) { weston_keyboard_end_grab(grab->keyboard); if (keyboard->input_method_resource) keyboard->grab = &keyboard->input_method_grab; free(b); } else { /* Don't send the key press event for the binding key */ return; } } if (!wl_list_empty(&keyboard->focus_resource_list)) { serial = wl_display_next_serial(display); wl_resource_for_each(resource, &keyboard->focus_resource_list) { wl_keyboard_send_key(resource, serial, time, key, state); } } } static void binding_modifiers(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct wl_resource *resource; wl_resource_for_each(resource, &grab->keyboard->focus_resource_list) { wl_keyboard_send_modifiers(resource, serial, mods_depressed, mods_latched, mods_locked, group); } } static void binding_cancel(struct weston_keyboard_grab *grab) { struct binding_keyboard_grab *binding_grab = container_of(grab, struct binding_keyboard_grab, grab); weston_keyboard_end_grab(grab->keyboard); free(binding_grab); } static const struct weston_keyboard_grab_interface binding_grab = { binding_key, binding_modifiers, binding_cancel, }; static void install_binding_grab(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, struct weston_surface *focus) { struct binding_keyboard_grab *grab; grab = malloc(sizeof *grab); grab->key = key; grab->grab.interface = &binding_grab; weston_keyboard_start_grab(keyboard, &grab->grab); /* Notify the surface which had the focus before this binding * triggered that we stole a keypress from under it, by forcing * a wl_keyboard leave/enter pair. The enter event will contain * the pressed key in the keys array, so the client will know * the exact state of the keyboard. * If the old focus surface is different than the new one it * means it was changed in the binding handler, so it received * the enter event already. */ if (focus && keyboard->focus == focus) { weston_keyboard_set_focus(keyboard, NULL); weston_keyboard_set_focus(keyboard, focus); } } void weston_compositor_run_key_binding(struct weston_compositor *compositor, struct weston_keyboard *keyboard, uint32_t time, uint32_t key, enum wl_keyboard_key_state state) { struct weston_binding *b, *tmp; struct weston_surface *focus; struct weston_seat *seat = keyboard->seat; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; /* Invalidate all active modifier bindings. */ wl_list_for_each(b, &compositor->modifier_binding_list, link) b->key = key; wl_list_for_each_safe(b, tmp, &compositor->key_binding_list, link) { if (b->key == key && b->modifier == seat->modifier_state) { weston_key_binding_handler_t handler = b->handler; focus = keyboard->focus; handler(keyboard, time, key, b->data); /* If this was a key binding and it didn't * install a keyboard grab, install one now to * swallow the key press. */ if (keyboard->grab == &keyboard->default_grab) install_binding_grab(keyboard, time, key, focus); } } } void weston_compositor_run_modifier_binding(struct weston_compositor *compositor, struct weston_keyboard *keyboard, enum weston_keyboard_modifier modifier, enum wl_keyboard_key_state state) { struct weston_binding *b, *tmp; if (keyboard->grab != &keyboard->default_grab) return; wl_list_for_each_safe(b, tmp, &compositor->modifier_binding_list, link) { weston_modifier_binding_handler_t handler = b->handler; if (b->modifier != modifier) continue; /* Prime the modifier binding. */ if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { b->key = 0; continue; } /* Ignore the binding if a key was pressed in between. */ else if (b->key != 0) { return; } handler(keyboard, modifier, b->data); } } void weston_compositor_run_button_binding(struct weston_compositor *compositor, struct weston_pointer *pointer, uint32_t time, uint32_t button, enum wl_pointer_button_state state) { struct weston_binding *b, *tmp; if (state == WL_POINTER_BUTTON_STATE_RELEASED) return; /* Invalidate all active modifier bindings. */ wl_list_for_each(b, &compositor->modifier_binding_list, link) b->key = button; wl_list_for_each_safe(b, tmp, &compositor->button_binding_list, link) { if (b->button == button && b->modifier == pointer->seat->modifier_state) { weston_button_binding_handler_t handler = b->handler; handler(pointer, time, button, b->data); } } } void weston_compositor_run_touch_binding(struct weston_compositor *compositor, struct weston_touch *touch, uint32_t time, int touch_type) { struct weston_binding *b, *tmp; if (touch->num_tp != 1 || touch_type != WL_TOUCH_DOWN) return; wl_list_for_each_safe(b, tmp, &compositor->touch_binding_list, link) { if (b->modifier == touch->seat->modifier_state) { weston_touch_binding_handler_t handler = b->handler; handler(touch, time, b->data); } } } int weston_compositor_run_axis_binding(struct weston_compositor *compositor, struct weston_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct weston_binding *b, *tmp; /* Invalidate all active modifier bindings. */ wl_list_for_each(b, &compositor->modifier_binding_list, link) b->key = axis; wl_list_for_each_safe(b, tmp, &compositor->axis_binding_list, link) { if (b->axis == axis && b->modifier == pointer->seat->modifier_state) { weston_axis_binding_handler_t handler = b->handler; handler(pointer, time, axis, value, b->data); return 1; } } return 0; } int weston_compositor_run_debug_binding(struct weston_compositor *compositor, struct weston_keyboard *keyboard, uint32_t time, uint32_t key, enum wl_keyboard_key_state state) { weston_key_binding_handler_t handler; struct weston_binding *binding, *tmp; int count = 0; wl_list_for_each_safe(binding, tmp, &compositor->debug_binding_list, link) { if (key != binding->key) continue; count++; handler = binding->handler; handler(keyboard, time, key, binding->data); } return count; } struct debug_binding_grab { struct weston_keyboard_grab grab; struct weston_seat *seat; uint32_t key[2]; int key_released[2]; }; static void debug_binding_key(struct weston_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state) { struct debug_binding_grab *db = (struct debug_binding_grab *) grab; struct weston_compositor *ec = db->seat->compositor; struct wl_display *display = ec->wl_display; struct wl_resource *resource; uint32_t serial; int send = 0, terminate = 0; int check_binding = 1; int i; struct wl_list *resource_list; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) { /* Do not run bindings on key releases */ check_binding = 0; for (i = 0; i < 2; i++) if (key == db->key[i]) db->key_released[i] = 1; if (db->key_released[0] && db->key_released[1]) { /* All key releases been swalled so end the grab */ terminate = 1; } else if (key != db->key[0] && key != db->key[1]) { /* Should not swallow release of other keys */ send = 1; } } else if (key == db->key[0] && !db->key_released[0]) { /* Do not check bindings for the first press of the binding * key. This allows it to be used as a debug shortcut. * We still need to swallow this event. */ check_binding = 0; } else if (db->key[1]) { /* If we already ran a binding don't process another one since * we can't keep track of all the binding keys that were * pressed in order to swallow the release events. */ send = 1; check_binding = 0; } if (check_binding) { if (weston_compositor_run_debug_binding(ec, grab->keyboard, time, key, state)) { /* We ran a binding so swallow the press and keep the * grab to swallow the released too. */ send = 0; terminate = 0; db->key[1] = key; } else { /* Terminate the grab since the key pressed is not a * debug binding key. */ send = 1; terminate = 1; } } if (send) { serial = wl_display_next_serial(display); resource_list = &grab->keyboard->focus_resource_list; wl_resource_for_each(resource, resource_list) { wl_keyboard_send_key(resource, serial, time, key, state); } } if (terminate) { weston_keyboard_end_grab(grab->keyboard); if (grab->keyboard->input_method_resource) grab->keyboard->grab = &grab->keyboard->input_method_grab; free(db); } } static void debug_binding_modifiers(struct weston_keyboard_grab *grab, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct wl_resource *resource; struct wl_list *resource_list; resource_list = &grab->keyboard->focus_resource_list; wl_resource_for_each(resource, resource_list) { wl_keyboard_send_modifiers(resource, serial, mods_depressed, mods_latched, mods_locked, group); } } static void debug_binding_cancel(struct weston_keyboard_grab *grab) { struct debug_binding_grab *db = (struct debug_binding_grab *) grab; weston_keyboard_end_grab(grab->keyboard); free(db); } struct weston_keyboard_grab_interface debug_binding_keyboard_grab = { debug_binding_key, debug_binding_modifiers, debug_binding_cancel, }; static void debug_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct debug_binding_grab *grab; grab = calloc(1, sizeof *grab); if (!grab) return; grab->seat = keyboard->seat; grab->key[0] = key; grab->grab.interface = &debug_binding_keyboard_grab; weston_keyboard_start_grab(keyboard, &grab->grab); } /** Install the trigger binding for debug bindings. * * \param compositor The compositor. * \param mod The modifier. * * This will add a key binding for modifier+SHIFT+SPACE that will trigger * debug key bindings. */ WL_EXPORT void weston_install_debug_key_binding(struct weston_compositor *compositor, uint32_t mod) { weston_compositor_add_key_binding(compositor, KEY_SPACE, mod | MODIFIER_SHIFT, debug_binding, NULL); } weston-1.9.0/xwayland/0000775000175000017500000000000012600133270011664 500000000000000weston-1.9.0/xwayland/selection.c0000664000175000017500000004747712551544325013774 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include "xwayland.h" #include "shared/helpers.h" static int writable_callback(int fd, uint32_t mask, void *data) { struct weston_wm *wm = data; unsigned char *property; int len, remainder; property = xcb_get_property_value(wm->property_reply); remainder = xcb_get_property_value_length(wm->property_reply) - wm->property_start; len = write(fd, property + wm->property_start, remainder); if (len == -1) { free(wm->property_reply); wm->property_reply = NULL; if (wm->property_source) wl_event_source_remove(wm->property_source); wm->property_source = NULL; close(fd); weston_log("write error to target fd: %m\n"); return 1; } weston_log("wrote %d (chunk size %d) of %d bytes\n", wm->property_start + len, len, xcb_get_property_value_length(wm->property_reply)); wm->property_start += len; if (len == remainder) { free(wm->property_reply); wm->property_reply = NULL; if (wm->property_source) wl_event_source_remove(wm->property_source); wm->property_source = NULL; if (wm->incr) { xcb_delete_property(wm->conn, wm->selection_window, wm->atom.wl_selection); } else { weston_log("transfer complete\n"); close(fd); } } return 1; } static void weston_wm_write_property(struct weston_wm *wm, xcb_get_property_reply_t *reply) { wm->property_start = 0; wm->property_reply = reply; writable_callback(wm->data_source_fd, WL_EVENT_WRITABLE, wm); if (wm->property_reply) wm->property_source = wl_event_loop_add_fd(wm->server->loop, wm->data_source_fd, WL_EVENT_WRITABLE, writable_callback, wm); } static void weston_wm_get_incr_chunk(struct weston_wm *wm) { xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; cookie = xcb_get_property(wm->conn, 0, /* delete */ wm->selection_window, wm->atom.wl_selection, XCB_GET_PROPERTY_TYPE_ANY, 0, /* offset */ 0x1fffffff /* length */); reply = xcb_get_property_reply(wm->conn, cookie, NULL); if (reply == NULL) return; dump_property(wm, wm->atom.wl_selection, reply); if (xcb_get_property_value_length(reply) > 0) { /* reply's ownership is transfered to wm, which is responsible * for freeing it */ weston_wm_write_property(wm, reply); } else { weston_log("transfer complete\n"); close(wm->data_source_fd); free(reply); } } struct x11_data_source { struct weston_data_source base; struct weston_wm *wm; }; static void data_source_accept(struct weston_data_source *source, uint32_t time, const char *mime_type) { } static void data_source_send(struct weston_data_source *base, const char *mime_type, int32_t fd) { struct x11_data_source *source = (struct x11_data_source *) base; struct weston_wm *wm = source->wm; if (strcmp(mime_type, "text/plain;charset=utf-8") == 0) { /* Get data for the utf8_string target */ xcb_convert_selection(wm->conn, wm->selection_window, wm->atom.clipboard, wm->atom.utf8_string, wm->atom.wl_selection, XCB_TIME_CURRENT_TIME); xcb_flush(wm->conn); fcntl(fd, F_SETFL, O_WRONLY | O_NONBLOCK); wm->data_source_fd = fd; } } static void data_source_cancel(struct weston_data_source *source) { } static void weston_wm_get_selection_targets(struct weston_wm *wm) { struct x11_data_source *source; struct weston_compositor *compositor; struct weston_seat *seat = weston_wm_pick_seat(wm); xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; xcb_atom_t *value; char **p; uint32_t i; cookie = xcb_get_property(wm->conn, 1, /* delete */ wm->selection_window, wm->atom.wl_selection, XCB_GET_PROPERTY_TYPE_ANY, 0, /* offset */ 4096 /* length */); reply = xcb_get_property_reply(wm->conn, cookie, NULL); if (reply == NULL) return; dump_property(wm, wm->atom.wl_selection, reply); if (reply->type != XCB_ATOM_ATOM) { free(reply); return; } source = malloc(sizeof *source); if (source == NULL) { free(reply); return; } wl_signal_init(&source->base.destroy_signal); source->base.accept = data_source_accept; source->base.send = data_source_send; source->base.cancel = data_source_cancel; source->wm = wm; wl_array_init(&source->base.mime_types); value = xcb_get_property_value(reply); for (i = 0; i < reply->value_len; i++) { if (value[i] == wm->atom.utf8_string) { p = wl_array_add(&source->base.mime_types, sizeof *p); if (p) *p = strdup("text/plain;charset=utf-8"); } } compositor = wm->server->compositor; weston_seat_set_selection(seat, &source->base, wl_display_next_serial(compositor->wl_display)); free(reply); } static void weston_wm_get_selection_data(struct weston_wm *wm) { xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; cookie = xcb_get_property(wm->conn, 1, /* delete */ wm->selection_window, wm->atom.wl_selection, XCB_GET_PROPERTY_TYPE_ANY, 0, /* offset */ 0x1fffffff /* length */); reply = xcb_get_property_reply(wm->conn, cookie, NULL); dump_property(wm, wm->atom.wl_selection, reply); if (reply == NULL) { return; } else if (reply->type == wm->atom.incr) { wm->incr = 1; free(reply); } else { wm->incr = 0; /* reply's ownership is transfered to wm, which is responsible * for freeing it */ weston_wm_write_property(wm, reply); } } static void weston_wm_handle_selection_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_selection_notify_event_t *selection_notify = (xcb_selection_notify_event_t *) event; if (selection_notify->property == XCB_ATOM_NONE) { /* convert selection failed */ } else if (selection_notify->target == wm->atom.targets) { weston_wm_get_selection_targets(wm); } else { weston_wm_get_selection_data(wm); } } static const size_t incr_chunk_size = 64 * 1024; static void weston_wm_send_selection_notify(struct weston_wm *wm, xcb_atom_t property) { xcb_selection_notify_event_t selection_notify; memset(&selection_notify, 0, sizeof selection_notify); selection_notify.response_type = XCB_SELECTION_NOTIFY; selection_notify.sequence = 0; selection_notify.time = wm->selection_request.time; selection_notify.requestor = wm->selection_request.requestor; selection_notify.selection = wm->selection_request.selection; selection_notify.target = wm->selection_request.target; selection_notify.property = property; xcb_send_event(wm->conn, 0, /* propagate */ wm->selection_request.requestor, XCB_EVENT_MASK_NO_EVENT, (char *) &selection_notify); } static void weston_wm_send_targets(struct weston_wm *wm) { xcb_atom_t targets[] = { wm->atom.timestamp, wm->atom.targets, wm->atom.utf8_string, /* wm->atom.compound_text, */ wm->atom.text, /* wm->atom.string */ }; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->selection_request.requestor, wm->selection_request.property, XCB_ATOM_ATOM, 32, /* format */ ARRAY_LENGTH(targets), targets); weston_wm_send_selection_notify(wm, wm->selection_request.property); } static void weston_wm_send_timestamp(struct weston_wm *wm) { xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->selection_request.requestor, wm->selection_request.property, XCB_ATOM_INTEGER, 32, /* format */ 1, &wm->selection_timestamp); weston_wm_send_selection_notify(wm, wm->selection_request.property); } static int weston_wm_flush_source_data(struct weston_wm *wm) { int length; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->selection_request.requestor, wm->selection_request.property, wm->selection_target, 8, /* format */ wm->source_data.size, wm->source_data.data); wm->selection_property_set = 1; length = wm->source_data.size; wm->source_data.size = 0; return length; } static int weston_wm_read_data_source(int fd, uint32_t mask, void *data) { struct weston_wm *wm = data; int len, current, available; void *p; current = wm->source_data.size; if (wm->source_data.size < incr_chunk_size) p = wl_array_add(&wm->source_data, incr_chunk_size); else p = (char *) wm->source_data.data + wm->source_data.size; available = wm->source_data.alloc - current; len = read(fd, p, available); if (len == -1) { weston_log("read error from data source: %m\n"); weston_wm_send_selection_notify(wm, XCB_ATOM_NONE); wl_event_source_remove(wm->property_source); wm->property_source = NULL; close(fd); wl_array_release(&wm->source_data); } weston_log("read %d (available %d, mask 0x%x) bytes: \"%.*s\"\n", len, available, mask, len, (char *) p); wm->source_data.size = current + len; if (wm->source_data.size >= incr_chunk_size) { if (!wm->incr) { weston_log("got %zu bytes, starting incr\n", wm->source_data.size); wm->incr = 1; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->selection_request.requestor, wm->selection_request.property, wm->atom.incr, 32, /* format */ 1, &incr_chunk_size); wm->selection_property_set = 1; wm->flush_property_on_delete = 1; wl_event_source_remove(wm->property_source); wm->property_source = NULL; weston_wm_send_selection_notify(wm, wm->selection_request.property); } else if (wm->selection_property_set) { weston_log("got %zu bytes, waiting for " "property delete\n", wm->source_data.size); wm->flush_property_on_delete = 1; wl_event_source_remove(wm->property_source); wm->property_source = NULL; } else { weston_log("got %zu bytes, " "property deleted, seting new property\n", wm->source_data.size); weston_wm_flush_source_data(wm); } } else if (len == 0 && !wm->incr) { weston_log("non-incr transfer complete\n"); /* Non-incr transfer all done. */ weston_wm_flush_source_data(wm); weston_wm_send_selection_notify(wm, wm->selection_request.property); xcb_flush(wm->conn); wl_event_source_remove(wm->property_source); wm->property_source = NULL; close(fd); wl_array_release(&wm->source_data); wm->selection_request.requestor = XCB_NONE; } else if (len == 0 && wm->incr) { weston_log("incr transfer complete\n"); wm->flush_property_on_delete = 1; if (wm->selection_property_set) { weston_log("got %zu bytes, waiting for " "property delete\n", wm->source_data.size); } else { weston_log("got %zu bytes, " "property deleted, seting new property\n", wm->source_data.size); weston_wm_flush_source_data(wm); } xcb_flush(wm->conn); wl_event_source_remove(wm->property_source); wm->property_source = NULL; close(wm->data_source_fd); wm->data_source_fd = -1; close(fd); } else { weston_log("nothing happened, buffered the bytes\n"); } return 1; } static void weston_wm_send_data(struct weston_wm *wm, xcb_atom_t target, const char *mime_type) { struct weston_data_source *source; struct weston_seat *seat = weston_wm_pick_seat(wm); int p[2]; if (pipe2(p, O_CLOEXEC | O_NONBLOCK) == -1) { weston_log("pipe2 failed: %m\n"); weston_wm_send_selection_notify(wm, XCB_ATOM_NONE); return; } wl_array_init(&wm->source_data); wm->selection_target = target; wm->data_source_fd = p[0]; wm->property_source = wl_event_loop_add_fd(wm->server->loop, wm->data_source_fd, WL_EVENT_READABLE, weston_wm_read_data_source, wm); source = seat->selection_data_source; source->send(source, mime_type, p[1]); close(p[1]); } static void weston_wm_send_incr_chunk(struct weston_wm *wm) { int length; weston_log("property deleted\n"); wm->selection_property_set = 0; if (wm->flush_property_on_delete) { weston_log("setting new property, %zu bytes\n", wm->source_data.size); wm->flush_property_on_delete = 0; length = weston_wm_flush_source_data(wm); if (wm->data_source_fd >= 0) { wm->property_source = wl_event_loop_add_fd(wm->server->loop, wm->data_source_fd, WL_EVENT_READABLE, weston_wm_read_data_source, wm); } else if (length > 0) { /* Transfer is all done, but queue a flush for * the delete of the last chunk so we can set * the 0 sized propert to signal the end of * the transfer. */ wm->flush_property_on_delete = 1; wl_array_release(&wm->source_data); } else { wm->selection_request.requestor = XCB_NONE; } } } static int weston_wm_handle_selection_property_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_property_notify_event_t *property_notify = (xcb_property_notify_event_t *) event; if (property_notify->window == wm->selection_window) { if (property_notify->state == XCB_PROPERTY_NEW_VALUE && property_notify->atom == wm->atom.wl_selection && wm->incr) weston_wm_get_incr_chunk(wm); return 1; } else if (property_notify->window == wm->selection_request.requestor) { if (property_notify->state == XCB_PROPERTY_DELETE && property_notify->atom == wm->selection_request.property && wm->incr) weston_wm_send_incr_chunk(wm); return 1; } return 0; } static void weston_wm_handle_selection_request(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_selection_request_event_t *selection_request = (xcb_selection_request_event_t *) event; weston_log("selection request, %s, ", get_atom_name(wm->conn, selection_request->selection)); weston_log_continue("target %s, ", get_atom_name(wm->conn, selection_request->target)); weston_log_continue("property %s\n", get_atom_name(wm->conn, selection_request->property)); wm->selection_request = *selection_request; wm->incr = 0; wm->flush_property_on_delete = 0; if (selection_request->selection == wm->atom.clipboard_manager) { /* The weston clipboard should already have grabbed * the first target, so just send selection notify * now. This isn't synchronized with the clipboard * finishing getting the data, so there's a race here. */ weston_wm_send_selection_notify(wm, wm->selection_request.property); return; } if (selection_request->target == wm->atom.targets) { weston_wm_send_targets(wm); } else if (selection_request->target == wm->atom.timestamp) { weston_wm_send_timestamp(wm); } else if (selection_request->target == wm->atom.utf8_string || selection_request->target == wm->atom.text) { weston_wm_send_data(wm, wm->atom.utf8_string, "text/plain;charset=utf-8"); } else { weston_log("can only handle UTF8_STRING targets...\n"); weston_wm_send_selection_notify(wm, XCB_ATOM_NONE); } } static int weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_xfixes_selection_notify_event_t *xfixes_selection_notify = (xcb_xfixes_selection_notify_event_t *) event; struct weston_compositor *compositor; struct weston_seat *seat = weston_wm_pick_seat(wm); uint32_t serial; if (xfixes_selection_notify->selection != wm->atom.clipboard) return 0; weston_log("xfixes selection notify event: owner %d\n", xfixes_selection_notify->owner); if (xfixes_selection_notify->owner == XCB_WINDOW_NONE) { if (wm->selection_owner != wm->selection_window) { /* A real X client selection went away, not our * proxy selection. Clear the wayland selection. */ compositor = wm->server->compositor; serial = wl_display_next_serial(compositor->wl_display); weston_seat_set_selection(seat, NULL, serial); } wm->selection_owner = XCB_WINDOW_NONE; return 1; } wm->selection_owner = xfixes_selection_notify->owner; /* We have to use XCB_TIME_CURRENT_TIME when we claim the * selection, so grab the actual timestamp here so we can * answer TIMESTAMP conversion requests correctly. */ if (xfixes_selection_notify->owner == wm->selection_window) { wm->selection_timestamp = xfixes_selection_notify->timestamp; weston_log("our window, skipping\n"); return 1; } wm->incr = 0; xcb_convert_selection(wm->conn, wm->selection_window, wm->atom.clipboard, wm->atom.targets, wm->atom.wl_selection, xfixes_selection_notify->timestamp); xcb_flush(wm->conn); return 1; } int weston_wm_handle_selection_event(struct weston_wm *wm, xcb_generic_event_t *event) { switch (event->response_type & ~0x80) { case XCB_SELECTION_NOTIFY: weston_wm_handle_selection_notify(wm, event); return 1; case XCB_PROPERTY_NOTIFY: return weston_wm_handle_selection_property_notify(wm, event); case XCB_SELECTION_REQUEST: weston_wm_handle_selection_request(wm, event); return 1; } switch (event->response_type - wm->xfixes->first_event) { case XCB_XFIXES_SELECTION_NOTIFY: return weston_wm_handle_xfixes_selection_notify(wm, event); } return 0; } static void weston_wm_set_selection(struct wl_listener *listener, void *data) { struct weston_seat *seat = data; struct weston_wm *wm = container_of(listener, struct weston_wm, selection_listener); struct weston_data_source *source = seat->selection_data_source; const char **p, **end; int has_text_plain = 0; if (source == NULL) { if (wm->selection_owner == wm->selection_window) xcb_set_selection_owner(wm->conn, XCB_ATOM_NONE, wm->atom.clipboard, wm->selection_timestamp); return; } if (source->send == data_source_send) return; p = source->mime_types.data; end = (const char **) ((char *) source->mime_types.data + source->mime_types.size); while (p < end) { weston_log(" %s\n", *p); if (strcmp(*p, "text/plain") == 0 || strcmp(*p, "text/plain;charset=utf-8") == 0) has_text_plain = 1; p++; } if (has_text_plain) { xcb_set_selection_owner(wm->conn, wm->selection_window, wm->atom.clipboard, XCB_TIME_CURRENT_TIME); } else { xcb_set_selection_owner(wm->conn, XCB_ATOM_NONE, wm->atom.clipboard, XCB_TIME_CURRENT_TIME); } } void weston_wm_selection_init(struct weston_wm *wm) { struct weston_seat *seat; uint32_t values[1], mask; wm->selection_request.requestor = XCB_NONE; values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE; wm->selection_window = xcb_generate_id(wm->conn); xcb_create_window(wm->conn, XCB_COPY_FROM_PARENT, wm->selection_window, wm->screen->root, 0, 0, 10, 10, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, wm->screen->root_visual, XCB_CW_EVENT_MASK, values); xcb_set_selection_owner(wm->conn, wm->selection_window, wm->atom.clipboard_manager, XCB_TIME_CURRENT_TIME); mask = XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER | XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY | XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE; xcb_xfixes_select_selection_input(wm->conn, wm->selection_window, wm->atom.clipboard, mask); seat = weston_wm_pick_seat(wm); wm->selection_listener.notify = weston_wm_set_selection; wl_signal_add(&seat->selection_signal, &wm->selection_listener); weston_wm_set_selection(&wm->selection_listener, seat); } weston-1.9.0/xwayland/hash.c0000664000175000017500000001702412456345006012712 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1988-2004 Keith Packard and Bart Massey. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Except as contained in this notice, the names of the authors * or their institutions shall not be used in advertising or * otherwise to promote the sale, use or other dealings in this * Software without prior written authorization from the * authors. * * Authors: * Eric Anholt * Keith Packard */ #include #include #include #include "hash.h" struct hash_entry { uint32_t hash; void *data; }; struct hash_table { struct hash_entry *table; uint32_t size; uint32_t rehash; uint32_t max_entries; uint32_t size_index; uint32_t entries; uint32_t deleted_entries; }; #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) /* * From Knuth -- a good choice for hash/rehash values is p, p-2 where * p and p-2 are both prime. These tables are sized to have an extra 10% * free to avoid exponential performance degradation as the hash table fills */ static const uint32_t deleted_data; static const struct { uint32_t max_entries, size, rehash; } hash_sizes[] = { { 2, 5, 3 }, { 4, 7, 5 }, { 8, 13, 11 }, { 16, 19, 17 }, { 32, 43, 41 }, { 64, 73, 71 }, { 128, 151, 149 }, { 256, 283, 281 }, { 512, 571, 569 }, { 1024, 1153, 1151 }, { 2048, 2269, 2267 }, { 4096, 4519, 4517 }, { 8192, 9013, 9011 }, { 16384, 18043, 18041 }, { 32768, 36109, 36107 }, { 65536, 72091, 72089 }, { 131072, 144409, 144407 }, { 262144, 288361, 288359 }, { 524288, 576883, 576881 }, { 1048576, 1153459, 1153457 }, { 2097152, 2307163, 2307161 }, { 4194304, 4613893, 4613891 }, { 8388608, 9227641, 9227639 }, { 16777216, 18455029, 18455027 }, { 33554432, 36911011, 36911009 }, { 67108864, 73819861, 73819859 }, { 134217728, 147639589, 147639587 }, { 268435456, 295279081, 295279079 }, { 536870912, 590559793, 590559791 }, { 1073741824, 1181116273, 1181116271}, { 2147483648ul, 2362232233ul, 2362232231ul} }; static int entry_is_free(struct hash_entry *entry) { return entry->data == NULL; } static int entry_is_deleted(struct hash_entry *entry) { return entry->data == &deleted_data; } static int entry_is_present(struct hash_entry *entry) { return entry->data != NULL && entry->data != &deleted_data; } struct hash_table * hash_table_create(void) { struct hash_table *ht; ht = malloc(sizeof(*ht)); if (ht == NULL) return NULL; ht->size_index = 0; ht->size = hash_sizes[ht->size_index].size; ht->rehash = hash_sizes[ht->size_index].rehash; ht->max_entries = hash_sizes[ht->size_index].max_entries; ht->table = calloc(ht->size, sizeof(*ht->table)); ht->entries = 0; ht->deleted_entries = 0; if (ht->table == NULL) { free(ht); return NULL; } return ht; } /** * Frees the given hash table. */ void hash_table_destroy(struct hash_table *ht) { if (!ht) return; free(ht->table); free(ht); } /** * Finds a hash table entry with the given key and hash of that key. * * Returns NULL if no entry is found. Note that the data pointer may be * modified by the user. */ static void * hash_table_search(struct hash_table *ht, uint32_t hash) { uint32_t hash_address; hash_address = hash % ht->size; do { uint32_t double_hash; struct hash_entry *entry = ht->table + hash_address; if (entry_is_free(entry)) { return NULL; } else if (entry_is_present(entry) && entry->hash == hash) { return entry; } double_hash = 1 + hash % ht->rehash; hash_address = (hash_address + double_hash) % ht->size; } while (hash_address != hash % ht->size); return NULL; } void hash_table_for_each(struct hash_table *ht, hash_table_iterator_func_t func, void *data) { struct hash_entry *entry; uint32_t i; for (i = 0; i < ht->size; i++) { entry = ht->table + i; if (entry_is_present(entry)) func(entry->data, data); } } void * hash_table_lookup(struct hash_table *ht, uint32_t hash) { struct hash_entry *entry; entry = hash_table_search(ht, hash); if (entry != NULL) return entry->data; return NULL; } static void hash_table_rehash(struct hash_table *ht, unsigned int new_size_index) { struct hash_table old_ht; struct hash_entry *table, *entry; if (new_size_index >= ARRAY_SIZE(hash_sizes)) return; table = calloc(hash_sizes[new_size_index].size, sizeof(*ht->table)); if (table == NULL) return; old_ht = *ht; ht->table = table; ht->size_index = new_size_index; ht->size = hash_sizes[ht->size_index].size; ht->rehash = hash_sizes[ht->size_index].rehash; ht->max_entries = hash_sizes[ht->size_index].max_entries; ht->entries = 0; ht->deleted_entries = 0; for (entry = old_ht.table; entry != old_ht.table + old_ht.size; entry++) { if (entry_is_present(entry)) { hash_table_insert(ht, entry->hash, entry->data); } } free(old_ht.table); } /** * Inserts the data with the given hash into the table. * * Note that insertion may rearrange the table on a resize or rehash, * so previously found hash_entries are no longer valid after this function. */ int hash_table_insert(struct hash_table *ht, uint32_t hash, void *data) { uint32_t hash_address; if (ht->entries >= ht->max_entries) { hash_table_rehash(ht, ht->size_index + 1); } else if (ht->deleted_entries + ht->entries >= ht->max_entries) { hash_table_rehash(ht, ht->size_index); } hash_address = hash % ht->size; do { struct hash_entry *entry = ht->table + hash_address; uint32_t double_hash; if (!entry_is_present(entry)) { if (entry_is_deleted(entry)) ht->deleted_entries--; entry->hash = hash; entry->data = data; ht->entries++; return 0; } double_hash = 1 + hash % ht->rehash; hash_address = (hash_address + double_hash) % ht->size; } while (hash_address != hash % ht->size); /* We could hit here if a required resize failed. An unchecked-malloc * application could ignore this result. */ return -1; } /** * This function deletes the given hash table entry. * * Note that deletion doesn't otherwise modify the table, so an iteration over * the table deleting entries is safe. */ void hash_table_remove(struct hash_table *ht, uint32_t hash) { struct hash_entry *entry; entry = hash_table_search(ht, hash); if (entry != NULL) { entry->data = (void *) &deleted_data; ht->entries--; ht->deleted_entries++; } } weston-1.9.0/xwayland/dnd.c0000664000175000017500000001672012556771651012550 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "xwayland.h" #include "cairo-util.h" #include "compositor.h" #include "hash.h" static void weston_dnd_start(struct weston_wm *wm, xcb_window_t owner) { uint32_t values[1], version = 4; wm->dnd_window = xcb_generate_id(wm->conn); values[0] = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_PROPERTY_CHANGE; xcb_create_window(wm->conn, XCB_COPY_FROM_PARENT, wm->dnd_window, wm->screen->root, 0, 0, 8192, 8192, 0, XCB_WINDOW_CLASS_INPUT_ONLY, wm->screen->root_visual, XCB_CW_EVENT_MASK, values); xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->dnd_window, wm->atom.xdnd_aware, XCB_ATOM_ATOM, 32, /* format */ 1, &version); xcb_map_window(wm->conn, wm->dnd_window); wm->dnd_owner = owner; } static void weston_dnd_stop(struct weston_wm *wm) { xcb_destroy_window(wm->conn, wm->dnd_window); wm->dnd_window = XCB_WINDOW_NONE; } struct dnd_data_source { struct weston_data_source base; struct weston_wm *wm; int version; uint32_t window; }; static void data_source_accept(struct weston_data_source *base, uint32_t time, const char *mime_type) { struct dnd_data_source *source = (struct dnd_data_source *) base; xcb_client_message_event_t client_message; struct weston_wm *wm = source->wm; weston_log("got accept, mime-type %s\n", mime_type); /* FIXME: If we rewrote UTF8_STRING to * text/plain;charset=utf-8 and the source doesn't support the * mime-type, we'll have to rewrite the mime-type back to * UTF8_STRING here. */ client_message.response_type = XCB_CLIENT_MESSAGE; client_message.format = 32; client_message.window = wm->dnd_window; client_message.type = wm->atom.xdnd_status; client_message.data.data32[0] = wm->dnd_window; client_message.data.data32[1] = 2; if (mime_type) client_message.data.data32[1] |= 1; client_message.data.data32[2] = 0; client_message.data.data32[3] = 0; client_message.data.data32[4] = wm->atom.xdnd_action_copy; xcb_send_event(wm->conn, 0, wm->dnd_owner, XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (char *) &client_message); } static void data_source_send(struct weston_data_source *base, const char *mime_type, int32_t fd) { struct dnd_data_source *source = (struct dnd_data_source *) base; struct weston_wm *wm = source->wm; weston_log("got send, %s\n", mime_type); /* Get data for the utf8_string target */ xcb_convert_selection(wm->conn, wm->selection_window, wm->atom.xdnd_selection, wm->atom.utf8_string, wm->atom.wl_selection, XCB_TIME_CURRENT_TIME); xcb_flush(wm->conn); fcntl(fd, F_SETFL, O_WRONLY | O_NONBLOCK); wm->data_source_fd = fd; } static void data_source_cancel(struct weston_data_source *source) { weston_log("got cancel\n"); } static void handle_enter(struct weston_wm *wm, xcb_client_message_event_t *client_message) { struct dnd_data_source *source; struct weston_seat *seat = weston_wm_pick_seat(wm); struct weston_pointer *pointer = weston_seat_get_pointer(seat); char **p; const char *name; uint32_t *types; int i, length, has_text; xcb_get_property_cookie_t cookie; xcb_get_property_reply_t *reply; source = malloc(sizeof *source); if (source == NULL) return; wl_signal_init(&source->base.destroy_signal); source->base.accept = data_source_accept; source->base.send = data_source_send; source->base.cancel = data_source_cancel; source->wm = wm; source->window = client_message->data.data32[0]; source->version = client_message->data.data32[1] >> 24; if (client_message->data.data32[1] & 1) { cookie = xcb_get_property(wm->conn, 0, /* delete */ source->window, wm->atom.xdnd_type_list, XCB_ATOM_ANY, 0, 2048); reply = xcb_get_property_reply(wm->conn, cookie, NULL); types = xcb_get_property_value(reply); length = reply->value_len; } else { reply = NULL; types = &client_message->data.data32[2]; length = 3; } wl_array_init(&source->base.mime_types); has_text = 0; for (i = 0; i < length; i++) { if (types[i] == XCB_ATOM_NONE) continue; name = get_atom_name(wm->conn, types[i]); if (types[i] == wm->atom.utf8_string || types[i] == wm->atom.text_plain_utf8 || types[i] == wm->atom.text_plain) { if (has_text) continue; has_text = 1; p = wl_array_add(&source->base.mime_types, sizeof *p); if (p) *p = strdup("text/plain;charset=utf-8"); } else if (strchr(name, '/')) { p = wl_array_add(&source->base.mime_types, sizeof *p); if (p) *p = strdup(name); } } free(reply); weston_pointer_start_drag(pointer, &source->base, NULL, NULL); } int weston_wm_handle_dnd_event(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_xfixes_selection_notify_event_t *xfixes_selection_notify = (xcb_xfixes_selection_notify_event_t *) event; xcb_client_message_event_t *client_message = (xcb_client_message_event_t *) event; switch (event->response_type - wm->xfixes->first_event) { case XCB_XFIXES_SELECTION_NOTIFY: if (xfixes_selection_notify->selection != wm->atom.xdnd_selection) return 0; weston_log("XdndSelection owner: %d!\n", xfixes_selection_notify->owner); if (xfixes_selection_notify->owner != XCB_WINDOW_NONE) weston_dnd_start(wm, xfixes_selection_notify->owner); else weston_dnd_stop(wm); return 1; } switch (EVENT_TYPE(event)) { case XCB_CLIENT_MESSAGE: if (client_message->type == wm->atom.xdnd_enter) { handle_enter(wm, client_message); return 1; } else if (client_message->type == wm->atom.xdnd_leave) { weston_log("got leave!\n"); return 1; } else if (client_message->type == wm->atom.xdnd_drop) { weston_log("got drop!\n"); return 1; } else if (client_message->type == wm->atom.xdnd_drop) { weston_log("got enter!\n"); return 1; } return 0; } return 0; } void weston_wm_dnd_init(struct weston_wm *wm) { uint32_t mask; mask = XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER | XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY | XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE; xcb_xfixes_select_selection_input(wm->conn, wm->selection_window, wm->atom.xdnd_selection, mask); } weston-1.9.0/xwayland/xwayland.h0000664000175000017500000001307312537627703013632 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include #include "compositor.h" #define SEND_EVENT_MASK (0x80) #define EVENT_TYPE(event) ((event)->response_type & ~SEND_EVENT_MASK) struct weston_xserver { struct wl_display *wl_display; struct wl_event_loop *loop; struct wl_event_source *sigchld_source; int abstract_fd; struct wl_event_source *abstract_source; int unix_fd; struct wl_event_source *unix_source; int wm_fd; int display; struct wl_event_source *sigusr1_source; struct weston_process process; struct wl_resource *resource; struct wl_client *client; struct weston_compositor *compositor; struct weston_wm *wm; struct wl_listener destroy_listener; }; struct weston_wm { xcb_connection_t *conn; const xcb_query_extension_reply_t *xfixes; struct wl_event_source *source; xcb_screen_t *screen; struct hash_table *window_hash; struct weston_xserver *server; xcb_window_t wm_window; struct weston_wm_window *focus_window; struct theme *theme; xcb_cursor_t *cursors; int last_cursor; xcb_render_pictforminfo_t format_rgb, format_rgba; xcb_visualid_t visual_id; xcb_colormap_t colormap; struct wl_listener create_surface_listener; struct wl_listener activate_listener; struct wl_listener transform_listener; struct wl_listener kill_listener; struct wl_list unpaired_window_list; xcb_window_t selection_window; xcb_window_t selection_owner; int incr; int data_source_fd; struct wl_event_source *property_source; xcb_get_property_reply_t *property_reply; int property_start; struct wl_array source_data; xcb_selection_request_event_t selection_request; xcb_atom_t selection_target; xcb_timestamp_t selection_timestamp; int selection_property_set; int flush_property_on_delete; struct wl_listener selection_listener; xcb_window_t dnd_window; xcb_window_t dnd_owner; struct { xcb_atom_t wm_protocols; xcb_atom_t wm_normal_hints; xcb_atom_t wm_take_focus; xcb_atom_t wm_delete_window; xcb_atom_t wm_state; xcb_atom_t wm_s0; xcb_atom_t wm_client_machine; xcb_atom_t net_wm_cm_s0; xcb_atom_t net_wm_name; xcb_atom_t net_wm_pid; xcb_atom_t net_wm_icon; xcb_atom_t net_wm_state; xcb_atom_t net_wm_state_maximized_vert; xcb_atom_t net_wm_state_maximized_horz; xcb_atom_t net_wm_state_fullscreen; xcb_atom_t net_wm_user_time; xcb_atom_t net_wm_icon_name; xcb_atom_t net_wm_desktop; xcb_atom_t net_wm_window_type; xcb_atom_t net_wm_window_type_desktop; xcb_atom_t net_wm_window_type_dock; xcb_atom_t net_wm_window_type_toolbar; xcb_atom_t net_wm_window_type_menu; xcb_atom_t net_wm_window_type_utility; xcb_atom_t net_wm_window_type_splash; xcb_atom_t net_wm_window_type_dialog; xcb_atom_t net_wm_window_type_dropdown; xcb_atom_t net_wm_window_type_popup; xcb_atom_t net_wm_window_type_tooltip; xcb_atom_t net_wm_window_type_notification; xcb_atom_t net_wm_window_type_combo; xcb_atom_t net_wm_window_type_dnd; xcb_atom_t net_wm_window_type_normal; xcb_atom_t net_wm_moveresize; xcb_atom_t net_supporting_wm_check; xcb_atom_t net_supported; xcb_atom_t motif_wm_hints; xcb_atom_t clipboard; xcb_atom_t clipboard_manager; xcb_atom_t targets; xcb_atom_t utf8_string; xcb_atom_t wl_selection; xcb_atom_t incr; xcb_atom_t timestamp; xcb_atom_t multiple; xcb_atom_t compound_text; xcb_atom_t text; xcb_atom_t string; xcb_atom_t text_plain_utf8; xcb_atom_t text_plain; xcb_atom_t xdnd_selection; xcb_atom_t xdnd_aware; xcb_atom_t xdnd_enter; xcb_atom_t xdnd_leave; xcb_atom_t xdnd_drop; xcb_atom_t xdnd_status; xcb_atom_t xdnd_finished; xcb_atom_t xdnd_type_list; xcb_atom_t xdnd_action_copy; xcb_atom_t wl_surface_id; } atom; }; void dump_property(struct weston_wm *wm, xcb_atom_t property, xcb_get_property_reply_t *reply); const char * get_atom_name(xcb_connection_t *c, xcb_atom_t atom); void weston_wm_selection_init(struct weston_wm *wm); int weston_wm_handle_selection_event(struct weston_wm *wm, xcb_generic_event_t *event); struct weston_wm * weston_wm_create(struct weston_xserver *wxs, int fd); void weston_wm_destroy(struct weston_wm *wm); struct weston_seat * weston_wm_pick_seat(struct weston_wm *wm); int weston_wm_handle_dnd_event(struct weston_wm *wm, xcb_generic_event_t *event); void weston_wm_dnd_init(struct weston_wm *wm); weston-1.9.0/xwayland/launcher.c0000664000175000017500000002430012537664716013577 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "xwayland.h" #include "shared/helpers.h" static int handle_sigusr1(int signal_number, void *data) { struct weston_xserver *wxs = data; /* We'd be safer if we actually had the struct * signalfd_siginfo from the signalfd data and could verify * this came from Xwayland.*/ wxs->wm = weston_wm_create(wxs, wxs->wm_fd); wl_event_source_remove(wxs->sigusr1_source); return 1; } static int weston_xserver_handle_event(int listen_fd, uint32_t mask, void *data) { struct weston_xserver *wxs = data; char display[8], s[8], abstract_fd[8], unix_fd[8], wm_fd[8]; int sv[2], wm[2], fd; char *xserver = NULL; struct weston_config_section *section; if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sv) < 0) { weston_log("wl connection socketpair failed\n"); return 1; } if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, wm) < 0) { weston_log("X wm connection socketpair failed\n"); return 1; } wxs->process.pid = fork(); switch (wxs->process.pid) { case 0: /* SOCK_CLOEXEC closes both ends, so we need to unset * the flag on the client fd. */ fd = dup(sv[1]); if (fd < 0) goto fail; snprintf(s, sizeof s, "%d", fd); setenv("WAYLAND_SOCKET", s, 1); snprintf(display, sizeof display, ":%d", wxs->display); fd = dup(wxs->abstract_fd); if (fd < 0) goto fail; snprintf(abstract_fd, sizeof abstract_fd, "%d", fd); fd = dup(wxs->unix_fd); if (fd < 0) goto fail; snprintf(unix_fd, sizeof unix_fd, "%d", fd); fd = dup(wm[1]); if (fd < 0) goto fail; snprintf(wm_fd, sizeof wm_fd, "%d", fd); section = weston_config_get_section(wxs->compositor->config, "xwayland", NULL, NULL); weston_config_section_get_string(section, "path", &xserver, XSERVER_PATH); /* Ignore SIGUSR1 in the child, which will make the X * server send SIGUSR1 to the parent (weston) when * it's done with initialization. During * initialization the X server will round trip and * block on the wayland compositor, so avoid making * blocking requests (like xcb_connect_to_fd) until * it's done with that. */ signal(SIGUSR1, SIG_IGN); if (execl(xserver, xserver, display, "-rootless", "-listen", abstract_fd, "-listen", unix_fd, "-wm", wm_fd, "-terminate", NULL) < 0) weston_log("exec of '%s %s -rootless " "-listen %s -listen %s -wm %s " "-terminate' failed: %m\n", xserver, display, abstract_fd, unix_fd, wm_fd); fail: _exit(EXIT_FAILURE); default: weston_log("forked X server, pid %d\n", wxs->process.pid); close(sv[1]); wxs->client = wl_client_create(wxs->wl_display, sv[0]); close(wm[1]); wxs->wm_fd = wm[0]; weston_watch_process(&wxs->process); wl_event_source_remove(wxs->abstract_source); wl_event_source_remove(wxs->unix_source); break; case -1: weston_log( "failed to fork\n"); break; } return 1; } static void weston_xserver_shutdown(struct weston_xserver *wxs) { char path[256]; snprintf(path, sizeof path, "/tmp/.X%d-lock", wxs->display); unlink(path); snprintf(path, sizeof path, "/tmp/.X11-unix/X%d", wxs->display); unlink(path); if (wxs->process.pid == 0) { wl_event_source_remove(wxs->abstract_source); wl_event_source_remove(wxs->unix_source); } close(wxs->abstract_fd); close(wxs->unix_fd); if (wxs->wm) { weston_wm_destroy(wxs->wm); wxs->wm = NULL; } wxs->loop = NULL; } static void weston_xserver_cleanup(struct weston_process *process, int status) { struct weston_xserver *wxs = container_of(process, struct weston_xserver, process); wxs->process.pid = 0; wxs->client = NULL; wxs->resource = NULL; wxs->abstract_source = wl_event_loop_add_fd(wxs->loop, wxs->abstract_fd, WL_EVENT_READABLE, weston_xserver_handle_event, wxs); wxs->unix_source = wl_event_loop_add_fd(wxs->loop, wxs->unix_fd, WL_EVENT_READABLE, weston_xserver_handle_event, wxs); if (wxs->wm) { weston_log("xserver exited, code %d\n", status); weston_wm_destroy(wxs->wm); wxs->wm = NULL; } else { /* If the X server crashes before it binds to the * xserver interface, shut down and don't try * again. */ weston_log("xserver crashing too fast: %d\n", status); weston_xserver_shutdown(wxs); } } static int bind_to_abstract_socket(int display) { struct sockaddr_un addr; socklen_t size, name_size; int fd; fd = socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); if (fd < 0) return -1; addr.sun_family = AF_LOCAL; name_size = snprintf(addr.sun_path, sizeof addr.sun_path, "%c/tmp/.X11-unix/X%d", 0, display); size = offsetof(struct sockaddr_un, sun_path) + name_size; if (bind(fd, (struct sockaddr *) &addr, size) < 0) { weston_log("failed to bind to @%s: %m\n", addr.sun_path + 1); close(fd); return -1; } if (listen(fd, 1) < 0) { close(fd); return -1; } return fd; } static int bind_to_unix_socket(int display) { struct sockaddr_un addr; socklen_t size, name_size; int fd; fd = socket(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0); if (fd < 0) return -1; addr.sun_family = AF_LOCAL; name_size = snprintf(addr.sun_path, sizeof addr.sun_path, "/tmp/.X11-unix/X%d", display) + 1; size = offsetof(struct sockaddr_un, sun_path) + name_size; unlink(addr.sun_path); if (bind(fd, (struct sockaddr *) &addr, size) < 0) { weston_log("failed to bind to %s: %m\n", addr.sun_path); close(fd); return -1; } if (listen(fd, 1) < 0) { unlink(addr.sun_path); close(fd); return -1; } return fd; } static int create_lockfile(int display, char *lockfile, size_t lsize) { char pid[16], *end; int fd, size; pid_t other; snprintf(lockfile, lsize, "/tmp/.X%d-lock", display); fd = open(lockfile, O_WRONLY | O_CLOEXEC | O_CREAT | O_EXCL, 0444); if (fd < 0 && errno == EEXIST) { fd = open(lockfile, O_CLOEXEC | O_RDONLY); if (fd < 0 || read(fd, pid, 11) != 11) { weston_log("can't read lock file %s: %s\n", lockfile, strerror(errno)); if (fd >= 0) close (fd); errno = EEXIST; return -1; } other = strtol(pid, &end, 0); if (end != pid + 10) { weston_log("can't parse lock file %s\n", lockfile); close(fd); errno = EEXIST; return -1; } if (kill(other, 0) < 0 && errno == ESRCH) { /* stale lock file; unlink and try again */ weston_log("unlinking stale lock file %s\n", lockfile); close(fd); if (unlink(lockfile)) /* If we fail to unlink, return EEXIST so we try the next display number.*/ errno = EEXIST; else errno = EAGAIN; return -1; } close(fd); errno = EEXIST; return -1; } else if (fd < 0) { weston_log("failed to create lock file %s: %s\n", lockfile, strerror(errno)); return -1; } /* Subtle detail: we use the pid of the wayland * compositor, not the xserver in the lock file. */ size = snprintf(pid, sizeof pid, "%10d\n", getpid()); if (write(fd, pid, size) != size) { unlink(lockfile); close(fd); return -1; } close(fd); return 0; } static void weston_xserver_destroy(struct wl_listener *l, void *data) { struct weston_xserver *wxs = container_of(l, struct weston_xserver, destroy_listener); if (!wxs) return; if (wxs->loop) weston_xserver_shutdown(wxs); free(wxs); } WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct wl_display *display = compositor->wl_display; struct weston_xserver *wxs; char lockfile[256], display_name[8]; wxs = zalloc(sizeof *wxs); if (wxs == NULL) return -1; wxs->process.cleanup = weston_xserver_cleanup; wxs->wl_display = display; wxs->compositor = compositor; wxs->display = 0; retry: if (create_lockfile(wxs->display, lockfile, sizeof lockfile) < 0) { if (errno == EAGAIN) { goto retry; } else if (errno == EEXIST) { wxs->display++; goto retry; } else { free(wxs); return -1; } } wxs->abstract_fd = bind_to_abstract_socket(wxs->display); if (wxs->abstract_fd < 0 && errno == EADDRINUSE) { wxs->display++; unlink(lockfile); goto retry; } wxs->unix_fd = bind_to_unix_socket(wxs->display); if (wxs->unix_fd < 0) { unlink(lockfile); close(wxs->abstract_fd); free(wxs); return -1; } snprintf(display_name, sizeof display_name, ":%d", wxs->display); weston_log("xserver listening on display %s\n", display_name); setenv("DISPLAY", display_name, 1); wxs->loop = wl_display_get_event_loop(display); wxs->abstract_source = wl_event_loop_add_fd(wxs->loop, wxs->abstract_fd, WL_EVENT_READABLE, weston_xserver_handle_event, wxs); wxs->unix_source = wl_event_loop_add_fd(wxs->loop, wxs->unix_fd, WL_EVENT_READABLE, weston_xserver_handle_event, wxs); wxs->sigusr1_source = wl_event_loop_add_signal(wxs->loop, SIGUSR1, handle_sigusr1, wxs); wxs->destroy_listener.notify = weston_xserver_destroy; wl_signal_add(&compositor->destroy_signal, &wxs->destroy_listener); return 0; } weston-1.9.0/xwayland/window-manager.c0000664000175000017500000021472212561200202014673 00000000000000/* * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "xwayland.h" #include "cairo-util.h" #include "compositor.h" #include "hash.h" #include "shared/helpers.h" struct wm_size_hints { uint32_t flags; int32_t x, y; int32_t width, height; /* should set so old wm's don't mess up */ int32_t min_width, min_height; int32_t max_width, max_height; int32_t width_inc, height_inc; struct { int32_t x; int32_t y; } min_aspect, max_aspect; int32_t base_width, base_height; int32_t win_gravity; }; #define USPosition (1L << 0) #define USSize (1L << 1) #define PPosition (1L << 2) #define PSize (1L << 3) #define PMinSize (1L << 4) #define PMaxSize (1L << 5) #define PResizeInc (1L << 6) #define PAspect (1L << 7) #define PBaseSize (1L << 8) #define PWinGravity (1L << 9) struct motif_wm_hints { uint32_t flags; uint32_t functions; uint32_t decorations; int32_t input_mode; uint32_t status; }; #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) #define MWM_DECOR_EVERYTHING \ (MWM_DECOR_BORDER | MWM_DECOR_RESIZEH | MWM_DECOR_TITLE | \ MWM_DECOR_MENU | MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE) #define MWM_INPUT_MODELESS 0 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 #define MWM_INPUT_SYSTEM_MODAL 2 #define MWM_INPUT_FULL_APPLICATION_MODAL 3 #define MWM_INPUT_APPLICATION_MODAL MWM_INPUT_PRIMARY_APPLICATION_MODAL #define MWM_TEAROFF_WINDOW (1L<<0) #define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0 #define _NET_WM_MOVERESIZE_SIZE_TOP 1 #define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2 #define _NET_WM_MOVERESIZE_SIZE_RIGHT 3 #define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4 #define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5 #define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6 #define _NET_WM_MOVERESIZE_SIZE_LEFT 7 #define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */ #define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ #define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ #define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ struct weston_wm_window { struct weston_wm *wm; xcb_window_t id; xcb_window_t frame_id; struct frame *frame; cairo_surface_t *cairo_surface; uint32_t surface_id; struct weston_surface *surface; struct shell_surface *shsurf; struct weston_view *view; struct wl_listener surface_destroy_listener; struct wl_event_source *repaint_source; struct wl_event_source *configure_source; int properties_dirty; int pid; char *machine; char *class; char *name; struct weston_wm_window *transient_for; uint32_t protocols; xcb_atom_t type; int width, height; int x, y; int saved_width, saved_height; int decorate; int override_redirect; int fullscreen; int has_alpha; int delete_window; int maximized_vert; int maximized_horz; struct wm_size_hints size_hints; struct motif_wm_hints motif_hints; struct wl_list link; }; static struct weston_wm_window * get_wm_window(struct weston_surface *surface); static void weston_wm_window_schedule_repaint(struct weston_wm_window *window); static void xserver_map_shell_surface(struct weston_wm_window *window, struct weston_surface *surface); static int __attribute__ ((format (printf, 1, 2))) wm_log(const char *fmt, ...) { #ifdef WM_DEBUG int l; va_list argp; va_start(argp, fmt); l = weston_vlog(fmt, argp); va_end(argp); return l; #else return 0; #endif } static int __attribute__ ((format (printf, 1, 2))) wm_log_continue(const char *fmt, ...) { #ifdef WM_DEBUG int l; va_list argp; va_start(argp, fmt); l = weston_vlog_continue(fmt, argp); va_end(argp); return l; #else return 0; #endif } static bool __attribute__ ((warn_unused_result)) wm_lookup_window(struct weston_wm *wm, xcb_window_t hash, struct weston_wm_window **window) { *window = hash_table_lookup(wm->window_hash, hash); if (*window) return true; return false; } const char * get_atom_name(xcb_connection_t *c, xcb_atom_t atom) { xcb_get_atom_name_cookie_t cookie; xcb_get_atom_name_reply_t *reply; xcb_generic_error_t *e; static char buffer[64]; if (atom == XCB_ATOM_NONE) return "None"; cookie = xcb_get_atom_name (c, atom); reply = xcb_get_atom_name_reply (c, cookie, &e); if (reply) { snprintf(buffer, sizeof buffer, "%.*s", xcb_get_atom_name_name_length (reply), xcb_get_atom_name_name (reply)); } else { snprintf(buffer, sizeof buffer, "(atom %u)", atom); } free(reply); return buffer; } static xcb_cursor_t xcb_cursor_image_load_cursor(struct weston_wm *wm, const XcursorImage *img) { xcb_connection_t *c = wm->conn; xcb_screen_iterator_t s = xcb_setup_roots_iterator(xcb_get_setup(c)); xcb_screen_t *screen = s.data; xcb_gcontext_t gc; xcb_pixmap_t pix; xcb_render_picture_t pic; xcb_cursor_t cursor; int stride = img->width * 4; pix = xcb_generate_id(c); xcb_create_pixmap(c, 32, pix, screen->root, img->width, img->height); pic = xcb_generate_id(c); xcb_render_create_picture(c, pic, pix, wm->format_rgba.id, 0, 0); gc = xcb_generate_id(c); xcb_create_gc(c, gc, pix, 0, 0); xcb_put_image(c, XCB_IMAGE_FORMAT_Z_PIXMAP, pix, gc, img->width, img->height, 0, 0, 0, 32, stride * img->height, (uint8_t *) img->pixels); xcb_free_gc(c, gc); cursor = xcb_generate_id(c); xcb_render_create_cursor(c, cursor, pic, img->xhot, img->yhot); xcb_render_free_picture(c, pic); xcb_free_pixmap(c, pix); return cursor; } static xcb_cursor_t xcb_cursor_images_load_cursor(struct weston_wm *wm, const XcursorImages *images) { /* TODO: treat animated cursors as well */ if (images->nimage != 1) return -1; return xcb_cursor_image_load_cursor(wm, images->images[0]); } static xcb_cursor_t xcb_cursor_library_load_cursor(struct weston_wm *wm, const char *file) { xcb_cursor_t cursor; XcursorImages *images; char *v = NULL; int size = 0; if (!file) return 0; v = getenv ("XCURSOR_SIZE"); if (v) size = atoi(v); if (!size) size = 32; images = XcursorLibraryLoadImages (file, NULL, size); if (!images) return -1; cursor = xcb_cursor_images_load_cursor (wm, images); XcursorImagesDestroy (images); return cursor; } void dump_property(struct weston_wm *wm, xcb_atom_t property, xcb_get_property_reply_t *reply) { int32_t *incr_value; const char *text_value, *name; xcb_atom_t *atom_value; int width, len; uint32_t i; width = wm_log_continue("%s: ", get_atom_name(wm->conn, property)); if (reply == NULL) { wm_log_continue("(no reply)\n"); return; } width += wm_log_continue("%s/%d, length %d (value_len %d): ", get_atom_name(wm->conn, reply->type), reply->format, xcb_get_property_value_length(reply), reply->value_len); if (reply->type == wm->atom.incr) { incr_value = xcb_get_property_value(reply); wm_log_continue("%d\n", *incr_value); } else if (reply->type == wm->atom.utf8_string || reply->type == wm->atom.string) { text_value = xcb_get_property_value(reply); if (reply->value_len > 40) len = 40; else len = reply->value_len; wm_log_continue("\"%.*s\"\n", len, text_value); } else if (reply->type == XCB_ATOM_ATOM) { atom_value = xcb_get_property_value(reply); for (i = 0; i < reply->value_len; i++) { name = get_atom_name(wm->conn, atom_value[i]); if (width + strlen(name) + 2 > 78) { wm_log_continue("\n "); width = 4; } else if (i > 0) { width += wm_log_continue(", "); } width += wm_log_continue("%s", name); } wm_log_continue("\n"); } else { wm_log_continue("huh?\n"); } } static void read_and_dump_property(struct weston_wm *wm, xcb_window_t window, xcb_atom_t property) { xcb_get_property_reply_t *reply; xcb_get_property_cookie_t cookie; cookie = xcb_get_property(wm->conn, 0, window, property, XCB_ATOM_ANY, 0, 2048); reply = xcb_get_property_reply(wm->conn, cookie, NULL); dump_property(wm, property, reply); free(reply); } /* We reuse some predefined, but otherwise useles atoms */ #define TYPE_WM_PROTOCOLS XCB_ATOM_CUT_BUFFER0 #define TYPE_MOTIF_WM_HINTS XCB_ATOM_CUT_BUFFER1 #define TYPE_NET_WM_STATE XCB_ATOM_CUT_BUFFER2 #define TYPE_WM_NORMAL_HINTS XCB_ATOM_CUT_BUFFER3 static void weston_wm_window_read_properties(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; #define F(field) offsetof(struct weston_wm_window, field) const struct { xcb_atom_t atom; xcb_atom_t type; int offset; } props[] = { { XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, F(class) }, { XCB_ATOM_WM_NAME, XCB_ATOM_STRING, F(name) }, { XCB_ATOM_WM_TRANSIENT_FOR, XCB_ATOM_WINDOW, F(transient_for) }, { wm->atom.wm_protocols, TYPE_WM_PROTOCOLS, F(protocols) }, { wm->atom.wm_normal_hints, TYPE_WM_NORMAL_HINTS, F(protocols) }, { wm->atom.net_wm_state, TYPE_NET_WM_STATE }, { wm->atom.net_wm_window_type, XCB_ATOM_ATOM, F(type) }, { wm->atom.net_wm_name, XCB_ATOM_STRING, F(name) }, { wm->atom.net_wm_pid, XCB_ATOM_CARDINAL, F(pid) }, { wm->atom.motif_wm_hints, TYPE_MOTIF_WM_HINTS, 0 }, { wm->atom.wm_client_machine, XCB_ATOM_WM_CLIENT_MACHINE, F(machine) }, }; #undef F xcb_get_property_cookie_t cookie[ARRAY_LENGTH(props)]; xcb_get_property_reply_t *reply; void *p; uint32_t *xid; xcb_atom_t *atom; uint32_t i; char name[1024]; if (!window->properties_dirty) return; window->properties_dirty = 0; for (i = 0; i < ARRAY_LENGTH(props); i++) cookie[i] = xcb_get_property(wm->conn, 0, /* delete */ window->id, props[i].atom, XCB_ATOM_ANY, 0, 2048); window->decorate = window->override_redirect ? 0 : MWM_DECOR_EVERYTHING; window->size_hints.flags = 0; window->motif_hints.flags = 0; window->delete_window = 0; for (i = 0; i < ARRAY_LENGTH(props); i++) { reply = xcb_get_property_reply(wm->conn, cookie[i], NULL); if (!reply) /* Bad window, typically */ continue; if (reply->type == XCB_ATOM_NONE) { /* No such property */ free(reply); continue; } p = ((char *) window + props[i].offset); switch (props[i].type) { case XCB_ATOM_WM_CLIENT_MACHINE: case XCB_ATOM_STRING: /* FIXME: We're using this for both string and utf8_string */ if (*(char **) p) free(*(char **) p); *(char **) p = strndup(xcb_get_property_value(reply), xcb_get_property_value_length(reply)); break; case XCB_ATOM_WINDOW: xid = xcb_get_property_value(reply); if (!wm_lookup_window(wm, *xid, p)) weston_log("XCB_ATOM_WINDOW contains window" " id not found in hash table.\n"); break; case XCB_ATOM_CARDINAL: case XCB_ATOM_ATOM: atom = xcb_get_property_value(reply); *(xcb_atom_t *) p = *atom; break; case TYPE_WM_PROTOCOLS: atom = xcb_get_property_value(reply); for (i = 0; i < reply->value_len; i++) if (atom[i] == wm->atom.wm_delete_window) { window->delete_window = 1; break; } break; case TYPE_WM_NORMAL_HINTS: memcpy(&window->size_hints, xcb_get_property_value(reply), sizeof window->size_hints); break; case TYPE_NET_WM_STATE: window->fullscreen = 0; atom = xcb_get_property_value(reply); for (i = 0; i < reply->value_len; i++) { if (atom[i] == wm->atom.net_wm_state_fullscreen) window->fullscreen = 1; if (atom[i] == wm->atom.net_wm_state_maximized_vert) window->maximized_vert = 1; if (atom[i] == wm->atom.net_wm_state_maximized_horz) window->maximized_horz = 1; } break; case TYPE_MOTIF_WM_HINTS: memcpy(&window->motif_hints, xcb_get_property_value(reply), sizeof window->motif_hints); if (window->motif_hints.flags & MWM_HINTS_DECORATIONS) { if (window->motif_hints.decorations & MWM_DECOR_ALL) /* MWM_DECOR_ALL means all except the other values listed. */ window->decorate = MWM_DECOR_EVERYTHING & (~window->motif_hints.decorations); else window->decorate = window->motif_hints.decorations; } break; default: break; } free(reply); } if (window->pid > 0) { gethostname(name, sizeof(name)); for (i = 0; i < sizeof(name); i++) { if (name[i] == '\0') break; } if (i == sizeof(name)) name[0] = '\0'; /* ignore stupid hostnames */ /* this is only one heuristic to guess the PID of a client is * valid, assuming it's compliant with icccm and ewmh. * Non-compliants and remote applications of course fail. */ if (!window->machine || strcmp(window->machine, name)) window->pid = 0; } if (window->shsurf && window->name) shell_interface->set_title(window->shsurf, window->name); if (window->frame && window->name) frame_set_title(window->frame, window->name); if (window->shsurf && window->pid > 0) shell_interface->set_pid(window->shsurf, window->pid); } static void weston_wm_window_get_frame_size(struct weston_wm_window *window, int *width, int *height) { struct theme *t = window->wm->theme; if (window->fullscreen) { *width = window->width; *height = window->height; } else if (window->decorate && window->frame) { *width = frame_width(window->frame); *height = frame_height(window->frame); } else { *width = window->width + t->margin * 2; *height = window->height + t->margin * 2; } } static void weston_wm_window_get_child_position(struct weston_wm_window *window, int *x, int *y) { struct theme *t = window->wm->theme; if (window->fullscreen) { *x = 0; *y = 0; } else if (window->decorate && window->frame) { frame_interior(window->frame, x, y, NULL, NULL); } else { *x = t->margin; *y = t->margin; } } static void weston_wm_window_send_configure_notify(struct weston_wm_window *window) { xcb_configure_notify_event_t configure_notify; struct weston_wm *wm = window->wm; int x, y; weston_wm_window_get_child_position(window, &x, &y); configure_notify.response_type = XCB_CONFIGURE_NOTIFY; configure_notify.pad0 = 0; configure_notify.event = window->id; configure_notify.window = window->id; configure_notify.above_sibling = XCB_WINDOW_NONE; configure_notify.x = x; configure_notify.y = y; configure_notify.width = window->width; configure_notify.height = window->height; configure_notify.border_width = 0; configure_notify.override_redirect = 0; configure_notify.pad1 = 0; xcb_send_event(wm->conn, 0, window->id, XCB_EVENT_MASK_STRUCTURE_NOTIFY, (char *) &configure_notify); } static void weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_configure_request_event_t *configure_request = (xcb_configure_request_event_t *) event; struct weston_wm_window *window; uint32_t mask, values[16]; int x, y, width, height, i = 0; wm_log("XCB_CONFIGURE_REQUEST (window %d) %d,%d @ %dx%d\n", configure_request->window, configure_request->x, configure_request->y, configure_request->width, configure_request->height); if (!wm_lookup_window(wm, configure_request->window, &window)) return; if (window->fullscreen) { weston_wm_window_send_configure_notify(window); return; } if (configure_request->value_mask & XCB_CONFIG_WINDOW_WIDTH) window->width = configure_request->width; if (configure_request->value_mask & XCB_CONFIG_WINDOW_HEIGHT) window->height = configure_request->height; if (window->frame) frame_resize_inside(window->frame, window->width, window->height); weston_wm_window_get_child_position(window, &x, &y); values[i++] = x; values[i++] = y; values[i++] = window->width; values[i++] = window->height; values[i++] = 0; mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_BORDER_WIDTH; if (configure_request->value_mask & XCB_CONFIG_WINDOW_SIBLING) { values[i++] = configure_request->sibling; mask |= XCB_CONFIG_WINDOW_SIBLING; } if (configure_request->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) { values[i++] = configure_request->stack_mode; mask |= XCB_CONFIG_WINDOW_STACK_MODE; } xcb_configure_window(wm->conn, window->id, mask, values); weston_wm_window_get_frame_size(window, &width, &height); values[0] = width; values[1] = height; mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; xcb_configure_window(wm->conn, window->frame_id, mask, values); weston_wm_window_schedule_repaint(window); } static int our_resource(struct weston_wm *wm, uint32_t id) { const xcb_setup_t *setup; setup = xcb_get_setup(wm->conn); return (id & ~setup->resource_id_mask) == setup->resource_id_base; } static void weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_configure_notify_event_t *configure_notify = (xcb_configure_notify_event_t *) event; struct weston_wm_window *window; wm_log("XCB_CONFIGURE_NOTIFY (window %d) %d,%d @ %dx%d\n", configure_notify->window, configure_notify->x, configure_notify->y, configure_notify->width, configure_notify->height); if (!wm_lookup_window(wm, configure_notify->window, &window)) return; window->x = configure_notify->x; window->y = configure_notify->y; if (window->override_redirect) { window->width = configure_notify->width; window->height = configure_notify->height; if (window->frame) frame_resize_inside(window->frame, window->width, window->height); } } static void weston_wm_kill_client(struct wl_listener *listener, void *data) { struct weston_surface *surface = data; struct weston_wm_window *window = get_wm_window(surface); if (!window) return; if (window->pid > 0) kill(window->pid, SIGKILL); } static void weston_wm_create_surface(struct wl_listener *listener, void *data) { struct weston_surface *surface = data; struct weston_wm *wm = container_of(listener, struct weston_wm, create_surface_listener); struct weston_wm_window *window; if (wl_resource_get_client(surface->resource) != wm->server->client) return; wl_list_for_each(window, &wm->unpaired_window_list, link) if (window->surface_id == wl_resource_get_id(surface->resource)) { xserver_map_shell_surface(window, surface); window->surface_id = 0; wl_list_remove(&window->link); break; } } static void weston_wm_send_focus_window(struct weston_wm *wm, struct weston_wm_window *window) { xcb_client_message_event_t client_message; if (window) { uint32_t values[1]; if (window->override_redirect) return; client_message.response_type = XCB_CLIENT_MESSAGE; client_message.format = 32; client_message.window = window->id; client_message.type = wm->atom.wm_protocols; client_message.data.data32[0] = wm->atom.wm_take_focus; client_message.data.data32[1] = XCB_TIME_CURRENT_TIME; xcb_send_event(wm->conn, 0, window->id, XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (char *) &client_message); xcb_set_input_focus (wm->conn, XCB_INPUT_FOCUS_POINTER_ROOT, window->id, XCB_TIME_CURRENT_TIME); values[0] = XCB_STACK_MODE_ABOVE; xcb_configure_window (wm->conn, window->frame_id, XCB_CONFIG_WINDOW_STACK_MODE, values); } else { xcb_set_input_focus (wm->conn, XCB_INPUT_FOCUS_POINTER_ROOT, XCB_NONE, XCB_TIME_CURRENT_TIME); } } static void weston_wm_window_activate(struct wl_listener *listener, void *data) { struct weston_surface *surface = data; struct weston_wm_window *window = NULL; struct weston_wm *wm = container_of(listener, struct weston_wm, activate_listener); if (surface) { window = get_wm_window(surface); } weston_wm_send_focus_window(wm, window); if (wm->focus_window) { if (wm->focus_window->frame) frame_unset_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE); weston_wm_window_schedule_repaint(wm->focus_window); } wm->focus_window = window; if (wm->focus_window) { if (wm->focus_window->frame) frame_set_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE); weston_wm_window_schedule_repaint(wm->focus_window); } } static void weston_wm_window_transform(struct wl_listener *listener, void *data) { struct weston_surface *surface = data; struct weston_wm_window *window = get_wm_window(surface); struct weston_wm *wm = container_of(listener, struct weston_wm, transform_listener); uint32_t mask, values[2]; if (!window || !wm) return; if (!window->view || !weston_view_is_mapped(window->view)) return; if (window->x != window->view->geometry.x || window->y != window->view->geometry.y) { values[0] = window->view->geometry.x; values[1] = window->view->geometry.y; mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y; xcb_configure_window(wm->conn, window->frame_id, mask, values); xcb_flush(wm->conn); } } #define ICCCM_WITHDRAWN_STATE 0 #define ICCCM_NORMAL_STATE 1 #define ICCCM_ICONIC_STATE 3 static void weston_wm_window_set_wm_state(struct weston_wm_window *window, int32_t state) { struct weston_wm *wm = window->wm; uint32_t property[2]; property[0] = state; property[1] = XCB_WINDOW_NONE; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, window->id, wm->atom.wm_state, wm->atom.wm_state, 32, /* format */ 2, property); } static void weston_wm_window_set_net_wm_state(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; uint32_t property[3]; int i; i = 0; if (window->fullscreen) property[i++] = wm->atom.net_wm_state_fullscreen; if (window->maximized_vert) property[i++] = wm->atom.net_wm_state_maximized_vert; if (window->maximized_horz) property[i++] = wm->atom.net_wm_state_maximized_horz; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, window->id, wm->atom.net_wm_state, XCB_ATOM_ATOM, 32, /* format */ i, property); } static void weston_wm_window_create_frame(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; uint32_t values[3]; int x, y, width, height; int buttons = FRAME_BUTTON_CLOSE; if (window->decorate & MWM_DECOR_MAXIMIZE) buttons |= FRAME_BUTTON_MAXIMIZE; window->frame = frame_create(window->wm->theme, window->width, window->height, buttons, window->name); frame_resize_inside(window->frame, window->width, window->height); weston_wm_window_get_frame_size(window, &width, &height); weston_wm_window_get_child_position(window, &x, &y); values[0] = wm->screen->black_pixel; values[1] = XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT; values[2] = wm->colormap; window->frame_id = xcb_generate_id(wm->conn); xcb_create_window(wm->conn, 32, window->frame_id, wm->screen->root, 0, 0, width, height, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, wm->visual_id, XCB_CW_BORDER_PIXEL | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP, values); xcb_reparent_window(wm->conn, window->id, window->frame_id, x, y); values[0] = 0; xcb_configure_window(wm->conn, window->id, XCB_CONFIG_WINDOW_BORDER_WIDTH, values); window->cairo_surface = cairo_xcb_surface_create_with_xrender_format(wm->conn, wm->screen, window->frame_id, &wm->format_rgba, width, height); hash_table_insert(wm->window_hash, window->frame_id, window); } /* * Sets the _NET_WM_DESKTOP property for the window to 'desktop'. * Passing a <0 desktop value deletes the property. */ static void weston_wm_window_set_virtual_desktop(struct weston_wm_window *window, int desktop) { if (desktop >= 0) { xcb_change_property(window->wm->conn, XCB_PROP_MODE_REPLACE, window->id, window->wm->atom.net_wm_desktop, XCB_ATOM_CARDINAL, 32, /* format */ 1, &desktop); } else { xcb_delete_property(window->wm->conn, window->id, window->wm->atom.net_wm_desktop); } } static void weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_map_request_event_t *map_request = (xcb_map_request_event_t *) event; struct weston_wm_window *window; if (our_resource(wm, map_request->window)) { wm_log("XCB_MAP_REQUEST (window %d, ours)\n", map_request->window); return; } if (!wm_lookup_window(wm, map_request->window, &window)) return; weston_wm_window_read_properties(window); if (window->frame_id == XCB_WINDOW_NONE) weston_wm_window_create_frame(window); wm_log("XCB_MAP_REQUEST (window %d, %p, frame %d)\n", window->id, window, window->frame_id); weston_wm_window_set_wm_state(window, ICCCM_NORMAL_STATE); weston_wm_window_set_net_wm_state(window); weston_wm_window_set_virtual_desktop(window, 0); xcb_map_window(wm->conn, map_request->window); xcb_map_window(wm->conn, window->frame_id); } static void weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_map_notify_event_t *map_notify = (xcb_map_notify_event_t *) event; if (our_resource(wm, map_notify->window)) { wm_log("XCB_MAP_NOTIFY (window %d, ours)\n", map_notify->window); return; } wm_log("XCB_MAP_NOTIFY (window %d)\n", map_notify->window); } static void weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_unmap_notify_event_t *unmap_notify = (xcb_unmap_notify_event_t *) event; struct weston_wm_window *window; wm_log("XCB_UNMAP_NOTIFY (window %d, event %d%s)\n", unmap_notify->window, unmap_notify->event, our_resource(wm, unmap_notify->window) ? ", ours" : ""); if (our_resource(wm, unmap_notify->window)) return; if (unmap_notify->response_type & SEND_EVENT_MASK) /* We just ignore the ICCCM 4.1.4 synthetic unmap notify * as it may come in after we've destroyed the window. */ return; if (!wm_lookup_window(wm, unmap_notify->window, &window)) return; if (window->surface_id) { /* Make sure we're not on the unpaired surface list or we * could be assigned a surface during surface creation that * was mapped before this unmap request. */ wl_list_remove(&window->link); window->surface_id = 0; } if (wm->focus_window == window) wm->focus_window = NULL; if (window->surface) wl_list_remove(&window->surface_destroy_listener.link); window->surface = NULL; window->shsurf = NULL; window->view = NULL; weston_wm_window_set_wm_state(window, ICCCM_WITHDRAWN_STATE); weston_wm_window_set_virtual_desktop(window, -1); xcb_unmap_window(wm->conn, window->frame_id); } static void weston_wm_window_draw_decoration(void *data) { struct weston_wm_window *window = data; struct weston_wm *wm = window->wm; struct theme *t = wm->theme; cairo_t *cr; int x, y, width, height; int32_t input_x, input_y, input_w, input_h; struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; uint32_t flags = 0; weston_wm_window_read_properties(window); window->repaint_source = NULL; weston_wm_window_get_frame_size(window, &width, &height); weston_wm_window_get_child_position(window, &x, &y); cairo_xcb_surface_set_size(window->cairo_surface, width, height); cr = cairo_create(window->cairo_surface); if (window->fullscreen) { /* nothing */ } else if (window->decorate) { if (wm->focus_window == window) flags |= THEME_FRAME_ACTIVE; frame_repaint(window->frame, cr); } else { cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0); cairo_paint(cr); render_shadow(cr, t->shadow, 2, 2, width + 8, height + 8, 64, 64); } cairo_destroy(cr); if (window->surface) { pixman_region32_fini(&window->surface->pending.opaque); if (window->has_alpha) { pixman_region32_init(&window->surface->pending.opaque); } else { /* We leave an extra pixel around the X window area to * make sure we don't sample from the undefined alpha * channel when filtering. */ pixman_region32_init_rect(&window->surface->pending.opaque, x - 1, y - 1, window->width + 2, window->height + 2); } if (window->view) weston_view_geometry_dirty(window->view); pixman_region32_fini(&window->surface->pending.input); if (window->decorate && !window->fullscreen) { frame_input_rect(window->frame, &input_x, &input_y, &input_w, &input_h); } else { input_x = x; input_y = y; input_w = width; input_h = height; } pixman_region32_init_rect(&window->surface->pending.input, input_x, input_y, input_w, input_h); shell_interface->set_window_geometry(window->shsurf, input_x, input_y, input_w, input_h); } } static void weston_wm_window_schedule_repaint(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; int width, height; if (window->frame_id == XCB_WINDOW_NONE) { if (window->surface != NULL) { weston_wm_window_get_frame_size(window, &width, &height); pixman_region32_fini(&window->surface->pending.opaque); if (window->has_alpha) { pixman_region32_init(&window->surface->pending.opaque); } else { pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0, width, height); } if (window->view) weston_view_geometry_dirty(window->view); } return; } if (window->repaint_source) return; window->repaint_source = wl_event_loop_add_idle(wm->server->loop, weston_wm_window_draw_decoration, window); } static void weston_wm_handle_property_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_property_notify_event_t *property_notify = (xcb_property_notify_event_t *) event; struct weston_wm_window *window; if (!wm_lookup_window(wm, property_notify->window, &window)) return; window->properties_dirty = 1; wm_log("XCB_PROPERTY_NOTIFY: window %d, ", property_notify->window); if (property_notify->state == XCB_PROPERTY_DELETE) wm_log("deleted\n"); else read_and_dump_property(wm, property_notify->window, property_notify->atom); if (property_notify->atom == wm->atom.net_wm_name || property_notify->atom == XCB_ATOM_WM_NAME) weston_wm_window_schedule_repaint(window); } static void weston_wm_window_create(struct weston_wm *wm, xcb_window_t id, int width, int height, int x, int y, int override) { struct weston_wm_window *window; uint32_t values[1]; xcb_get_geometry_cookie_t geometry_cookie; xcb_get_geometry_reply_t *geometry_reply; window = zalloc(sizeof *window); if (window == NULL) { wm_log("failed to allocate window\n"); return; } geometry_cookie = xcb_get_geometry(wm->conn, id); values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_FOCUS_CHANGE; xcb_change_window_attributes(wm->conn, id, XCB_CW_EVENT_MASK, values); window->wm = wm; window->id = id; window->properties_dirty = 1; window->override_redirect = override; window->width = width; window->height = height; window->x = x; window->y = y; geometry_reply = xcb_get_geometry_reply(wm->conn, geometry_cookie, NULL); /* technically we should use XRender and check the visual format's alpha_mask, but checking depth is simpler and works in all known cases */ if (geometry_reply != NULL) window->has_alpha = geometry_reply->depth == 32; free(geometry_reply); hash_table_insert(wm->window_hash, id, window); } static void weston_wm_window_destroy(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; if (window->repaint_source) wl_event_source_remove(window->repaint_source); if (window->cairo_surface) cairo_surface_destroy(window->cairo_surface); if (window->frame_id) { xcb_reparent_window(wm->conn, window->id, wm->wm_window, 0, 0); xcb_destroy_window(wm->conn, window->frame_id); weston_wm_window_set_wm_state(window, ICCCM_WITHDRAWN_STATE); weston_wm_window_set_virtual_desktop(window, -1); hash_table_remove(wm->window_hash, window->frame_id); window->frame_id = XCB_WINDOW_NONE; } if (window->surface_id) wl_list_remove(&window->link); if (window->surface) wl_list_remove(&window->surface_destroy_listener.link); hash_table_remove(window->wm->window_hash, window->id); free(window); } static void weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_create_notify_event_t *create_notify = (xcb_create_notify_event_t *) event; wm_log("XCB_CREATE_NOTIFY (window %d, width %d, height %d%s%s)\n", create_notify->window, create_notify->width, create_notify->height, create_notify->override_redirect ? ", override" : "", our_resource(wm, create_notify->window) ? ", ours" : ""); if (our_resource(wm, create_notify->window)) return; weston_wm_window_create(wm, create_notify->window, create_notify->width, create_notify->height, create_notify->x, create_notify->y, create_notify->override_redirect); } static void weston_wm_handle_destroy_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_destroy_notify_event_t *destroy_notify = (xcb_destroy_notify_event_t *) event; struct weston_wm_window *window; wm_log("XCB_DESTROY_NOTIFY, win %d, event %d%s\n", destroy_notify->window, destroy_notify->event, our_resource(wm, destroy_notify->window) ? ", ours" : ""); if (our_resource(wm, destroy_notify->window)) return; if (!wm_lookup_window(wm, destroy_notify->window, &window)) return; weston_wm_window_destroy(window); } static void weston_wm_handle_reparent_notify(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_reparent_notify_event_t *reparent_notify = (xcb_reparent_notify_event_t *) event; struct weston_wm_window *window; wm_log("XCB_REPARENT_NOTIFY (window %d, parent %d, event %d)\n", reparent_notify->window, reparent_notify->parent, reparent_notify->event); if (reparent_notify->parent == wm->screen->root) { weston_wm_window_create(wm, reparent_notify->window, 10, 10, reparent_notify->x, reparent_notify->y, reparent_notify->override_redirect); } else if (!our_resource(wm, reparent_notify->parent)) { if (!wm_lookup_window(wm, reparent_notify->window, &window)) return; weston_wm_window_destroy(window); } } struct weston_seat * weston_wm_pick_seat(struct weston_wm *wm) { return container_of(wm->server->compositor->seat_list.next, struct weston_seat, link); } static struct weston_seat * weston_wm_pick_seat_for_window(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; struct weston_seat *seat, *s; seat = NULL; wl_list_for_each(s, &wm->server->compositor->seat_list, link) { struct weston_pointer *pointer = weston_seat_get_pointer(s); struct weston_pointer *old_pointer = weston_seat_get_pointer(seat); if (pointer && pointer->focus && pointer->focus->surface == window->surface && pointer->button_count > 0 && (!seat || pointer->grab_serial - old_pointer->grab_serial < (1 << 30))) seat = s; } return seat; } static void weston_wm_window_handle_moveresize(struct weston_wm_window *window, xcb_client_message_event_t *client_message) { static const int map[] = { THEME_LOCATION_RESIZING_TOP_LEFT, THEME_LOCATION_RESIZING_TOP, THEME_LOCATION_RESIZING_TOP_RIGHT, THEME_LOCATION_RESIZING_RIGHT, THEME_LOCATION_RESIZING_BOTTOM_RIGHT, THEME_LOCATION_RESIZING_BOTTOM, THEME_LOCATION_RESIZING_BOTTOM_LEFT, THEME_LOCATION_RESIZING_LEFT }; struct weston_wm *wm = window->wm; struct weston_seat *seat = weston_wm_pick_seat_for_window(window); struct weston_pointer *pointer = weston_seat_get_pointer(seat); int detail; struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; if (!pointer || pointer->button_count != 1 || !pointer->focus || pointer->focus->surface != window->surface) return; detail = client_message->data.data32[2]; switch (detail) { case _NET_WM_MOVERESIZE_MOVE: shell_interface->move(window->shsurf, pointer); break; case _NET_WM_MOVERESIZE_SIZE_TOPLEFT: case _NET_WM_MOVERESIZE_SIZE_TOP: case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT: case _NET_WM_MOVERESIZE_SIZE_RIGHT: case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT: case _NET_WM_MOVERESIZE_SIZE_BOTTOM: case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT: case _NET_WM_MOVERESIZE_SIZE_LEFT: shell_interface->resize(window->shsurf, pointer, map[detail]); break; case _NET_WM_MOVERESIZE_CANCEL: break; } } #define _NET_WM_STATE_REMOVE 0 #define _NET_WM_STATE_ADD 1 #define _NET_WM_STATE_TOGGLE 2 static int update_state(int action, int *state) { int new_state, changed; switch (action) { case _NET_WM_STATE_REMOVE: new_state = 0; break; case _NET_WM_STATE_ADD: new_state = 1; break; case _NET_WM_STATE_TOGGLE: new_state = !*state; break; default: return 0; } changed = (*state != new_state); *state = new_state; return changed; } static void weston_wm_window_configure(void *data); static void weston_wm_window_set_toplevel(struct weston_wm_window *window) { struct weston_shell_interface *shell_interface = &window->wm->server->compositor->shell_interface; shell_interface->set_toplevel(window->shsurf); window->width = window->saved_width; window->height = window->saved_height; if (window->frame) frame_resize_inside(window->frame, window->width, window->height); weston_wm_window_configure(window); } static inline bool weston_wm_window_is_maximized(struct weston_wm_window *window) { return window->maximized_horz && window->maximized_vert; } static void weston_wm_window_handle_state(struct weston_wm_window *window, xcb_client_message_event_t *client_message) { struct weston_wm *wm = window->wm; struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; uint32_t action, property; int maximized = weston_wm_window_is_maximized(window); action = client_message->data.data32[0]; property = client_message->data.data32[1]; if (property == wm->atom.net_wm_state_fullscreen && update_state(action, &window->fullscreen)) { weston_wm_window_set_net_wm_state(window); if (window->fullscreen) { window->saved_width = window->width; window->saved_height = window->height; if (window->shsurf) shell_interface->set_fullscreen(window->shsurf, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, NULL); } else { if (window->shsurf) weston_wm_window_set_toplevel(window); } } else { if (property == wm->atom.net_wm_state_maximized_vert && update_state(action, &window->maximized_vert)) weston_wm_window_set_net_wm_state(window); if (property == wm->atom.net_wm_state_maximized_horz && update_state(action, &window->maximized_horz)) weston_wm_window_set_net_wm_state(window); if (maximized != weston_wm_window_is_maximized(window)) { if (weston_wm_window_is_maximized(window)) { window->saved_width = window->width; window->saved_height = window->height; if (window->shsurf) shell_interface->set_maximized(window->shsurf); } else if (window->shsurf) { weston_wm_window_set_toplevel(window); } } } } static void surface_destroy(struct wl_listener *listener, void *data) { struct weston_wm_window *window = container_of(listener, struct weston_wm_window, surface_destroy_listener); wm_log("surface for xid %d destroyed\n", window->id); /* This should have been freed by the shell. * Don't try to use it later. */ window->shsurf = NULL; window->surface = NULL; window->view = NULL; } static void weston_wm_window_handle_surface_id(struct weston_wm_window *window, xcb_client_message_event_t *client_message) { struct weston_wm *wm = window->wm; struct wl_resource *resource; if (window->surface_id != 0) { wm_log("already have surface id for window %d\n", window->id); return; } /* Xwayland will send the wayland requests to create the * wl_surface before sending this client message. Even so, we * can end up handling the X event before the wayland requests * and thus when we try to look up the surface ID, the surface * hasn't been created yet. In that case put the window on * the unpaired window list and continue when the surface gets * created. */ uint32_t id = client_message->data.data32[0]; resource = wl_client_get_object(wm->server->client, id); if (resource) { window->surface_id = 0; xserver_map_shell_surface(window, wl_resource_get_user_data(resource)); } else { window->surface_id = id; wl_list_insert(&wm->unpaired_window_list, &window->link); } } static void weston_wm_handle_client_message(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_client_message_event_t *client_message = (xcb_client_message_event_t *) event; struct weston_wm_window *window; wm_log("XCB_CLIENT_MESSAGE (%s %d %d %d %d %d win %d)\n", get_atom_name(wm->conn, client_message->type), client_message->data.data32[0], client_message->data.data32[1], client_message->data.data32[2], client_message->data.data32[3], client_message->data.data32[4], client_message->window); /* The window may get created and destroyed before we actually * handle the message. If it doesn't exist, bail. */ if (!wm_lookup_window(wm, client_message->window, &window)) return; if (client_message->type == wm->atom.net_wm_moveresize) weston_wm_window_handle_moveresize(window, client_message); else if (client_message->type == wm->atom.net_wm_state) weston_wm_window_handle_state(window, client_message); else if (client_message->type == wm->atom.wl_surface_id) weston_wm_window_handle_surface_id(window, client_message); } enum cursor_type { XWM_CURSOR_TOP, XWM_CURSOR_BOTTOM, XWM_CURSOR_LEFT, XWM_CURSOR_RIGHT, XWM_CURSOR_TOP_LEFT, XWM_CURSOR_TOP_RIGHT, XWM_CURSOR_BOTTOM_LEFT, XWM_CURSOR_BOTTOM_RIGHT, XWM_CURSOR_LEFT_PTR, }; /* * The following correspondences between file names and cursors was copied * from: https://bugs.kde.org/attachment.cgi?id=67313 */ static const char *bottom_left_corners[] = { "bottom_left_corner", "sw-resize", "size_bdiag" }; static const char *bottom_right_corners[] = { "bottom_right_corner", "se-resize", "size_fdiag" }; static const char *bottom_sides[] = { "bottom_side", "s-resize", "size_ver" }; static const char *left_ptrs[] = { "left_ptr", "default", "top_left_arrow", "left-arrow" }; static const char *left_sides[] = { "left_side", "w-resize", "size_hor" }; static const char *right_sides[] = { "right_side", "e-resize", "size_hor" }; static const char *top_left_corners[] = { "top_left_corner", "nw-resize", "size_fdiag" }; static const char *top_right_corners[] = { "top_right_corner", "ne-resize", "size_bdiag" }; static const char *top_sides[] = { "top_side", "n-resize", "size_ver" }; struct cursor_alternatives { const char **names; size_t count; }; static const struct cursor_alternatives cursors[] = { {top_sides, ARRAY_LENGTH(top_sides)}, {bottom_sides, ARRAY_LENGTH(bottom_sides)}, {left_sides, ARRAY_LENGTH(left_sides)}, {right_sides, ARRAY_LENGTH(right_sides)}, {top_left_corners, ARRAY_LENGTH(top_left_corners)}, {top_right_corners, ARRAY_LENGTH(top_right_corners)}, {bottom_left_corners, ARRAY_LENGTH(bottom_left_corners)}, {bottom_right_corners, ARRAY_LENGTH(bottom_right_corners)}, {left_ptrs, ARRAY_LENGTH(left_ptrs)}, }; static void weston_wm_create_cursors(struct weston_wm *wm) { const char *name; int i, count = ARRAY_LENGTH(cursors); size_t j; wm->cursors = malloc(count * sizeof(xcb_cursor_t)); for (i = 0; i < count; i++) { for (j = 0; j < cursors[i].count; j++) { name = cursors[i].names[j]; wm->cursors[i] = xcb_cursor_library_load_cursor(wm, name); if (wm->cursors[i] != (xcb_cursor_t)-1) break; } } wm->last_cursor = -1; } static void weston_wm_destroy_cursors(struct weston_wm *wm) { uint8_t i; for (i = 0; i < ARRAY_LENGTH(cursors); i++) xcb_free_cursor(wm->conn, wm->cursors[i]); free(wm->cursors); } static int get_cursor_for_location(enum theme_location location) { // int location = theme_get_location(t, x, y, width, height, 0); switch (location) { case THEME_LOCATION_RESIZING_TOP: return XWM_CURSOR_TOP; case THEME_LOCATION_RESIZING_BOTTOM: return XWM_CURSOR_BOTTOM; case THEME_LOCATION_RESIZING_LEFT: return XWM_CURSOR_LEFT; case THEME_LOCATION_RESIZING_RIGHT: return XWM_CURSOR_RIGHT; case THEME_LOCATION_RESIZING_TOP_LEFT: return XWM_CURSOR_TOP_LEFT; case THEME_LOCATION_RESIZING_TOP_RIGHT: return XWM_CURSOR_TOP_RIGHT; case THEME_LOCATION_RESIZING_BOTTOM_LEFT: return XWM_CURSOR_BOTTOM_LEFT; case THEME_LOCATION_RESIZING_BOTTOM_RIGHT: return XWM_CURSOR_BOTTOM_RIGHT; case THEME_LOCATION_EXTERIOR: case THEME_LOCATION_TITLEBAR: default: return XWM_CURSOR_LEFT_PTR; } } static void weston_wm_window_set_cursor(struct weston_wm *wm, xcb_window_t window_id, int cursor) { uint32_t cursor_value_list; if (wm->last_cursor == cursor) return; wm->last_cursor = cursor; cursor_value_list = wm->cursors[cursor]; xcb_change_window_attributes (wm->conn, window_id, XCB_CW_CURSOR, &cursor_value_list); xcb_flush(wm->conn); } static void weston_wm_window_close(struct weston_wm_window *window, xcb_timestamp_t time) { xcb_client_message_event_t client_message; if (window->delete_window) { client_message.response_type = XCB_CLIENT_MESSAGE; client_message.format = 32; client_message.window = window->id; client_message.type = window->wm->atom.wm_protocols; client_message.data.data32[0] = window->wm->atom.wm_delete_window; client_message.data.data32[1] = time; xcb_send_event(window->wm->conn, 0, window->id, XCB_EVENT_MASK_NO_EVENT, (char *) &client_message); } else { xcb_kill_client(window->wm->conn, window->id); } } static void weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_button_press_event_t *button = (xcb_button_press_event_t *) event; struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; struct weston_seat *seat; struct weston_pointer *pointer; struct weston_wm_window *window; enum theme_location location; enum frame_button_state button_state; uint32_t button_id; wm_log("XCB_BUTTON_%s (detail %d)\n", button->response_type == XCB_BUTTON_PRESS ? "PRESS" : "RELEASE", button->detail); if (!wm_lookup_window(wm, button->event, &window) || !window->decorate) return; if (button->detail != 1 && button->detail != 2) return; seat = weston_wm_pick_seat_for_window(window); pointer = weston_seat_get_pointer(seat); button_state = button->response_type == XCB_BUTTON_PRESS ? FRAME_BUTTON_PRESSED : FRAME_BUTTON_RELEASED; button_id = button->detail == 1 ? BTN_LEFT : BTN_RIGHT; /* Make sure we're looking at the right location. The frame * could have received a motion event from a pointer from a * different wl_seat, but under X it looks like our core * pointer moved. Move the frame pointer to the button press * location before deciding what to do. */ location = frame_pointer_motion(window->frame, NULL, button->event_x, button->event_y); location = frame_pointer_button(window->frame, NULL, button_id, button_state); if (frame_status(window->frame) & FRAME_STATUS_REPAINT) weston_wm_window_schedule_repaint(window); if (frame_status(window->frame) & FRAME_STATUS_MOVE) { if (pointer) shell_interface->move(window->shsurf, pointer); frame_status_clear(window->frame, FRAME_STATUS_MOVE); } if (frame_status(window->frame) & FRAME_STATUS_RESIZE) { if (pointer) shell_interface->resize(window->shsurf, pointer, location); frame_status_clear(window->frame, FRAME_STATUS_RESIZE); } if (frame_status(window->frame) & FRAME_STATUS_CLOSE) { weston_wm_window_close(window, button->time); frame_status_clear(window->frame, FRAME_STATUS_CLOSE); } if (frame_status(window->frame) & FRAME_STATUS_MAXIMIZE) { window->maximized_horz = !window->maximized_horz; window->maximized_vert = !window->maximized_vert; if (weston_wm_window_is_maximized(window)) { window->saved_width = window->width; window->saved_height = window->height; shell_interface->set_maximized(window->shsurf); } else { weston_wm_window_set_toplevel(window); } frame_status_clear(window->frame, FRAME_STATUS_MAXIMIZE); } } static void weston_wm_handle_motion(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_motion_notify_event_t *motion = (xcb_motion_notify_event_t *) event; struct weston_wm_window *window; enum theme_location location; int cursor; if (!wm_lookup_window(wm, motion->event, &window) || !window->decorate) return; location = frame_pointer_motion(window->frame, NULL, motion->event_x, motion->event_y); if (frame_status(window->frame) & FRAME_STATUS_REPAINT) weston_wm_window_schedule_repaint(window); cursor = get_cursor_for_location(location); weston_wm_window_set_cursor(wm, window->frame_id, cursor); } static void weston_wm_handle_enter(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_enter_notify_event_t *enter = (xcb_enter_notify_event_t *) event; struct weston_wm_window *window; enum theme_location location; int cursor; if (!wm_lookup_window(wm, enter->event, &window) || !window->decorate) return; location = frame_pointer_enter(window->frame, NULL, enter->event_x, enter->event_y); if (frame_status(window->frame) & FRAME_STATUS_REPAINT) weston_wm_window_schedule_repaint(window); cursor = get_cursor_for_location(location); weston_wm_window_set_cursor(wm, window->frame_id, cursor); } static void weston_wm_handle_leave(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_leave_notify_event_t *leave = (xcb_leave_notify_event_t *) event; struct weston_wm_window *window; if (!wm_lookup_window(wm, leave->event, &window) || !window->decorate) return; frame_pointer_leave(window->frame, NULL); if (frame_status(window->frame) & FRAME_STATUS_REPAINT) weston_wm_window_schedule_repaint(window); weston_wm_window_set_cursor(wm, window->frame_id, XWM_CURSOR_LEFT_PTR); } static void weston_wm_handle_focus_in(struct weston_wm *wm, xcb_generic_event_t *event) { xcb_focus_in_event_t *focus = (xcb_focus_in_event_t *) event; /* Do not let X clients change the focus behind the compositor's * back. Reset the focus to the old one if it changed. */ if (!wm->focus_window || focus->event != wm->focus_window->id) weston_wm_send_focus_window(wm, wm->focus_window); } static int weston_wm_handle_event(int fd, uint32_t mask, void *data) { struct weston_wm *wm = data; xcb_generic_event_t *event; int count = 0; while (event = xcb_poll_for_event(wm->conn), event != NULL) { if (weston_wm_handle_selection_event(wm, event)) { free(event); count++; continue; } if (weston_wm_handle_dnd_event(wm, event)) { free(event); count++; continue; } switch (EVENT_TYPE(event)) { case XCB_BUTTON_PRESS: case XCB_BUTTON_RELEASE: weston_wm_handle_button(wm, event); break; case XCB_ENTER_NOTIFY: weston_wm_handle_enter(wm, event); break; case XCB_LEAVE_NOTIFY: weston_wm_handle_leave(wm, event); break; case XCB_MOTION_NOTIFY: weston_wm_handle_motion(wm, event); break; case XCB_CREATE_NOTIFY: weston_wm_handle_create_notify(wm, event); break; case XCB_MAP_REQUEST: weston_wm_handle_map_request(wm, event); break; case XCB_MAP_NOTIFY: weston_wm_handle_map_notify(wm, event); break; case XCB_UNMAP_NOTIFY: weston_wm_handle_unmap_notify(wm, event); break; case XCB_REPARENT_NOTIFY: weston_wm_handle_reparent_notify(wm, event); break; case XCB_CONFIGURE_REQUEST: weston_wm_handle_configure_request(wm, event); break; case XCB_CONFIGURE_NOTIFY: weston_wm_handle_configure_notify(wm, event); break; case XCB_DESTROY_NOTIFY: weston_wm_handle_destroy_notify(wm, event); break; case XCB_MAPPING_NOTIFY: wm_log("XCB_MAPPING_NOTIFY\n"); break; case XCB_PROPERTY_NOTIFY: weston_wm_handle_property_notify(wm, event); break; case XCB_CLIENT_MESSAGE: weston_wm_handle_client_message(wm, event); break; case XCB_FOCUS_IN: weston_wm_handle_focus_in(wm, event); break; } free(event); count++; } xcb_flush(wm->conn); return count; } static void weston_wm_get_visual_and_colormap(struct weston_wm *wm) { xcb_depth_iterator_t d_iter; xcb_visualtype_iterator_t vt_iter; xcb_visualtype_t *visualtype; d_iter = xcb_screen_allowed_depths_iterator(wm->screen); visualtype = NULL; while (d_iter.rem > 0) { if (d_iter.data->depth == 32) { vt_iter = xcb_depth_visuals_iterator(d_iter.data); visualtype = vt_iter.data; break; } xcb_depth_next(&d_iter); } if (visualtype == NULL) { weston_log("no 32 bit visualtype\n"); return; } wm->visual_id = visualtype->visual_id; wm->colormap = xcb_generate_id(wm->conn); xcb_create_colormap(wm->conn, XCB_COLORMAP_ALLOC_NONE, wm->colormap, wm->screen->root, wm->visual_id); } static void weston_wm_get_resources(struct weston_wm *wm) { #define F(field) offsetof(struct weston_wm, field) static const struct { const char *name; int offset; } atoms[] = { { "WM_PROTOCOLS", F(atom.wm_protocols) }, { "WM_NORMAL_HINTS", F(atom.wm_normal_hints) }, { "WM_TAKE_FOCUS", F(atom.wm_take_focus) }, { "WM_DELETE_WINDOW", F(atom.wm_delete_window) }, { "WM_STATE", F(atom.wm_state) }, { "WM_S0", F(atom.wm_s0) }, { "WM_CLIENT_MACHINE", F(atom.wm_client_machine) }, { "_NET_WM_CM_S0", F(atom.net_wm_cm_s0) }, { "_NET_WM_NAME", F(atom.net_wm_name) }, { "_NET_WM_PID", F(atom.net_wm_pid) }, { "_NET_WM_ICON", F(atom.net_wm_icon) }, { "_NET_WM_STATE", F(atom.net_wm_state) }, { "_NET_WM_STATE_MAXIMIZED_VERT", F(atom.net_wm_state_maximized_vert) }, { "_NET_WM_STATE_MAXIMIZED_HORZ", F(atom.net_wm_state_maximized_horz) }, { "_NET_WM_STATE_FULLSCREEN", F(atom.net_wm_state_fullscreen) }, { "_NET_WM_USER_TIME", F(atom.net_wm_user_time) }, { "_NET_WM_ICON_NAME", F(atom.net_wm_icon_name) }, { "_NET_WM_DESKTOP", F(atom.net_wm_desktop) }, { "_NET_WM_WINDOW_TYPE", F(atom.net_wm_window_type) }, { "_NET_WM_WINDOW_TYPE_DESKTOP", F(atom.net_wm_window_type_desktop) }, { "_NET_WM_WINDOW_TYPE_DOCK", F(atom.net_wm_window_type_dock) }, { "_NET_WM_WINDOW_TYPE_TOOLBAR", F(atom.net_wm_window_type_toolbar) }, { "_NET_WM_WINDOW_TYPE_MENU", F(atom.net_wm_window_type_menu) }, { "_NET_WM_WINDOW_TYPE_UTILITY", F(atom.net_wm_window_type_utility) }, { "_NET_WM_WINDOW_TYPE_SPLASH", F(atom.net_wm_window_type_splash) }, { "_NET_WM_WINDOW_TYPE_DIALOG", F(atom.net_wm_window_type_dialog) }, { "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU", F(atom.net_wm_window_type_dropdown) }, { "_NET_WM_WINDOW_TYPE_POPUP_MENU", F(atom.net_wm_window_type_popup) }, { "_NET_WM_WINDOW_TYPE_TOOLTIP", F(atom.net_wm_window_type_tooltip) }, { "_NET_WM_WINDOW_TYPE_NOTIFICATION", F(atom.net_wm_window_type_notification) }, { "_NET_WM_WINDOW_TYPE_COMBO", F(atom.net_wm_window_type_combo) }, { "_NET_WM_WINDOW_TYPE_DND", F(atom.net_wm_window_type_dnd) }, { "_NET_WM_WINDOW_TYPE_NORMAL", F(atom.net_wm_window_type_normal) }, { "_NET_WM_MOVERESIZE", F(atom.net_wm_moveresize) }, { "_NET_SUPPORTING_WM_CHECK", F(atom.net_supporting_wm_check) }, { "_NET_SUPPORTED", F(atom.net_supported) }, { "_MOTIF_WM_HINTS", F(atom.motif_wm_hints) }, { "CLIPBOARD", F(atom.clipboard) }, { "CLIPBOARD_MANAGER", F(atom.clipboard_manager) }, { "TARGETS", F(atom.targets) }, { "UTF8_STRING", F(atom.utf8_string) }, { "_WL_SELECTION", F(atom.wl_selection) }, { "INCR", F(atom.incr) }, { "TIMESTAMP", F(atom.timestamp) }, { "MULTIPLE", F(atom.multiple) }, { "UTF8_STRING" , F(atom.utf8_string) }, { "COMPOUND_TEXT", F(atom.compound_text) }, { "TEXT", F(atom.text) }, { "STRING", F(atom.string) }, { "text/plain;charset=utf-8", F(atom.text_plain_utf8) }, { "text/plain", F(atom.text_plain) }, { "XdndSelection", F(atom.xdnd_selection) }, { "XdndAware", F(atom.xdnd_aware) }, { "XdndEnter", F(atom.xdnd_enter) }, { "XdndLeave", F(atom.xdnd_leave) }, { "XdndDrop", F(atom.xdnd_drop) }, { "XdndStatus", F(atom.xdnd_status) }, { "XdndFinished", F(atom.xdnd_finished) }, { "XdndTypeList", F(atom.xdnd_type_list) }, { "XdndActionCopy", F(atom.xdnd_action_copy) }, { "WL_SURFACE_ID", F(atom.wl_surface_id) } }; #undef F xcb_xfixes_query_version_cookie_t xfixes_cookie; xcb_xfixes_query_version_reply_t *xfixes_reply; xcb_intern_atom_cookie_t cookies[ARRAY_LENGTH(atoms)]; xcb_intern_atom_reply_t *reply; xcb_render_query_pict_formats_reply_t *formats_reply; xcb_render_query_pict_formats_cookie_t formats_cookie; xcb_render_pictforminfo_t *formats; uint32_t i; xcb_prefetch_extension_data (wm->conn, &xcb_xfixes_id); xcb_prefetch_extension_data (wm->conn, &xcb_composite_id); formats_cookie = xcb_render_query_pict_formats(wm->conn); for (i = 0; i < ARRAY_LENGTH(atoms); i++) cookies[i] = xcb_intern_atom (wm->conn, 0, strlen(atoms[i].name), atoms[i].name); for (i = 0; i < ARRAY_LENGTH(atoms); i++) { reply = xcb_intern_atom_reply (wm->conn, cookies[i], NULL); *(xcb_atom_t *) ((char *) wm + atoms[i].offset) = reply->atom; free(reply); } wm->xfixes = xcb_get_extension_data(wm->conn, &xcb_xfixes_id); if (!wm->xfixes || !wm->xfixes->present) weston_log("xfixes not available\n"); xfixes_cookie = xcb_xfixes_query_version(wm->conn, XCB_XFIXES_MAJOR_VERSION, XCB_XFIXES_MINOR_VERSION); xfixes_reply = xcb_xfixes_query_version_reply(wm->conn, xfixes_cookie, NULL); weston_log("xfixes version: %d.%d\n", xfixes_reply->major_version, xfixes_reply->minor_version); free(xfixes_reply); formats_reply = xcb_render_query_pict_formats_reply(wm->conn, formats_cookie, 0); if (formats_reply == NULL) return; formats = xcb_render_query_pict_formats_formats(formats_reply); for (i = 0; i < formats_reply->num_formats; i++) { if (formats[i].direct.red_mask != 0xff && formats[i].direct.red_shift != 16) continue; if (formats[i].type == XCB_RENDER_PICT_TYPE_DIRECT && formats[i].depth == 24) wm->format_rgb = formats[i]; if (formats[i].type == XCB_RENDER_PICT_TYPE_DIRECT && formats[i].depth == 32 && formats[i].direct.alpha_mask == 0xff && formats[i].direct.alpha_shift == 24) wm->format_rgba = formats[i]; } free(formats_reply); } static void weston_wm_create_wm_window(struct weston_wm *wm) { static const char name[] = "Weston WM"; wm->wm_window = xcb_generate_id(wm->conn); xcb_create_window(wm->conn, XCB_COPY_FROM_PARENT, wm->wm_window, wm->screen->root, 0, 0, 10, 10, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, wm->screen->root_visual, 0, NULL); xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->wm_window, wm->atom.net_supporting_wm_check, XCB_ATOM_WINDOW, 32, /* format */ 1, &wm->wm_window); xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->wm_window, wm->atom.net_wm_name, wm->atom.utf8_string, 8, /* format */ strlen(name), name); xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->screen->root, wm->atom.net_supporting_wm_check, XCB_ATOM_WINDOW, 32, /* format */ 1, &wm->wm_window); /* Claim the WM_S0 selection even though we don't suport * the --replace functionality. */ xcb_set_selection_owner(wm->conn, wm->wm_window, wm->atom.wm_s0, XCB_TIME_CURRENT_TIME); xcb_set_selection_owner(wm->conn, wm->wm_window, wm->atom.net_wm_cm_s0, XCB_TIME_CURRENT_TIME); } struct weston_wm * weston_wm_create(struct weston_xserver *wxs, int fd) { struct weston_wm *wm; struct wl_event_loop *loop; xcb_screen_iterator_t s; uint32_t values[1]; xcb_atom_t supported[5]; wm = zalloc(sizeof *wm); if (wm == NULL) return NULL; wm->server = wxs; wm->window_hash = hash_table_create(); if (wm->window_hash == NULL) { free(wm); return NULL; } /* xcb_connect_to_fd takes ownership of the fd. */ wm->conn = xcb_connect_to_fd(fd, NULL); if (xcb_connection_has_error(wm->conn)) { weston_log("xcb_connect_to_fd failed\n"); close(fd); hash_table_destroy(wm->window_hash); free(wm); return NULL; } s = xcb_setup_roots_iterator(xcb_get_setup(wm->conn)); wm->screen = s.data; loop = wl_display_get_event_loop(wxs->wl_display); wm->source = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE, weston_wm_handle_event, wm); wl_event_source_check(wm->source); weston_wm_get_resources(wm); weston_wm_get_visual_and_colormap(wm); values[0] = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_PROPERTY_CHANGE; xcb_change_window_attributes(wm->conn, wm->screen->root, XCB_CW_EVENT_MASK, values); xcb_composite_redirect_subwindows(wm->conn, wm->screen->root, XCB_COMPOSITE_REDIRECT_MANUAL); wm->theme = theme_create(); supported[0] = wm->atom.net_wm_moveresize; supported[1] = wm->atom.net_wm_state; supported[2] = wm->atom.net_wm_state_fullscreen; supported[3] = wm->atom.net_wm_state_maximized_vert; supported[4] = wm->atom.net_wm_state_maximized_horz; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->screen->root, wm->atom.net_supported, XCB_ATOM_ATOM, 32, /* format */ ARRAY_LENGTH(supported), supported); weston_wm_selection_init(wm); weston_wm_dnd_init(wm); xcb_flush(wm->conn); wm->create_surface_listener.notify = weston_wm_create_surface; wl_signal_add(&wxs->compositor->create_surface_signal, &wm->create_surface_listener); wm->activate_listener.notify = weston_wm_window_activate; wl_signal_add(&wxs->compositor->activate_signal, &wm->activate_listener); wm->transform_listener.notify = weston_wm_window_transform; wl_signal_add(&wxs->compositor->transform_signal, &wm->transform_listener); wm->kill_listener.notify = weston_wm_kill_client; wl_signal_add(&wxs->compositor->kill_signal, &wm->kill_listener); wl_list_init(&wm->unpaired_window_list); weston_wm_create_cursors(wm); weston_wm_window_set_cursor(wm, wm->screen->root, XWM_CURSOR_LEFT_PTR); /* Create wm window and take WM_S0 selection last, which * signals to Xwayland that we're done with setup. */ weston_wm_create_wm_window(wm); weston_log("created wm, root %d\n", wm->screen->root); return wm; } void weston_wm_destroy(struct weston_wm *wm) { /* FIXME: Free windows in hash. */ hash_table_destroy(wm->window_hash); weston_wm_destroy_cursors(wm); xcb_disconnect(wm->conn); wl_event_source_remove(wm->source); wl_list_remove(&wm->selection_listener.link); wl_list_remove(&wm->activate_listener.link); wl_list_remove(&wm->kill_listener.link); wl_list_remove(&wm->transform_listener.link); wl_list_remove(&wm->create_surface_listener.link); free(wm); } static struct weston_wm_window * get_wm_window(struct weston_surface *surface) { struct wl_listener *listener; listener = wl_signal_get(&surface->destroy_signal, surface_destroy); if (listener) return container_of(listener, struct weston_wm_window, surface_destroy_listener); return NULL; } static void weston_wm_window_configure(void *data) { struct weston_wm_window *window = data; struct weston_wm *wm = window->wm; uint32_t values[4]; int x, y, width, height; weston_wm_window_get_child_position(window, &x, &y); values[0] = x; values[1] = y; values[2] = window->width; values[3] = window->height; xcb_configure_window(wm->conn, window->id, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values); weston_wm_window_get_frame_size(window, &width, &height); values[0] = width; values[1] = height; xcb_configure_window(wm->conn, window->frame_id, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, values); window->configure_source = NULL; weston_wm_window_schedule_repaint(window); } static void send_configure(struct weston_surface *surface, int32_t width, int32_t height) { struct weston_wm_window *window = get_wm_window(surface); struct weston_wm *wm = window->wm; struct theme *t = window->wm->theme; int vborder, hborder; if (window->decorate && !window->fullscreen) { hborder = 2 * t->width; vborder = t->titlebar_height + t->width; } else { hborder = 0; vborder = 0; } if (width > hborder) window->width = width - hborder; else window->width = 1; if (height > vborder) window->height = height - vborder; else window->height = 1; if (window->frame) frame_resize_inside(window->frame, window->width, window->height); if (window->configure_source) return; window->configure_source = wl_event_loop_add_idle(wm->server->loop, weston_wm_window_configure, window); } static const struct weston_shell_client shell_client = { send_configure }; static int legacy_fullscreen(struct weston_wm *wm, struct weston_wm_window *window, struct weston_output **output_ret) { struct weston_compositor *compositor = wm->server->compositor; struct weston_output *output; uint32_t minmax = PMinSize | PMaxSize; int matching_size; /* Heuristics for detecting legacy fullscreen windows... */ wl_list_for_each(output, &compositor->output_list, link) { if (output->x == window->x && output->y == window->y && output->width == window->width && output->height == window->height && window->override_redirect) { *output_ret = output; return 1; } matching_size = 0; if ((window->size_hints.flags & (USSize |PSize)) && window->size_hints.width == output->width && window->size_hints.height == output->height) matching_size = 1; if ((window->size_hints.flags & minmax) == minmax && window->size_hints.min_width == output->width && window->size_hints.min_height == output->height && window->size_hints.max_width == output->width && window->size_hints.max_height == output->height) matching_size = 1; if (matching_size && !window->decorate && (window->size_hints.flags & (USPosition | PPosition)) && window->size_hints.x == output->x && window->size_hints.y == output->y) { *output_ret = output; return 1; } } return 0; } static bool weston_wm_window_type_inactive(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; return window->type == wm->atom.net_wm_window_type_tooltip || window->type == wm->atom.net_wm_window_type_dropdown || window->type == wm->atom.net_wm_window_type_dnd || window->type == wm->atom.net_wm_window_type_combo || window->type == wm->atom.net_wm_window_type_popup || window->type == wm->atom.net_wm_window_type_utility; } static void xserver_map_shell_surface(struct weston_wm_window *window, struct weston_surface *surface) { struct weston_wm *wm = window->wm; struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; struct weston_output *output; struct weston_wm_window *parent; int flags = 0; weston_wm_window_read_properties(window); /* A weston_wm_window may have many different surfaces assigned * throughout its life, so we must make sure to remove the listener * from the old surface signal list. */ if (window->surface) wl_list_remove(&window->surface_destroy_listener.link); window->surface = surface; window->surface_destroy_listener.notify = surface_destroy; wl_signal_add(&window->surface->destroy_signal, &window->surface_destroy_listener); weston_wm_window_schedule_repaint(window); if (!shell_interface->create_shell_surface) return; if (!shell_interface->get_primary_view) return; if (window->surface->configure) { weston_log("warning, unexpected in %s: " "surface's configure hook is already set.\n", __func__); return; } window->shsurf = shell_interface->create_shell_surface(shell_interface->shell, window->surface, &shell_client); window->view = shell_interface->get_primary_view(shell_interface->shell, window->shsurf); if (window->name) shell_interface->set_title(window->shsurf, window->name); if (window->pid > 0) shell_interface->set_pid(window->shsurf, window->pid); if (window->fullscreen) { window->saved_width = window->width; window->saved_height = window->height; shell_interface->set_fullscreen(window->shsurf, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, NULL); return; } else if (legacy_fullscreen(wm, window, &output)) { window->fullscreen = 1; shell_interface->set_fullscreen(window->shsurf, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, output); } else if (window->override_redirect) { shell_interface->set_xwayland(window->shsurf, window->x, window->y, WL_SHELL_SURFACE_TRANSIENT_INACTIVE); } else if (window->transient_for && window->transient_for->surface) { parent = window->transient_for; if (weston_wm_window_type_inactive(window)) flags = WL_SHELL_SURFACE_TRANSIENT_INACTIVE; shell_interface->set_transient(window->shsurf, parent->surface, window->x - parent->x, window->y - parent->y, flags); } else if (weston_wm_window_is_maximized(window)) { shell_interface->set_maximized(window->shsurf); } else { if (weston_wm_window_type_inactive(window)) { shell_interface->set_xwayland(window->shsurf, window->x, window->y, WL_SHELL_SURFACE_TRANSIENT_INACTIVE); } else { shell_interface->set_toplevel(window->shsurf); } } } weston-1.9.0/xwayland/hash.h0000664000175000017500000000404412456345006012715 00000000000000/* * Copyright © 2009 Intel Corporation * Copyright © 1988-2004 Keith Packard and Bart Massey. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Except as contained in this notice, the names of the authors * or their institutions shall not be used in advertising or * otherwise to promote the sale, use or other dealings in this * Software without prior written authorization from the * authors. * * Authors: * Eric Anholt * Keith Packard */ #ifndef HASH_H #define HASH_H struct hash_table; struct hash_table *hash_table_create(void); typedef void (*hash_table_iterator_func_t)(void *element, void *data); void hash_table_destroy(struct hash_table *ht); void *hash_table_lookup(struct hash_table *ht, uint32_t hash); int hash_table_insert(struct hash_table *ht, uint32_t hash, void *data); void hash_table_remove(struct hash_table *ht, uint32_t hash); void hash_table_for_each(struct hash_table *ht, hash_table_iterator_func_t func, void *data); #endif weston-1.9.0/man/0000775000175000017500000000000012600133270010610 500000000000000weston-1.9.0/man/weston.man0000664000175000017500000002455612543150037012566 00000000000000.TH WESTON 1 "2012-11-27" "Weston __version__" .SH NAME weston \- the reference Wayland server .SH SYNOPSIS .B weston . .\" *************************************************************** .SH DESCRIPTION .B weston is the reference implementation of a Wayland server. A Wayland server is a display server, a window manager, and a compositor all in one. Weston has several backends as loadable modules: it can run on Linux KMS (kernel modesetting via DRM), as an X client, or inside another Wayland server instance. Weston supports fundamentally different graphical user interface paradigms via shell plugins. Two plugins are provided: the desktop shell, and the tablet shell. When weston is started as the first windowing system (i.e. not under X nor under another Wayland server), it should be done with the command .B weston-launch to set up proper privileged access to devices. Weston also supports X clients via .BR XWayland ", see below." . .\" *************************************************************** .SH BACKENDS .TP .I drm-backend.so The DRM backend uses Linux KMS for output and evdev devices for input. It supports multiple monitors in a unified desktop with DPMS. See .BR weston-drm (7), if installed. .TP .I wayland-backend.so The Wayland backend runs on another Wayland server, a different Weston instance, for example. Weston shows up as a single desktop window on the parent server. .TP .I x11-backend.so The X11 backend runs on an X server. Each Weston output becomes an X window. This is a cheap way to test multi-monitor support of a Wayland shell, desktop, or applications. . .\" *************************************************************** .SH SHELLS Each of these shells have its own public protocol interface for clients. This means that a client must be specifically written for a shell protocol, otherwise it will not work. .TP Desktop shell Desktop shell is like a modern X desktop environment, concentrating on traditional keyboard and mouse user interfaces and the familiar desktop-like window management. Desktop shell consists of the shell plugin .I desktop-shell.so and the special client .B weston-desktop-shell which provides the wallpaper, panel, and screen locking dialog. .TP Fullscreen shell Fullscreen shell is intended for a client that needs to take over whole outputs, often all outputs. This is primarily intended for running another compositor on Weston. The other compositor does not need to handle any platform-specifics like DRM/KMS or evdev/libinput. The shell consists only of the shell plugin .IR fullscreen-shell.so . .TP IVI-shell In-vehicle infotainment shell is a special purpose shell that exposes a GENIVI Layer Manager compatible API to controller modules, and a very simple shell protocol towards clients. IVI-shell starts with loading .IR ivi-shell.so , and then a controller module which may launch helper clients. . .\" *************************************************************** .SH XWAYLAND XWayland requires a special X.org server to be installed. This X server will connect to a Wayland server as a Wayland client, and X clients will connect to the X server. XWayland provides backwards compatibility to X applications in a Wayland stack. XWayland is activated by instructing .BR weston " to load " xwayland.so " module, see " EXAMPLES . Weston starts listening on a new X display socket, and exports it in the environment variable .BR DISPLAY . When the first X client connects, Weston launches a special X server as a Wayland client to handle the X client and all future X clients. It has also its own X window manager where cursor themes and sizes can be chosen using .BR XCURSOR_PATH and .BR XCURSOR_SIZE " environment variables. See " ENVIRONMENT . . .\" *************************************************************** .SH OPTIONS . .SS Weston core options: .TP \fB\-\^B\fR\fIbackend.so\fR, \fB\-\-backend\fR=\fIbackend.so\fR Load .I backend.so instead of the default backend. The file is searched for in .IR "__weston_modules_dir__" , or you can pass an absolute path. The default backend is .I __weston_native_backend__ unless the environment suggests otherwise, see .IR DISPLAY " and " WAYLAND_DISPLAY . .TP \fB\-\^c\fR\fIconfig.ini\fR, \fB\-\-config\fR=\fIconfig.ini\fR Load .IR config.ini " instead of " weston.ini . The argument can also be an absolute path starting with a .IR / . If the path is not absolute, it will be searched in the normal config paths, see .BR weston.ini (5). If also .B --no-config is given, no configuration file will be read. .TP .BR \-\-version Print the program version. .TP .BR \-\^h ", " \-\-help Print a summary of command line options, and quit. .TP \fB\-\^i\fR\fIN\fR, \fB\-\-idle\-time\fR=\fIN\fR Set the idle timeout to .I N seconds. The default timeout is 300 seconds. When there has not been any user input for the idle timeout, Weston enters an inactive mode. The screen fades to black, monitors may switch off, and the shell may lock the session. A value of 0 effectively disables the timeout. .TP \fB\-\-log\fR=\fIfile.log\fR Append log messages to the file .I file.log instead of writing them to stderr. .TP \fB\-\-modules\fR=\fImodule1.so,module2.so\fR Load the comma-separated list of modules. Only used by the test suite. The file is searched for in .IR "__weston_modules_dir__" , or you can pass an absolute path. .TP .BR \-\-no-config Do not read .I weston.ini for the compositor. Avoids e.g. loading compositor modules via the configuration file, which is useful for unit tests. .TP \fB\-\^S\fR\fIname\fR, \fB\-\-socket\fR=\fIname\fR Weston will listen in the Wayland socket called .IR name . Weston will export .B WAYLAND_DISPLAY with this value in the environment for all child processes to allow them to connect to the right server automatically. .SS DRM backend options: See .BR weston-drm (7). . .SS Wayland backend options: .TP \fB\-\-display\fR=\fIdisplay\fR Name of the Wayland display to connect to, see also .I WAYLAND_DISPLAY of the environment. .TP .B \-\-fullscreen Create a single fullscreen output .TP \fB\-\-output\-count\fR=\fIN\fR Create .I N Wayland windows to emulate the same number of outputs. .TP \fB\-\-width\fR=\fIW\fR, \fB\-\-height\fR=\fIH\fR Make all outputs have a size of .IR W x H " pixels." .TP .B \-\-scale\fR=\fIN\fR Give all outputs a scale factor of .I N. .TP .B \-\-use\-pixman Use the pixman renderer. By default, weston will try to use EGL and GLES2 for rendering and will fall back to the pixman-based renderer for software compositing if EGL cannot be used. Passing this option will force weston to use the pixman renderer. . .SS X11 backend options: .TP .B \-\-fullscreen .TP .B \-\-no\-input Do not provide any input devices. Used for testing input-less Weston. .TP \fB\-\-output\-count\fR=\fIN\fR Create .I N X windows to emulate the same number of outputs. .TP \fB\-\-width\fR=\fIW\fR, \fB\-\-height\fR=\fIH\fR Make the default size of each X window .IR W x H " pixels." .TP .B \-\-scale\fR=\fIN\fR Give all outputs a scale factor of .I N. .TP .B \-\-use\-pixman Use the pixman renderer. By default weston will try to use EGL and GLES2 for rendering. Passing this option will make weston use the pixman library for software compsiting. . .\" *************************************************************** .SH FILES . If the environment variable is set, the configuration file is read from the respective path, or the current directory if neither is set. .PP .BI $XDG_CONFIG_HOME /weston.ini .br .BI $HOME /.config/weston.ini .br .I ./weston.ini .br . .\" *************************************************************** .SH ENVIRONMENT . .TP .B DISPLAY The X display. If .B DISPLAY is set, and .B WAYLAND_DISPLAY is not set, the default backend becomes .IR x11-backend.so . .TP .B WAYLAND_DEBUG If set to any value, causes libwayland to print the live protocol to stderr. .TP .B WAYLAND_DISPLAY The name of the display (socket) of an already running Wayland server, without the path. The directory path is always taken from .BR XDG_RUNTIME_DIR . If .B WAYLAND_DISPLAY is not set, the socket name is "wayland-0". If .B WAYLAND_DISPLAY is already set, the default backend becomes .IR wayland-backend.so . This allows launching Weston as a nested server. .TP .B WAYLAND_SOCKET For Wayland clients, holds the file descriptor of an open local socket to a Wayland server. .TP .B WESTON_CONFIG_FILE Weston sets this variable to the absolute path of the configuration file it loads, or to the empty string if no file is used. Programs that use .I weston.ini will read the file specified by this variable instead, or do not read any file if it is empty. Unset variable causes falling back to the default name .IR weston.ini . .TP .B XCURSOR_PATH Set the list of paths to look for cursors in. It changes both libwayland-cursor and libXcursor, so it affects both Wayland and X11 based clients. See .B xcursor (3). .TP .B XCURSOR_SIZE This variable can be set for choosing an specific size of cursor. Affect Wayland and X11 clients. See .B xcursor (3). .TP .B XDG_CONFIG_HOME If set, specifies the directory where to look for .BR weston.ini . .TP .B XDG_RUNTIME_DIR The directory for Weston's socket and lock files. Wayland clients will automatically use this. . .\" *************************************************************** .SH DIAGNOSTICS Weston has a segmentation fault handler, that attempts to restore the virtual console or ungrab X before raising .BR SIGTRAP . If you run .BR weston " under " gdb (1) from an X11 terminal or a different virtual terminal, and tell gdb .IP handle SIGSEGV nostop .PP This will allow weston to switch back to gdb on crash and then gdb will catch the crash with SIGTRAP. . .\" *************************************************************** .SH BUGS Bugs should be reported to the freedesktop.org bugzilla at https://bugs.freedesktop.org with product "Wayland" and component "weston". . .\" *************************************************************** .SH WWW http://wayland.freedesktop.org/ . .\" *************************************************************** .SH EXAMPLES .IP "Launch Weston with the DRM backend on a VT" weston-launch .IP "Launch Weston with the DRM backend and XWayland support" weston-launch -- --modules=xwayland.so .IP "Launch Weston (wayland-1) nested in another Weston instance (wayland-0)" WAYLAND_DISPLAY=wayland-0 weston -Swayland-1 .IP "From an X terminal, launch Weston with the x11 backend" weston . .\" *************************************************************** .SH "SEE ALSO" .BR weston-drm (7) .\".BR weston-launch (1), .\".BR weston.ini (5) weston-1.9.0/man/weston.ini.man0000664000175000017500000003322212543150037013332 00000000000000.\" shorthand for double quote that works everywhere. .ds q \N'34' .TH weston.ini 5 "2013-01-17" "Weston __version__" .SH NAME weston.ini \- configuration file for .B Weston \- the reference Wayland compositor .SH INTRODUCTION .B Weston obtains configuration from its command line parameters and the configuration file described here. .SH DESCRIPTION .B Weston uses a configuration file called .I weston.ini for its setup. The .I weston.ini configuration file is searched for in one of the following places when the server is started: .PP .RS 4 .nf .BR "$XDG_CONFIG_HOME/weston.ini " "(if $XDG_CONFIG_HOME is set)" .BR "$HOME/.config/weston.ini " "(if $HOME is set)" .B "weston/weston.ini in each" .BR "\ \ \ \ $XDG_CONFIG_DIR " "(if $XDG_CONFIG_DIRS is set)" .BR "/etc/xdg/weston/weston.ini " "(if $XDG_CONFIG_DIRS is not set)" .BR "/weston.ini " "(if no variables were set)" .fi .RE .PP where environment variable .B $HOME is the user's home directory, and .B $XDG_CONFIG_HOME is the user specific configuration directory, and .B $XDG_CONFIG_DIRS is a colon .B ':' delimited listed of configuration base directories, such as .BR /etc/xdg-foo:/etc/xdg . .PP The .I weston.ini file is composed of a number of sections which may be present in any order, or omitted to use default configuration values. Each section has the form: .PP .RS 4 .nf .BI [ SectionHeader ] .RI Key1=Value1 .RI Key2=Value2 ... .fi .RE .PP The spaces are significant. Comment lines are ignored: .PP .RS 4 .nf .IR "#comment" .fi .RE .PP The section headers are: .PP .RS 4 .nf .BR "core " "The core modules and options" .BR "libinput " "Input device configuration" .BR "shell " "Desktop customization" .BR "launcher " "Add launcher to the panel" .BR "output " "Output configuration" .BR "input-method " "Onscreen keyboard input" .BR "keyboard " "Keyboard layouts" .BR "terminal " "Terminal application options" .BR "xwayland " "XWayland options" .BR "screen-share " "Screen sharing options" .fi .RE .PP Possible value types are string, signed and unsigned 32-bit integer, and boolean. Strings must not be quoted, do not support any escape sequences, and run till the end of the line. Integers can be given in decimal (e.g. 123), octal (e.g. 0173), and hexadecimal (e.g. 0x7b) form. Boolean values can be only 'true' or 'false'. .RE .SH "CORE SECTION" The .B core section is used to select the startup compositor modules and general options. .TP 7 .BI "shell=" desktop-shell.so specifies a shell to load (string). This can be used to load your own implemented shell or one with Weston as default. Available shells in the .IR "__weston_modules_dir__" directory are: .PP .RS 10 .nf .BR desktop-shell.so .fi .RE .TP 7 .BI "modules=" xwayland.so,cms-colord.so specifies the modules to load (string). Available modules in the .IR "__weston_modules_dir__" directory are: .PP .RS 10 .nf .BR xwayland.so .BR cms-colord.so .BR screen-share.so .fi .RE .TP 7 .BI "backend=" headless-backend.so overrides defaults backend. Available backend modules in the .IR "__weston_modules_dir__" directory are: .PP .RS 10 .nf .BR drm-backend.so .BR fbdev-backend.so .BR headless-backend.so .BR rdp-backend.so .BR rpi-backend.so .BR wayland-backend.so .BR x11-backend.so .fi .RE .TP 7 .BI "repaint-window=" N Set the approximate length of the repaint window in milliseconds. The repaint window is used to control and reduce the output latency for clients. If the window is longer than the output refresh period, the repaint will be done immediately when the previous repaint finishes, not processing client requests in between. If the repaint window is too short, the compositor may miss the target vertical blank, increasing output latency. The default value is 7 milliseconds. The allowed range is from -10 to 1000 milliseconds. Using a negative value will force the compositor to always miss the target vblank. .TP 7 .BI "gbm-format="format sets the GBM format used for the framebuffer for the GBM backend. Can be .B xrgb8888, .B xrgb2101010, .B rgb565. By default, xrgb8888 is used. .RS .PP .RE .TP 7 .BI "idle-time="seconds sets Weston's idle timeout in seconds. This idle timeout is the time after which Weston will enter an "inactive" mode and screen will fade to black. A value of 0 disables the timeout. .IR Important : This option may also be set via Weston's '-i' command line option and will take precedence over the current .ini option. This means that if both weston.ini and command line define this idle-timeout time, the one specified in the command-line will be used. On the other hand, if none of these sets the value, default idle timeout will be set to 300 seconds. .RS .SH "LIBINPUT SECTION" The .B libinput section is used to configure input devices when using the libinput input device backend. .PP Available configuration are: .TP 7 .BI "enable_tap=" true enables tap to click on touchpad devices .RS .PP .SH "SHELL SECTION" The .B shell section is used to customize the compositor. Some keys may not be handled by different shell plugins. .PP The entries that can appear in this section are: .TP 7 .BI "client=" file sets the path for the shell client to run. If not specified .I __weston_shell_client__ is launched (string). .TP 7 .BI "background-image=" file sets the path for the background image file (string). .TP 7 .BI "background-type=" tile determines how the background image is drawn (string). Can be .BR scale ", " scale-crop " or " tile " (default)." Scale means scaled to fit the output precisely, not preserving aspect ratio. Scale-crop preserves aspect ratio, scales the background image just big enough to cover the output, and centers it. The image ends up cropped from left and right, or top and bottom, if the aspect ratio does not match the output. Tile repeats the background image to fill the output. .TP 7 .BI "background-color=" 0xAARRGGBB sets the color of the background (unsigned integer). The hexadecimal digit pairs are in order alpha, red, green, and blue. .TP 7 .BI "panel-color=" 0xAARRGGBB sets the color of the panel (unsigned integer). The hexadecimal digit pairs are in order transparency, red, green, and blue. Examples: .PP .RS 10 .nf .BR "0xffff0000 " "Red" .BR "0xff00ff00 " "Green" .BR "0xff0000ff " "Blue" .BR "0x00ffffff " "Fully transparent" .fi .RE .TP 7 .BI "panel-location=" top sets the location of the panel (string). Can be .B top, .B none. .TP 7 .BI "locking=" true enables screen locking (boolean). .TP 7 .BI "animation=" zoom sets the effect used for opening new windows (string). Can be .B zoom, .B fade, .B none. By default, no animation is used. .TP 7 .BI "close-animation=" fade sets the effect used when closing windows (string). Can be .B fade, .B none. By default, the fade animation is used. .TP 7 .BI "startup-animation=" fade sets the effect used for opening new windows (string). Can be .B fade, .B none. By default, the fade animation is used. .TP 7 .BI "focus-animation=" dim-layer sets the effect used with the focused and unfocused windows. Can be .B dim-layer, .B none. By default, no animation is used. .TP 7 .BI "binding-modifier=" ctrl sets the modifier key used for common bindings (string), such as moving surfaces, resizing, rotating, switching, closing and setting the transparency for windows, controlling the backlight and zooming the desktop. Possible values: ctrl, alt, super (default) .TP 7 .BI "num-workspaces=" 6 defines the number of workspaces (unsigned integer). The user can switch workspaces by using the binding+F1, F2 keys. If this key is not set, fall back to one workspace. .TP 7 .BI "cursor-theme=" theme sets the cursor theme (string). .TP 7 .BI "cursor-size=" 24 sets the cursor size (unsigned integer). .TP 7 .BI "lockscreen-icon=" path sets the path to lock screen icon image (string). (tablet shell only) .TP 7 .BI "lockscreen=" path sets the path to lock screen background image (string). (tablet shell only) .TP 7 .BI "homescreen=" path sets the path to home screen background image (string). (tablet shell only) .RE .SH "LAUNCHER SECTION" There can be multiple launcher sections, one for each launcher. .TP 7 .BI "icon=" icon sets the path to icon image (string). Svg images are not currently supported. .TP 7 .BI "path=" program sets the path to the program that is run by clicking on this launcher (string). It is possible to pass arguments and environment variables to the program. For example: .nf .in +4n path=GDK_BACKEND=wayland gnome-terminal --full-screen .in .fi .PP .SH "OUTPUT SECTION" There can be multiple output sections, each corresponding to one output. It is currently only recognized by the drm and x11 backends. .TP 7 .BI "name=" name sets a name for the output (string). The backend uses the name to identify the output. All X11 output names start with a letter X. All Wayland output names start with the letters WL. The available output names for DRM backend are listed in the .B "weston-launch(1)" output. Examples of usage: .PP .RS 10 .nf .BR "LVDS1 " "DRM backend, Laptop internal panel no.1" .BR "VGA1 " "DRM backend, VGA connector no.1" .BR "X1 " "X11 backend, X window no.1" .BR "WL1 " "Wayland backend, Wayland window no.1" .fi .RE .RS .PP See .B "weston-drm(7)" for more details. .RE .TP 7 .BI "mode=" mode sets the output mode (string). The mode parameter is handled differently depending on the backend. On the X11 backend, it just sets the WIDTHxHEIGHT of the weston window. The DRM backend accepts different modes: .PP .RS 10 .nf .BR "WIDTHxHEIGHT " "Resolution size width and height in pixels" .BR "preferred " "Uses the preferred mode" .BR "current " "Uses the current crt controller mode" .BR "off " "Disables the output" .fi .RE .RS .PP Optionally, an user may specify a modeline, such as: .PP .nf .in +4n .nf 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync .fi .in .PP It consists of the refresh rate in Hz, horizontal and vertical resolution, options for horizontal and vertical synchronisation. The program .B "cvt(1)" can provide suitable modeline string. .RE .TP 7 .BI "transform=" normal The transformation applied to screen output (string). The transform key can be one of the following 8 strings: .PP .RS 10 .nf .BR "normal " "Normal output." .BR "90 " "90 degrees clockwise." .BR "180 " "Upside down." .BR "270 " "90 degrees counter clockwise." .BR "flipped " "Horizontally flipped" .BR "flipped-90 " "Flipped and 90 degrees clockwise" .BR "flipped-180 " "Flipped upside down" .BR "flipped-270 " "Flipped and 90 degrees counter clockwise" .fi .RE .TP 7 .BI "scale=" factor An integer, 1 by default, typically configured as 2 when needed, denoting the scale factor of the output. Applications that support it render at the appropriate scale. For other applications, weston will scale their output by this factor. .RE .RS .PP Use a value of 2 for outputs with high resolution. Such displays are often called "HiDPI" or "retina" displays. .RE .TP 7 .BI "seat=" name The logical seat name that that this output should be associated with. If this is set then the seat's input will be confined to the output that has the seat set on it. The expectation is that this functionality will be used in a multiheaded environment with a single compositor for multiple output and input configurations. The default seat is called "default" and will always be present. This seat can be constrained like any other. .RE .SH "INPUT-METHOD SECTION" .TP 7 .BI "path=" "/usr/libexec/weston-keyboard" sets the path of the on screen keyboard input method (string). .RE .RE .SH "KEYBOARD SECTION" This section contains the following keys: .TP 7 .BI "keymap_rules=" "evdev" sets the keymap rules file (string). Used to map layout and model to input device. .RE .RE .TP 7 .BI "keymap_model=" "pc105" sets the keymap model (string). See the Models section in .B "xkeyboard-config(7)." .RE .RE .TP 7 .BI "keymap_layout=" "us,de,gb" sets the comma separated list of keyboard layout codes (string). See the Layouts section in .B "xkeyboard-config(7)." .RE .RE .TP 7 .BI "keymap_variant=" "euro,,intl" sets the comma separated list of keyboard layout variants (string). The number of variants must be the same as the number of layouts above. See the Layouts section in .B "xkeyboard-config(7)." .RE .RE .TP 7 .BI "keymap_options=" "grp:alt_shift_toggle,grp_led:scroll" sets the keymap options (string). See the Options section in .B "xkeyboard-config(7)." .RE .RE .TP 7 .BI "repeat-rate=" "40" sets the rate of repeating keys in characters per second (unsigned integer) .RE .RE .TP 7 .BI "repeat-delay=" "400" sets the delay in milliseconds since key down until repeating starts (unsigned integer) .RE .RE .TP 7 .BI "numlock-on=" "false" sets the default state of the numlock on weston startup for the backends which support it. .RE .RE .SH "TERMINAL SECTION" Contains settings for the weston terminal application (weston-terminal). It allows to customize the font and shell of the command line interface. .TP 7 .BI "font=" "DejaVu Sans Mono" sets the font of the terminal (string). For a good experience it is recommended to use monospace fonts. In case the font is not found, the default one is used. .RE .RE .TP 7 .BI "font-size=" "14" sets the size of the terminal font (unsigned integer). .RE .RE .TP 7 .BI "term=" "xterm-256color" The terminal shell (string). Sets the $TERM variable. .RE .RE .SH "XWAYLAND SECTION" .TP 7 .BI "path=" "/usr/bin/Xwayland" sets the path to the xserver to run (string). .RE .RE .SH "SCREEN-SHARE SECTION" .TP 7 .BI "command=" "/usr/bin/weston --backend=rdp-backend.so \ --shell=fullscreen-shell.so --no-clients-resize" sets the command to start a fullscreen-shell server for screen sharing (string). .RE .RE .SH "SEE ALSO" .BR weston (1), .BR weston-launch (1), .BR weston-drm (7), .BR xkeyboard-config (7) weston-1.9.0/man/weston-drm.man0000664000175000017500000001023112456345006013334 00000000000000.TH WESTON-DRM 7 "2012-11-27" "Weston __version__" .SH NAME weston-drm \- the DRM backend for Weston .SH SYNOPSIS .B weston-launch .LP .B weston --backend=drm-backend.so . .\" *************************************************************** .SH DESCRIPTION The DRM backend is the native Weston backend for systems that support the Linux kernel DRM, kernel mode setting (KMS), and evdev input devices. It is the recommended backend for desktop PCs, and aims to provide the full Wayland experience with the "every frame is perfect" concept. It also relies on the Mesa GBM interface. With the DRM backend, .B weston runs without any underlying windowing system. The backend uses the Linux KMS API to detect connected monitors. Monitor hot-plugging is supported. Input devices are found automatically by .BR udev (7). Compositing happens mainly in GL\ ES\ 2, initialized through EGL. It is also possible to take advantage of hardware cursors and overlays, when they exist and are functional. Full-screen surfaces will be scanned out directly without compositing, when possible. Hardware accelerated clients are supported via EGL. The backend chooses the DRM graphics device first based on seat id. If seat identifiers are not set, it looks for the graphics device that was used in boot. If that is not found, it finally chooses the first DRM device returned by .BR udev (7). Combining multiple graphics devices are not supported yet. The DRM backend relies on .B weston-launch for managing input device access and DRM master status, so that .B weston can be run without root privileges. On switching away from the virtual terminal (VT) hosting Weston, all input devices are closed and the DRM master capability is dropped, so that other servers, including .BR Xorg (1), can run on other VTs. On switching back to Weston's VT, input devices and DRM master are re-acquired through the parent process .BR weston-launch . . .\" *************************************************************** .SH CONFIGURATION . The DRM backend uses the following entries from .BR weston.ini . .SS Section output .TP \fBname\fR=\fIconnector\fR The KMS connector name identifying the output, for instance .IR LVDS1 . .TP \fBmode\fR=\fImode\fR Specify the video mode for the output. The argument .I mode can be one of the words .BR off " to turn the output off, " .BR preferred " to use the monitor's preferred video mode, or " .BR current " to use the current video mode and avoid a mode switch." It can also be a resolution as \fIwidth\fBx\fIheight\fR, or a detailed mode line as below. .TP \fBmode\fR=\fIdotclock hdisp hsyncstart hsyncend htotal \ vdisp vsyncstart vsyncend vtotal hflag vflag\fR Use the given detailed mode line as the video mode for this output. The definition is the same as in .BR xorg.conf "(5), and " cvt (1) can generate detailed mode lines. .TP \fBtransform\fR=\fItransform\fR Transform for the output, which can be rotated in 90-degree steps and possibly flipped. Possible values are .BR normal ", " 90 ", " 180 ", " 270 ", " .BR flipped ", " flipped-90 ", " flipped-180 ", and " flipped-270 . . .\" *************************************************************** .SH OPTIONS . When the DRM backend is loaded, .B weston will understand the following additional command line options. .TP \fB\-\-connector\fR=\fIconnectorid\fR Use the connector with id number .I connectorid as the only initial output. .TP .B \-\-current\-mode By default, use the current video mode of all outputs, instead of switching to the monitor preferred mode. .TP \fB\-\-seat\fR=\fIseatid\fR Use graphics and input devices designated for seat .I seatid instead of the default seat .BR seat0 . .TP \fB\-\-tty\fR=\fIx\fR Launch Weston on tty .I x instead of using the current tty. . .\" *************************************************************** .SH ENVIRONMENT . .TP .B WESTON_TTY_FD The file descriptor (integer) of the opened tty where .B weston will run. Set by .BR weston-launch . .TP .B WESTON_LAUNCHER_SOCK The file descriptor (integer) where .B weston-launch is listening. Automatically set by .BR weston-launch . . .\" *************************************************************** .SH "SEE ALSO" .BR weston (1) .\".BR weston-launch (1), .\".BR weston.ini (5) weston-1.9.0/COPYING0000664000175000017500000000256212537627703011037 00000000000000Copyright © 2008-2012 Kristian Høgsberg Copyright © 2010-2012 Intel Corporation Copyright © 2010-2011 Benjamin Franzke Copyright © 2011-2012 Collabora, Ltd. Copyright © 2010 Red Hat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- The above is the version of the MIT "Expat" License used by X.org: http://cgit.freedesktop.org/xorg/xserver/tree/COPYING weston-1.9.0/fullscreen-shell/0000775000175000017500000000000012600133270013304 500000000000000weston-1.9.0/fullscreen-shell/fullscreen-shell.c0000664000175000017500000005574112562222573016667 00000000000000/* * Copyright © 2013 Jason Ekstrand * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "compositor.h" #include "fullscreen-shell-server-protocol.h" #include "shared/helpers.h" struct fullscreen_shell { struct wl_client *client; struct wl_listener client_destroyed; struct weston_compositor *compositor; struct weston_layer layer; struct wl_list output_list; struct wl_listener output_created_listener; struct wl_listener seat_created_listener; }; struct fs_output { struct fullscreen_shell *shell; struct wl_list link; struct weston_output *output; struct wl_listener output_destroyed; struct { struct weston_surface *surface; struct wl_listener surface_destroyed; struct wl_resource *mode_feedback; int presented_for_mode; enum _wl_fullscreen_shell_present_method method; int32_t framerate; } pending; struct weston_surface *surface; struct wl_listener surface_destroyed; struct weston_view *view; struct weston_view *black_view; struct weston_transform transform; /* matrix from x, y */ int presented_for_mode; enum _wl_fullscreen_shell_present_method method; uint32_t framerate; }; struct pointer_focus_listener { struct fullscreen_shell *shell; struct wl_listener pointer_focus; struct wl_listener seat_caps; struct wl_listener seat_destroyed; }; static void pointer_focus_changed(struct wl_listener *listener, void *data) { struct weston_pointer *pointer = data; if (pointer->focus && pointer->focus->surface->resource) weston_surface_activate(pointer->focus->surface, pointer->seat); } static void seat_caps_changed(struct wl_listener *l, void *data) { struct weston_seat *seat = data; struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct pointer_focus_listener *listener; struct fs_output *fsout; listener = container_of(l, struct pointer_focus_listener, seat_caps); /* no pointer */ if (pointer) { if (!listener->pointer_focus.link.prev) { wl_signal_add(&pointer->focus_signal, &listener->pointer_focus); } } else { if (listener->pointer_focus.link.prev) { wl_list_remove(&listener->pointer_focus.link); } } if (keyboard && keyboard->focus != NULL) { wl_list_for_each(fsout, &listener->shell->output_list, link) { if (fsout->surface) { weston_surface_activate(fsout->surface, seat); return; } } } } static void seat_destroyed(struct wl_listener *l, void *data) { struct pointer_focus_listener *listener; listener = container_of(l, struct pointer_focus_listener, seat_destroyed); free(listener); } static void seat_created(struct wl_listener *l, void *data) { struct weston_seat *seat = data; struct pointer_focus_listener *listener; listener = zalloc(sizeof *listener); if (!listener) return; listener->shell = container_of(l, struct fullscreen_shell, seat_created_listener); listener->pointer_focus.notify = pointer_focus_changed; listener->seat_caps.notify = seat_caps_changed; listener->seat_destroyed.notify = seat_destroyed; wl_signal_add(&seat->destroy_signal, &listener->seat_destroyed); wl_signal_add(&seat->updated_caps_signal, &listener->seat_caps); seat_caps_changed(&listener->seat_caps, seat); } static void black_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy) { } static struct weston_view * create_black_surface(struct weston_compositor *ec, struct fs_output *fsout, float x, float y, int w, int h) { struct weston_surface *surface = NULL; struct weston_view *view; surface = weston_surface_create(ec); if (surface == NULL) { weston_log("no memory\n"); return NULL; } view = weston_view_create(surface); if (!view) { weston_surface_destroy(surface); weston_log("no memory\n"); return NULL; } surface->configure = black_surface_configure; surface->configure_private = fsout; weston_surface_set_color(surface, 0.0f, 0.0f, 0.0f, 1.0f); pixman_region32_fini(&surface->opaque); pixman_region32_init_rect(&surface->opaque, 0, 0, w, h); pixman_region32_fini(&surface->input); pixman_region32_init_rect(&surface->input, 0, 0, w, h); weston_surface_set_size(surface, w, h); weston_view_set_position(view, x, y); return view; } static void fs_output_set_surface(struct fs_output *fsout, struct weston_surface *surface, enum _wl_fullscreen_shell_present_method method, int32_t framerate, int presented_for_mode); static void fs_output_apply_pending(struct fs_output *fsout); static void fs_output_clear_pending(struct fs_output *fsout); static void fs_output_destroy(struct fs_output *fsout) { fs_output_set_surface(fsout, NULL, 0, 0, 0); fs_output_clear_pending(fsout); wl_list_remove(&fsout->link); if (fsout->output) wl_list_remove(&fsout->output_destroyed.link); } static void output_destroyed(struct wl_listener *listener, void *data) { struct fs_output *output = container_of(listener, struct fs_output, output_destroyed); fs_output_destroy(output); } static void surface_destroyed(struct wl_listener *listener, void *data) { struct fs_output *fsout = container_of(listener, struct fs_output, surface_destroyed); fsout->surface = NULL; fsout->view = NULL; } static void pending_surface_destroyed(struct wl_listener *listener, void *data) { struct fs_output *fsout = container_of(listener, struct fs_output, pending.surface_destroyed); fsout->pending.surface = NULL; } static struct fs_output * fs_output_create(struct fullscreen_shell *shell, struct weston_output *output) { struct fs_output *fsout; fsout = zalloc(sizeof *fsout); if (!fsout) return NULL; fsout->shell = shell; wl_list_insert(&shell->output_list, &fsout->link); fsout->output = output; fsout->output_destroyed.notify = output_destroyed; wl_signal_add(&output->destroy_signal, &fsout->output_destroyed); fsout->surface_destroyed.notify = surface_destroyed; fsout->pending.surface_destroyed.notify = pending_surface_destroyed; fsout->black_view = create_black_surface(shell->compositor, fsout, output->x, output->y, output->width, output->height); weston_layer_entry_insert(&shell->layer.view_list, &fsout->black_view->layer_link); wl_list_init(&fsout->transform.link); return fsout; } static struct fs_output * fs_output_for_output(struct weston_output *output) { struct wl_listener *listener; if (!output) return NULL; listener = wl_signal_get(&output->destroy_signal, output_destroyed); return container_of(listener, struct fs_output, output_destroyed); } static void restore_output_mode(struct weston_output *output) { if (output->original_mode) weston_output_mode_switch_to_native(output); } /* * Returns the bounding box of a surface and all its sub-surfaces, * in the surface coordinates system. */ static void surface_subsurfaces_boundingbox(struct weston_surface *surface, int32_t *x, int32_t *y, int32_t *w, int32_t *h) { pixman_region32_t region; pixman_box32_t *box; struct weston_subsurface *subsurface; pixman_region32_init_rect(®ion, 0, 0, surface->width, surface->height); wl_list_for_each(subsurface, &surface->subsurface_list, parent_link) { pixman_region32_union_rect(®ion, ®ion, subsurface->position.x, subsurface->position.y, subsurface->surface->width, subsurface->surface->height); } box = pixman_region32_extents(®ion); if (x) *x = box->x1; if (y) *y = box->y1; if (w) *w = box->x2 - box->x1; if (h) *h = box->y2 - box->y1; pixman_region32_fini(®ion); } static void fs_output_center_view(struct fs_output *fsout) { int32_t surf_x, surf_y, surf_width, surf_height; float x, y; struct weston_output *output = fsout->output; surface_subsurfaces_boundingbox(fsout->view->surface, &surf_x, &surf_y, &surf_width, &surf_height); x = output->x + (output->width - surf_width) / 2 - surf_x / 2; y = output->y + (output->height - surf_height) / 2 - surf_y / 2; weston_view_set_position(fsout->view, x, y); } static void fs_output_scale_view(struct fs_output *fsout, float width, float height) { float x, y; int32_t surf_x, surf_y, surf_width, surf_height; struct weston_matrix *matrix; struct weston_view *view = fsout->view; struct weston_output *output = fsout->output; surface_subsurfaces_boundingbox(view->surface, &surf_x, &surf_y, &surf_width, &surf_height); if (output->width == surf_width && output->height == surf_height) { weston_view_set_position(view, fsout->output->x - surf_x, fsout->output->y - surf_y); } else { matrix = &fsout->transform.matrix; weston_matrix_init(matrix); weston_matrix_scale(matrix, width / surf_width, height / surf_height, 1); wl_list_remove(&fsout->transform.link); wl_list_insert(&fsout->view->geometry.transformation_list, &fsout->transform.link); x = output->x + (output->width - width) / 2 - surf_x; y = output->y + (output->height - height) / 2 - surf_y; weston_view_set_position(view, x, y); } } static void fs_output_configure(struct fs_output *fsout, struct weston_surface *surface); static void fs_output_configure_simple(struct fs_output *fsout, struct weston_surface *configured_surface) { struct weston_output *output = fsout->output; float output_aspect, surface_aspect; int32_t surf_x, surf_y, surf_width, surf_height; if (fsout->pending.surface == configured_surface) fs_output_apply_pending(fsout); assert(fsout->view); restore_output_mode(fsout->output); wl_list_remove(&fsout->transform.link); wl_list_init(&fsout->transform.link); surface_subsurfaces_boundingbox(fsout->view->surface, &surf_x, &surf_y, &surf_width, &surf_height); output_aspect = (float) output->width / (float) output->height; surface_aspect = (float) surf_width / (float) surf_height; switch (fsout->method) { case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT: case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER: fs_output_center_view(fsout); break; case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM: if (output_aspect < surface_aspect) fs_output_scale_view(fsout, output->width, output->width / surface_aspect); else fs_output_scale_view(fsout, output->height * surface_aspect, output->height); break; case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM_CROP: if (output_aspect < surface_aspect) fs_output_scale_view(fsout, output->height * surface_aspect, output->height); else fs_output_scale_view(fsout, output->width, output->width / surface_aspect); break; case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_STRETCH: fs_output_scale_view(fsout, output->width, output->height); break; default: break; } weston_view_set_position(fsout->black_view, fsout->output->x - surf_x, fsout->output->y - surf_y); weston_surface_set_size(fsout->black_view->surface, fsout->output->width, fsout->output->height); } static void fs_output_configure_for_mode(struct fs_output *fsout, struct weston_surface *configured_surface) { int32_t surf_x, surf_y, surf_width, surf_height; struct weston_mode mode; int ret; if (fsout->pending.surface != configured_surface) { /* Nothing to really reconfigure. We'll just recenter the * view in case they played with subsurfaces */ fs_output_center_view(fsout); return; } /* We have a pending surface */ surface_subsurfaces_boundingbox(fsout->pending.surface, &surf_x, &surf_y, &surf_width, &surf_height); /* The actual output mode is in physical units. We need to * transform the surface size to physical unit size by flipping ans * possibly scaling it. */ switch (fsout->output->transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_270: mode.width = surf_height * fsout->output->native_scale; mode.height = surf_width * fsout->output->native_scale; break; case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED_180: default: mode.width = surf_width * fsout->output->native_scale; mode.height = surf_height * fsout->output->native_scale; } mode.flags = 0; mode.refresh = fsout->pending.framerate; ret = weston_output_mode_switch_to_temporary(fsout->output, &mode, fsout->output->native_scale); if (ret != 0) { /* The mode switch failed. Clear the pending and * reconfigure as per normal */ if (fsout->pending.mode_feedback) { _wl_fullscreen_shell_mode_feedback_send_mode_failed( fsout->pending.mode_feedback); wl_resource_destroy(fsout->pending.mode_feedback); fsout->pending.mode_feedback = NULL; } fs_output_clear_pending(fsout); return; } if (fsout->pending.mode_feedback) { _wl_fullscreen_shell_mode_feedback_send_mode_successful( fsout->pending.mode_feedback); wl_resource_destroy(fsout->pending.mode_feedback); fsout->pending.mode_feedback = NULL; } fs_output_apply_pending(fsout); weston_view_set_position(fsout->view, fsout->output->x - surf_x, fsout->output->y - surf_y); } static void fs_output_configure(struct fs_output *fsout, struct weston_surface *surface) { if (fsout->pending.surface == surface) { if (fsout->pending.presented_for_mode) fs_output_configure_for_mode(fsout, surface); else fs_output_configure_simple(fsout, surface); } else { if (fsout->presented_for_mode) fs_output_configure_for_mode(fsout, surface); else fs_output_configure_simple(fsout, surface); } weston_output_schedule_repaint(fsout->output); } static void configure_presented_surface(struct weston_surface *surface, int32_t sx, int32_t sy) { struct fullscreen_shell *shell = surface->configure_private; struct fs_output *fsout; if (surface->configure != configure_presented_surface) return; wl_list_for_each(fsout, &shell->output_list, link) if (fsout->surface == surface || fsout->pending.surface == surface) fs_output_configure(fsout, surface); } static void fs_output_apply_pending(struct fs_output *fsout) { assert(fsout->pending.surface); if (fsout->surface && fsout->surface != fsout->pending.surface) { wl_list_remove(&fsout->surface_destroyed.link); weston_view_destroy(fsout->view); fsout->view = NULL; if (wl_list_empty(&fsout->surface->views)) { fsout->surface->configure = NULL; fsout->surface->configure_private = NULL; } fsout->surface = NULL; } fsout->method = fsout->pending.method; fsout->framerate = fsout->pending.framerate; fsout->presented_for_mode = fsout->pending.presented_for_mode; if (fsout->surface != fsout->pending.surface) { fsout->surface = fsout->pending.surface; fsout->view = weston_view_create(fsout->surface); if (!fsout->view) { weston_log("no memory\n"); return; } wl_signal_add(&fsout->surface->destroy_signal, &fsout->surface_destroyed); weston_layer_entry_insert(&fsout->shell->layer.view_list, &fsout->view->layer_link); } fs_output_clear_pending(fsout); } static void fs_output_clear_pending(struct fs_output *fsout) { if (!fsout->pending.surface) return; if (fsout->pending.mode_feedback) { _wl_fullscreen_shell_mode_feedback_send_present_cancelled( fsout->pending.mode_feedback); wl_resource_destroy(fsout->pending.mode_feedback); fsout->pending.mode_feedback = NULL; } wl_list_remove(&fsout->pending.surface_destroyed.link); fsout->pending.surface = NULL; } static void fs_output_set_surface(struct fs_output *fsout, struct weston_surface *surface, enum _wl_fullscreen_shell_present_method method, int32_t framerate, int presented_for_mode) { fs_output_clear_pending(fsout); if (surface) { if (!surface->configure) { surface->configure = configure_presented_surface; surface->configure_private = fsout->shell; } fsout->pending.surface = surface; wl_signal_add(&fsout->pending.surface->destroy_signal, &fsout->pending.surface_destroyed); fsout->pending.method = method; fsout->pending.framerate = framerate; fsout->pending.presented_for_mode = presented_for_mode; } else if (fsout->surface) { /* we clear immediately */ wl_list_remove(&fsout->surface_destroyed.link); weston_view_destroy(fsout->view); fsout->view = NULL; if (wl_list_empty(&fsout->surface->views)) { fsout->surface->configure = NULL; fsout->surface->configure_private = NULL; } fsout->surface = NULL; weston_output_schedule_repaint(fsout->output); } } static void fullscreen_shell_release(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void fullscreen_shell_present_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_res, uint32_t method, struct wl_resource *output_res) { struct fullscreen_shell *shell = wl_resource_get_user_data(resource); struct weston_output *output; struct weston_surface *surface; struct weston_seat *seat; struct fs_output *fsout; surface = surface_res ? wl_resource_get_user_data(surface_res) : NULL; switch(method) { case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT: case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER: case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM: case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM_CROP: case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_STRETCH: break; default: wl_resource_post_error(resource, _WL_FULLSCREEN_SHELL_ERROR_INVALID_METHOD, "Invalid presentation method"); } if (output_res) { output = wl_resource_get_user_data(output_res); fsout = fs_output_for_output(output); fs_output_set_surface(fsout, surface, method, 0, 0); } else { wl_list_for_each(fsout, &shell->output_list, link) fs_output_set_surface(fsout, surface, method, 0, 0); } if (surface) { wl_list_for_each(seat, &shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (keyboard && !keyboard->focus) weston_surface_activate(surface, seat); } } } static void mode_feedback_destroyed(struct wl_resource *resource) { struct fs_output *fsout = wl_resource_get_user_data(resource); fsout->pending.mode_feedback = NULL; } static void fullscreen_shell_present_surface_for_mode(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_res, struct wl_resource *output_res, int32_t framerate, uint32_t feedback_id) { struct fullscreen_shell *shell = wl_resource_get_user_data(resource); struct weston_output *output; struct weston_surface *surface; struct weston_seat *seat; struct fs_output *fsout; output = wl_resource_get_user_data(output_res); fsout = fs_output_for_output(output); if (surface_res == NULL) { fs_output_set_surface(fsout, NULL, 0, 0, 0); return; } surface = wl_resource_get_user_data(surface_res); fs_output_set_surface(fsout, surface, 0, framerate, 1); fsout->pending.mode_feedback = wl_resource_create(client, &_wl_fullscreen_shell_mode_feedback_interface, 1, feedback_id); wl_resource_set_implementation(fsout->pending.mode_feedback, NULL, fsout, mode_feedback_destroyed); wl_list_for_each(seat, &shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (keyboard && !keyboard->focus) weston_surface_activate(surface, seat); } } struct _wl_fullscreen_shell_interface fullscreen_shell_implementation = { fullscreen_shell_release, fullscreen_shell_present_surface, fullscreen_shell_present_surface_for_mode, }; static void output_created(struct wl_listener *listener, void *data) { struct fullscreen_shell *shell; shell = container_of(listener, struct fullscreen_shell, output_created_listener); fs_output_create(shell, data); } static void client_destroyed(struct wl_listener *listener, void *data) { struct fullscreen_shell *shell = container_of(listener, struct fullscreen_shell, client_destroyed); shell->client = NULL; } static void bind_fullscreen_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct fullscreen_shell *shell = data; struct wl_resource *resource; if (shell->client != NULL && shell->client != client) return; else if (shell->client == NULL) { shell->client = client; wl_client_add_destroy_listener(client, &shell->client_destroyed); } resource = wl_resource_create(client, &_wl_fullscreen_shell_interface, 1, id); wl_resource_set_implementation(resource, &fullscreen_shell_implementation, shell, NULL); if (shell->compositor->capabilities & WESTON_CAP_CURSOR_PLANE) _wl_fullscreen_shell_send_capability(resource, _WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE); if (shell->compositor->capabilities & WESTON_CAP_ARBITRARY_MODES) _wl_fullscreen_shell_send_capability(resource, _WL_FULLSCREEN_SHELL_CAPABILITY_ARBITRARY_MODES); } WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct fullscreen_shell *shell; struct weston_seat *seat; struct weston_output *output; shell = zalloc(sizeof *shell); if (shell == NULL) return -1; shell->compositor = compositor; shell->client_destroyed.notify = client_destroyed; weston_layer_init(&shell->layer, &compositor->cursor_layer.link); wl_list_init(&shell->output_list); shell->output_created_listener.notify = output_created; wl_signal_add(&compositor->output_created_signal, &shell->output_created_listener); wl_list_for_each(output, &compositor->output_list, link) fs_output_create(shell, output); shell->seat_created_listener.notify = seat_created; wl_signal_add(&compositor->seat_created_signal, &shell->seat_created_listener); wl_list_for_each(seat, &compositor->seat_list, link) seat_created(NULL, seat); wl_global_create(compositor->wl_display, &_wl_fullscreen_shell_interface, 1, shell, bind_fullscreen_shell); return 0; } weston-1.9.0/aclocal.m40000664000175000017500000013515712600132777011644 00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) weston-1.9.0/tests/0000775000175000017500000000000012600133270011177 500000000000000weston-1.9.0/tests/weston-test-runner.c0000664000175000017500000001155012537627703015112 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "weston-test-runner.h" #define SKIP 77 char __attribute__((weak)) *server_parameters=""; extern const struct weston_test __start_test_section, __stop_test_section; static const struct weston_test * find_test(const char *name) { const struct weston_test *t; for (t = &__start_test_section; t < &__stop_test_section; t++) if (strcmp(t->name, name) == 0) return t; return NULL; } static void run_test(const struct weston_test *t, void *data) { t->run(data); exit(EXIT_SUCCESS); } static void list_tests(void) { const struct weston_test *t; fprintf(stderr, "Available test names:\n"); for (t = &__start_test_section; t < &__stop_test_section; t++) fprintf(stderr, " %s\n", t->name); } static int exec_and_report_test(const struct weston_test *t, void *test_data, int iteration) { int success = 0; int skip = 0; int hardfail = 0; siginfo_t info; pid_t pid = fork(); assert(pid >= 0); if (pid == 0) run_test(t, test_data); /* never returns */ if (waitid(P_ALL, 0, &info, WEXITED)) { fprintf(stderr, "waitid failed: %m\n"); abort(); } if (test_data) fprintf(stderr, "test \"%s/%i\":\t", t->name, iteration); else fprintf(stderr, "test \"%s\":\t", t->name); switch (info.si_code) { case CLD_EXITED: fprintf(stderr, "exit status %d", info.si_status); if (info.si_status == EXIT_SUCCESS) success = 1; else if (info.si_status == SKIP) skip = 1; break; case CLD_KILLED: case CLD_DUMPED: fprintf(stderr, "signal %d", info.si_status); if (info.si_status != SIGABRT) hardfail = 1; break; } if (t->must_fail) success = !success; if (success && !hardfail) { fprintf(stderr, ", pass.\n"); return 1; } else if (skip) { fprintf(stderr, ", skip.\n"); return SKIP; } else { fprintf(stderr, ", fail.\n"); return 0; } } /* Returns number of tests and number of pass / fail in param args */ static int iterate_test(const struct weston_test *t, int *passed, int *skipped) { int ret, i; void *current_test_data = (void *) t->table_data; for (i = 0; i < t->n_elements; ++i, current_test_data += t->element_size) { ret = exec_and_report_test(t, current_test_data, i); if (ret == SKIP) ++(*skipped); else if (ret) ++(*passed); } return t->n_elements; } int main(int argc, char *argv[]) { const struct weston_test *t; int total = 0; int pass = 0; int skip = 0; if (argc == 2) { const char *testname = argv[1]; if (strcmp(testname, "--help") == 0 || strcmp(testname, "-h") == 0) { fprintf(stderr, "Usage: %s [test-name]\n", program_invocation_short_name); list_tests(); exit(EXIT_SUCCESS); } if (strcmp(testname, "--params") == 0 || strcmp(testname, "-p") == 0) { printf("%s", server_parameters); exit(EXIT_SUCCESS); } t = find_test(argv[1]); if (t == NULL) { fprintf(stderr, "unknown test: \"%s\"\n", argv[1]); list_tests(); exit(EXIT_FAILURE); } int number_passed_in_test = 0, number_skipped_in_test = 0; total += iterate_test(t, &number_passed_in_test, &number_skipped_in_test); pass += number_passed_in_test; skip += number_skipped_in_test; } else { for (t = &__start_test_section; t < &__stop_test_section; t++) { int number_passed_in_test = 0, number_skipped_in_test = 0; total += iterate_test(t, &number_passed_in_test, &number_skipped_in_test); pass += number_passed_in_test; skip += number_skipped_in_test; } } fprintf(stderr, "%d tests, %d pass, %d skip, %d fail\n", total, pass, skip, total - pass - skip); if (skip == total) return SKIP; else if (pass + skip == total) return EXIT_SUCCESS; return EXIT_FAILURE; } weston-1.9.0/tests/reference/0000775000175000017500000000000012600133270013135 500000000000000weston-1.9.0/tests/reference/internal-screenshot-good-00.png0000664000175000017500000000171212531203521020716 00000000000000PNG  IHDR@q-kbKGDIDATx1j1A [ρÁmU0@uXd72-Yb?Mc5&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&10Fcc`lLi#1Mc06 `4ؘ&1C(->fIENDB`weston-1.9.0/tests/reference/internal-screenshot-bad-00.png0000664000175000017500000001203512531203521020514 00000000000000PNG  IHDR@O*<bKGDIDATxy\UuY~Ut0$W4ǥL-%IK[ƴrm&'3YjHLdqqI\X] ̼sϹ/urj&No C!`ѵCˆu~p504) %bAE~!rcϷ ?V㸞11uXDEQ FicrQ>y㢻E\'O̦hp8NHޟn>z=wzCjU)S&LfZl~vN:׳ճv7jx}A`0\8?c'4oڸ,/g.7fr_)6q/xٯT~g76!S^ؾ^Ug.NOqCd7^Un]~ā䲼qΊx†U3nN#jܰcW|a#m^Nf}[:d5ǭ,/CYi oNj2-ϚV$˕+B5ذaϵ`Uk31dIn$_q{?xAC#qy5߻o6m:v=&꿲[5:uȑ0h4%U n{}Fh4,fbZmv{:uLᅋ{R$7cGԃI;Sף[*ё3z^h8I%>c˨q1L ߝ7^}bvNα4Me=ԧNIIa,2ᾉVdN_M߭O5"TQbmVj~f97O͞4n"ycS'ǻbc6})-3rr 71濻y;ys$N;3*yݱH\jY}06nY=Y9rξ6ڵv<}6ȵjc5 uf)_}B̔ɓV`~z9V/D4,6.6d iRfgi6$8(y1wy0|>_3zqD<5*)urD}$Iϟw\n lXx^mk`ɧ1M*Ax=(z$1Bf)陽cbrZ}OlQ|hrwi3x"`0U]<71qܽ0/c,9m$+A}mWN s<{)N?9/V;q͒2N8fkYu(66WSbGy1{ρV[{{Z4=Ⱦ  ~o}s4';2:w]Կ]h6mډMMx8NRU>`u)s`C//P-gZWAA/(yL("I,_̿pvJI\lS1gSn/1c[vf4M> ,[x}fُpKS&m|wCMiQ}*]v*]*.-+п5[CޙZ[|'MM6=~KNy]YÇjۦU||~UO'lXknږޡ]ۧFxc<} -7Wxުk٬͛67nܸ]D[[/;nDȺ EEc1=_}aONrWT8;.p56xڙ_hZs^ݻ3v5g]h$$I$)*LSj*"K$$k*9}h,**:sT4Zc2[-ñwOf?Xs&+q5?{a﬷yȱ{v֢Yj}UT8K=eՃ,c&N?q05aêe+׸ݿ%(/Ns횕5mLbRS^?9bԸ==FA ߾3g=С{sgPԄ c/N ~f]b鉛S֏{bȌA]:w p/L8^ &$+S[jtѫ\nz=Ԯasg#uX_sƞ uXjCU 8A Gjyq[W}yWqEU| _i) {'fSUj/R5kONOEMS8N0 \)464XgnYS&?kzoVU-/V&߯<^%Uh ;6=ԧ_xjW*>Wu\M~!gN}kc.8t8) {"qLF[POZmTE4xFwlyAӴfNQ_| }SϚn՚_´vk`x[6fIShHOhY17A{h[^~Y{ p4i^_܀-,c_84W~x >vPsُ p;p q/yXf8 p90q7/$+%a0 @ L+2gK8C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ Cwz(ٝ22M#0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @x7#wz~G`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ C!`0a0 @ ?eI*ŪIENDB`weston-1.9.0/tests/internal-screenshot.ini0000664000175000017500000000007312527750600015621 00000000000000[shell] startup-animation=none background-color=0xCC336699 weston-1.9.0/tests/ivi-shell-app-test.c0000664000175000017500000000421512537627703014736 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "weston-test-client-helper.h" #include "ivi-application-client-protocol.h" static struct ivi_application * get_ivi_application(struct client *client) { struct global *g; struct global *global_iviapp = NULL; static struct ivi_application *iviapp; if (iviapp) return iviapp; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "ivi_application")) continue; if (global_iviapp) assert(0 && "multiple ivi_application objects"); global_iviapp = g; } assert(global_iviapp && "no ivi_application found"); assert(global_iviapp->version == 1); iviapp = wl_registry_bind(client->wl_registry, global_iviapp->name, &ivi_application_interface, 1); assert(iviapp); return iviapp; } TEST(ivi_application_exists) { struct client *client; struct ivi_application *iviapp; client = create_client(); iviapp = get_ivi_application(client); client_roundtrip(client); printf("Successful bind: %p\n", iviapp); } weston-1.9.0/tests/keyboard-test.c0000664000175000017500000000445312561200202014042 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "weston-test-client-helper.h" TEST(simple_keyboard_test) { struct client *client; struct surface *expect_focus = NULL; struct keyboard *keyboard; uint32_t expect_key = 0; uint32_t expect_state = 0; client = create_client_and_test_surface(10, 10, 1, 1); assert(client); keyboard = client->input->keyboard; while (1) { assert(keyboard->key == expect_key); assert(keyboard->state == expect_state); assert(keyboard->focus == expect_focus); if (keyboard->state == WL_KEYBOARD_KEY_STATE_PRESSED) { expect_state = WL_KEYBOARD_KEY_STATE_RELEASED; weston_test_send_key(client->test->weston_test, expect_key, expect_state); } else if (keyboard->focus) { expect_focus = NULL; weston_test_activate_surface( client->test->weston_test, NULL); } else if (expect_key < 10) { expect_key++; expect_focus = client->surface; expect_state = WL_KEYBOARD_KEY_STATE_PRESSED; weston_test_activate_surface( client->test->weston_test, expect_focus->wl_surface); weston_test_send_key(client->test->weston_test, expect_key, expect_state); } else { break; } client_roundtrip(client); } } weston-1.9.0/tests/devices-test.c0000664000175000017500000002323712537627703013713 00000000000000/* * Copyright © 2015 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include "weston-test-client-helper.h" /** * Test (un)plugging devices * * At the end of each test we must return Weston to the previous state * (add all removed devices and remove extra devices), so that * the environment is prepared for the other tests too */ #define WL_SEAT_CAPABILITY_ALL (WL_SEAT_CAPABILITY_KEYBOARD |\ WL_SEAT_CAPABILITY_POINTER |\ WL_SEAT_CAPABILITY_TOUCH) /* simply test if weston sends the right capabilities when * some devices are removed */ TEST(seat_capabilities_test) { struct client *cl = create_client_and_test_surface(100, 100, 100, 100); assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); assert(cl->input->pointer); weston_test_device_release(cl->test->weston_test, "pointer"); client_roundtrip(cl); assert(!cl->input->pointer); assert(!(cl->input->caps & WL_SEAT_CAPABILITY_POINTER)); assert(cl->input->keyboard); weston_test_device_release(cl->test->weston_test, "keyboard"); client_roundtrip(cl); assert(!cl->input->keyboard); assert(!(cl->input->caps & WL_SEAT_CAPABILITY_KEYBOARD)); assert(cl->input->touch); weston_test_device_release(cl->test->weston_test, "touch"); client_roundtrip(cl); assert(!cl->input->touch); assert(!(cl->input->caps & WL_SEAT_CAPABILITY_TOUCH)); /* restore previous state */ weston_test_device_add(cl->test->weston_test, "keyboard"); weston_test_device_add(cl->test->weston_test, "pointer"); weston_test_device_add(cl->test->weston_test, "touch"); client_roundtrip(cl); assert(cl->input->pointer); assert(cl->input->keyboard); assert(cl->input->touch); /* add extra devices */ weston_test_device_add(cl->test->weston_test, "keyboard"); weston_test_device_add(cl->test->weston_test, "pointer"); weston_test_device_add(cl->test->weston_test, "touch"); client_roundtrip(cl); /* remove extra devices */ weston_test_device_release(cl->test->weston_test, "keyboard"); weston_test_device_release(cl->test->weston_test, "pointer"); weston_test_device_release(cl->test->weston_test, "touch"); client_roundtrip(cl); /* we still should have all the capabilities, since the devices * were doubled */ assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); assert(cl->input->pointer); assert(cl->input->keyboard); assert(cl->input->touch); } #define COUNT 15 TEST(multiple_device_add_and_remove) { int i; struct client *cl = create_client_and_test_surface(100, 100, 100, 100); /* add device a lot of times */ for (i = 0; i < COUNT; ++i) { weston_test_device_add(cl->test->weston_test, "keyboard"); weston_test_device_add(cl->test->weston_test, "pointer"); weston_test_device_add(cl->test->weston_test, "touch"); } client_roundtrip(cl); assert(cl->input->pointer); assert(cl->input->keyboard); assert(cl->input->touch); assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); /* release all new devices */ for (i = 0; i < COUNT; ++i) { weston_test_device_release(cl->test->weston_test, "keyboard"); weston_test_device_release(cl->test->weston_test, "pointer"); weston_test_device_release(cl->test->weston_test, "touch"); } client_roundtrip(cl); /* there is still one from each device left */ assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); assert(cl->input->pointer); assert(cl->input->keyboard); assert(cl->input->touch); } TEST(device_release_before_destroy) { struct client *cl = create_client_and_test_surface(100, 100, 100, 100); /* we can release pointer when we won't be using it anymore. * Do it and see what happens if the device is destroyed * right after that */ wl_pointer_release(cl->input->pointer->wl_pointer); /* we must free and set to NULL the structures, otherwise * seat capabilities will double-free them */ free(cl->input->pointer); cl->input->pointer = NULL; wl_keyboard_release(cl->input->keyboard->wl_keyboard); free(cl->input->keyboard); cl->input->keyboard = NULL; wl_touch_release(cl->input->touch->wl_touch); free(cl->input->touch); cl->input->touch = NULL; weston_test_device_release(cl->test->weston_test, "pointer"); weston_test_device_release(cl->test->weston_test, "keyboard"); weston_test_device_release(cl->test->weston_test, "touch"); client_roundtrip(cl); assert(cl->input->caps == 0); /* restore previous state */ weston_test_device_add(cl->test->weston_test, "pointer"); weston_test_device_add(cl->test->weston_test, "keyboard"); weston_test_device_add(cl->test->weston_test, "touch"); client_roundtrip(cl); assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); } TEST(device_release_before_destroy_multiple) { int i; /* if weston crashed during this test, then there is * some inconsistency */ for (i = 0; i < 30; ++i) { /* Fifty times run the previous test. This will create * fifty clients, because we don't have any * way how to destroy them (worth of adding!). Only one * client will run at a time though and so should have no * effect on the result of the test (after the client * finishes its body, it just 'is' and does nothing). */ device_release_before_destroy(); } } /* normal work-flow test */ TEST(device_release_after_destroy) { struct client *cl = create_client_and_test_surface(100, 100, 100, 100); weston_test_device_release(cl->test->weston_test, "pointer"); wl_pointer_release(cl->input->pointer->wl_pointer); /* we must free the memory manually, otherwise seat.capabilities * will try to free it and will use invalid proxy */ free(cl->input->pointer); cl->input->pointer = NULL; client_roundtrip(cl); weston_test_device_release(cl->test->weston_test, "keyboard"); wl_keyboard_release(cl->input->keyboard->wl_keyboard); free(cl->input->keyboard); cl->input->keyboard = NULL; client_roundtrip(cl); weston_test_device_release(cl->test->weston_test, "touch"); wl_touch_release(cl->input->touch->wl_touch); free(cl->input->touch); cl->input->touch = NULL; client_roundtrip(cl); assert(cl->input->caps == 0); /* restore previous state */ weston_test_device_add(cl->test->weston_test, "pointer"); weston_test_device_add(cl->test->weston_test, "keyboard"); weston_test_device_add(cl->test->weston_test, "touch"); client_roundtrip(cl); assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); } TEST(device_release_after_destroy_multiple) { int i; /* if weston crashed during this test, then there is * some inconsistency */ for (i = 0; i < 30; ++i) { device_release_after_destroy(); } } /* see https://bugzilla.gnome.org/show_bug.cgi?id=745008 * It is a mutter bug, but highly relevant. Weston does not * suffer from this bug atm, but it is worth of testing. */ TEST(get_device_after_destroy) { struct client *cl = create_client_and_test_surface(100, 100, 100, 100); struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; /* There's a race: * 1) compositor destroyes device * 2) client asks for the device, because it has not got * new capabilities yet * 3) compositor gets request with new_id for destroyed device * 4) client uses the new_id * 5) client gets new capabilities, destroying the objects * * If compositor just bail out in step 3) and does not create * resource, then client gets error in step 4) - even though * it followed the protocol (it just didn't know about new * capabilities). * * This test simulates this situation */ /* connection is buffered, so after calling client_roundtrip(), * this whole batch will be delivered to compositor and will * exactly simulate our situation */ weston_test_device_release(cl->test->weston_test, "pointer"); wl_pointer = wl_seat_get_pointer(cl->input->wl_seat); assert(wl_pointer); /* this should be ignored */ wl_pointer_set_cursor(wl_pointer, 0, NULL, 0, 0); /* this should not be ignored */ wl_pointer_release(wl_pointer); client_roundtrip(cl); weston_test_device_release(cl->test->weston_test, "keyboard"); wl_keyboard = wl_seat_get_keyboard(cl->input->wl_seat); assert(wl_keyboard); wl_keyboard_release(wl_keyboard); client_roundtrip(cl); weston_test_device_release(cl->test->weston_test, "touch"); wl_touch = wl_seat_get_touch(cl->input->wl_seat); assert(wl_touch); wl_touch_release(wl_touch); client_roundtrip(cl); /* get weston to the previous state */ weston_test_device_add(cl->test->weston_test, "pointer"); weston_test_device_add(cl->test->weston_test, "keyboard"); weston_test_device_add(cl->test->weston_test, "touch"); client_roundtrip(cl); assert(cl->input->caps == WL_SEAT_CAPABILITY_ALL); } TEST(get_device_after_destroy_multiple) { int i; /* if weston crashed during this test, then there is * some inconsistency */ for (i = 0; i < 30; ++i) { get_device_after_destroy(); } } weston-1.9.0/tests/weston-test-client-helper.h0000664000175000017500000001141012560760452016327 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_TEST_CLIENT_HELPER_H_ #define _WESTON_TEST_CLIENT_HELPER_H_ #include "config.h" #include #include #include #include "weston-test-runner.h" #include "weston-test-client-protocol.h" struct client { struct wl_display *wl_display; struct wl_registry *wl_registry; struct wl_compositor *wl_compositor; struct wl_shm *wl_shm; struct test *test; /* the seat that is actually used for input events */ struct input *input; /* server can have more wl_seats. We need keep them all until we * find the one that we need. After that, the others * will be destroyed, so this list will have the length of 1. * If some day in the future we will need the other seats, * we can just keep them here. */ struct wl_list inputs; struct output *output; struct surface *surface; int has_argb; struct wl_list global_list; bool has_wl_drm; }; struct global { uint32_t name; char *interface; uint32_t version; struct wl_list link; }; struct test { struct weston_test *weston_test; int pointer_x; int pointer_y; uint32_t n_egl_buffers; int buffer_copy_done; }; struct input { struct wl_seat *wl_seat; struct pointer *pointer; struct keyboard *keyboard; struct touch *touch; char *seat_name; enum wl_seat_capability caps; struct wl_list link; }; struct pointer { struct wl_pointer *wl_pointer; struct surface *focus; int x; int y; uint32_t button; uint32_t state; }; struct keyboard { struct wl_keyboard *wl_keyboard; struct surface *focus; uint32_t key; uint32_t state; uint32_t mods_depressed; uint32_t mods_latched; uint32_t mods_locked; uint32_t group; struct { int rate; int delay; } repeat_info; }; struct touch { struct wl_touch *wl_touch; int down_x; int down_y; int x; int y; int id; int up_id; /* id of last wl_touch.up event */ int frame_no; int cancel_no; }; struct output { struct wl_output *wl_output; int x; int y; int width; int height; int scale; int initialized; }; struct surface { struct wl_surface *wl_surface; struct wl_buffer *wl_buffer; struct output *output; int x; int y; int width; int height; void *data; }; struct rectangle { int x; int y; int width; int height; }; void * fail_on_null(void *p); static inline void * xzalloc(size_t s) { return fail_on_null(calloc(1, s)); } static inline void * xmalloc(size_t s) { return fail_on_null(malloc(s)); } struct client * create_client(void); struct client * create_client_and_test_surface(int x, int y, int width, int height); struct wl_buffer * create_shm_buffer(struct client *client, int width, int height, void **pixels); int surface_contains(struct surface *surface, int x, int y); void move_client(struct client *client, int x, int y); #define client_roundtrip(c) do { \ assert(wl_display_roundtrip((c)->wl_display) >= 0); \ } while (0) struct wl_callback * frame_callback_set(struct wl_surface *surface, int *done); int frame_callback_wait_nofail(struct client *client, int *done); #define frame_callback_wait(c, d) assert(frame_callback_wait_nofail((c), (d))) int get_n_egl_buffers(struct client *client); void skip(const char *fmt, ...); void expect_protocol_error(struct client *client, const struct wl_interface *intf, uint32_t code); char* screenshot_output_filename(const char *basename, uint32_t seq); char* screenshot_reference_filename(const char *basename, uint32_t seq); bool check_surfaces_geometry(const struct surface *a, const struct surface *b); bool check_surfaces_equal(const struct surface *a, const struct surface *b); bool check_surfaces_match_in_clip(const struct surface *a, const struct surface *b, const struct rectangle *clip); #endif weston-1.9.0/tests/setbacklight.c0000664000175000017500000001171412537627703013755 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Author: Tiago Vignatti */ /* * \file setbacklight.c * Test program to get a backlight connector and set its brightness value. * Queries for the connectors id can be performed using drm/tests/modeprint * program. */ #include "config.h" #include #include #include #include #include #include #include "libbacklight.h" static uint32_t get_drm_connector_type(struct udev_device *drm_device, uint32_t connector_id) { const char *filename; int fd, i, connector_type; drmModeResPtr res; drmModeConnectorPtr connector; filename = udev_device_get_devnode(drm_device); fd = open(filename, O_RDWR | O_CLOEXEC); if (fd < 0) { printf("couldn't open drm_device\n"); return -1; } res = drmModeGetResources(fd); if (res == 0) { printf("Failed to get resources from card\n"); close(fd); return -1; } for (i = 0; i < res->count_connectors; i++) { connector = drmModeGetConnector(fd, res->connectors[i]); if (!connector) continue; if ((connector->connection == DRM_MODE_DISCONNECTED) || (connector->connector_id != connector_id)) { drmModeFreeConnector(connector); continue; } connector_type = connector->connector_type; drmModeFreeConnector(connector); drmModeFreeResources(res); close(fd); return connector_type; } close(fd); drmModeFreeResources(res); return -1; } /* returns a value between 0-255 range, where higher is brighter */ static uint32_t get_normalized_backlight(struct backlight *backlight) { long brightness, max_brightness; long norm; brightness = backlight_get_brightness(backlight); max_brightness = backlight_get_max_brightness(backlight); /* convert it to a scale of 0 to 255 */ norm = (brightness * 255)/(max_brightness); return (int) norm; } static void set_backlight(struct udev_device *drm_device, int connector_id, int blight) { int connector_type; long max_brightness, brightness, actual_brightness; struct backlight *backlight; long new_blight; connector_type = get_drm_connector_type(drm_device, connector_id); if (connector_type < 0) return; backlight = backlight_init(drm_device, connector_type); if (!backlight) { printf("backlight adjust failed\n"); return; } max_brightness = backlight_get_max_brightness(backlight); printf("Max backlight: %ld\n", max_brightness); brightness = backlight_get_brightness(backlight); printf("Cached backlight: %ld\n", brightness); actual_brightness = backlight_get_actual_brightness(backlight); printf("Hardware backlight: %ld\n", actual_brightness); printf("normalized current brightness: %d\n", get_normalized_backlight(backlight)); /* denormalized value */ new_blight = (blight * max_brightness) / 255; backlight_set_brightness(backlight, new_blight); printf("Setting brightness to: %ld (norm: %d)\n", new_blight, blight); backlight_destroy(backlight); } int main(int argc, char **argv) { int blight, connector_id; const char *path; struct udev *udev; struct udev_enumerate *e; struct udev_list_entry *entry; struct udev_device *drm_device; if (argc < 3) { printf("Please add connector_id and brightness values from 0-255\n"); return 1; } connector_id = atoi(argv[1]); blight = atoi(argv[2]); udev = udev_new(); if (udev == NULL) { printf("failed to initialize udev context\n"); return 1; } e = udev_enumerate_new(udev); udev_enumerate_add_match_subsystem(e, "drm"); udev_enumerate_add_match_sysname(e, "card[0-9]*"); udev_enumerate_scan_devices(e); drm_device = NULL; udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { path = udev_list_entry_get_name(entry); drm_device = udev_device_new_from_syspath(udev, path); break; } if (drm_device == NULL) { printf("no drm device found\n"); return 1; } set_backlight(drm_device, connector_id, blight); udev_device_unref(drm_device); return 0; } weston-1.9.0/tests/roles-test.c0000664000175000017500000000731412537627703013413 00000000000000/* * Copyright © 2014 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include "weston-test-client-helper.h" static struct wl_subcompositor * get_subcompositor(struct client *client) { struct global *g; struct global *global_sub = NULL; struct wl_subcompositor *sub; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "wl_subcompositor")) continue; if (global_sub) assert(0 && "multiple wl_subcompositor objects"); global_sub = g; } assert(global_sub && "no wl_subcompositor found"); assert(global_sub->version == 1); sub = wl_registry_bind(client->wl_registry, global_sub->name, &wl_subcompositor_interface, 1); assert(sub); return sub; } static struct wl_shell * get_wl_shell(struct client *client) { struct global *g; struct global *global = NULL; struct wl_shell *shell; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "wl_shell")) continue; if (global) assert(0 && "multiple wl_shell objects"); global = g; } assert(global && "no wl_shell found"); shell = wl_registry_bind(client->wl_registry, global->name, &wl_shell_interface, 1); assert(shell); return shell; } TEST(test_role_conflict_sub_wlshell) { struct client *client; struct wl_subcompositor *subco; struct wl_surface *child; struct wl_subsurface *sub; struct wl_shell *shell; struct wl_shell_surface *shsurf; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); subco = get_subcompositor(client); shell = get_wl_shell(client); child = wl_compositor_create_surface(client->wl_compositor); assert(child); sub = wl_subcompositor_get_subsurface(subco, child, client->surface->wl_surface); assert(sub); shsurf = wl_shell_get_shell_surface(shell, child); assert(shsurf); expect_protocol_error(client, &wl_shell_interface, WL_SHELL_ERROR_ROLE); } TEST(test_role_conflict_wlshell_sub) { struct client *client; struct wl_subcompositor *subco; struct wl_surface *child; struct wl_subsurface *sub; struct wl_shell *shell; struct wl_shell_surface *shsurf; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); subco = get_subcompositor(client); shell = get_wl_shell(client); child = wl_compositor_create_surface(client->wl_compositor); assert(child); shsurf = wl_shell_get_shell_surface(shell, child); assert(shsurf); sub = wl_subcompositor_get_subsurface(subco, child, client->surface->wl_surface); assert(sub); expect_protocol_error(client, &wl_subcompositor_interface, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE); } weston-1.9.0/tests/matrix-test.c0000664000175000017500000002154012537664635013575 00000000000000/* * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "shared/matrix.h" struct inverse_matrix { double LU[16]; /* column-major */ unsigned perm[4]; /* permutation */ }; static struct timespec begin_time; static void reset_timer(void) { clock_gettime(CLOCK_MONOTONIC, &begin_time); } static double read_timer(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return (double)(t.tv_sec - begin_time.tv_sec) + 1e-9 * (t.tv_nsec - begin_time.tv_nsec); } static double det3x3(const float *c0, const float *c1, const float *c2) { return (double) c0[0] * c1[1] * c2[2] + c1[0] * c2[1] * c0[2] + c2[0] * c0[1] * c1[2] - c0[2] * c1[1] * c2[0] - c1[2] * c2[1] * c0[0] - c2[2] * c0[1] * c1[0]; } static double determinant(const struct weston_matrix *m) { double det = 0; #if 1 /* develop on last row */ det -= m->d[3 + 0 * 4] * det3x3(&m->d[4], &m->d[8], &m->d[12]); det += m->d[3 + 1 * 4] * det3x3(&m->d[0], &m->d[8], &m->d[12]); det -= m->d[3 + 2 * 4] * det3x3(&m->d[0], &m->d[4], &m->d[12]); det += m->d[3 + 3 * 4] * det3x3(&m->d[0], &m->d[4], &m->d[8]); #else /* develop on first row */ det += m->d[0 + 0 * 4] * det3x3(&m->d[5], &m->d[9], &m->d[13]); det -= m->d[0 + 1 * 4] * det3x3(&m->d[1], &m->d[9], &m->d[13]); det += m->d[0 + 2 * 4] * det3x3(&m->d[1], &m->d[5], &m->d[13]); det -= m->d[0 + 3 * 4] * det3x3(&m->d[1], &m->d[5], &m->d[9]); #endif return det; } static void print_permutation_matrix(const struct inverse_matrix *m) { const unsigned *p = m->perm; const char *row[4] = { "1 0 0 0\n", "0 1 0 0\n", "0 0 1 0\n", "0 0 0 1\n" }; printf(" P =\n%s%s%s%s", row[p[0]], row[p[1]], row[p[2]], row[p[3]]); } static void print_LU_decomposition(const struct inverse_matrix *m) { unsigned r, c; printf(" L " " U\n"); for (r = 0; r < 4; ++r) { double v; for (c = 0; c < 4; ++c) { if (c < r) v = m->LU[r + c * 4]; else if (c == r) v = 1.0; else v = 0.0; printf(" %12.6f", v); } printf(" | "); for (c = 0; c < 4; ++c) { if (c >= r) v = m->LU[r + c * 4]; else v = 0.0; printf(" %12.6f", v); } printf("\n"); } } static void print_inverse_data_matrix(const struct inverse_matrix *m) { unsigned r, c; for (r = 0; r < 4; ++r) { for (c = 0; c < 4; ++c) printf(" %12.6f", m->LU[r + c * 4]); printf("\n"); } printf("permutation: "); for (r = 0; r < 4; ++r) printf(" %u", m->perm[r]); printf("\n"); } static void print_matrix(const struct weston_matrix *m) { unsigned r, c; for (r = 0; r < 4; ++r) { for (c = 0; c < 4; ++c) printf(" %14.6e", m->d[r + c * 4]); printf("\n"); } } static double frand(void) { double r = random(); return r / (double)(RAND_MAX / 2) - 1.0f; } static void randomize_matrix(struct weston_matrix *m) { unsigned i; for (i = 0; i < 16; ++i) #if 1 m->d[i] = frand() * exp(10.0 * frand()); #else m->d[i] = frand(); #endif } /* Take a matrix, compute inverse, multiply together * and subtract the identity matrix to get the error matrix. * Return the largest absolute value from the error matrix. */ static double test_inverse(struct weston_matrix *m) { unsigned i; struct inverse_matrix q; double errsup = 0.0; if (matrix_invert(q.LU, q.perm, m) != 0) return INFINITY; for (i = 0; i < 4; ++i) inverse_transform(q.LU, q.perm, &m->d[i * 4]); m->d[0] -= 1.0f; m->d[5] -= 1.0f; m->d[10] -= 1.0f; m->d[15] -= 1.0f; for (i = 0; i < 16; ++i) { double err = fabs(m->d[i]); if (err > errsup) errsup = err; } return errsup; } enum { TEST_OK, TEST_NOT_INVERTIBLE_OK, TEST_FAIL, TEST_COUNT }; static int test(void) { struct weston_matrix m; double det, errsup; randomize_matrix(&m); det = determinant(&m); errsup = test_inverse(&m); if (errsup < 1e-6) return TEST_OK; if (fabs(det) < 1e-5 && isinf(errsup)) return TEST_NOT_INVERTIBLE_OK; printf("test fail, det: %g, error sup: %g\n", det, errsup); return TEST_FAIL; } static int running; static void stopme(int n) { running = 0; } static void test_loop_precision(void) { int counts[TEST_COUNT] = { 0 }; printf("\nRunning a test loop for 10 seconds...\n"); running = 1; alarm(10); while (running) { counts[test()]++; } printf("tests: %d ok, %d not invertible but ok, %d failed.\n" "Total: %d iterations.\n", counts[TEST_OK], counts[TEST_NOT_INVERTIBLE_OK], counts[TEST_FAIL], counts[TEST_OK] + counts[TEST_NOT_INVERTIBLE_OK] + counts[TEST_FAIL]); } static void __attribute__((noinline)) test_loop_speed_matrixvector(void) { struct weston_matrix m; struct weston_vector v = { { 0.5, 0.5, 0.5, 1.0 } }; unsigned long count = 0; double t; printf("\nRunning 3 s test on weston_matrix_transform()...\n"); weston_matrix_init(&m); running = 1; alarm(3); reset_timer(); while (running) { weston_matrix_transform(&m, &v); count++; } t = read_timer(); printf("%lu iterations in %f seconds, avg. %.1f ns/iter.\n", count, t, 1e9 * t / count); } static void __attribute__((noinline)) test_loop_speed_inversetransform(void) { struct weston_matrix m; struct inverse_matrix inv; struct weston_vector v = { { 0.5, 0.5, 0.5, 1.0 } }; unsigned long count = 0; double t; printf("\nRunning 3 s test on inverse_transform()...\n"); weston_matrix_init(&m); matrix_invert(inv.LU, inv.perm, &m); running = 1; alarm(3); reset_timer(); while (running) { inverse_transform(inv.LU, inv.perm, v.f); count++; } t = read_timer(); printf("%lu iterations in %f seconds, avg. %.1f ns/iter.\n", count, t, 1e9 * t / count); } static void __attribute__((noinline)) test_loop_speed_invert(void) { struct weston_matrix m; struct inverse_matrix inv; unsigned long count = 0; double t; printf("\nRunning 3 s test on matrix_invert()...\n"); weston_matrix_init(&m); running = 1; alarm(3); reset_timer(); while (running) { matrix_invert(inv.LU, inv.perm, &m); count++; } t = read_timer(); printf("%lu iterations in %f seconds, avg. %.1f ns/iter.\n", count, t, 1e9 * t / count); } static void __attribute__((noinline)) test_loop_speed_invert_explicit(void) { struct weston_matrix m; unsigned long count = 0; double t; printf("\nRunning 3 s test on weston_matrix_invert()...\n"); weston_matrix_init(&m); running = 1; alarm(3); reset_timer(); while (running) { weston_matrix_invert(&m, &m); count++; } t = read_timer(); printf("%lu iterations in %f seconds, avg. %.1f ns/iter.\n", count, t, 1e9 * t / count); } int main(void) { struct sigaction ding; struct weston_matrix M; struct inverse_matrix Q; int ret; double errsup; double det; ding.sa_handler = stopme; sigemptyset(&ding.sa_mask); ding.sa_flags = 0; sigaction(SIGALRM, &ding, NULL); srandom(13); M.d[0] = 3.0; M.d[4] = 17.0; M.d[8] = 10.0; M.d[12] = 0.0; M.d[1] = 2.0; M.d[5] = 4.0; M.d[9] = -2.0; M.d[13] = 0.0; M.d[2] = 6.0; M.d[6] = 18.0; M.d[10] = -12; M.d[14] = 0.0; M.d[3] = 0.0; M.d[7] = 0.0; M.d[11] = 0.0; M.d[15] = 1.0; ret = matrix_invert(Q.LU, Q.perm, &M); printf("ret = %d\n", ret); printf("det = %g\n\n", determinant(&M)); if (ret != 0) return 1; print_inverse_data_matrix(&Q); printf("P * A = L * U\n"); print_permutation_matrix(&Q); print_LU_decomposition(&Q); printf("a random matrix:\n"); randomize_matrix(&M); det = determinant(&M); print_matrix(&M); errsup = test_inverse(&M); printf("\nThe matrix multiplied by its inverse, error:\n"); print_matrix(&M); printf("max abs error: %g, original determinant %g\n", errsup, det); test_loop_precision(); test_loop_speed_matrixvector(); test_loop_speed_inversetransform(); test_loop_speed_invert(); test_loop_speed_invert_explicit(); return 0; } weston-1.9.0/tests/surface-test.c0000664000175000017500000000433212537664635013721 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "src/compositor.h" static void surface_transform(void *data) { struct weston_compositor *compositor = data; struct weston_surface *surface; struct weston_view *view; float x, y; surface = weston_surface_create(compositor); assert(surface); view = weston_view_create(surface); assert(view); surface->width = 200; surface->height = 200; weston_view_set_position(view, 100, 100); weston_view_update_transform(view); weston_view_to_global_float(view, 20, 20, &x, &y); fprintf(stderr, "20,20 maps to %f, %f\n", x, y); assert(x == 120 && y == 120); weston_view_set_position(view, 150, 300); weston_view_update_transform(view); weston_view_to_global_float(view, 50, 40, &x, &y); assert(x == 200 && y == 340); wl_display_terminate(compositor->wl_display); } WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct wl_event_loop *loop; loop = wl_display_get_event_loop(compositor->wl_display); wl_event_loop_add_idle(loop, surface_transform, compositor); return 0; } weston-1.9.0/tests/subsurface-test.c0000664000175000017500000003166312537627703014435 00000000000000/* * Copyright © 2012 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "weston-test-client-helper.h" #define NUM_SUBSURFACES 3 struct compound_surface { struct wl_subcompositor *subco; struct wl_surface *parent; struct wl_surface *child[NUM_SUBSURFACES]; struct wl_subsurface *sub[NUM_SUBSURFACES]; }; static struct wl_subcompositor * get_subcompositor(struct client *client) { struct global *g; struct global *global_sub = NULL; struct wl_subcompositor *sub; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "wl_subcompositor")) continue; if (global_sub) assert(0 && "multiple wl_subcompositor objects"); global_sub = g; } assert(global_sub && "no wl_subcompositor found"); assert(global_sub->version == 1); sub = wl_registry_bind(client->wl_registry, global_sub->name, &wl_subcompositor_interface, 1); assert(sub); return sub; } static void populate_compound_surface(struct compound_surface *com, struct client *client) { int i; com->subco = get_subcompositor(client); com->parent = wl_compositor_create_surface(client->wl_compositor); for (i = 0; i < NUM_SUBSURFACES; i++) { com->child[i] = wl_compositor_create_surface(client->wl_compositor); com->sub[i] = wl_subcompositor_get_subsurface(com->subco, com->child[i], com->parent); } } TEST(test_subsurface_basic_protocol) { struct client *client; struct compound_surface com1; struct compound_surface com2; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com1, client); populate_compound_surface(&com2, client); client_roundtrip(client); } TEST(test_subsurface_position_protocol) { struct client *client; struct compound_surface com; int i; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com, client); for (i = 0; i < NUM_SUBSURFACES; i++) wl_subsurface_set_position(com.sub[i], (i + 2) * 20, (i + 2) * 10); client_roundtrip(client); } TEST(test_subsurface_placement_protocol) { struct client *client; struct compound_surface com; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com, client); wl_subsurface_place_above(com.sub[0], com.child[1]); wl_subsurface_place_above(com.sub[1], com.parent); wl_subsurface_place_below(com.sub[2], com.child[0]); wl_subsurface_place_below(com.sub[1], com.parent); client_roundtrip(client); } TEST(test_subsurface_paradox) { struct client *client; struct wl_surface *parent; struct wl_subcompositor *subco; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); subco = get_subcompositor(client); parent = wl_compositor_create_surface(client->wl_compositor); /* surface is its own parent */ wl_subcompositor_get_subsurface(subco, parent, parent); expect_protocol_error(client, &wl_subcompositor_interface, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE); } TEST(test_subsurface_identical_link) { struct client *client; struct compound_surface com; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com, client); /* surface is already a subsurface */ wl_subcompositor_get_subsurface(com.subco, com.child[0], com.parent); expect_protocol_error(client, &wl_subcompositor_interface, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE); } TEST(test_subsurface_change_link) { struct client *client; struct compound_surface com; struct wl_surface *stranger; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); stranger = wl_compositor_create_surface(client->wl_compositor); populate_compound_surface(&com, client); /* surface is already a subsurface */ wl_subcompositor_get_subsurface(com.subco, com.child[0], stranger); expect_protocol_error(client, &wl_subcompositor_interface, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE); } TEST(test_subsurface_nesting) { struct client *client; struct compound_surface com; struct wl_surface *stranger; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); stranger = wl_compositor_create_surface(client->wl_compositor); populate_compound_surface(&com, client); /* parent is a sub-surface */ wl_subcompositor_get_subsurface(com.subco, stranger, com.child[0]); client_roundtrip(client); } TEST(test_subsurface_nesting_parent) { struct client *client; struct compound_surface com; struct wl_surface *stranger; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); stranger = wl_compositor_create_surface(client->wl_compositor); populate_compound_surface(&com, client); /* surface is already a parent */ wl_subcompositor_get_subsurface(com.subco, com.parent, stranger); client_roundtrip(client); } TEST(test_subsurface_loop_paradox) { struct client *client; struct wl_surface *surface[3]; struct wl_subcompositor *subco; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); subco = get_subcompositor(client); surface[0] = wl_compositor_create_surface(client->wl_compositor); surface[1] = wl_compositor_create_surface(client->wl_compositor); surface[2] = wl_compositor_create_surface(client->wl_compositor); /* create a nesting loop */ wl_subcompositor_get_subsurface(subco, surface[1], surface[0]); wl_subcompositor_get_subsurface(subco, surface[2], surface[1]); wl_subcompositor_get_subsurface(subco, surface[0], surface[2]); expect_protocol_error(client, &wl_subcompositor_interface, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE); } TEST(test_subsurface_place_above_stranger) { struct client *client; struct compound_surface com; struct wl_surface *stranger; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); stranger = wl_compositor_create_surface(client->wl_compositor); populate_compound_surface(&com, client); /* bad sibling */ wl_subsurface_place_above(com.sub[0], stranger); expect_protocol_error(client, &wl_subsurface_interface, WL_SUBSURFACE_ERROR_BAD_SURFACE); } TEST(test_subsurface_place_below_stranger) { struct client *client; struct compound_surface com; struct wl_surface *stranger; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); stranger = wl_compositor_create_surface(client->wl_compositor); populate_compound_surface(&com, client); /* bad sibling */ wl_subsurface_place_below(com.sub[0], stranger); expect_protocol_error(client, &wl_subsurface_interface, WL_SUBSURFACE_ERROR_BAD_SURFACE); } TEST(test_subsurface_place_above_foreign) { struct client *client; struct compound_surface com1; struct compound_surface com2; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com1, client); populate_compound_surface(&com2, client); /* bad sibling */ wl_subsurface_place_above(com1.sub[0], com2.child[0]); expect_protocol_error(client, &wl_subsurface_interface, WL_SUBSURFACE_ERROR_BAD_SURFACE); } TEST(test_subsurface_place_below_foreign) { struct client *client; struct compound_surface com1; struct compound_surface com2; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com1, client); populate_compound_surface(&com2, client); /* bad sibling */ wl_subsurface_place_below(com1.sub[0], com2.child[0]); expect_protocol_error(client, &wl_subsurface_interface, WL_SUBSURFACE_ERROR_BAD_SURFACE); } TEST(test_subsurface_destroy_protocol) { struct client *client; struct compound_surface com; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); populate_compound_surface(&com, client); /* not needed anymore */ wl_subcompositor_destroy(com.subco); /* detach child from parent */ wl_subsurface_destroy(com.sub[0]); /* destroy: child, parent */ wl_surface_destroy(com.child[1]); wl_surface_destroy(com.parent); /* destroy: parent, child */ wl_surface_destroy(com.child[2]); /* destroy: sub, child */ wl_surface_destroy(com.child[0]); /* 2x destroy: child, sub */ wl_subsurface_destroy(com.sub[2]); wl_subsurface_destroy(com.sub[1]); client_roundtrip(client); } static void create_subsurface_tree(struct client *client, struct wl_surface **surfs, struct wl_subsurface **subs, int n) { struct wl_subcompositor *subco; int i; subco = get_subcompositor(client); for (i = 0; i < n; i++) surfs[i] = wl_compositor_create_surface(client->wl_compositor); /* * The tree of sub-surfaces: * 0 * / \ * 1 2 - 10 * / \ |\ * 3 5 9 6 * / / \ * 4 7 8 * Surface 0 has no wl_subsurface, others do. */ switch (n) { default: assert(0); break; #define SUB_LINK(s,p) \ subs[s] = wl_subcompositor_get_subsurface(subco, surfs[s], surfs[p]) case 11: SUB_LINK(10, 2); case 10: SUB_LINK(9, 2); case 9: SUB_LINK(8, 6); case 8: SUB_LINK(7, 6); case 7: SUB_LINK(6, 2); case 6: SUB_LINK(5, 1); case 5: SUB_LINK(4, 3); case 4: SUB_LINK(3, 1); case 3: SUB_LINK(2, 0); case 2: SUB_LINK(1, 0); #undef SUB_LINK }; } static void destroy_subsurface_tree(struct wl_surface **surfs, struct wl_subsurface **subs, int n) { int i; for (i = n; i-- > 0; ) { if (surfs[i]) wl_surface_destroy(surfs[i]); if (subs[i]) wl_subsurface_destroy(subs[i]); } } static int has_dupe(int *cnt, int n) { int i; for (i = 0; i < n; i++) if (cnt[i] == cnt[n]) return 1; return 0; } /* Note: number of permutations to test is: set_size! / (set_size - NSTEPS)! */ #define NSTEPS 3 struct permu_state { int set_size; int cnt[NSTEPS]; }; static void permu_init(struct permu_state *s, int set_size) { int i; s->set_size = set_size; for (i = 0; i < NSTEPS; i++) s->cnt[i] = 0; } static int permu_next(struct permu_state *s) { int k; s->cnt[NSTEPS - 1]++; while (1) { if (s->cnt[0] >= s->set_size) { return -1; } for (k = 1; k < NSTEPS; k++) { if (s->cnt[k] >= s->set_size) { s->cnt[k - 1]++; s->cnt[k] = 0; break; } if (has_dupe(s->cnt, k)) { s->cnt[k]++; break; } } if (k == NSTEPS) return 0; } } static void destroy_permu_object(struct wl_surface **surfs, struct wl_subsurface **subs, int i) { int h = (i + 1) / 2; if (i & 1) { fprintf(stderr, " [sub %2d]", h); wl_subsurface_destroy(subs[h]); subs[h] = NULL; } else { fprintf(stderr, " [surf %2d]", h); wl_surface_destroy(surfs[h]); surfs[h] = NULL; } } TEST(test_subsurface_destroy_permutations) { /* * Test wl_surface and wl_subsurface destruction orders in a * complex tree of sub-surfaces. * * In the tree of sub-surfaces, go through every possible * permutation of destroying all wl_surface and wl_subsurface * objects. Execpt, to limit running time to a reasonable level, * execute only the first NSTEPS destructions from each * permutation, and ignore identical cases. */ const int test_size = 11; struct client *client; struct wl_surface *surfs[test_size]; struct wl_subsurface *subs[test_size]; struct permu_state per; int counter = 0; int i; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); permu_init(&per, test_size * 2 - 1); while (permu_next(&per) != -1) { /* for each permutation of NSTEPS out of test_size */ memset(surfs, 0, sizeof surfs); memset(subs, 0, sizeof subs); create_subsurface_tree(client, surfs, subs, test_size); fprintf(stderr, "permu"); for (i = 0; i < NSTEPS; i++) fprintf(stderr, " %2d", per.cnt[i]); for (i = 0; i < NSTEPS; i++) destroy_permu_object(surfs, subs, per.cnt[i]); fprintf(stderr, "\n"); client_roundtrip(client); destroy_subsurface_tree(surfs, subs, test_size); counter++; } client_roundtrip(client); fprintf(stderr, "tried %d destroy permutations\n", counter); } weston-1.9.0/tests/text-test.c0000664000175000017500000001265612537627703013260 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "weston-test-client-helper.h" #include "text-client-protocol.h" struct text_input_state { int activated; int deactivated; }; static void text_input_commit_string(void *data, struct wl_text_input *text_input, uint32_t serial, const char *text) { } static void text_input_preedit_string(void *data, struct wl_text_input *text_input, uint32_t serial, const char *text, const char *commit) { } static void text_input_delete_surrounding_text(void *data, struct wl_text_input *text_input, int32_t index, uint32_t length) { } static void text_input_cursor_position(void *data, struct wl_text_input *text_input, int32_t index, int32_t anchor) { } static void text_input_preedit_styling(void *data, struct wl_text_input *text_input, uint32_t index, uint32_t length, uint32_t style) { } static void text_input_preedit_cursor(void *data, struct wl_text_input *text_input, int32_t index) { } static void text_input_modifiers_map(void *data, struct wl_text_input *text_input, struct wl_array *map) { } static void text_input_keysym(void *data, struct wl_text_input *text_input, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers) { } static void text_input_enter(void *data, struct wl_text_input *text_input, struct wl_surface *surface) { struct text_input_state *state = data; fprintf(stderr, "%s\n", __FUNCTION__); state->activated += 1; } static void text_input_leave(void *data, struct wl_text_input *text_input) { struct text_input_state *state = data; state->deactivated += 1; } static void text_input_input_panel_state(void *data, struct wl_text_input *text_input, uint32_t state) { } static void text_input_language(void *data, struct wl_text_input *text_input, uint32_t serial, const char *language) { } static void text_input_text_direction(void *data, struct wl_text_input *text_input, uint32_t serial, uint32_t direction) { } static const struct wl_text_input_listener text_input_listener = { text_input_enter, text_input_leave, text_input_modifiers_map, text_input_input_panel_state, text_input_preedit_string, text_input_preedit_styling, text_input_preedit_cursor, text_input_commit_string, text_input_cursor_position, text_input_delete_surrounding_text, text_input_keysym, text_input_language, text_input_text_direction }; TEST(text_test) { struct client *client; struct global *global; struct wl_text_input_manager *factory; struct wl_text_input *text_input; struct text_input_state state; client = create_client_and_test_surface(100, 100, 100, 100); assert(client); factory = NULL; wl_list_for_each(global, &client->global_list, link) { if (strcmp(global->interface, "wl_text_input_manager") == 0) factory = wl_registry_bind(client->wl_registry, global->name, &wl_text_input_manager_interface, 1); } assert(factory); memset(&state, 0, sizeof state); text_input = wl_text_input_manager_create_text_input(factory); wl_text_input_add_listener(text_input, &text_input_listener, &state); /* Make sure our test surface has keyboard focus. */ weston_test_activate_surface(client->test->weston_test, client->surface->wl_surface); client_roundtrip(client); assert(client->input->keyboard->focus == client->surface); /* Activate test model and make sure we get enter event. */ wl_text_input_activate(text_input, client->input->wl_seat, client->surface->wl_surface); client_roundtrip(client); assert(state.activated == 1 && state.deactivated == 0); /* Deactivate test model and make sure we get leave event. */ wl_text_input_deactivate(text_input, client->input->wl_seat); client_roundtrip(client); assert(state.activated == 1 && state.deactivated == 1); /* Activate test model again. */ wl_text_input_activate(text_input, client->input->wl_seat, client->surface->wl_surface); client_roundtrip(client); assert(state.activated == 2 && state.deactivated == 1); /* Take keyboard focus away and verify we get leave event. */ weston_test_activate_surface(client->test->weston_test, NULL); client_roundtrip(client); assert(state.activated == 2 && state.deactivated == 2); } weston-1.9.0/tests/config-parser-test.c0000664000175000017500000002431312552265076015022 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "config-parser.h" #include "shared/helpers.h" #include "zunitc/zunitc.h" struct fixture_data { const char *text; struct weston_config *config; }; static struct weston_config * load_config(const char *text) { struct weston_config *config = NULL; int len = 0; int fd = -1; char file[] = "/tmp/weston-config-parser-test-XXXXXX"; ZUC_ASSERTG_NOT_NULL(text, out); fd = mkstemp(file); ZUC_ASSERTG_NE(-1, fd, out); len = write(fd, text, strlen(text)); ZUC_ASSERTG_EQ((int)strlen(text), len, out_close); config = weston_config_parse(file); out_close: close(fd); unlink(file); out: return config; } static void * setup_test_config(void *data) { struct weston_config *config = load_config(data); ZUC_ASSERTG_NOT_NULL(config, out); out: return config; } static void * setup_test_config_failing(void *data) { struct weston_config *config = load_config(data); ZUC_ASSERTG_NULL(config, err_free); return config; err_free: weston_config_destroy(config); return NULL; } static void cleanup_test_config(void *data) { struct weston_config *config = data; ZUC_ASSERT_NOT_NULL(config); weston_config_destroy(config); } static struct zuc_fixture config_test_t0 = { .data = "# nothing in this file...\n", .set_up = setup_test_config, .tear_down = cleanup_test_config }; static struct zuc_fixture config_test_t1 = { .data = "# comment line here...\n" "\n" "[foo]\n" "a=b\n" "name= Roy Batty \n" "\n" "\n" "[bar]\n" "# more comments\n" "number=5252\n" "flag=false\n" "\n" "[stuff]\n" "flag= true \n" "\n" "[bucket]\n" "color=blue \n" "contents=live crabs\n" "pinchy=true\n" "\n" "[bucket]\n" "material=plastic \n" "color=red\n" "contents=sand\n", .set_up = setup_test_config, .tear_down = cleanup_test_config }; static const char *section_names[] = { "foo", "bar", "stuff", "bucket", "bucket" }; /* * Since these next few won't parse, we don't add the tear_down to * attempt cleanup. */ static struct zuc_fixture config_test_t2 = { .data = "# invalid section...\n" "[this bracket isn't closed\n", .set_up = setup_test_config_failing, }; static struct zuc_fixture config_test_t3 = { .data = "# line without = ...\n" "[bambam]\n" "this line isn't any kind of valid\n", .set_up = setup_test_config_failing, }; static struct zuc_fixture config_test_t4 = { .data = "# starting with = ...\n" "[bambam]\n" "=not valid at all\n", .set_up = setup_test_config_failing, }; ZUC_TEST_F(config_test_t0, comment_only) { struct weston_config *config = data; ZUC_ASSERT_NOT_NULL(config); } /** @todo individual t1 tests should have more descriptive names. */ ZUC_TEST_F(config_test_t1, test001) { struct weston_config_section *section; struct weston_config *config = data; ZUC_ASSERT_NOT_NULL(config); section = weston_config_get_section(config, "mollusc", NULL, NULL); ZUC_ASSERT_NULL(section); } ZUC_TEST_F(config_test_t1, test002) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "foo", NULL, NULL); r = weston_config_section_get_string(section, "a", &s, NULL); ZUC_ASSERTG_EQ(0, r, out_free); ZUC_ASSERTG_STREQ("b", s, out_free); out_free: free(s); } ZUC_TEST_F(config_test_t1, test003) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "foo", NULL, NULL); r = weston_config_section_get_string(section, "b", &s, NULL); ZUC_ASSERT_EQ(-1, r); ZUC_ASSERT_EQ(ENOENT, errno); ZUC_ASSERT_NULL(s); } ZUC_TEST_F(config_test_t1, test004) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "foo", NULL, NULL); r = weston_config_section_get_string(section, "name", &s, NULL); ZUC_ASSERTG_EQ(0, r, out_free); ZUC_ASSERTG_STREQ("Roy Batty", s, out_free); out_free: free(s); } ZUC_TEST_F(config_test_t1, test005) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bar", NULL, NULL); r = weston_config_section_get_string(section, "a", &s, "boo"); ZUC_ASSERTG_EQ(-1, r, out_free); ZUC_ASSERTG_EQ(ENOENT, errno, out_free); ZUC_ASSERTG_STREQ("boo", s, out_free); out_free: free(s); } ZUC_TEST_F(config_test_t1, test006) { int r; int32_t n; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bar", NULL, NULL); r = weston_config_section_get_int(section, "number", &n, 600); ZUC_ASSERT_EQ(0, r); ZUC_ASSERT_EQ(5252, n); } ZUC_TEST_F(config_test_t1, test007) { int r; int32_t n; struct weston_config_section *section; struct weston_config *config = data;; section = weston_config_get_section(config, "bar", NULL, NULL); r = weston_config_section_get_int(section, "+++", &n, 700); ZUC_ASSERT_EQ(-1, r); ZUC_ASSERT_EQ(ENOENT, errno); ZUC_ASSERT_EQ(700, n); } ZUC_TEST_F(config_test_t1, test008) { int r; uint32_t u; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bar", NULL, NULL); r = weston_config_section_get_uint(section, "number", &u, 600); ZUC_ASSERT_EQ(0, r); ZUC_ASSERT_EQ(5252, u); } ZUC_TEST_F(config_test_t1, test009) { int r; uint32_t u; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bar", NULL, NULL); r = weston_config_section_get_uint(section, "+++", &u, 600); ZUC_ASSERT_EQ(-1, r); ZUC_ASSERT_EQ(ENOENT, errno); ZUC_ASSERT_EQ(600, u); } ZUC_TEST_F(config_test_t1, test010) { int r, b; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bar", NULL, NULL); r = weston_config_section_get_bool(section, "flag", &b, 600); ZUC_ASSERT_EQ(0, r); ZUC_ASSERT_EQ(0, b); } ZUC_TEST_F(config_test_t1, test011) { int r, b; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "stuff", NULL, NULL); r = weston_config_section_get_bool(section, "flag", &b, -1); ZUC_ASSERT_EQ(0, r); ZUC_ASSERT_EQ(1, b); } ZUC_TEST_F(config_test_t1, test012) { int r, b; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "stuff", NULL, NULL); r = weston_config_section_get_bool(section, "flag", &b, -1); ZUC_ASSERT_EQ(0, r); ZUC_ASSERT_EQ(1, b); } ZUC_TEST_F(config_test_t1, test013) { int r, b; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "stuff", NULL, NULL); r = weston_config_section_get_bool(section, "bonk", &b, -1); ZUC_ASSERT_EQ(-1, r); ZUC_ASSERT_EQ(ENOENT, errno); ZUC_ASSERT_EQ(-1, b); } ZUC_TEST_F(config_test_t1, test014) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bucket", "color", "blue"); r = weston_config_section_get_string(section, "contents", &s, NULL); ZUC_ASSERTG_EQ(0, r, out_free); ZUC_ASSERTG_STREQ("live crabs", s, out_free); out_free: free(s); } ZUC_TEST_F(config_test_t1, test015) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bucket", "color", "red"); r = weston_config_section_get_string(section, "contents", &s, NULL); ZUC_ASSERTG_EQ(0, r, out_free); ZUC_ASSERTG_STREQ("sand", s, out_free); out_free: free(s); } ZUC_TEST_F(config_test_t1, test016) { char *s; int r; struct weston_config_section *section; struct weston_config *config = data; section = weston_config_get_section(config, "bucket", "color", "pink"); ZUC_ASSERT_NULL(section); r = weston_config_section_get_string(section, "contents", &s, "eels"); ZUC_ASSERTG_EQ(-1, r, out_free); ZUC_ASSERTG_EQ(ENOENT, errno, out_free); ZUC_ASSERTG_STREQ("eels", s, out_free); out_free: free(s); } ZUC_TEST_F(config_test_t1, test017) { const char *name; int i; struct weston_config_section *section; struct weston_config *config = data; section = NULL; i = 0; while (weston_config_next_section(config, §ion, &name)) ZUC_ASSERT_STREQ(section_names[i++], name); ZUC_ASSERT_EQ(5, i); } ZUC_TEST_F(config_test_t2, doesnt_parse) { struct weston_config *config = data; ZUC_ASSERT_NULL(config); } ZUC_TEST_F(config_test_t3, doesnt_parse) { struct weston_config *config = data; ZUC_ASSERT_NULL(config); } ZUC_TEST_F(config_test_t4, doesnt_parse) { struct weston_config *config = data; ZUC_ASSERT_NULL(config); } ZUC_TEST(config_test, destroy_null) { weston_config_destroy(NULL); ZUC_ASSERT_EQ(0, weston_config_next_section(NULL, NULL, NULL)); } ZUC_TEST(config_test, section_from_null) { struct weston_config_section *section; section = weston_config_get_section(NULL, "bucket", NULL, NULL); ZUC_ASSERT_NULL(section); } weston-1.9.0/tests/button-test.c0000664000175000017500000000410112537627703013571 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include "weston-test-client-helper.h" TEST(simple_button_test) { struct client *client; struct pointer *pointer; client = create_client_and_test_surface(100, 100, 100, 100); assert(client); pointer = client->input->pointer; assert(pointer->button == 0); assert(pointer->state == 0); weston_test_move_pointer(client->test->weston_test, 150, 150); client_roundtrip(client); assert(pointer->x == 50); assert(pointer->y == 50); weston_test_send_button(client->test->weston_test, BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED); client_roundtrip(client); assert(pointer->button == BTN_LEFT); assert(pointer->state == WL_POINTER_BUTTON_STATE_PRESSED); weston_test_send_button(client->test->weston_test, BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED); client_roundtrip(client); assert(pointer->button == BTN_LEFT); assert(pointer->state == WL_POINTER_BUTTON_STATE_RELEASED); } weston-1.9.0/tests/vertex-clip-test.c0000664000175000017500000001443212537664701014527 00000000000000/* * Copyright © 2013 Sam Spilsbury * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "weston-test-runner.h" #include "shared/helpers.h" #include "src/vertex-clipping.h" #define BOUNDING_BOX_TOP_Y 100.0f #define BOUNDING_BOX_LEFT_X 50.0f #define BOUNDING_BOX_RIGHT_X 100.0f #define BOUNDING_BOX_BOTTOM_Y 50.0f #define INSIDE_X1 (BOUNDING_BOX_LEFT_X + 1.0f) #define INSIDE_X2 (BOUNDING_BOX_RIGHT_X - 1.0f) #define INSIDE_Y1 (BOUNDING_BOX_BOTTOM_Y + 1.0f) #define INSIDE_Y2 (BOUNDING_BOX_TOP_Y - 1.0f) #define OUTSIDE_X1 (BOUNDING_BOX_LEFT_X - 1.0f) #define OUTSIDE_X2 (BOUNDING_BOX_RIGHT_X + 1.0f) #define OUTSIDE_Y1 (BOUNDING_BOX_BOTTOM_Y - 1.0f) #define OUTSIDE_Y2 (BOUNDING_BOX_TOP_Y + 1.0f) static void populate_clip_context (struct clip_context *ctx) { ctx->clip.x1 = BOUNDING_BOX_LEFT_X; ctx->clip.y1 = BOUNDING_BOX_BOTTOM_Y; ctx->clip.x2 = BOUNDING_BOX_RIGHT_X; ctx->clip.y2 = BOUNDING_BOX_TOP_Y; } static int clip_polygon (struct clip_context *ctx, struct polygon8 *polygon, float *vertices_x, float *vertices_y) { populate_clip_context(ctx); return clip_transformed(ctx, polygon, vertices_x, vertices_y); } struct vertex_clip_test_data { struct polygon8 surface; struct polygon8 expected; }; const struct vertex_clip_test_data test_data[] = { /* All inside */ { { { INSIDE_X1, INSIDE_X2, INSIDE_X2, INSIDE_X1 }, { INSIDE_Y1, INSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 }, { { INSIDE_X1, INSIDE_X2, INSIDE_X2, INSIDE_X1 }, { INSIDE_Y1, INSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 } }, /* Top outside */ { { { INSIDE_X1, INSIDE_X2, INSIDE_X2, INSIDE_X1 }, { INSIDE_Y1, INSIDE_Y1, OUTSIDE_Y2, OUTSIDE_Y2 }, 4 }, { { INSIDE_X1, INSIDE_X1, INSIDE_X2, INSIDE_X2 }, { BOUNDING_BOX_TOP_Y, INSIDE_Y1, INSIDE_Y1, BOUNDING_BOX_TOP_Y }, 4 } }, /* Bottom outside */ { { { INSIDE_X1, INSIDE_X2, INSIDE_X2, INSIDE_X1 }, { OUTSIDE_Y1, OUTSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 }, { { INSIDE_X1, INSIDE_X2, INSIDE_X2, INSIDE_X1 }, { BOUNDING_BOX_BOTTOM_Y, BOUNDING_BOX_BOTTOM_Y, INSIDE_Y2, INSIDE_Y2 }, 4 } }, /* Left outside */ { { { OUTSIDE_X1, INSIDE_X2, INSIDE_X2, OUTSIDE_X1 }, { INSIDE_Y1, INSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 }, { { BOUNDING_BOX_LEFT_X, INSIDE_X2, INSIDE_X2, BOUNDING_BOX_LEFT_X }, { INSIDE_Y1, INSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 } }, /* Right outside */ { { { INSIDE_X1, OUTSIDE_X2, OUTSIDE_X2, INSIDE_X1 }, { INSIDE_Y1, INSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 }, { { INSIDE_X1, BOUNDING_BOX_RIGHT_X, BOUNDING_BOX_RIGHT_X, INSIDE_X1 }, { INSIDE_Y1, INSIDE_Y1, INSIDE_Y2, INSIDE_Y2 }, 4 } }, /* Diamond extending from bounding box edges, clip to bounding box */ { { { BOUNDING_BOX_LEFT_X - 25, BOUNDING_BOX_LEFT_X + 25, BOUNDING_BOX_RIGHT_X + 25, BOUNDING_BOX_RIGHT_X - 25 }, { BOUNDING_BOX_BOTTOM_Y + 25, BOUNDING_BOX_TOP_Y + 25, BOUNDING_BOX_TOP_Y - 25, BOUNDING_BOX_BOTTOM_Y - 25 }, 4 }, { { BOUNDING_BOX_LEFT_X, BOUNDING_BOX_LEFT_X, BOUNDING_BOX_RIGHT_X, BOUNDING_BOX_RIGHT_X }, { BOUNDING_BOX_BOTTOM_Y, BOUNDING_BOX_TOP_Y, BOUNDING_BOX_TOP_Y, BOUNDING_BOX_BOTTOM_Y }, 4 } }, /* Diamond inside of bounding box edges, clip t bounding box, 8 resulting vertices */ { { { BOUNDING_BOX_LEFT_X - 12.5, BOUNDING_BOX_LEFT_X + 25, BOUNDING_BOX_RIGHT_X + 12.5, BOUNDING_BOX_RIGHT_X - 25 }, { BOUNDING_BOX_BOTTOM_Y + 25, BOUNDING_BOX_TOP_Y + 12.5, BOUNDING_BOX_TOP_Y - 25, BOUNDING_BOX_BOTTOM_Y - 12.5 }, 4 }, { { BOUNDING_BOX_LEFT_X + 12.5, BOUNDING_BOX_LEFT_X, BOUNDING_BOX_LEFT_X, BOUNDING_BOX_LEFT_X + 12.5, BOUNDING_BOX_RIGHT_X - 12.5, BOUNDING_BOX_RIGHT_X, BOUNDING_BOX_RIGHT_X, BOUNDING_BOX_RIGHT_X - 12.5 }, { BOUNDING_BOX_BOTTOM_Y, BOUNDING_BOX_BOTTOM_Y + 12.5, BOUNDING_BOX_TOP_Y - 12.5, BOUNDING_BOX_TOP_Y, BOUNDING_BOX_TOP_Y, BOUNDING_BOX_TOP_Y - 12.5, BOUNDING_BOX_BOTTOM_Y + 12.5, BOUNDING_BOX_BOTTOM_Y }, 8 } } }; /* clip_polygon modifies the source operand and the test data must * be const, so we need to deep copy it */ static void deep_copy_polygon8(const struct polygon8 *src, struct polygon8 *dst) { dst->n = src->n; memcpy((void *) dst->x, src->x, sizeof (src->x)); memcpy((void *) dst->y, src->y, sizeof (src->y)); } TEST_P(clip_polygon_n_vertices_emitted, test_data) { struct vertex_clip_test_data *tdata = data; struct clip_context ctx; struct polygon8 polygon; float vertices_x[8]; float vertices_y[8]; deep_copy_polygon8(&tdata->surface, &polygon); int emitted = clip_polygon(&ctx, &polygon, vertices_x, vertices_y); assert(emitted == tdata->expected.n); } TEST_P(clip_polygon_expected_vertices, test_data) { struct vertex_clip_test_data *tdata = data; struct clip_context ctx; struct polygon8 polygon; float vertices_x[8]; float vertices_y[8]; deep_copy_polygon8(&tdata->surface, &polygon); int emitted = clip_polygon(&ctx, &polygon, vertices_x, vertices_y); int i = 0; for (; i < emitted; ++i) { assert(vertices_x[i] == tdata->expected.x[i]); assert(vertices_y[i] == tdata->expected.y[i]); } } TEST(float_difference_different) { assert(float_difference(1.0f, 0.0f) == 1.0f); } TEST(float_difference_same) { assert(float_difference(1.0f, 1.0f) == 0.0f); } weston-1.9.0/tests/internal-screenshot-test.c0000664000175000017500000002162012561200202016224 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include /* memcpy */ #include #include "weston-test-client-helper.h" char *server_parameters="--use-pixman --width=320 --height=240"; /** write_surface_as_png() * * Writes out a given weston test surface to disk as a PNG image * using the provided filename (with path). * * @returns true if successfully saved file; false otherwise. */ static bool write_surface_as_png(const struct surface* weston_surface, const char *fname) { cairo_surface_t *cairo_surface; cairo_status_t status; int bpp = 4; /* Assume ARGB */ int stride = bpp * weston_surface->width; cairo_surface = cairo_image_surface_create_for_data(weston_surface->data, CAIRO_FORMAT_ARGB32, weston_surface->width, weston_surface->height, stride); printf("Writing PNG to disk\n"); status = cairo_surface_write_to_png(cairo_surface, fname); if (status != CAIRO_STATUS_SUCCESS) { printf("Failed to save screenshot: %s\n", cairo_status_to_string(status)); return false; } cairo_surface_destroy(cairo_surface); return true; } /** load_surface_from_png() * * Reads a PNG image from disk using the given filename (and path) * and returns as a freshly allocated weston test surface. * * @returns weston test surface with image, which should be free'd * when no longer used; or, NULL in case of error. */ static struct surface* load_surface_from_png(const char *fname) { struct surface *reference; cairo_surface_t *reference_cairo_surface; cairo_status_t status; size_t source_data_size; int bpp; int stride; reference_cairo_surface = cairo_image_surface_create_from_png(fname); status = cairo_surface_status(reference_cairo_surface); if (status != CAIRO_STATUS_SUCCESS) { printf("Could not open %s: %s\n", fname, cairo_status_to_string(status)); cairo_surface_destroy(reference_cairo_surface); return NULL; } /* Disguise the cairo surface in a weston test surface */ reference = xzalloc(sizeof *reference); if (reference == NULL) { perror("xzalloc reference"); cairo_surface_destroy(reference_cairo_surface); return NULL; } reference->width = cairo_image_surface_get_width(reference_cairo_surface); reference->height = cairo_image_surface_get_height(reference_cairo_surface); stride = cairo_image_surface_get_stride(reference_cairo_surface); source_data_size = stride * reference->height; /* Check that the file's stride matches our assumption */ bpp = 4; if (stride != bpp * reference->width) { printf("Mismatched stride for screenshot reference image %s\n", fname); cairo_surface_destroy(reference_cairo_surface); free(reference); return NULL; } /* Allocate new buffer for our weston reference, and copy the data from the cairo surface so we can destroy it */ reference->data = xzalloc(source_data_size); if (reference->data == NULL) { perror("xzalloc reference data"); cairo_surface_destroy(reference_cairo_surface); free(reference); return NULL; } memcpy(reference->data, cairo_image_surface_get_data(reference_cairo_surface), source_data_size); cairo_surface_destroy(reference_cairo_surface); return reference; } /** create_screenshot_surface() * * Allocates and initializes a weston test surface for use in * storing a screenshot of the client's output. Establishes a * shm backed wl_buffer for retrieving screenshot image data * from the server, sized to match the client's output display. * * @returns stack allocated surface image, which should be * free'd when done using it. */ static struct surface* create_screenshot_surface(struct client *client) { struct surface* screenshot; screenshot = xzalloc(sizeof *screenshot); if (screenshot == NULL) return NULL; screenshot->wl_buffer = create_shm_buffer(client, client->output->width, client->output->height, &screenshot->data); screenshot->height = client->output->height; screenshot->width = client->output->width; return screenshot; } /** capture_screenshot_of_output() * * Requests a screenshot from the server of the output that the * client appears on. The image data returned from the server * can be accessed from the screenshot surface's data member. * * @returns a new surface object, which should be free'd when no * longer needed. */ static struct surface * capture_screenshot_of_output(struct client *client) { struct surface *screenshot; /* Create a surface to hold the screenshot */ screenshot = create_screenshot_surface(client); client->test->buffer_copy_done = 0; weston_test_capture_screenshot(client->test->weston_test, client->output->wl_output, screenshot->wl_buffer); while (client->test->buffer_copy_done == 0) if (wl_display_dispatch(client->wl_display) < 0) break; /* FIXME: Document somewhere the orientation the screenshot is taken * and how the clip coords are interpreted, in case of scaling/transform. * If we're using read_pixels() just make sure it is documented somewhere. * Protocol docs in the XML, comparison function docs in Doxygen style. */ return screenshot; } static void draw_stuff(void *pixels, int w, int h) { int x, y; uint8_t r, g, b; uint32_t *pixel; for (x = 0; x < w; x++) for (y = 0; y < h; y++) { b = x; g = x + y; r = y; pixel = (uint32_t *)pixels + y * w + x; *pixel = (255 << 24) | (r << 16) | (g << 8) | b; } } TEST(internal_screenshot) { struct wl_buffer *buf; struct client *client; struct wl_surface *surface; struct surface *screenshot = NULL; struct surface *reference_good = NULL; struct surface *reference_bad = NULL; struct rectangle clip; const char *fname; bool match = false; bool dump_all_images = true; void *pixels; /* Create the client */ printf("Creating client for test\n"); client = create_client_and_test_surface(100, 100, 100, 100); assert(client); surface = client->surface->wl_surface; buf = create_shm_buffer(client, 100, 100, &pixels); draw_stuff(pixels, 100, 100); wl_surface_attach(surface, buf, 0, 0); wl_surface_damage(surface, 0, 0, 100, 100); wl_surface_commit(surface); /* Take a snapshot. Result will be in screenshot->wl_buffer. */ printf("Taking a screenshot\n"); screenshot = capture_screenshot_of_output(client); assert(screenshot); /* Load good reference image */ fname = screenshot_reference_filename("internal-screenshot-good", 0); printf("Loading good reference image %s\n", fname); reference_good = load_surface_from_png(fname); assert(reference_good); /* Load bad reference image */ fname = screenshot_reference_filename("internal-screenshot-bad", 0); printf("Loading bad reference image %s\n", fname); reference_bad = load_surface_from_png(fname); assert(reference_bad); /* Test check_surfaces_equal() * We expect this to fail since we use a bad reference image */ match = check_surfaces_equal(screenshot, reference_bad); printf("Screenshot %s reference image\n", match? "equal to" : "different from"); assert(!match); free(reference_bad->data); free(reference_bad); /* Test check_surfaces_match_in_clip() * Alpha-blending and other effects can cause irrelevant discrepancies, so look only * at a small portion of the solid-colored background */ clip.x = 100; clip.y = 100; clip.width = 100; clip.height = 100; printf("Clip: %d,%d %d x %d\n", clip.x, clip.y, clip.width, clip.height); match = check_surfaces_match_in_clip(screenshot, reference_good, &clip); printf("Screenshot %s reference image in clipped area\n", match? "matches" : "doesn't match"); free(reference_good->data); free(reference_good); /* Test dumping of non-matching images */ if (!match || dump_all_images) { fname = screenshot_output_filename("internal-screenshot", 0); write_surface_as_png(screenshot, fname); } free(screenshot); printf("Test complete\n"); assert(match); } weston-1.9.0/tests/surface-global-test.c0000664000175000017500000000541012537664635015155 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include "src/compositor.h" static void surface_to_from_global(void *data) { struct weston_compositor *compositor = data; struct weston_surface *surface; struct weston_view *view; float x, y; wl_fixed_t fx, fy; int32_t ix, iy; surface = weston_surface_create(compositor); assert(surface); view = weston_view_create(surface); assert(view); surface->width = 50; surface->height = 50; weston_view_set_position(view, 5, 10); weston_view_update_transform(view); weston_view_to_global_float(view, 33, 22, &x, &y); assert(x == 38 && y == 32); weston_view_to_global_float(view, -8, -2, &x, &y); assert(x == -3 && y == 8); weston_view_to_global_fixed(view, wl_fixed_from_int(12), wl_fixed_from_int(5), &fx, &fy); assert(fx == wl_fixed_from_int(17) && fy == wl_fixed_from_int(15)); weston_view_from_global_float(view, 38, 32, &x, &y); assert(x == 33 && y == 22); weston_view_from_global_float(view, 42, 5, &x, &y); assert(x == 37 && y == -5); weston_view_from_global_fixed(view, wl_fixed_from_int(21), wl_fixed_from_int(100), &fx, &fy); assert(fx == wl_fixed_from_int(16) && fy == wl_fixed_from_int(90)); weston_view_from_global(view, 0, 0, &ix, &iy); assert(ix == -5 && iy == -10); weston_view_from_global(view, 5, 10, &ix, &iy); assert(ix == 0 && iy == 0); wl_display_terminate(compositor->wl_display); } WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct wl_event_loop *loop; loop = wl_display_get_event_loop(compositor->wl_display); wl_event_loop_add_idle(loop, surface_to_from_global, compositor); return 0; } weston-1.9.0/tests/ivi_layout-test.c0000664000175000017500000003001612543150037014432 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include "shared/helpers.h" #include "weston-test-client-helper.h" #include "ivi-application-client-protocol.h" #include "ivi-test.h" struct runner { struct client *client; struct weston_test_runner *test_runner; int done; }; static void runner_finished_handler(void *data, struct weston_test_runner *test_runner) { struct runner *runner = data; runner->done = 1; } static const struct weston_test_runner_listener test_runner_listener = { runner_finished_handler }; static struct runner * client_create_runner(struct client *client) { struct runner *runner; struct global *g; struct global *global_runner = NULL; runner = xzalloc(sizeof(*runner)); runner->client = client; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "weston_test_runner")) continue; if (global_runner) assert(0 && "multiple weston_test_runner objects"); global_runner = g; } assert(global_runner && "no weston_test_runner found"); assert(global_runner->version == 1); runner->test_runner = wl_registry_bind(client->wl_registry, global_runner->name, &weston_test_runner_interface, 1); assert(runner->test_runner); weston_test_runner_add_listener(runner->test_runner, &test_runner_listener, runner); return runner; } static void runner_destroy(struct runner *runner) { weston_test_runner_destroy(runner->test_runner); client_roundtrip(runner->client); free(runner); } static void runner_run(struct runner *runner, const char *test_name) { fprintf(stderr, "weston_test_runner.run(\"%s\")\n", test_name); runner->done = 0; weston_test_runner_run(runner->test_runner, test_name); while (!runner->done) { if (wl_display_dispatch(runner->client->wl_display) < 0) assert(0 && "runner wait"); } } static struct ivi_application * get_ivi_application(struct client *client) { struct global *g; struct global *global_iviapp = NULL; static struct ivi_application *iviapp; if (iviapp) return iviapp; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "ivi_application")) continue; if (global_iviapp) assert(0 && "multiple ivi_application objects"); global_iviapp = g; } assert(global_iviapp && "no ivi_application found"); assert(global_iviapp->version == 1); iviapp = wl_registry_bind(client->wl_registry, global_iviapp->name, &ivi_application_interface, 1); assert(iviapp); return iviapp; } struct ivi_window { struct wl_surface *wl_surface; struct ivi_surface *ivi_surface; uint32_t ivi_id; }; static struct ivi_window * client_create_ivi_window(struct client *client, uint32_t ivi_id) { struct ivi_application *iviapp; struct ivi_window *wnd; iviapp = get_ivi_application(client); wnd = xzalloc(sizeof(*wnd)); wnd->wl_surface = wl_compositor_create_surface(client->wl_compositor); wnd->ivi_surface = ivi_application_surface_create(iviapp, ivi_id, wnd->wl_surface); wnd->ivi_id = ivi_id; return wnd; } static void ivi_window_destroy(struct ivi_window *wnd) { ivi_surface_destroy(wnd->ivi_surface); wl_surface_destroy(wnd->wl_surface); free(wnd); } /******************************** tests ********************************/ /* * This is a test program, launched by ivi_layout-test-plugin.c. Each TEST() * is forked and exec'd as usual with the weston-test-runner framework. * * These tests make use of weston_test_runner global interface exposed by * ivi_layout-test-plugin.c. This allows these tests to trigger compositor-side * checks. * * See ivi_layout-test-plugin.c for further details. */ /** * RUNNER_TEST() names are defined in ivi_layout-test-plugin.c. * Each RUNNER_TEST name listed here uses the same simple initial client setup. */ const char * const basic_test_names[] = { "surface_visibility", "surface_opacity", "surface_orientation", "surface_dimension", "surface_position", "surface_destination_rectangle", "surface_source_rectangle", "surface_bad_opacity", "surface_properties_changed_notification", "surface_bad_properties_changed_notification", }; const char * const surface_property_commit_changes_test_names[] = { "commit_changes_after_visibility_set_surface_destroy", "commit_changes_after_opacity_set_surface_destroy", "commit_changes_after_orientation_set_surface_destroy", "commit_changes_after_dimension_set_surface_destroy", "commit_changes_after_position_set_surface_destroy", "commit_changes_after_source_rectangle_set_surface_destroy", "commit_changes_after_destination_rectangle_set_surface_destroy", }; const char * const render_order_test_names[] = { "layer_render_order", "layer_bad_render_order", }; TEST_P(ivi_layout_runner, basic_test_names) { /* an element from basic_test_names */ const char * const *test_name = data; struct client *client; struct runner *runner; struct ivi_window *wnd; client = create_client(); runner = client_create_runner(client); wnd = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); runner_run(runner, *test_name); ivi_window_destroy(wnd); runner_destroy(runner); } TEST(ivi_layout_surface_create) { struct client *client; struct runner *runner; struct ivi_window *winds[2]; client = create_client(); runner = client_create_runner(client); winds[0] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); winds[1] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(1)); runner_run(runner, "surface_create_p1"); ivi_window_destroy(winds[0]); runner_run(runner, "surface_create_p2"); ivi_window_destroy(winds[1]); runner_destroy(runner); } TEST_P(commit_changes_after_properties_set_surface_destroy, surface_property_commit_changes_test_names) { /* an element from surface_property_commit_changes_test_names */ const char * const *test_name = data; struct client *client; struct runner *runner; struct ivi_window *wnd; client = create_client(); runner = client_create_runner(client); wnd = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); runner_run(runner, *test_name); ivi_window_destroy(wnd); runner_run(runner, "ivi_layout_commit_changes"); runner_destroy(runner); } TEST(get_surface_after_destroy_ivi_surface) { struct client *client; struct runner *runner; struct ivi_window *wnd; client = create_client(); runner = client_create_runner(client); wnd = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); ivi_surface_destroy(wnd->ivi_surface); runner_run(runner, "get_surface_after_destroy_surface"); wl_surface_destroy(wnd->wl_surface); free(wnd); runner_destroy(runner); } TEST(get_surface_after_destroy_wl_surface) { struct client *client; struct runner *runner; struct ivi_window *wnd; client = create_client(); runner = client_create_runner(client); wnd = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); wl_surface_destroy(wnd->wl_surface); runner_run(runner, "get_surface_after_destroy_surface"); ivi_surface_destroy(wnd->ivi_surface); free(wnd); runner_destroy(runner); } TEST_P(ivi_layout_layer_render_order_runner, render_order_test_names) { /* an element from render_order_test_names */ const char * const *test_name = data; struct client *client; struct runner *runner; struct ivi_window *winds[3]; client = create_client(); runner = client_create_runner(client); winds[0] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); winds[1] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(1)); winds[2] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(2)); runner_run(runner, *test_name); ivi_window_destroy(winds[0]); ivi_window_destroy(winds[1]); ivi_window_destroy(winds[2]); runner_destroy(runner); } TEST(destroy_surface_after_layer_render_order) { struct client *client; struct runner *runner; struct ivi_window *winds[3]; client = create_client(); runner = client_create_runner(client); winds[0] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); winds[1] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(1)); winds[2] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(2)); runner_run(runner, "test_layer_render_order_destroy_one_surface_p1"); ivi_window_destroy(winds[1]); runner_run(runner, "test_layer_render_order_destroy_one_surface_p2"); ivi_window_destroy(winds[0]); ivi_window_destroy(winds[2]); runner_destroy(runner); } TEST(commit_changes_after_render_order_set_surface_destroy) { struct client *client; struct runner *runner; struct ivi_window *winds[3]; client = create_client(); runner = client_create_runner(client); winds[0] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); winds[1] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(1)); winds[2] = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(2)); runner_run(runner, "commit_changes_after_render_order_set_surface_destroy"); ivi_window_destroy(winds[1]); runner_run(runner, "ivi_layout_commit_changes"); runner_run(runner, "cleanup_layer"); ivi_window_destroy(winds[0]); ivi_window_destroy(winds[2]); runner_destroy(runner); } TEST(ivi_layout_surface_configure_notification) { struct client *client; struct runner *runner; struct ivi_window *wind; struct wl_buffer *buffer; client = create_client(); runner = client_create_runner(client); runner_run(runner, "surface_configure_notification_p1"); wind = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); buffer = create_shm_buffer(client, 200, 300, NULL); wl_surface_attach(wind->wl_surface, buffer, 0, 0); wl_surface_damage(wind->wl_surface, 0, 0, 20, 30); wl_surface_commit(wind->wl_surface); runner_run(runner, "surface_configure_notification_p2"); wl_surface_attach(wind->wl_surface, buffer, 0, 0); wl_surface_damage(wind->wl_surface, 0, 0, 40, 50); wl_surface_commit(wind->wl_surface); runner_run(runner, "surface_configure_notification_p3"); wl_buffer_destroy(buffer); ivi_window_destroy(wind); runner_destroy(runner); } TEST(ivi_layout_surface_create_notification) { struct client *client; struct runner *runner; struct ivi_window *wind; client = create_client(); runner = client_create_runner(client); runner_run(runner, "surface_create_notification_p1"); wind = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); runner_run(runner, "surface_create_notification_p2"); ivi_window_destroy(wind); wind = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); runner_run(runner, "surface_create_notification_p3"); ivi_window_destroy(wind); runner_destroy(runner); } TEST(ivi_layout_surface_remove_notification) { struct client *client; struct runner *runner; struct ivi_window *wind; client = create_client(); runner = client_create_runner(client); wind = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); runner_run(runner, "surface_remove_notification_p1"); ivi_window_destroy(wind); runner_run(runner, "surface_remove_notification_p2"); wind = client_create_ivi_window(client, IVI_TEST_SURFACE_ID(0)); ivi_window_destroy(wind); runner_run(runner, "surface_remove_notification_p3"); runner_destroy(runner); } weston-1.9.0/tests/bad-buffer-test.c0000664000175000017500000000512312537664635014265 00000000000000/* * Copyright © 2012 Intel Corporation * Copyright © 2013 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include "shared/os-compatibility.h" #include "weston-test-client-helper.h" /* tests, that attempt to crash the compositor on purpose */ static struct wl_buffer * create_bad_shm_buffer(struct client *client, int width, int height) { struct wl_shm *shm = client->wl_shm; int stride = width * 4; int size = stride * height; struct wl_shm_pool *pool; struct wl_buffer *buffer; int fd; fd = os_create_anonymous_file(size); assert(fd >= 0); pool = wl_shm_create_pool(shm, fd, size); buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_ARGB8888); wl_shm_pool_destroy(pool); /* Truncate the file to a small size, so that the compositor * will access it out-of-bounds, and hit SIGBUS. */ assert(ftruncate(fd, 12) == 0); close(fd); return buffer; } TEST(test_truncated_shm_file) { struct client *client; struct wl_buffer *bad_buffer; struct wl_surface *surface; int frame; client = create_client_and_test_surface(46, 76, 111, 134); assert(client); surface = client->surface->wl_surface; bad_buffer = create_bad_shm_buffer(client, 200, 200); wl_surface_attach(surface, bad_buffer, 0, 0); wl_surface_damage(surface, 0, 0, 200, 200); frame_callback_set(surface, &frame); wl_surface_commit(surface); frame_callback_wait_nofail(client, &frame); expect_protocol_error(client, &wl_buffer_interface, WL_SHM_ERROR_INVALID_FD); } weston-1.9.0/tests/surface-screenshot.c0000664000175000017500000001212312556771651015112 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "compositor.h" #include "file-util.h" static char * encode_PAM_comment_line(const char *comment) { size_t len = strlen(comment); char *str = malloc(len + 2); char *dst = str; const char *src = comment; const char *end = src + len; *dst++ = '#'; *dst++ = ' '; for (; src < end; src++, dst++) { if (*src == '\n' || !isprint(*src)) *dst = '_'; else *dst = *src; } return str; } /* * PAM image format: * http://en.wikipedia.org/wiki/Netpbm#PAM_graphics_format * RGBA is in byte address order. * * ImageMagick 'convert' can convert a PAM image to a more common format. * To view the image metadata: $ head -n7 image.pam */ static int write_PAM_image_rgba(FILE *fp, int width, int height, void *pixels, size_t size, const char *comment) { char *str; int ret; assert(size == (size_t)4 * width * height); ret = fprintf(fp, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 4\nMAXVAL 255\n" "TUPLTYPE RGB_ALPHA\n", width, height); if (ret < 0) return -1; if (comment) { str = encode_PAM_comment_line(comment); ret = fprintf(fp, "%s\n", str); free(str); if (ret < 0) return -1; } ret = fprintf(fp, "ENDHDR\n"); if (ret < 0) return -1; if (fwrite(pixels, 1, size, fp) != size) return -1; if (ferror(fp)) return -1; return 0; } static uint32_t unmult(uint32_t c, uint32_t a) { return (c * 255 + a / 2) / a; } static void unpremultiply_and_swap_a8b8g8r8_to_PAMrgba(void *pixels, size_t size) { uint32_t *p = pixels; uint32_t *end; for (end = p + size / 4; p < end; p++) { uint32_t v = *p; uint32_t a; a = (v & 0xff000000) >> 24; if (a == 0) { *p = 0; } else { uint8_t *dst = (uint8_t *)p; dst[0] = unmult((v & 0x000000ff) >> 0, a); dst[1] = unmult((v & 0x0000ff00) >> 8, a); dst[2] = unmult((v & 0x00ff0000) >> 16, a); dst[3] = a; } } } static void trigger_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { const char *prefix = "surfaceshot-"; const char *suffix = ".pam"; char fname[1024]; struct weston_surface *surface; struct weston_seat *seat = keyboard->seat; struct weston_pointer *pointer = weston_seat_get_pointer(seat); int width, height; char desc[512]; void *pixels; const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ size_t sz; int ret; FILE *fp; if (!pointer || !pointer->focus) return; surface = pointer->focus->surface; weston_surface_get_content_size(surface, &width, &height); if (!surface->get_label || surface->get_label(surface, desc, sizeof(desc)) < 0) snprintf(desc, sizeof(desc), "(unknown)"); weston_log("surface screenshot of %p: '%s', %dx%d\n", surface, desc, width, height); sz = width * bytespp * height; if (sz == 0) { weston_log("no content for %p\n", surface); return; } pixels = malloc(sz); if (!pixels) { weston_log("%s: failed to malloc %zu B\n", __func__, sz); return; } ret = weston_surface_copy_content(surface, pixels, sz, 0, 0, width, height); if (ret < 0) { weston_log("shooting surface %p failed\n", surface); goto out; } unpremultiply_and_swap_a8b8g8r8_to_PAMrgba(pixels, sz); fp = file_create_dated(prefix, suffix, fname, sizeof(fname)); if (!fp) { const char *msg; switch (errno) { case ETIME: msg = "failure in datetime formatting"; break; default: msg = strerror(errno); } weston_log("Cannot open '%s*%s' for writing: %s\n", prefix, suffix, msg); goto out; } ret = write_PAM_image_rgba(fp, width, height, pixels, sz, desc); if (fclose(fp) != 0 || ret < 0) weston_log("writing surface %p screenshot failed.\n", surface); else weston_log("successfully shot surface %p into '%s'\n", surface, fname); out: free(pixels); } WL_EXPORT int module_init(struct weston_compositor *ec, int *argc, char *argv[]) { weston_compositor_add_debug_binding(ec, KEY_H, trigger_binding, ec); return 0; } weston-1.9.0/tests/presentation-test.c0000664000175000017500000001315512537664701015001 00000000000000/* * Copyright © 2014 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "shared/helpers.h" #include "weston-test-client-helper.h" #include "presentation_timing-client-protocol.h" static struct presentation * get_presentation(struct client *client) { struct global *g; struct global *global_pres = NULL; static struct presentation *pres; if (pres) return pres; wl_list_for_each(g, &client->global_list, link) { if (strcmp(g->interface, "presentation")) continue; if (global_pres) assert(0 && "multiple presentation objects"); global_pres = g; } assert(global_pres && "no presentation found"); assert(global_pres->version == 1); pres = wl_registry_bind(client->wl_registry, global_pres->name, &presentation_interface, 1); assert(pres); return pres; } struct feedback { struct client *client; struct presentation_feedback *obj; enum { FB_PENDING = 0, FB_PRESENTED, FB_DISCARDED } result; struct wl_output *sync_output; uint64_t seq; struct timespec time; uint32_t refresh_nsec; uint32_t flags; }; static void timespec_from_proto(struct timespec *tm, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec) { tm->tv_sec = ((uint64_t)tv_sec_hi << 32) + tv_sec_lo; tm->tv_nsec = tv_nsec; } static void feedback_sync_output(void *data, struct presentation_feedback *presentation_feedback, struct wl_output *output) { struct feedback *fb = data; assert(fb->result == FB_PENDING); if (output) fb->sync_output = output; } static void feedback_presented(void *data, struct presentation_feedback *presentation_feedback, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh_nsec, uint32_t seq_hi, uint32_t seq_lo, uint32_t flags) { struct feedback *fb = data; assert(fb->result == FB_PENDING); fb->result = FB_PRESENTED; fb->seq = ((uint64_t)seq_hi << 32) + seq_lo; timespec_from_proto(&fb->time, tv_sec_hi, tv_sec_lo, tv_nsec); fb->refresh_nsec = refresh_nsec; fb->flags = flags; } static void feedback_discarded(void *data, struct presentation_feedback *presentation_feedback) { struct feedback *fb = data; assert(fb->result == FB_PENDING); fb->result = FB_DISCARDED; } static const struct presentation_feedback_listener feedback_listener = { feedback_sync_output, feedback_presented, feedback_discarded }; static struct feedback * feedback_create(struct client *client, struct wl_surface *surface) { struct feedback *fb; fb = xzalloc(sizeof *fb); fb->client = client; fb->obj = presentation_feedback(get_presentation(client), surface); presentation_feedback_add_listener(fb->obj, &feedback_listener, fb); return fb; } static void feedback_wait(struct feedback *fb) { while (fb->result == FB_PENDING) { assert(wl_display_dispatch(fb->client->wl_display) >= 0); } } static char * pflags_to_str(uint32_t flags, char *str, unsigned len) { static const struct { uint32_t flag; char sym; } desc[] = { { PRESENTATION_FEEDBACK_KIND_VSYNC, 's' }, { PRESENTATION_FEEDBACK_KIND_HW_CLOCK, 'c' }, { PRESENTATION_FEEDBACK_KIND_HW_COMPLETION, 'e' }, { PRESENTATION_FEEDBACK_KIND_ZERO_COPY, 'z' }, }; unsigned i; *str = '\0'; if (len < ARRAY_LENGTH(desc) + 1) return str; for (i = 0; i < ARRAY_LENGTH(desc); i++) str[i] = flags & desc[i].flag ? desc[i].sym : '_'; str[ARRAY_LENGTH(desc)] = '\0'; return str; } static void feedback_print(struct feedback *fb) { char str[10]; switch (fb->result) { case FB_PENDING: printf("pending"); return; case FB_DISCARDED: printf("discarded"); return; case FB_PRESENTED: break; } pflags_to_str(fb->flags, str, sizeof str); printf("presented %lld.%09lld, refresh %u us, [%s] seq %" PRIu64, (long long)fb->time.tv_sec, (long long)fb->time.tv_nsec, fb->refresh_nsec / 1000, str, fb->seq); } static void feedback_destroy(struct feedback *fb) { presentation_feedback_destroy(fb->obj); free(fb); } TEST(test_presentation_feedback_simple) { struct client *client; struct feedback *fb; client = create_client_and_test_surface(100, 50, 123, 77); assert(client); wl_surface_attach(client->surface->wl_surface, client->surface->wl_buffer, 0, 0); fb = feedback_create(client, client->surface->wl_surface); wl_surface_damage(client->surface->wl_surface, 0, 0, 100, 100); wl_surface_commit(client->surface->wl_surface); client_roundtrip(client); feedback_wait(fb); printf("%s feedback:", __func__); feedback_print(fb); printf("\n"); feedback_destroy(fb); } weston-1.9.0/tests/weston-tests-env0000775000175000017500000000462412527750600014332 00000000000000#!/bin/bash TEST_FILE=${1##*/} TEST_NAME=${TEST_FILE%.*} if [ -z "$TEST_NAME" ]; then echo "usage: $(basename $0) " exit 1; fi WESTON=$abs_builddir/weston LOGDIR=$abs_builddir/logs mkdir -p "$LOGDIR" || exit SERVERLOG="$LOGDIR/${TEST_NAME}-serverlog.txt" OUTLOG="$LOGDIR/${TEST_NAME}-log.txt" rm -f "$SERVERLOG" || exit BACKEND=${BACKEND:-headless-backend.so} MODDIR=$abs_builddir/.libs SHELL_PLUGIN=$MODDIR/desktop-shell.so TEST_PLUGIN=$MODDIR/weston-test.so XWAYLAND_PLUGIN=$MODDIR/xwayland.so CONFIG_FILE="${TEST_NAME}.ini" if [ -e "${abs_builddir}/${CONFIG_FILE}" ]; then CONFIG="--config=${abs_builddir}/${CONFIG_FILE}" elif [ -e "${abs_top_srcdir}/tests/${CONFIG_FILE}" ]; then CONFIG="--config=${abs_top_srcdir}/tests/${CONFIG_FILE}" else CONFIG="--no-config" fi case $TEST_FILE in ivi-*.la|ivi-*.so) SHELL_PLUGIN=$MODDIR/ivi-shell.so WESTON_BUILD_DIR=$abs_builddir \ WESTON_TEST_REFERENCE_PATH=$abs_top_srcdir/tests/reference \ $WESTON --backend=$MODDIR/$BACKEND \ --config=$abs_builddir/tests/weston-ivi.ini \ --shell=$SHELL_PLUGIN \ --socket=test-${TEST_NAME} \ --modules=$TEST_PLUGIN \ --ivi-module=$MODDIR/${TEST_FILE/.la/.so} \ --log="$SERVERLOG" \ &> "$OUTLOG" ;; *.la|*.so) WESTON_BUILD_DIR=$abs_builddir \ WESTON_TEST_REFERENCE_PATH=$abs_top_srcdir/tests/reference \ $WESTON --backend=$MODDIR/$BACKEND \ --shell=$SHELL_PLUGIN \ --socket=test-${TEST_NAME} \ --modules=$MODDIR/${TEST_FILE/.la/.so},$XWAYLAND_PLUGIN \ --log="$SERVERLOG" \ ${CONFIG} \ &> "$OUTLOG" ;; ivi-*.weston) SHELL_PLUGIN=$MODDIR/ivi-shell.so WESTON_BUILD_DIR=$abs_builddir \ WESTON_TEST_REFERENCE_PATH=$abs_top_srcdir/tests/reference \ WESTON_TEST_CLIENT_PATH=$abs_builddir/$TEST_FILE $WESTON \ --socket=test-${TEST_NAME} \ --backend=$MODDIR/$BACKEND \ --config=$abs_builddir/tests/weston-ivi.ini \ --shell=$SHELL_PLUGIN \ --log="$SERVERLOG" \ --modules=$TEST_PLUGIN \ $($abs_builddir/$TESTNAME --params) \ &> "$OUTLOG" ;; *) WESTON_BUILD_DIR=$abs_builddir \ WESTON_TEST_REFERENCE_PATH=$abs_top_srcdir/tests/reference \ WESTON_TEST_CLIENT_PATH=$abs_builddir/$TEST_FILE $WESTON \ --socket=test-${TEST_NAME} \ --backend=$MODDIR/$BACKEND \ --shell=$SHELL_PLUGIN \ --log="$SERVERLOG" \ --modules=$TEST_PLUGIN,$XWAYLAND_PLUGIN \ ${CONFIG} \ $($abs_builddir/$TEST_FILE --params) \ &> "$OUTLOG" esac weston-1.9.0/tests/ivi-test.h0000664000175000017500000000316012543150037013042 00000000000000/* * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef IVI_TEST_H #define IVI_TEST_H /* * IVI_TEST_SURFACE_ID_BASE is an arbitrary number picked for the * IVI tests. The only requirement is that it does not clash with * any other ivi-id range used in Weston. */ #define IVI_TEST_SURFACE_ID_BASE 0xffc01200 #define IVI_TEST_SURFACE_ID(i) (IVI_TEST_SURFACE_ID_BASE + i) #define IVI_TEST_LAYER_ID_BASE 0xeef01200 #define IVI_TEST_LAYER_ID(i) (IVI_TEST_LAYER_ID_BASE + i) #define IVI_TEST_SURFACE_COUNT (3) #endif /* IVI_TEST_H */ weston-1.9.0/tests/buffer-count-test.c0000664000175000017500000001116012537664635014665 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "weston-test-client-helper.h" #include "shared/platform.h" #define fail(msg) { fprintf(stderr, "%s failed\n", msg); return -1; } struct test_data { struct client *client; EGLDisplay egl_dpy; EGLContext egl_ctx; EGLConfig egl_conf; EGLSurface egl_surface; }; static int init_egl(struct test_data *test_data) { struct wl_egl_window *native_window; struct surface *surface = test_data->client->surface; const char *str, *mesa; static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 0, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; EGLint major, minor, n; EGLBoolean ret; test_data->egl_dpy = weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR, test_data->client->wl_display, NULL); if (!test_data->egl_dpy) fail("eglGetPlatformDisplay or eglGetDisplay"); if (eglInitialize(test_data->egl_dpy, &major, &minor) != EGL_TRUE) fail("eglInitialize"); if (eglBindAPI(EGL_OPENGL_ES_API) != EGL_TRUE) fail("eglBindAPI"); ret = eglChooseConfig(test_data->egl_dpy, config_attribs, &test_data->egl_conf, 1, &n); if (!(ret && n == 1)) fail("eglChooseConfig"); test_data->egl_ctx = eglCreateContext(test_data->egl_dpy, test_data->egl_conf, EGL_NO_CONTEXT, context_attribs); if (!test_data->egl_ctx) fail("eglCreateContext"); native_window = wl_egl_window_create(surface->wl_surface, surface->width, surface->height); test_data->egl_surface = weston_platform_create_egl_surface(test_data->egl_dpy, test_data->egl_conf, native_window, NULL); ret = eglMakeCurrent(test_data->egl_dpy, test_data->egl_surface, test_data->egl_surface, test_data->egl_ctx); if (ret != EGL_TRUE) fail("eglMakeCurrent"); /* This test is specific to mesa 10.1 and later, which is the * first release that doesn't accidentally triple-buffer. */ str = (const char *) glGetString(GL_VERSION); mesa = strstr(str, "Mesa "); if (mesa == NULL) skip("unknown EGL implementation (%s)\n", str); if (sscanf(mesa + 5, "%d.%d", &major, &minor) != 2) skip("unrecognized mesa version (%s)\n", str); if (major < 10 || (major == 10 && minor < 1)) skip("mesa version too old (%s)\n", str); return 0; } TEST(test_buffer_count) { struct test_data test_data; uint32_t buffer_count; int i; test_data.client = create_client_and_test_surface(10, 10, 10, 10); if (!test_data.client->has_wl_drm) skip("compositor has not bound its display to EGL\n"); if (init_egl(&test_data) < 0) skip("could not initialize egl, " "possibly using the headless backend\n"); /* This is meant to represent a typical game loop which is * expecting eglSwapBuffers to block and throttle the * rendering to a sensible frame rate. Therefore it doesn't * expect to have to install a frame callback itself. I'd * imagine this is what a typical SDL game would end up * doing */ for (i = 0; i < 10; i++) { glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(test_data.egl_dpy, test_data.egl_surface); } buffer_count = get_n_egl_buffers(test_data.client); printf("buffers used = %i\n", buffer_count); /* The implementation should only end up creating two buffers * and cycling between them */ assert(buffer_count == 2); } weston-1.9.0/tests/weston-test-client-helper.c0000664000175000017500000005761312575610240016334 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include "shared/os-compatibility.h" #include "weston-test-client-helper.h" #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) > (b)) ? (b) : (a)) #define clip(x, a, b) min(max(x, a), b) void * fail_on_null(void *p) { if (p == NULL) { fprintf(stderr, "out of memory\n"); exit(EXIT_FAILURE); } return p; } int surface_contains(struct surface *surface, int x, int y) { /* test whether a global x,y point is contained in the surface */ int sx = surface->x; int sy = surface->y; int sw = surface->width; int sh = surface->height; return x >= sx && y >= sy && x < sx + sw && y < sy + sh; } static void frame_callback_handler(void *data, struct wl_callback *callback, uint32_t time) { int *done = data; *done = 1; wl_callback_destroy(callback); } static const struct wl_callback_listener frame_listener = { frame_callback_handler }; struct wl_callback * frame_callback_set(struct wl_surface *surface, int *done) { struct wl_callback *callback; *done = 0; callback = wl_surface_frame(surface); wl_callback_add_listener(callback, &frame_listener, done); return callback; } int frame_callback_wait_nofail(struct client *client, int *done) { while (!*done) { if (wl_display_dispatch(client->wl_display) < 0) return 0; } return 1; } void move_client(struct client *client, int x, int y) { struct surface *surface = client->surface; int done; client->surface->x = x; client->surface->y = y; weston_test_move_surface(client->test->weston_test, surface->wl_surface, surface->x, surface->y); /* The attach here is necessary because commit() will call configure * only on surfaces newly attached, and the one that sets the surface * position is the configure. */ wl_surface_attach(surface->wl_surface, surface->wl_buffer, 0, 0); wl_surface_damage(surface->wl_surface, 0, 0, surface->width, surface->height); frame_callback_set(surface->wl_surface, &done); wl_surface_commit(surface->wl_surface); frame_callback_wait(client, &done); } int get_n_egl_buffers(struct client *client) { client->test->n_egl_buffers = -1; weston_test_get_n_egl_buffers(client->test->weston_test); wl_display_roundtrip(client->wl_display); return client->test->n_egl_buffers; } static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *wl_surface, wl_fixed_t x, wl_fixed_t y) { struct pointer *pointer = data; pointer->focus = wl_surface_get_user_data(wl_surface); pointer->x = wl_fixed_to_int(x); pointer->y = wl_fixed_to_int(y); fprintf(stderr, "test-client: got pointer enter %d %d, surface %p\n", pointer->x, pointer->y, pointer->focus); } static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *wl_surface) { struct pointer *pointer = data; pointer->focus = NULL; fprintf(stderr, "test-client: got pointer leave, surface %p\n", wl_surface_get_user_data(wl_surface)); } static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct pointer *pointer = data; pointer->x = wl_fixed_to_int(x); pointer->y = wl_fixed_to_int(y); fprintf(stderr, "test-client: got pointer motion %d %d\n", pointer->x, pointer->y); } static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { struct pointer *pointer = data; pointer->button = button; pointer->state = state; fprintf(stderr, "test-client: got pointer button %u %u\n", button, state); } static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { fprintf(stderr, "test-client: got pointer axis %u %f\n", axis, wl_fixed_to_double(value)); } static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, }; static void keyboard_handle_keymap(void *data, struct wl_keyboard *wl_keyboard, uint32_t format, int fd, uint32_t size) { close(fd); fprintf(stderr, "test-client: got keyboard keymap\n"); } static void keyboard_handle_enter(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *wl_surface, struct wl_array *keys) { struct keyboard *keyboard = data; keyboard->focus = wl_surface_get_user_data(wl_surface); fprintf(stderr, "test-client: got keyboard enter, surface %p\n", keyboard->focus); } static void keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, struct wl_surface *wl_surface) { struct keyboard *keyboard = data; keyboard->focus = NULL; fprintf(stderr, "test-client: got keyboard leave, surface %p\n", wl_surface_get_user_data(wl_surface)); } static void keyboard_handle_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { struct keyboard *keyboard = data; keyboard->key = key; keyboard->state = state; fprintf(stderr, "test-client: got keyboard key %u %u\n", key, state); } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct keyboard *keyboard = data; keyboard->mods_depressed = mods_depressed; keyboard->mods_latched = mods_latched; keyboard->mods_locked = mods_locked; keyboard->group = group; fprintf(stderr, "test-client: got keyboard modifiers %u %u %u %u\n", mods_depressed, mods_latched, mods_locked, group); } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, int32_t rate, int32_t delay) { struct keyboard *keyboard = data; keyboard->repeat_info.rate = rate; keyboard->repeat_info.delay = delay; fprintf(stderr, "test-client: got keyboard repeat_info %d %d\n", rate, delay); } static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, keyboard_handle_repeat_info, }; static void touch_handle_down(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct touch *touch = data; touch->down_x = wl_fixed_to_int(x_w); touch->down_y = wl_fixed_to_int(y_w); touch->id = id; fprintf(stderr, "test-client: got touch down %d %d, surf: %p, id: %d\n", touch->down_x, touch->down_y, surface, id); } static void touch_handle_up(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id) { struct touch *touch = data; touch->up_id = id; fprintf(stderr, "test-client: got touch up, id: %d\n", id); } static void touch_handle_motion(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct touch *touch = data; touch->x = wl_fixed_to_int(x_w); touch->y = wl_fixed_to_int(y_w); fprintf(stderr, "test-client: got touch motion, %d %d, id: %d\n", touch->x, touch->y, id); } static void touch_handle_frame(void *data, struct wl_touch *wl_touch) { struct touch *touch = data; ++touch->frame_no; fprintf(stderr, "test-client: got touch frame (%d)\n", touch->frame_no); } static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) { struct touch *touch = data; ++touch->cancel_no; fprintf(stderr, "test-client: got touch cancel (%d)\n", touch->cancel_no); } static const struct wl_touch_listener touch_listener = { touch_handle_down, touch_handle_up, touch_handle_motion, touch_handle_frame, touch_handle_cancel, }; static void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *output) { struct surface *surface = data; surface->output = wl_output_get_user_data(output); fprintf(stderr, "test-client: got surface enter output %p\n", surface->output); } static void surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output) { struct surface *surface = data; surface->output = NULL; fprintf(stderr, "test-client: got surface leave output %p\n", wl_output_get_user_data(output)); } static const struct wl_surface_listener surface_listener = { surface_enter, surface_leave }; struct wl_buffer * create_shm_buffer(struct client *client, int width, int height, void **pixels) { struct wl_shm *shm = client->wl_shm; int stride = width * 4; int size = stride * height; struct wl_shm_pool *pool; struct wl_buffer *buffer; int fd; void *data; fd = os_create_anonymous_file(size); assert(fd >= 0); data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { close(fd); assert(data != MAP_FAILED); } pool = wl_shm_create_pool(shm, fd, size); buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_ARGB8888); wl_shm_pool_destroy(pool); close(fd); if (pixels) *pixels = data; return buffer; } static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct client *client = data; if (format == WL_SHM_FORMAT_ARGB8888) client->has_argb = 1; } struct wl_shm_listener shm_listener = { shm_format }; static void test_handle_pointer_position(void *data, struct weston_test *weston_test, wl_fixed_t x, wl_fixed_t y) { struct test *test = data; test->pointer_x = wl_fixed_to_int(x); test->pointer_y = wl_fixed_to_int(y); fprintf(stderr, "test-client: got global pointer %d %d\n", test->pointer_x, test->pointer_y); } static void test_handle_n_egl_buffers(void *data, struct weston_test *weston_test, uint32_t n) { struct test *test = data; test->n_egl_buffers = n; } static void test_handle_capture_screenshot_done(void *data, struct weston_test *weston_test) { struct test *test = data; printf("Screenshot has been captured\n"); test->buffer_copy_done = 1; } static const struct weston_test_listener test_listener = { test_handle_pointer_position, test_handle_n_egl_buffers, test_handle_capture_screenshot_done, }; static void input_update_devices(struct input *input) { struct pointer *pointer; struct keyboard *keyboard; struct touch *touch; struct wl_seat *seat = input->wl_seat; enum wl_seat_capability caps = input->caps; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { pointer = xzalloc(sizeof *pointer); pointer->wl_pointer = wl_seat_get_pointer(seat); wl_pointer_set_user_data(pointer->wl_pointer, pointer); wl_pointer_add_listener(pointer->wl_pointer, &pointer_listener, pointer); input->pointer = pointer; } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { wl_pointer_destroy(input->pointer->wl_pointer); free(input->pointer); input->pointer = NULL; } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->keyboard) { keyboard = xzalloc(sizeof *keyboard); keyboard->wl_keyboard = wl_seat_get_keyboard(seat); wl_keyboard_set_user_data(keyboard->wl_keyboard, keyboard); wl_keyboard_add_listener(keyboard->wl_keyboard, &keyboard_listener, keyboard); input->keyboard = keyboard; } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->keyboard) { wl_keyboard_destroy(input->keyboard->wl_keyboard); free(input->keyboard); input->keyboard = NULL; } if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { touch = xzalloc(sizeof *touch); touch->wl_touch = wl_seat_get_touch(seat); wl_touch_set_user_data(touch->wl_touch, touch); wl_touch_add_listener(touch->wl_touch, &touch_listener, touch); input->touch = touch; } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { wl_touch_destroy(input->touch->wl_touch); free(input->touch); input->touch = NULL; } } static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { struct input *input = data; input->caps = caps; /* we will create/update the devices only with the right (test) seat. * If we haven't discovered which seat is the test seat, just * store capabilities and bail out */ if (input->seat_name && strcmp(input->seat_name, "test-seat") == 0) input_update_devices(input); fprintf(stderr, "test-client: got seat %p capabilities: %x\n", input, caps); } static void seat_handle_name(void *data, struct wl_seat *seat, const char *name) { struct input *input = data; input->seat_name = strdup(name); assert(input->seat_name && "No memory"); fprintf(stderr, "test-client: got seat %p name: \'%s\'\n", input, name); } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, seat_handle_name, }; static void output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, int physical_width, int physical_height, int subpixel, const char *make, const char *model, int32_t transform) { struct output *output = data; output->x = x; output->y = y; } static void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh) { struct output *output = data; if (flags & WL_OUTPUT_MODE_CURRENT) { output->width = width; output->height = height; } } static void output_handle_scale(void *data, struct wl_output *wl_output, int scale) { struct output *output = data; output->scale = scale; } static void output_handle_done(void *data, struct wl_output *wl_output) { struct output *output = data; output->initialized = 1; } static const struct wl_output_listener output_listener = { output_handle_geometry, output_handle_mode, output_handle_done, output_handle_scale, }; static void handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct client *client = data; struct output *output; struct test *test; struct global *global; struct input *input; global = xzalloc(sizeof *global); global->name = id; global->interface = strdup(interface); assert(interface); global->version = version; wl_list_insert(client->global_list.prev, &global->link); if (strcmp(interface, "wl_compositor") == 0) { client->wl_compositor = wl_registry_bind(registry, id, &wl_compositor_interface, version); } else if (strcmp(interface, "wl_seat") == 0) { input = xzalloc(sizeof *input); input->wl_seat = wl_registry_bind(registry, id, &wl_seat_interface, version); wl_seat_add_listener(input->wl_seat, &seat_listener, input); wl_list_insert(&client->inputs, &input->link); } else if (strcmp(interface, "wl_shm") == 0) { client->wl_shm = wl_registry_bind(registry, id, &wl_shm_interface, version); wl_shm_add_listener(client->wl_shm, &shm_listener, client); } else if (strcmp(interface, "wl_output") == 0) { output = xzalloc(sizeof *output); output->wl_output = wl_registry_bind(registry, id, &wl_output_interface, version); wl_output_add_listener(output->wl_output, &output_listener, output); client->output = output; } else if (strcmp(interface, "weston_test") == 0) { test = xzalloc(sizeof *test); test->weston_test = wl_registry_bind(registry, id, &weston_test_interface, version); weston_test_add_listener(test->weston_test, &test_listener, test); client->test = test; } else if (strcmp(interface, "wl_drm") == 0) { client->has_wl_drm = true; } } static const struct wl_registry_listener registry_listener = { handle_global }; void skip(const char *fmt, ...) { va_list argp; va_start(argp, fmt); vfprintf(stderr, fmt, argp); va_end(argp); /* automake tests uses exit code 77. weston-test-runner will see * this and use it, and then weston-test's sigchld handler (in the * weston process) will use that as an exit status, which is what * automake will see in the end. */ exit(77); } void expect_protocol_error(struct client *client, const struct wl_interface *intf, uint32_t code) { int err; uint32_t errcode, failed = 0; const struct wl_interface *interface; unsigned int id; /* if the error has not come yet, make it happen */ wl_display_roundtrip(client->wl_display); err = wl_display_get_error(client->wl_display); assert(err && "Expected protocol error but nothing came"); assert(err == EPROTO && "Expected protocol error but got local error"); errcode = wl_display_get_protocol_error(client->wl_display, &interface, &id); /* check error */ if (errcode != code) { fprintf(stderr, "Should get error code %d but got %d\n", code, errcode); failed = 1; } /* this should be definitely set */ assert(interface); if (strcmp(intf->name, interface->name) != 0) { fprintf(stderr, "Should get interface '%s' but got '%s'\n", intf->name, interface->name); failed = 1; } if (failed) { fprintf(stderr, "Expected other protocol error\n"); abort(); } /* all OK */ fprintf(stderr, "Got expected protocol error on '%s' (object id: %d) " "with code %d\n", interface->name, id, errcode); } static void log_handler(const char *fmt, va_list args) { fprintf(stderr, "libwayland: "); vfprintf(stderr, fmt, args); } static void input_destroy(struct input *inp) { wl_list_remove(&inp->link); wl_seat_destroy(inp->wl_seat); free(inp); } /* find the test-seat and set it in client. * Destroy other inputs */ static void client_set_input(struct client *cl) { struct input *inp, *inptmp; wl_list_for_each_safe(inp, inptmp, &cl->inputs, link) { assert(inp->seat_name && "BUG: input with no name"); if (strcmp(inp->seat_name, "test-seat") == 0) { cl->input = inp; input_update_devices(inp); } else { input_destroy(inp); } } /* we keep only one input */ assert(wl_list_length(&cl->inputs) == 1); } struct client * create_client(void) { struct client *client; wl_log_set_handler_client(log_handler); /* connect to display */ client = xzalloc(sizeof *client); client->wl_display = wl_display_connect(NULL); assert(client->wl_display); wl_list_init(&client->global_list); wl_list_init(&client->inputs); /* setup registry so we can bind to interfaces */ client->wl_registry = wl_display_get_registry(client->wl_display); wl_registry_add_listener(client->wl_registry, ®istry_listener, client); /* this roundtrip makes sure we have all globals and we bound to them */ client_roundtrip(client); /* this roundtrip makes sure we got all wl_shm.format and wl_seat.* * events */ client_roundtrip(client); /* find the right input for us */ client_set_input(client); /* must have WL_SHM_FORMAT_ARGB32 */ assert(client->has_argb); /* must have weston_test interface */ assert(client->test); /* must have an output */ assert(client->output); /* the output must be initialized */ assert(client->output->initialized == 1); /* must have seat set */ assert(client->input); return client; } struct client * create_client_and_test_surface(int x, int y, int width, int height) { struct client *client; struct surface *surface; client = create_client(); /* initialize the client surface */ surface = xzalloc(sizeof *surface); surface->wl_surface = wl_compositor_create_surface(client->wl_compositor); assert(surface->wl_surface); wl_surface_add_listener(surface->wl_surface, &surface_listener, surface); client->surface = surface; wl_surface_set_user_data(surface->wl_surface, surface); surface->width = width; surface->height = height; surface->wl_buffer = create_shm_buffer(client, width, height, &surface->data); memset(surface->data, 64, width * height * 4); move_client(client, x, y); return client; } static const char* output_path(void) { char *path = getenv("WESTON_TEST_OUTPUT_PATH"); if (!path) return "."; return path; } char* screenshot_output_filename(const char *basename, uint32_t seq) { char *filename; if (asprintf(&filename, "%s/%s-%02d.png", output_path(), basename, seq) < 0) return NULL; return filename; } static const char* reference_path(void) { char *path = getenv("WESTON_TEST_REFERENCE_PATH"); if (!path) return "./tests/reference"; return path; } char* screenshot_reference_filename(const char *basename, uint32_t seq) { char *filename; if (asprintf(&filename, "%s/%s-%02d.png", reference_path(), basename, seq) < 0) return NULL; return filename; } /** * check_surfaces_geometry() - verifies two surfaces are same size * * @returns true if surfaces have the same width and height, or false * if not, or if there is no actual data. */ bool check_surfaces_geometry(const struct surface *a, const struct surface *b) { if (a == NULL || b == NULL) { printf("Undefined surfaces\n"); return false; } else if (a->data == NULL || b->data == NULL) { printf("Undefined data\n"); return false; } else if (a->width != b->width || a->height != b->height) { printf("Mismatched dimensions: %d,%d != %d,%d\n", a->width, a->height, b->width, b->height); return false; } return true; } /** * check_surfaces_equal() - tests if two surfaces are pixel-identical * * Returns true if surface buffers have all the same byte values, * false if the surfaces don't match or can't be compared due to * different dimensions. */ bool check_surfaces_equal(const struct surface *a, const struct surface *b) { int bpp = 4; /* Assumes ARGB */ if (!check_surfaces_geometry(a, b)) return false; return (memcmp(a->data, b->data, bpp * a->width * a->height) == 0); } /** * check_surfaces_match_in_clip() - tests if a given region within two * surfaces are pixel-identical. * * Returns true if the two surfaces have the same byte values within the * given clipping region, or false if they don't match or the surfaces * can't be compared. */ bool check_surfaces_match_in_clip(const struct surface *a, const struct surface *b, const struct rectangle *clip_rect) { int i, j; int x0, y0, x1, y1; void *p, *q; int bpp = 4; /* Assumes ARGB */ if (!check_surfaces_geometry(a, b) || clip_rect == NULL) return false; if (clip_rect->x > a->width || clip_rect->y > a->height) { printf("Clip outside image boundaries\n"); return true; } x0 = max(0, clip_rect->x); y0 = max(0, clip_rect->y); x1 = min(a->width, clip_rect->x + clip_rect->width); y1 = min(a->height, clip_rect->y + clip_rect->height); if (x0 == x1 || y0 == y1) { printf("Degenerate comparison\n"); return true; } printf("Bytewise comparison inside clip\n"); for (i=y0; idata + i * a->width * bpp + x0 * bpp; q = b->data + i * b->width * bpp + x0 * bpp; if (memcmp(p, q, (x1-x0)*bpp) != 0) { /* Dump the bad row */ printf("Mismatched image on row %d\n", i); for (j=0; j<(x1-x0)*bpp; j++) { char a_char = *((char*)(p+j*bpp)); char b_char = *((char*)(q+j*bpp)); printf("%d,%d: %8x %8x %s\n", i, j, a_char, b_char, (a_char != b_char)? " <---": ""); } return false; } } return true; } weston-1.9.0/tests/xwayland-test.c0000664000175000017500000000617612537627703014123 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * xwayland-test: Confirm that we can map a window and we're running * under Xwayland, not just X. * * This is done in steps: * 1) Confirm that the WL_SURFACE_ID atom exists * 2) Confirm that the window manager's name is "Weston WM" * 3) Make sure we can map a window */ #include "config.h" #include #include #include #include #include #include #include #include "weston-test-runner.h" TEST(xwayland_client_test) { Display *display; Window window, root, *support; XEvent event; int screen, status, actual_format; unsigned long nitems, bytes; Atom atom, type_atom, actual_type; char *wm_name; display = XOpenDisplay(NULL); if (!display) exit(EXIT_FAILURE); atom = XInternAtom(display, "WL_SURFACE_ID", True); assert(atom != None); atom = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", True); assert(atom != None); screen = DefaultScreen(display); root = RootWindow(display, screen); status = XGetWindowProperty(display, root, atom, 0L, ~0L, False, XA_WINDOW, &actual_type, &actual_format, &nitems, &bytes, (void *)&support); assert(status == Success); atom = XInternAtom(display, "_NET_WM_NAME", True); assert(atom != None); type_atom = XInternAtom(display, "UTF8_STRING", True); assert(atom != None); status = XGetWindowProperty(display, *support, atom, 0L, BUFSIZ, False, type_atom, &actual_type, &actual_format, &nitems, &bytes, (void *)&wm_name); assert(status == Success); assert(nitems); assert(strcmp("Weston WM", wm_name) == 0); free(support); free(wm_name); window = XCreateSimpleWindow(display, root, 100, 100, 300, 300, 1, BlackPixel(display, screen), WhitePixel(display, screen)); XSelectInput(display, window, ExposureMask); XMapWindow(display, window); alarm(4); while (1) { XNextEvent(display, &event); if (event.type == Expose) break; } XCloseDisplay(display); exit(EXIT_SUCCESS); } weston-1.9.0/tests/weston-test.c0000664000175000017500000003576012556771651013617 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "src/compositor.h" #include "weston-test-server-protocol.h" #ifdef ENABLE_EGL #include #include #include "src/weston-egl-ext.h" #endif /* ENABLE_EGL */ #include "shared/helpers.h" struct weston_test { struct weston_compositor *compositor; struct weston_layer layer; struct weston_process process; struct weston_seat seat; }; struct weston_test_surface { struct weston_surface *surface; struct weston_view *view; int32_t x, y; struct weston_test *test; }; static void test_client_sigchld(struct weston_process *process, int status) { struct weston_test *test = container_of(process, struct weston_test, process); /* Chain up from weston-test-runner's exit code so that automake * knows the exit status and can report e.g. skipped tests. */ if (WIFEXITED(status) && WEXITSTATUS(status) != 0) exit(WEXITSTATUS(status)); /* In case the child aborted or segfaulted... */ assert(status == 0); wl_display_terminate(test->compositor->wl_display); } static struct weston_seat * get_seat(struct weston_test *test) { return &test->seat; } static void notify_pointer_position(struct weston_test *test, struct wl_resource *resource) { struct weston_seat *seat = get_seat(test); struct weston_pointer *pointer = weston_seat_get_pointer(seat); weston_test_send_pointer_position(resource, pointer->x, pointer->y); } static void test_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct weston_test_surface *test_surface = surface->configure_private; struct weston_test *test = test_surface->test; if (wl_list_empty(&test_surface->view->layer_link.link)) weston_layer_entry_insert(&test->layer.view_list, &test_surface->view->layer_link); weston_view_set_position(test_surface->view, test_surface->x, test_surface->y); weston_view_update_transform(test_surface->view); } static void move_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource, int32_t x, int32_t y) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct weston_test_surface *test_surface; test_surface = surface->configure_private; if (!test_surface) { test_surface = malloc(sizeof *test_surface); if (!test_surface) { wl_resource_post_no_memory(resource); return; } test_surface->view = weston_view_create(surface); if (!test_surface->view) { wl_resource_post_no_memory(resource); free(test_surface); return; } surface->configure_private = test_surface; surface->configure = test_surface_configure; } test_surface->surface = surface; test_surface->test = wl_resource_get_user_data(resource); test_surface->x = x; test_surface->y = y; } static void move_pointer(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y) { struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); struct weston_pointer *pointer = weston_seat_get_pointer(seat); notify_motion(seat, 100, wl_fixed_from_int(x) - pointer->x, wl_fixed_from_int(y) - pointer->y); notify_pointer_position(test, resource); } static void send_button(struct wl_client *client, struct wl_resource *resource, int32_t button, uint32_t state) { struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); notify_button(seat, 100, button, state); } static void activate_surface(struct wl_client *client, struct wl_resource *resource, struct wl_resource *surface_resource) { struct weston_surface *surface = surface_resource ? wl_resource_get_user_data(surface_resource) : NULL; struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat; struct weston_keyboard *keyboard; seat = get_seat(test); keyboard = weston_seat_get_keyboard(seat); if (surface) { weston_surface_activate(surface, seat); notify_keyboard_focus_in(seat, &keyboard->keys, STATE_UPDATE_AUTOMATIC); } else { notify_keyboard_focus_out(seat); weston_surface_activate(surface, seat); } } static void send_key(struct wl_client *client, struct wl_resource *resource, uint32_t key, enum wl_keyboard_key_state state) { struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); notify_key(seat, 100, key, state, STATE_UPDATE_AUTOMATIC); } static void device_release(struct wl_client *client, struct wl_resource *resource, const char *device) { struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); if (strcmp(device, "pointer") == 0) { weston_seat_release_pointer(seat); } else if (strcmp(device, "keyboard") == 0) { weston_seat_release_keyboard(seat); } else if (strcmp(device, "touch") == 0) { weston_seat_release_touch(seat); } else if (strcmp(device, "seat") == 0) { weston_seat_release(seat); } else { assert(0 && "Unsupported device"); } } static void device_add(struct wl_client *client, struct wl_resource *resource, const char *device) { struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); if (strcmp(device, "pointer") == 0) { weston_seat_init_pointer(seat); } else if (strcmp(device, "keyboard") == 0) { weston_seat_init_keyboard(seat, NULL); } else if (strcmp(device, "touch") == 0) { weston_seat_init_touch(seat); } else { assert(0 && "Unsupported device"); } } #ifdef ENABLE_EGL static int is_egl_buffer(struct wl_resource *resource) { PFNEGLQUERYWAYLANDBUFFERWL query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); EGLint format; if (query_buffer(eglGetCurrentDisplay(), resource, EGL_TEXTURE_FORMAT, &format)) return 1; return 0; } #endif /* ENABLE_EGL */ static void get_n_buffers(struct wl_client *client, struct wl_resource *resource) { int n_buffers = 0; #ifdef ENABLE_EGL struct wl_resource *buffer_resource; int i; for (i = 0; i < 1000; i++) { buffer_resource = wl_client_get_object(client, i); if (buffer_resource == NULL) continue; if (is_egl_buffer(buffer_resource)) n_buffers++; } #endif /* ENABLE_EGL */ weston_test_send_n_egl_buffers(resource, n_buffers); } enum weston_test_screenshot_outcome { WESTON_TEST_SCREENSHOT_SUCCESS, WESTON_TEST_SCREENSHOT_NO_MEMORY, WESTON_TEST_SCREENSHOT_BAD_BUFFER }; typedef void (*weston_test_screenshot_done_func_t)(void *data, enum weston_test_screenshot_outcome outcome); struct test_screenshot { struct weston_compositor *compositor; struct wl_global *global; struct wl_client *client; struct weston_process process; struct wl_listener destroy_listener; }; struct test_screenshot_frame_listener { struct wl_listener listener; struct weston_buffer *buffer; weston_test_screenshot_done_func_t done; void *data; }; static void copy_bgra_yflip(uint8_t *dst, uint8_t *src, int height, int stride) { uint8_t *end; end = dst + height * stride; while (dst < end) { memcpy(dst, src, stride); dst += stride; src -= stride; } } static void copy_bgra(uint8_t *dst, uint8_t *src, int height, int stride) { /* TODO: optimize this out */ memcpy(dst, src, height * stride); } static void copy_row_swap_RB(void *vdst, void *vsrc, int bytes) { uint32_t *dst = vdst; uint32_t *src = vsrc; uint32_t *end = dst + bytes / 4; while (dst < end) { uint32_t v = *src++; /* A R G B */ uint32_t tmp = v & 0xff00ff00; tmp |= (v >> 16) & 0x000000ff; tmp |= (v << 16) & 0x00ff0000; *dst++ = tmp; } } static void copy_rgba_yflip(uint8_t *dst, uint8_t *src, int height, int stride) { uint8_t *end; end = dst + height * stride; while (dst < end) { copy_row_swap_RB(dst, src, stride); dst += stride; src -= stride; } } static void copy_rgba(uint8_t *dst, uint8_t *src, int height, int stride) { uint8_t *end; end = dst + height * stride; while (dst < end) { copy_row_swap_RB(dst, src, stride); dst += stride; src += stride; } } static void test_screenshot_frame_notify(struct wl_listener *listener, void *data) { struct test_screenshot_frame_listener *l = container_of(listener, struct test_screenshot_frame_listener, listener); struct weston_output *output = data; struct weston_compositor *compositor = output->compositor; int32_t stride; uint8_t *pixels, *d, *s; output->disable_planes--; wl_list_remove(&listener->link); stride = l->buffer->width * (PIXMAN_FORMAT_BPP(compositor->read_format) / 8); pixels = malloc(stride * l->buffer->height); if (pixels == NULL) { l->done(l->data, WESTON_TEST_SCREENSHOT_NO_MEMORY); free(l); return; } // FIXME: Needs to handle output transformations compositor->renderer->read_pixels(output, compositor->read_format, pixels, 0, 0, output->current_mode->width, output->current_mode->height); stride = wl_shm_buffer_get_stride(l->buffer->shm_buffer); d = wl_shm_buffer_get_data(l->buffer->shm_buffer); s = pixels + stride * (l->buffer->height - 1); wl_shm_buffer_begin_access(l->buffer->shm_buffer); /* XXX: It would be nice if we used Pixman to do all this rather * than our own implementation */ switch (compositor->read_format) { case PIXMAN_a8r8g8b8: case PIXMAN_x8r8g8b8: if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP) copy_bgra_yflip(d, s, output->current_mode->height, stride); else copy_bgra(d, pixels, output->current_mode->height, stride); break; case PIXMAN_x8b8g8r8: case PIXMAN_a8b8g8r8: if (compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP) copy_rgba_yflip(d, s, output->current_mode->height, stride); else copy_rgba(d, pixels, output->current_mode->height, stride); break; default: break; } wl_shm_buffer_end_access(l->buffer->shm_buffer); l->done(l->data, WESTON_TEST_SCREENSHOT_SUCCESS); free(pixels); free(l); } static bool weston_test_screenshot_shoot(struct weston_output *output, struct weston_buffer *buffer, weston_test_screenshot_done_func_t done, void *data) { struct test_screenshot_frame_listener *l; /* Get the shm buffer resource the client created */ if (!wl_shm_buffer_get(buffer->resource)) { done(data, WESTON_TEST_SCREENSHOT_BAD_BUFFER); return false; } buffer->shm_buffer = wl_shm_buffer_get(buffer->resource); buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer); buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer); /* Verify buffer is big enough */ if (buffer->width < output->current_mode->width || buffer->height < output->current_mode->height) { done(data, WESTON_TEST_SCREENSHOT_BAD_BUFFER); return false; } /* allocate the frame listener */ l = malloc(sizeof *l); if (l == NULL) { done(data, WESTON_TEST_SCREENSHOT_NO_MEMORY); return false; } /* Set up the listener */ l->buffer = buffer; l->done = done; l->data = data; l->listener.notify = test_screenshot_frame_notify; wl_signal_add(&output->frame_signal, &l->listener); /* Fire off a repaint */ output->disable_planes++; weston_output_schedule_repaint(output); return true; } static void capture_screenshot_done(void *data, enum weston_test_screenshot_outcome outcome) { struct wl_resource *resource = data; switch (outcome) { case WESTON_TEST_SCREENSHOT_SUCCESS: weston_test_send_capture_screenshot_done(resource); break; case WESTON_TEST_SCREENSHOT_NO_MEMORY: wl_resource_post_no_memory(resource); break; default: break; } } /** * Grabs a snapshot of the screen. */ static void capture_screenshot(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource, struct wl_resource *buffer_resource) { struct weston_output *output = wl_resource_get_user_data(output_resource); struct weston_buffer *buffer = weston_buffer_from_resource(buffer_resource); if (buffer == NULL) { wl_resource_post_no_memory(resource); return; } weston_test_screenshot_shoot(output, buffer, capture_screenshot_done, resource); } static const struct weston_test_interface test_implementation = { move_surface, move_pointer, send_button, activate_surface, send_key, device_release, device_add, get_n_buffers, capture_screenshot, }; static void bind_test(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct weston_test *test = data; struct wl_resource *resource; resource = wl_resource_create(client, &weston_test_interface, 1, id); if (!resource) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &test_implementation, test, NULL); notify_pointer_position(test, resource); } static void idle_launch_client(void *data) { struct weston_test *test = data; pid_t pid; sigset_t allsigs; char *path; path = getenv("WESTON_TEST_CLIENT_PATH"); if (path == NULL) return; pid = fork(); if (pid == -1) exit(EXIT_FAILURE); if (pid == 0) { sigfillset(&allsigs); sigprocmask(SIG_UNBLOCK, &allsigs, NULL); execl(path, path, NULL); weston_log("compositor: executing '%s' failed: %m\n", path); exit(EXIT_FAILURE); } test->process.pid = pid; test->process.cleanup = test_client_sigchld; weston_watch_process(&test->process); } WL_EXPORT int module_init(struct weston_compositor *ec, int *argc, char *argv[]) { struct weston_test *test; struct wl_event_loop *loop; test = zalloc(sizeof *test); if (test == NULL) return -1; test->compositor = ec; weston_layer_init(&test->layer, &ec->cursor_layer.link); if (wl_global_create(ec->wl_display, &weston_test_interface, 1, test, bind_test) == NULL) return -1; /* create our own seat */ weston_seat_init(&test->seat, ec, "test-seat"); /* add devices */ weston_seat_init_pointer(&test->seat); weston_seat_init_keyboard(&test->seat, NULL); weston_seat_init_touch(&test->seat); loop = wl_display_get_event_loop(ec->wl_display); wl_event_loop_add_idle(loop, idle_launch_client, test); return 0; } weston-1.9.0/tests/weston-test-runner.h0000664000175000017500000000503112537664701015113 00000000000000/* * Copyright © 2012 Intel Corporation * Copyright © 2013 Sam Spilsbury * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _WESTON_TEST_RUNNER_H_ #define _WESTON_TEST_RUNNER_H_ #include "config.h" #include #include "shared/helpers.h" #ifdef NDEBUG #error "Tests must not be built with NDEBUG defined, they rely on assert()." #endif struct weston_test { const char *name; void (*run)(void *); const void *table_data; size_t element_size; int n_elements; int must_fail; } __attribute__ ((aligned (32))); #define TEST_BEGIN(name, arg) \ static void name(arg) #define TEST_COMMON(func, name, ret, data, size, n_elem) \ static void func(void *); \ \ const struct weston_test test##name \ __attribute__ ((section ("test_section"))) = \ { \ #name, func, data, size, n_elem, ret \ }; #define NO_ARG_TEST(name, ret) \ TEST_COMMON(wrap##name, name, ret, NULL, 0, 1) \ static void name(void); \ static void wrap##name(void *data) \ { \ (void) data; \ name(); \ } \ \ TEST_BEGIN(name, void) #define ARG_TEST(name, ret, test_data) \ TEST_COMMON(name, name, ret, test_data, \ sizeof(test_data[0]), \ ARRAY_LENGTH(test_data)) \ TEST_BEGIN(name, void *data) \ #define TEST(name) NO_ARG_TEST(name, 0) #define FAIL_TEST(name) NO_ARG_TEST(name, 1) #define TEST_P(name, data) ARG_TEST(name, 0, data) #define FAIL_TEST_P(name, data) ARG_TEST(name, 1, data) #endif weston-1.9.0/tests/ivi_layout-internal-test.c0000664000175000017500000010442412543150037016251 00000000000000/* * Copyright © 2013 DENSO CORPORATION * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include "src/compositor.h" #include "ivi-shell/ivi-layout-export.h" #include "ivi-shell/ivi-layout-private.h" #include "ivi-test.h" struct test_context { struct weston_compositor *compositor; const struct ivi_controller_interface *controller_interface; uint32_t user_flags; }; static void iassert_fail(const char *cond, const char *file, int line, const char *func, struct test_context *ctx) { weston_log("Assert failure in %s:%d, %s: '%s'\n", file, line, func, cond); weston_compositor_exit_with_code(ctx->compositor, EXIT_FAILURE); } #define iassert(cond) ({ \ bool b_ = (cond); \ if (!b_) \ iassert_fail(#cond, __FILE__, __LINE__, __func__, ctx); \ b_; \ }) /************************ tests begin ******************************/ /* * These are all internal ivi_layout API tests that do not require * any client objects. */ static void test_surface_bad_visibility(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; bool visibility; iassert(ctl->surface_set_visibility(NULL, true) == IVI_FAILED); ctl->commit_changes(); visibility = ctl->surface_get_visibility(NULL); iassert(visibility == false); } static void test_surface_bad_destination_rectangle(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->surface_set_destination_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED); } static void test_surface_bad_orientation(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->surface_set_orientation(NULL, WL_OUTPUT_TRANSFORM_90) == IVI_FAILED); iassert(ctl->surface_get_orientation(NULL) == WL_OUTPUT_TRANSFORM_NORMAL); } static void test_surface_bad_dimension(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf = NULL; int32_t dest_width; int32_t dest_height; iassert(ctl->surface_set_dimension(NULL, 200, 300) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->surface_get_dimension(NULL, &dest_width, &dest_height) == IVI_FAILED); iassert(ctl->surface_get_dimension(ivisurf, NULL, &dest_height) == IVI_FAILED); iassert(ctl->surface_get_dimension(ivisurf, &dest_width, NULL) == IVI_FAILED); } static void test_surface_bad_position(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf = NULL; int32_t dest_x; int32_t dest_y; iassert(ctl->surface_set_position(NULL, 20, 30) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->surface_get_position(NULL, &dest_x, &dest_y) == IVI_FAILED); iassert(ctl->surface_get_position(ivisurf, NULL, &dest_y) == IVI_FAILED); iassert(ctl->surface_get_position(ivisurf, &dest_x, NULL) == IVI_FAILED); } static void test_surface_bad_source_rectangle(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->surface_set_source_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED); } static void test_surface_bad_properties(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->get_properties_of_surface(NULL) == NULL); } static void test_layer_create(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; uint32_t id1; uint32_t id2; struct ivi_layout_layer *ivilayer; struct ivi_layout_layer *new_ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(IVI_TEST_LAYER_ID(0) == ctl->get_id_of_layer(ivilayer)); new_ivilayer = ctl->get_layer_from_id(IVI_TEST_LAYER_ID(0)); iassert(ivilayer == new_ivilayer); id1 = ctl->get_id_of_layer(ivilayer); id2 = ctl->get_id_of_layer(new_ivilayer); iassert(id1 == id2); ctl->layer_destroy(ivilayer); iassert(ctl->get_layer_from_id(IVI_TEST_LAYER_ID(0)) == NULL); } static void test_layer_visibility(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_get_visibility(ivilayer) == false); iassert(ctl->layer_set_visibility(ivilayer, true) == IVI_SUCCEEDED); iassert(ctl->layer_get_visibility(ivilayer) == false); ctl->commit_changes(); iassert(ctl->layer_get_visibility(ivilayer) == true); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->visibility == true); ctl->layer_destroy(ivilayer); } static void test_layer_opacity(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_get_opacity(ivilayer) == wl_fixed_from_double(1.0)); iassert(ctl->layer_set_opacity( ivilayer, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED); iassert(ctl->layer_get_opacity(ivilayer) == wl_fixed_from_double(1.0)); ctl->commit_changes(); iassert(ctl->layer_get_opacity(ivilayer) == wl_fixed_from_double(0.5)); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->opacity == wl_fixed_from_double(0.5)); ctl->layer_destroy(ivilayer); } static void test_layer_orientation(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_get_orientation(ivilayer) == WL_OUTPUT_TRANSFORM_NORMAL); iassert(ctl->layer_set_orientation( ivilayer, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); iassert(ctl->layer_get_orientation(ivilayer) == WL_OUTPUT_TRANSFORM_NORMAL); ctl->commit_changes(); iassert(ctl->layer_get_orientation(ivilayer) == WL_OUTPUT_TRANSFORM_90); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->orientation == WL_OUTPUT_TRANSFORM_90); ctl->layer_destroy(ivilayer); } static void test_layer_dimension(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; int32_t dest_width; int32_t dest_height; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_get_dimension( ivilayer, &dest_width, &dest_height) == IVI_SUCCEEDED); iassert(dest_width == 200); iassert(dest_height == 300); iassert(ctl->layer_set_dimension(ivilayer, 400, 600) == IVI_SUCCEEDED); iassert(ctl->layer_get_dimension( ivilayer, &dest_width, &dest_height) == IVI_SUCCEEDED); iassert(dest_width == 200); iassert(dest_height == 300); ctl->commit_changes(); iassert(IVI_SUCCEEDED == ctl->layer_get_dimension( ivilayer, &dest_width, &dest_height)); iassert(dest_width == 400); iassert(dest_height == 600); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->dest_width == 400); iassert(prop->dest_height == 600); ctl->layer_destroy(ivilayer); } static void test_layer_position(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; int32_t dest_x; int32_t dest_y; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_get_position( ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); iassert(dest_x == 0); iassert(dest_y == 0); iassert(ctl->layer_set_position(ivilayer, 20, 30) == IVI_SUCCEEDED); iassert(ctl->layer_get_position( ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); iassert(dest_x == 0); iassert(dest_y == 0); ctl->commit_changes(); iassert(ctl->layer_get_position( ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); iassert(dest_x == 20); iassert(dest_y == 30); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->dest_x == 20); iassert(prop->dest_y == 30); ctl->layer_destroy(ivilayer); } static void test_layer_destination_rectangle(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; int32_t dest_width; int32_t dest_height; int32_t dest_x; int32_t dest_y; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->dest_width == 200); iassert(prop->dest_height == 300); iassert(prop->dest_x == 0); iassert(prop->dest_y == 0); iassert(ctl->layer_set_destination_rectangle( ivilayer, 20, 30, 400, 600) == IVI_SUCCEEDED); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->dest_width == 200); iassert(prop->dest_height == 300); iassert(prop->dest_x == 0); iassert(prop->dest_y == 0); ctl->commit_changes(); iassert(ctl->layer_get_dimension( ivilayer, &dest_width, &dest_height) == IVI_SUCCEEDED); iassert(dest_width == 400); iassert(dest_height == 600); iassert(ctl->layer_get_position( ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); iassert(dest_x == 20); iassert(dest_y == 30); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->dest_width == 400); iassert(prop->dest_height == 600); iassert(prop->dest_x == 20); iassert(prop->dest_y == 30); ctl->layer_destroy(ivilayer); } static void test_layer_source_rectangle(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; const struct ivi_layout_layer_properties *prop; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->source_width == 200); iassert(prop->source_height == 300); iassert(prop->source_x == 0); iassert(prop->source_y == 0); iassert(ctl->layer_set_source_rectangle( ivilayer, 20, 30, 400, 600) == IVI_SUCCEEDED); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->source_width == 200); iassert(prop->source_height == 300); iassert(prop->source_x == 0); iassert(prop->source_y == 0); ctl->commit_changes(); prop = ctl->get_properties_of_layer(ivilayer); iassert(prop->source_width == 400); iassert(prop->source_height == 600); iassert(prop->source_x == 20); iassert(prop->source_y == 30); ctl->layer_destroy(ivilayer); } static void test_layer_bad_remove(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; ctl->layer_destroy(NULL); } static void test_layer_bad_visibility(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->layer_set_visibility(NULL, true) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_visibility(NULL) == false); } static void test_layer_bad_opacity(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_opacity( NULL, wl_fixed_from_double(0.3)) == IVI_FAILED); iassert(ctl->layer_set_opacity( ivilayer, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED); iassert(ctl->layer_set_opacity( ivilayer, wl_fixed_from_double(-1)) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_opacity(ivilayer) == wl_fixed_from_double(0.3)); iassert(ctl->layer_set_opacity( ivilayer, wl_fixed_from_double(1.1)) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_opacity(ivilayer) == wl_fixed_from_double(0.3)); iassert(ctl->layer_set_opacity( NULL, wl_fixed_from_double(0.5)) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_opacity(NULL) == wl_fixed_from_double(0.0)); ctl->layer_destroy(ivilayer); } static void test_layer_bad_destination_rectangle(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->layer_set_destination_rectangle( NULL, 20, 30, 200, 300) == IVI_FAILED); } static void test_layer_bad_orientation(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->layer_set_orientation( NULL, WL_OUTPUT_TRANSFORM_90) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_orientation(NULL) == WL_OUTPUT_TRANSFORM_NORMAL); } static void test_layer_bad_dimension(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; int32_t dest_width; int32_t dest_height; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_dimension(NULL, 200, 300) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_dimension( NULL, &dest_width, &dest_height) == IVI_FAILED); iassert(ctl->layer_get_dimension( ivilayer, NULL, &dest_height) == IVI_FAILED); iassert(ctl->layer_get_dimension( ivilayer, &dest_width, NULL) == IVI_FAILED); ctl->layer_destroy(ivilayer); } static void test_layer_bad_position(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; int32_t dest_x; int32_t dest_y; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_position(NULL, 20, 30) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->layer_get_position(NULL, &dest_x, &dest_y) == IVI_FAILED); iassert(ctl->layer_get_position(ivilayer, NULL, &dest_y) == IVI_FAILED); iassert(ctl->layer_get_position(ivilayer, &dest_x, NULL) == IVI_FAILED); ctl->layer_destroy(ivilayer); } static void test_layer_bad_source_rectangle(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->layer_set_source_rectangle( NULL, 20, 30, 200, 300) == IVI_FAILED); } static void test_layer_bad_properties(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->get_properties_of_layer(NULL) == NULL); } static void test_commit_changes_after_visibility_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_visibility(ivilayer, true) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_commit_changes_after_opacity_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_opacity( ivilayer, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_commit_changes_after_orientation_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_orientation( ivilayer, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_commit_changes_after_dimension_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_dimension(ivilayer, 200, 300) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_commit_changes_after_position_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_position(ivilayer, 20, 30) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_commit_changes_after_source_rectangle_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_source_rectangle( ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_commit_changes_after_destination_rectangle_set_layer_destroy(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); iassert(ctl->layer_set_destination_rectangle( ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayer); ctl->commit_changes(); } static void test_layer_create_duplicate(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; struct ivi_layout_layer *duplicatelayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); if (ivilayer != NULL) iassert(ivilayer->ref_count == 1); duplicatelayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer == duplicatelayer); if (ivilayer != NULL) iassert(ivilayer->ref_count == 2); ctl->layer_destroy(ivilayer); if (ivilayer != NULL) iassert(ivilayer->ref_count == 1); ctl->layer_destroy(ivilayer); } static void test_get_layer_after_destory_layer(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ivilayer != NULL); ctl->layer_destroy(ivilayer); ivilayer = ctl->get_layer_from_id(IVI_TEST_LAYER_ID(0)); iassert(ivilayer == NULL); } static void test_screen_id(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_screen **iviscrns; int32_t screen_length = 0; uint32_t id_screen; int32_t i; iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); iassert(screen_length > 0); for (i = 0; i < screen_length; ++i) { id_screen = ctl->get_id_of_screen(iviscrns[i]); iassert(ctl->get_screen_from_id(id_screen) == iviscrns[i]); } if (screen_length > 0) free(iviscrns); } static void test_screen_resolution(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_screen **iviscrns; int32_t screen_length = 0; struct weston_output *output; int32_t width; int32_t height; int32_t i; iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); iassert(screen_length > 0); for (i = 0; i < screen_length; ++i) { output = ctl->screen_get_output(iviscrns[i]); iassert(output != NULL); iassert(ctl->get_screen_resolution( iviscrns[i], &width, &height) == IVI_SUCCEEDED); iassert(width == output->current_mode->width); iassert(height == output->current_mode->height); } if (screen_length > 0) free(iviscrns); } static void test_screen_render_order(struct test_context *ctx) { #define LAYER_NUM (3) const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_screen **iviscrns; int32_t screen_length = 0; struct ivi_layout_screen *iviscrn; struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; struct ivi_layout_layer **array; int32_t length = 0; uint32_t i; iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); iassert(screen_length > 0); if (screen_length <= 0) return; iviscrn = iviscrns[0]; for (i = 0; i < LAYER_NUM; i++) ivilayers[i] = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300); iassert(ctl->screen_set_render_order(iviscrn, ivilayers, LAYER_NUM) == IVI_SUCCEEDED); ctl->commit_changes(); iassert(ctl->get_layers_on_screen(iviscrn, &length, &array) == IVI_SUCCEEDED); iassert(length == LAYER_NUM); for (i = 0; i < LAYER_NUM; i++) iassert(array[i] == ivilayers[i]); if (length > 0) free(array); array = NULL; iassert(ctl->screen_set_render_order(iviscrn, NULL, 0) == IVI_SUCCEEDED); ctl->commit_changes(); iassert(ctl->get_layers_on_screen(iviscrn, &length, &array) == IVI_SUCCEEDED); iassert(length == 0 && array == NULL); for (i = 0; i < LAYER_NUM; i++) ctl->layer_destroy(ivilayers[i]); free(iviscrns); #undef LAYER_NUM } static void test_screen_bad_resolution(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_screen **iviscrns; int32_t screen_length = 0; struct ivi_layout_screen *iviscrn; int32_t width; int32_t height; iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); iassert(screen_length > 0); if (screen_length <= 0) return; iviscrn = iviscrns[0]; iassert(ctl->get_screen_resolution(NULL, &width, &height) == IVI_FAILED); iassert(ctl->get_screen_resolution(iviscrn, NULL, &height) == IVI_FAILED); iassert(ctl->get_screen_resolution(iviscrn, &width, NULL) == IVI_FAILED); free(iviscrns); } static void test_screen_bad_render_order(struct test_context *ctx) { #define LAYER_NUM (3) const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_screen **iviscrns; int32_t screen_length; struct ivi_layout_screen *iviscrn; struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; struct ivi_layout_layer **array; int32_t length = 0; uint32_t i; iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); iassert(screen_length > 0); if (screen_length <= 0) return; iviscrn = iviscrns[0]; for (i = 0; i < LAYER_NUM; i++) ivilayers[i] = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300); iassert(ctl->screen_set_render_order(NULL, ivilayers, LAYER_NUM) == IVI_FAILED); ctl->commit_changes(); iassert(ctl->get_layers_on_screen(NULL, &length, &array) == IVI_FAILED); iassert(ctl->get_layers_on_screen(iviscrn, NULL, &array) == IVI_FAILED); iassert(ctl->get_layers_on_screen(iviscrn, &length, NULL) == IVI_FAILED); for (i = 0; i < LAYER_NUM; i++) ctl->layer_destroy(ivilayers[i]); free(iviscrns); #undef LAYER_NUM } static void test_commit_changes_after_render_order_set_layer_destroy( struct test_context *ctx) { #define LAYER_NUM (3) const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_screen **iviscrns; int32_t screen_length; struct ivi_layout_screen *iviscrn; struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; uint32_t i; iassert(ctl->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); iassert(screen_length > 0); if (screen_length <= 0) return; iviscrn = iviscrns[0]; for (i = 0; i < LAYER_NUM; i++) ivilayers[i] = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300); iassert(ctl->screen_set_render_order(iviscrn, ivilayers, LAYER_NUM) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayers[1]); ctl->commit_changes(); ctl->layer_destroy(ivilayers[0]); ctl->layer_destroy(ivilayers[2]); free(iviscrns); #undef LAYER_NUM } static void test_layer_properties_changed_notification_callback(struct ivi_layout_layer *ivilayer, const struct ivi_layout_layer_properties *prop, enum ivi_layout_notification_mask mask, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0)); iassert(prop->source_width == 200); iassert(prop->source_height == 300); if (ctl->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0) && prop->source_width == 200 && prop->source_height == 300) ctx->user_flags = 1; } static void test_layer_properties_changed_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ctx->user_flags = 0; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ctl->layer_add_notification(ivilayer, test_layer_properties_changed_notification_callback, ctx) == IVI_SUCCEEDED); ctl->commit_changes(); iassert(ctx->user_flags == 0); iassert(ctl->layer_set_destination_rectangle( ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); ctl->commit_changes(); iassert(ctx->user_flags == 1); ctx->user_flags = 0; iassert(ctl->layer_set_destination_rectangle( ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); ctl->commit_changes(); iassert(ctx->user_flags == 0); ctl->layer_remove_notification(ivilayer); ctx->user_flags = 0; ctl->commit_changes(); iassert(ctx->user_flags == 0); ctl->layer_destroy(ivilayer); } static void test_layer_create_notification_callback(struct ivi_layout_layer *ivilayer, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; const struct ivi_layout_layer_properties *prop = ctl->get_properties_of_layer(ivilayer); iassert(ctl->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0)); iassert(prop->source_width == 200); iassert(prop->source_height == 300); if (ctl->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0) && prop->source_width == 200 && prop->source_height == 300) ctx->user_flags = 1; } static void test_layer_create_notification(struct test_context *ctx) { #define LAYER_NUM (2) const struct ivi_controller_interface *ctl = ctx->controller_interface; static const uint32_t layers[LAYER_NUM] = {IVI_TEST_LAYER_ID(0), IVI_TEST_LAYER_ID(1)}; struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; ctx->user_flags = 0; iassert(ctl->add_notification_create_layer( test_layer_create_notification_callback, ctx) == IVI_SUCCEEDED); ivilayers[0] = ctl->layer_create_with_dimension(layers[0], 200, 300); iassert(ctx->user_flags == 1); ctx->user_flags = 0; ctl->remove_notification_create_layer(test_layer_create_notification_callback, ctx); ivilayers[1] = ctl->layer_create_with_dimension(layers[1], 400, 500); iassert(ctx->user_flags == 0); ctl->layer_destroy(ivilayers[0]); ctl->layer_destroy(ivilayers[1]); #undef LAYER_NUM } static void test_layer_remove_notification_callback(struct ivi_layout_layer *ivilayer, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; const struct ivi_layout_layer_properties *prop = ctl->get_properties_of_layer(ivilayer); iassert(ctl->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0)); iassert(prop->source_width == 200); iassert(prop->source_height == 300); if (ctl->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0) && prop->source_width == 200 && prop->source_height == 300) ctx->user_flags = 1; } static void test_layer_remove_notification(struct test_context *ctx) { #define LAYER_NUM (2) const struct ivi_controller_interface *ctl = ctx->controller_interface; static const uint32_t layers[LAYER_NUM] = {IVI_TEST_LAYER_ID(0), IVI_TEST_LAYER_ID(1)}; struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; ctx->user_flags = 0; ivilayers[0] = ctl->layer_create_with_dimension(layers[0], 200, 300); iassert(ctl->add_notification_remove_layer( test_layer_remove_notification_callback, ctx) == IVI_SUCCEEDED); ctl->layer_destroy(ivilayers[0]); iassert(ctx->user_flags == 1); ctx->user_flags = 0; ivilayers[1] = ctl->layer_create_with_dimension(layers[1], 250, 350); ctl->remove_notification_remove_layer(test_layer_remove_notification_callback, ctx); ctl->layer_destroy(ivilayers[1]); iassert(ctx->user_flags == 0); #undef LAYER_NUM } static void test_layer_bad_properties_changed_notification_callback(struct ivi_layout_layer *ivilayer, const struct ivi_layout_layer_properties *prop, enum ivi_layout_notification_mask mask, void *userdata) { } static void test_layer_bad_properties_changed_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); iassert(ctl->layer_add_notification( NULL, test_layer_bad_properties_changed_notification_callback, NULL) == IVI_FAILED); iassert(ctl->layer_add_notification(ivilayer, NULL, NULL) == IVI_FAILED); ctl->layer_destroy(ivilayer); } static void test_surface_bad_configure_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->add_notification_configure_surface(NULL, NULL) == IVI_FAILED); } static void test_layer_bad_create_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->add_notification_create_layer(NULL, NULL) == IVI_FAILED); } static void test_surface_bad_create_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->add_notification_create_surface(NULL, NULL) == IVI_FAILED); } static void test_layer_bad_remove_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->add_notification_remove_layer(NULL, NULL) == IVI_FAILED); } static void test_surface_bad_remove_notification(struct test_context *ctx) { const struct ivi_controller_interface *ctl = ctx->controller_interface; iassert(ctl->add_notification_remove_surface(NULL, NULL) == IVI_FAILED); } /************************ tests end ********************************/ static void run_internal_tests(void *data) { struct test_context *ctx = data; test_surface_bad_visibility(ctx); test_surface_bad_destination_rectangle(ctx); test_surface_bad_orientation(ctx); test_surface_bad_dimension(ctx); test_surface_bad_position(ctx); test_surface_bad_source_rectangle(ctx); test_surface_bad_properties(ctx); test_layer_create(ctx); test_layer_visibility(ctx); test_layer_opacity(ctx); test_layer_orientation(ctx); test_layer_dimension(ctx); test_layer_position(ctx); test_layer_destination_rectangle(ctx); test_layer_source_rectangle(ctx); test_layer_bad_remove(ctx); test_layer_bad_visibility(ctx); test_layer_bad_opacity(ctx); test_layer_bad_destination_rectangle(ctx); test_layer_bad_orientation(ctx); test_layer_bad_dimension(ctx); test_layer_bad_position(ctx); test_layer_bad_source_rectangle(ctx); test_layer_bad_properties(ctx); test_commit_changes_after_visibility_set_layer_destroy(ctx); test_commit_changes_after_opacity_set_layer_destroy(ctx); test_commit_changes_after_orientation_set_layer_destroy(ctx); test_commit_changes_after_dimension_set_layer_destroy(ctx); test_commit_changes_after_position_set_layer_destroy(ctx); test_commit_changes_after_source_rectangle_set_layer_destroy(ctx); test_commit_changes_after_destination_rectangle_set_layer_destroy(ctx); test_layer_create_duplicate(ctx); test_get_layer_after_destory_layer(ctx); test_screen_id(ctx); test_screen_resolution(ctx); test_screen_render_order(ctx); test_screen_bad_resolution(ctx); test_screen_bad_render_order(ctx); test_commit_changes_after_render_order_set_layer_destroy(ctx); test_layer_properties_changed_notification(ctx); test_layer_create_notification(ctx); test_layer_remove_notification(ctx); test_layer_bad_properties_changed_notification(ctx); test_surface_bad_configure_notification(ctx); test_layer_bad_create_notification(ctx); test_surface_bad_create_notification(ctx); test_layer_bad_remove_notification(ctx); test_surface_bad_remove_notification(ctx); weston_compositor_exit_with_code(ctx->compositor, EXIT_SUCCESS); free(ctx); } int controller_module_init(struct weston_compositor *compositor, int *argc, char *argv[], const struct ivi_controller_interface *iface, size_t iface_version); WL_EXPORT int controller_module_init(struct weston_compositor *compositor, int *argc, char *argv[], const struct ivi_controller_interface *iface, size_t iface_version) { struct wl_event_loop *loop; struct test_context *ctx; /* strict check, since this is an internal test module */ if (iface_version != sizeof(*iface)) { weston_log("fatal: controller interface mismatch\n"); return -1; } ctx = zalloc(sizeof(*ctx)); if (!ctx) return -1; ctx->compositor = compositor; ctx->controller_interface = iface; loop = wl_display_get_event_loop(compositor->wl_display); wl_event_loop_add_idle(loop, run_internal_tests, ctx); return 0; } weston-1.9.0/tests/ivi_layout-test-plugin.c0000664000175000017500000007600012543150037015731 00000000000000/* * Copyright © 2012 Intel Corporation * Copyright © 2013 DENSO CORPORATION * Copyright © 2015 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include "src/compositor.h" #include "weston-test-server-protocol.h" #include "ivi-test.h" #include "ivi-shell/ivi-layout-export.h" #include "shared/helpers.h" struct test_context; struct runner_test { const char *name; void (*run)(struct test_context *); } __attribute__ ((aligned (32))); #define RUNNER_TEST(name) \ static void runner_func_##name(struct test_context *); \ \ const struct runner_test runner_test_##name \ __attribute__ ((section ("test_section"))) = \ { \ #name, runner_func_##name \ }; \ \ static void runner_func_##name(struct test_context *ctx) extern const struct runner_test __start_test_section; extern const struct runner_test __stop_test_section; static const struct runner_test * find_runner_test(const char *name) { const struct runner_test *t; for (t = &__start_test_section; t < &__stop_test_section; t++) { if (strcmp(t->name, name) == 0) return t; } return NULL; } struct test_launcher { struct weston_compositor *compositor; char exe[2048]; struct weston_process process; const struct ivi_controller_interface *controller_interface; }; struct test_context { const struct ivi_controller_interface *controller_interface; struct wl_resource *runner_resource; uint32_t user_flags; }; static struct test_context static_context; static void destroy_runner(struct wl_resource *resource) { assert(static_context.runner_resource == NULL || static_context.runner_resource == resource); static_context.controller_interface = NULL; static_context.runner_resource = NULL; } static void runner_destroy_handler(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void runner_run_handler(struct wl_client *client, struct wl_resource *resource, const char *test_name) { struct test_launcher *launcher; const struct runner_test *t; assert(static_context.runner_resource == NULL || static_context.runner_resource == resource); launcher = wl_resource_get_user_data(resource); static_context.controller_interface = launcher->controller_interface; static_context.runner_resource = resource; t = find_runner_test(test_name); if (!t) { weston_log("Error: runner test \"%s\" not found.\n", test_name); wl_resource_post_error(resource, WESTON_TEST_RUNNER_ERROR_UNKNOWN_TEST, "weston_test_runner: unknown: '%s'", test_name); return; } weston_log("weston_test_runner.run(\"%s\")\n", test_name); t->run(&static_context); weston_test_runner_send_finished(resource); } static const struct weston_test_runner_interface runner_implementation = { runner_destroy_handler, runner_run_handler }; static void bind_runner(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct test_launcher *launcher = data; struct wl_resource *resource; resource = wl_resource_create(client, &weston_test_runner_interface, 1, id); if (!resource) { wl_client_post_no_memory(client); return; } wl_resource_set_implementation(resource, &runner_implementation, launcher, destroy_runner); if (static_context.runner_resource != NULL) { weston_log("test FATAL: " "attempting to run several tests in parallel.\n"); wl_resource_post_error(resource, WESTON_TEST_RUNNER_ERROR_TEST_FAILED, "attempt to run parallel tests"); } } static void test_client_sigchld(struct weston_process *process, int status) { struct test_launcher *launcher = container_of(process, struct test_launcher, process); struct weston_compositor *c = launcher->compositor; /* Chain up from weston-test-runner's exit code so that automake * knows the exit status and can report e.g. skipped tests. */ if (WIFEXITED(status)) weston_compositor_exit_with_code(c, WEXITSTATUS(status)); else weston_compositor_exit_with_code(c, EXIT_FAILURE); } static void idle_launch_client(void *data) { struct test_launcher *launcher = data; pid_t pid; sigset_t allsigs; pid = fork(); if (pid == -1) { weston_log("fatal: failed to fork '%s': %m\n", launcher->exe); weston_compositor_exit_with_code(launcher->compositor, EXIT_FAILURE); return; } if (pid == 0) { sigfillset(&allsigs); sigprocmask(SIG_UNBLOCK, &allsigs, NULL); execl(launcher->exe, launcher->exe, NULL); weston_log("compositor: executing '%s' failed: %m\n", launcher->exe); _exit(EXIT_FAILURE); } launcher->process.pid = pid; launcher->process.cleanup = test_client_sigchld; weston_watch_process(&launcher->process); } int controller_module_init(struct weston_compositor *compositor, int *argc, char *argv[], const struct ivi_controller_interface *iface, size_t iface_version); WL_EXPORT int controller_module_init(struct weston_compositor *compositor, int *argc, char *argv[], const struct ivi_controller_interface *iface, size_t iface_version) { struct wl_event_loop *loop; struct test_launcher *launcher; const char *path; /* strict check, since this is an internal test module */ if (iface_version != sizeof(*iface)) { weston_log("fatal: controller interface mismatch\n"); return -1; } path = getenv("WESTON_BUILD_DIR"); if (!path) { weston_log("test setup failure: WESTON_BUILD_DIR not set\n"); return -1; } launcher = zalloc(sizeof *launcher); if (!launcher) return -1; launcher->compositor = compositor; launcher->controller_interface = iface; snprintf(launcher->exe, sizeof launcher->exe, "%s/ivi-layout.ivi", path); if (wl_global_create(compositor->wl_display, &weston_test_runner_interface, 1, launcher, bind_runner) == NULL) return -1; loop = wl_display_get_event_loop(compositor->wl_display); wl_event_loop_add_idle(loop, idle_launch_client, launcher); return 0; } static void runner_assert_fail(const char *cond, const char *file, int line, const char *func, struct test_context *ctx) { weston_log("Assert failure in %s:%d, %s: '%s'\n", file, line, func, cond); assert(ctx->runner_resource); wl_resource_post_error(ctx->runner_resource, WESTON_TEST_RUNNER_ERROR_TEST_FAILED, "Assert failure in %s:%d, %s: '%s'\n", file, line, func, cond); } #define runner_assert(cond) ({ \ bool b_ = (cond); \ if (!b_) \ runner_assert_fail(#cond, __FILE__, __LINE__, \ __func__, ctx); \ b_; \ }) #define runner_assert_or_return(cond) do { \ bool b_ = (cond); \ if (!b_) { \ runner_assert_fail(#cond, __FILE__, __LINE__, \ __func__, ctx); \ return; \ } \ } while (0) /*************************** tests **********************************/ /* * This is a controller module: a plugin to ivi-shell.so, i.e. a sub-plugin. * This module is specially written to execute tests that target the * ivi_layout API. * * This module is listed in TESTS in Makefile.am. weston-tests-env handles * this module specially by loading it in ivi-shell. * * Once Weston init completes, this module launches one test program: * ivi-layout.ivi (ivi_layout-test.c). That program uses the weston-test-runner * framework to fork and exec each TEST() in ivi_layout-test.c with a fresh * connection to the single compositor instance. * * Each TEST() in ivi_layout-test.c will bind to weston_test_runner global * interface. A TEST() will set up the client state, and issue * weston_test_runner.run request to execute the compositor-side of the test. * * The compositor-side parts of the tests are in this file. They are specified * by RUNNER_TEST() macro, where the name argument matches the name string * passed to weston_test_runner.run. * * A RUNNER_TEST() function simply returns when it succeeds. If it fails, * a fatal protocol error is sent to the client from runner_assert() or * runner_assert_or_return(). This module catches the test program exit * code and passes it out of Weston to the test harness. * * A single TEST() in ivi_layout-test.c may use multiple RUNNER_TEST()s to * achieve multiple test points over a client action sequence. */ RUNNER_TEST(surface_create_p1) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf[2]; uint32_t ivi_id; ivisurf[0] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf[0]); ivisurf[1] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(1)); runner_assert(ivisurf[1]); ivi_id = ctl->get_id_of_surface(ivisurf[0]); runner_assert(ivi_id == IVI_TEST_SURFACE_ID(0)); ivi_id = ctl->get_id_of_surface(ivisurf[1]); runner_assert(ivi_id == IVI_TEST_SURFACE_ID(1)); } RUNNER_TEST(surface_create_p2) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; /* the ivi_surface was destroyed by the client */ ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf == NULL); } RUNNER_TEST(surface_visibility) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; int32_t ret; bool visibility; const struct ivi_layout_surface_properties *prop; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf); ret = ctl->surface_set_visibility(ivisurf, true); runner_assert(ret == IVI_SUCCEEDED); ctl->commit_changes(); visibility = ctl->surface_get_visibility(ivisurf); runner_assert(visibility == true); prop = ctl->get_properties_of_surface(ivisurf); runner_assert(prop->visibility == true); } RUNNER_TEST(surface_opacity) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; int32_t ret; wl_fixed_t opacity; const struct ivi_layout_surface_properties *prop; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf); runner_assert(ctl->surface_get_opacity(ivisurf) == wl_fixed_from_double(1.0)); ret = ctl->surface_set_opacity(ivisurf, wl_fixed_from_double(0.5)); runner_assert(ret == IVI_SUCCEEDED); runner_assert(ctl->surface_get_opacity(ivisurf) == wl_fixed_from_double(1.0)); ctl->commit_changes(); opacity = ctl->surface_get_opacity(ivisurf); runner_assert(opacity == wl_fixed_from_double(0.5)); prop = ctl->get_properties_of_surface(ivisurf); runner_assert(prop->opacity == wl_fixed_from_double(0.5)); } RUNNER_TEST(surface_orientation) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; const struct ivi_layout_surface_properties *prop; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_get_orientation(ivisurf) == WL_OUTPUT_TRANSFORM_NORMAL); runner_assert(ctl->surface_set_orientation( ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); runner_assert(ctl->surface_get_orientation(ivisurf) == WL_OUTPUT_TRANSFORM_NORMAL); ctl->commit_changes(); runner_assert(ctl->surface_get_orientation( ivisurf) == WL_OUTPUT_TRANSFORM_90); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->orientation == WL_OUTPUT_TRANSFORM_90); } RUNNER_TEST(surface_dimension) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; const struct ivi_layout_surface_properties *prop; int32_t dest_width; int32_t dest_height; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_get_dimension( ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED); runner_assert(dest_width == 1); runner_assert(dest_height == 1); runner_assert(IVI_SUCCEEDED == ctl->surface_set_dimension(ivisurf, 200, 300)); runner_assert(ctl->surface_get_dimension( ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED); runner_assert(dest_width == 1); runner_assert(dest_height == 1); ctl->commit_changes(); runner_assert(ctl->surface_get_dimension( ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED); runner_assert(dest_width == 200); runner_assert(dest_height == 300); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->dest_width == 200); runner_assert(prop->dest_height == 300); } RUNNER_TEST(surface_position) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; const struct ivi_layout_surface_properties *prop; int32_t dest_x; int32_t dest_y; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_get_position( ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED); runner_assert(dest_x == 0); runner_assert(dest_y == 0); runner_assert(ctl->surface_set_position( ivisurf, 20, 30) == IVI_SUCCEEDED); runner_assert(ctl->surface_get_position( ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED); runner_assert(dest_x == 0); runner_assert(dest_y == 0); ctl->commit_changes(); runner_assert(ctl->surface_get_position( ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED); runner_assert(dest_x == 20); runner_assert(dest_y == 30); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->dest_x == 20); runner_assert(prop->dest_y == 30); } RUNNER_TEST(surface_destination_rectangle) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; const struct ivi_layout_surface_properties *prop; int32_t dest_width; int32_t dest_height; int32_t dest_x; int32_t dest_y; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->dest_width == 1); runner_assert(prop->dest_height == 1); runner_assert(prop->dest_x == 0); runner_assert(prop->dest_y == 0); runner_assert(ctl->surface_set_destination_rectangle( ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->dest_width == 1); runner_assert(prop->dest_height == 1); runner_assert(prop->dest_x == 0); runner_assert(prop->dest_y == 0); ctl->commit_changes(); runner_assert(ctl->surface_get_dimension( ivisurf, &dest_width, &dest_height) == IVI_SUCCEEDED); runner_assert(dest_width == 200); runner_assert(dest_height == 300); runner_assert(ctl->surface_get_position(ivisurf, &dest_x, &dest_y) == IVI_SUCCEEDED); runner_assert(dest_x == 20); runner_assert(dest_y == 30); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->dest_width == 200); runner_assert(prop->dest_height == 300); runner_assert(prop->dest_x == 20); runner_assert(prop->dest_y == 30); } RUNNER_TEST(surface_source_rectangle) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; const struct ivi_layout_surface_properties *prop; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->source_width == 0); runner_assert(prop->source_height == 0); runner_assert(prop->source_x == 0); runner_assert(prop->source_y == 0); runner_assert(ctl->surface_set_source_rectangle( ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->source_width == 0); runner_assert(prop->source_height == 0); runner_assert(prop->source_x == 0); runner_assert(prop->source_y == 0); ctl->commit_changes(); prop = ctl->get_properties_of_surface(ivisurf); runner_assert_or_return(prop); runner_assert(prop->source_width == 200); runner_assert(prop->source_height == 300); runner_assert(prop->source_x == 20); runner_assert(prop->source_y == 30); } RUNNER_TEST(surface_bad_opacity) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; wl_fixed_t opacity; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_opacity( NULL, wl_fixed_from_double(0.3)) == IVI_FAILED); runner_assert(ctl->surface_set_opacity( ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED); runner_assert(ctl->surface_set_opacity( ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED); ctl->commit_changes(); opacity = ctl->surface_get_opacity(ivisurf); runner_assert(opacity == wl_fixed_from_double(0.3)); runner_assert(ctl->surface_set_opacity( ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED); ctl->commit_changes(); opacity = ctl->surface_get_opacity(ivisurf); runner_assert(opacity == wl_fixed_from_double(0.3)); runner_assert(ctl->surface_set_opacity( NULL, wl_fixed_from_double(0.5)) == IVI_FAILED); ctl->commit_changes(); opacity = ctl->surface_get_opacity(NULL); runner_assert(opacity == wl_fixed_from_double(0.0)); } RUNNER_TEST(ivi_layout_commit_changes) { const struct ivi_controller_interface *ctl = ctx->controller_interface; ctl->commit_changes(); } RUNNER_TEST(commit_changes_after_visibility_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_visibility( ivisurf, true) == IVI_SUCCEEDED); } RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_opacity( ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED); } RUNNER_TEST(commit_changes_after_orientation_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_orientation( ivisurf, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); } RUNNER_TEST(commit_changes_after_dimension_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_dimension( ivisurf, 200, 300) == IVI_SUCCEEDED); } RUNNER_TEST(commit_changes_after_position_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_position( ivisurf, 20, 30) == IVI_SUCCEEDED); } RUNNER_TEST(commit_changes_after_source_rectangle_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_source_rectangle( ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); } RUNNER_TEST(commit_changes_after_destination_rectangle_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_set_destination_rectangle( ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); } RUNNER_TEST(get_surface_after_destroy_surface) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf == NULL); } RUNNER_TEST(layer_render_order) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {}; struct ivi_layout_surface **array; int32_t length = 0; uint32_t i; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) ivisurfs[i] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(i)); runner_assert(ctl->layer_set_render_order( ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED); ctl->commit_changes(); runner_assert(ctl->get_surfaces_on_layer( ivilayer, &length, &array) == IVI_SUCCEEDED); runner_assert(IVI_TEST_SURFACE_COUNT == length); for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) runner_assert(array[i] == ivisurfs[i]); if (length > 0) free(array); runner_assert(ctl->layer_set_render_order( ivilayer, NULL, 0) == IVI_SUCCEEDED); array = NULL; ctl->commit_changes(); runner_assert(ctl->get_surfaces_on_layer( ivilayer, &length, &array) == IVI_SUCCEEDED); runner_assert(length == 0 && array == NULL); ctl->layer_destroy(ivilayer); } RUNNER_TEST(test_layer_render_order_destroy_one_surface_p1) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {}; struct ivi_layout_surface **array; int32_t length = 0; int32_t i; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) ivisurfs[i] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(i)); runner_assert(ctl->layer_set_render_order( ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED); ctl->commit_changes(); runner_assert(ctl->get_surfaces_on_layer( ivilayer, &length, &array) == IVI_SUCCEEDED); runner_assert(IVI_TEST_SURFACE_COUNT == length); for (i = 0; i < length; i++) runner_assert(array[i] == ivisurfs[i]); if (length > 0) free(array); } RUNNER_TEST(test_layer_render_order_destroy_one_surface_p2) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; struct ivi_layout_surface *ivisurfs[2] = {}; struct ivi_layout_surface **array; int32_t length = 0; int32_t i; ivilayer = ctl->get_layer_from_id(IVI_TEST_LAYER_ID(0)); ivisurfs[0] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); ivisurfs[1] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(2)); runner_assert(ctl->get_surfaces_on_layer( ivilayer, &length, &array) == IVI_SUCCEEDED); runner_assert(2 == length); for (i = 0; i < length; i++) runner_assert(array[i] == ivisurfs[i]); if (length > 0) free(array); ctl->layer_destroy(ivilayer); } RUNNER_TEST(layer_bad_render_order) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {}; struct ivi_layout_surface **array = NULL; int32_t length = 0; uint32_t i; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) ivisurfs[i] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(i)); runner_assert(ctl->layer_set_render_order( NULL, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_FAILED); ctl->commit_changes(); runner_assert(ctl->get_surfaces_on_layer( NULL, &length, &array) == IVI_FAILED); runner_assert(length == 0 && array == NULL); runner_assert(ctl->get_surfaces_on_layer( ivilayer, NULL, &array) == IVI_FAILED); runner_assert(array == NULL); runner_assert(ctl->get_surfaces_on_layer( ivilayer, &length, NULL) == IVI_FAILED); runner_assert(length == 0); ctl->layer_destroy(ivilayer); } RUNNER_TEST(commit_changes_after_render_order_set_surface_destroy) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {}; int i; ivilayer = ctl->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) ivisurfs[i] = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(i)); runner_assert(ctl->layer_set_render_order( ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED); } RUNNER_TEST(cleanup_layer) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_layer *ivilayer; ivilayer = ctl->get_layer_from_id(IVI_TEST_LAYER_ID(0)); ctl->layer_destroy(ivilayer); } static void test_surface_properties_changed_notification_callback(struct ivi_layout_surface *ivisurf, const struct ivi_layout_surface_properties *prop, enum ivi_layout_notification_mask mask, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert_or_return(ctl->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); ctx->user_flags = 1; } RUNNER_TEST(surface_properties_changed_notification) { const struct ivi_controller_interface *ctl = ctx->controller_interface; const uint32_t id_surface = IVI_TEST_SURFACE_ID(0); struct ivi_layout_surface *ivisurf; ctx->user_flags = 0; ivisurf = ctl->get_surface_from_id(id_surface); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_add_notification( ivisurf, test_surface_properties_changed_notification_callback, ctx) == IVI_SUCCEEDED); ctl->commit_changes(); runner_assert(ctx->user_flags == 0); runner_assert(ctl->surface_set_destination_rectangle( ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); ctl->commit_changes(); runner_assert(ctx->user_flags == 1); ctx->user_flags = 0; runner_assert(ctl->surface_set_destination_rectangle( ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED); ctl->commit_changes(); runner_assert(ctx->user_flags == 0); ctl->surface_remove_notification(ivisurf); ctx->user_flags = 0; runner_assert(ctl->surface_set_destination_rectangle( ivisurf, 40, 50, 400, 500) == IVI_SUCCEEDED); ctl->commit_changes(); runner_assert(ctx->user_flags == 0); } static void test_surface_configure_notification_callback(struct ivi_layout_surface *ivisurf, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert_or_return(ctl->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); ctx->user_flags = 1; } RUNNER_TEST(surface_configure_notification_p1) { const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert(IVI_SUCCEEDED == ctl->add_notification_configure_surface(test_surface_configure_notification_callback, ctx)); ctl->commit_changes(); ctx->user_flags = 0; } RUNNER_TEST(surface_configure_notification_p2) { const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert(ctx->user_flags == 1); ctl->remove_notification_configure_surface(test_surface_configure_notification_callback, ctx); ctx->user_flags = 0; } RUNNER_TEST(surface_configure_notification_p3) { const struct ivi_controller_interface *ctl = ctx->controller_interface; ctl->commit_changes(); runner_assert(ctx->user_flags == 0); } static void test_surface_create_notification_callback(struct ivi_layout_surface *ivisurf, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert_or_return(ctl->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); ctx->user_flags = 1; } RUNNER_TEST(surface_create_notification_p1) { const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert(ctl->add_notification_create_surface( test_surface_create_notification_callback, ctx) == IVI_SUCCEEDED); ctx->user_flags = 0; } RUNNER_TEST(surface_create_notification_p2) { const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert(ctx->user_flags == 1); ctl->remove_notification_create_surface( test_surface_create_notification_callback, ctx); ctx->user_flags = 0; } RUNNER_TEST(surface_create_notification_p3) { runner_assert(ctx->user_flags == 0); } static void test_surface_remove_notification_callback(struct ivi_layout_surface *ivisurf, void *userdata) { struct test_context *ctx = userdata; const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert_or_return(ctl->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0)); ctx->user_flags = 1; } RUNNER_TEST(surface_remove_notification_p1) { const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert(ctl->add_notification_remove_surface( test_surface_remove_notification_callback, ctx) == IVI_SUCCEEDED); ctx->user_flags = 0; } RUNNER_TEST(surface_remove_notification_p2) { const struct ivi_controller_interface *ctl = ctx->controller_interface; runner_assert(ctx->user_flags == 1); ctl->remove_notification_remove_surface(test_surface_remove_notification_callback, ctx); ctx->user_flags = 0; } RUNNER_TEST(surface_remove_notification_p3) { runner_assert(ctx->user_flags == 0); } static void test_surface_bad_properties_changed_notification_callback(struct ivi_layout_surface *ivisurf, const struct ivi_layout_surface_properties *prop, enum ivi_layout_notification_mask mask, void *userdata) { } RUNNER_TEST(surface_bad_properties_changed_notification) { const struct ivi_controller_interface *ctl = ctx->controller_interface; struct ivi_layout_surface *ivisurf; ivisurf = ctl->get_surface_from_id(IVI_TEST_SURFACE_ID(0)); runner_assert(ivisurf != NULL); runner_assert(ctl->surface_add_notification( NULL, test_surface_bad_properties_changed_notification_callback, NULL) == IVI_FAILED); runner_assert(ctl->surface_add_notification( ivisurf, NULL, NULL) == IVI_FAILED); } weston-1.9.0/tests/event-test.c0000664000175000017500000002551712537627703013415 00000000000000/* * Copyright © 2012 Intel Corporation * Copyright © 2013 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "weston-test-client-helper.h" static void check_pointer(struct client *client, int x, int y) { int sx, sy; /* check that the client got the global pointer update */ assert(client->test->pointer_x == x); assert(client->test->pointer_y == y); /* Does global pointer map onto the surface? */ if (surface_contains(client->surface, x, y)) { /* check that the surface has the pointer focus */ assert(client->input->pointer->focus == client->surface); /* * check that the local surface pointer maps * to the global pointer. */ sx = client->input->pointer->x + client->surface->x; sy = client->input->pointer->y + client->surface->y; assert(sx == x); assert(sy == y); } else { /* * The global pointer does not map onto surface. So * check that it doesn't have the pointer focus. */ assert(client->input->pointer->focus == NULL); } } static void check_pointer_move(struct client *client, int x, int y) { weston_test_move_pointer(client->test->weston_test, x, y); client_roundtrip(client); check_pointer(client, x, y); } TEST(test_pointer_top_left) { struct client *client; int x, y; client = create_client_and_test_surface(46, 76, 111, 134); assert(client); /* move pointer outside top left */ x = client->surface->x - 1; y = client->surface->y - 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on top left */ x += 1; y += 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside top left */ x -= 1; y -= 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_bottom_left) { struct client *client; int x, y; client = create_client_and_test_surface(99, 100, 100, 98); assert(client); /* move pointer outside bottom left */ x = client->surface->x - 1; y = client->surface->y + client->surface->height; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on bottom left */ x += 1; y -= 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside bottom left */ x -= 1; y += 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_top_right) { struct client *client; int x, y; client = create_client_and_test_surface(48, 100, 67, 100); assert(client); /* move pointer outside top right */ x = client->surface->x + client->surface->width; y = client->surface->y - 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on top right */ x -= 1; y += 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside top right */ x += 1; y -= 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_bottom_right) { struct client *client; int x, y; client = create_client_and_test_surface(100, 123, 100, 69); assert(client); /* move pointer outside bottom right */ x = client->surface->x + client->surface->width; y = client->surface->y + client->surface->height; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on bottom right */ x -= 1; y -= 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside bottom right */ x += 1; y += 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_top_center) { struct client *client; int x, y; client = create_client_and_test_surface(100, 201, 100, 50); assert(client); /* move pointer outside top center */ x = client->surface->x + client->surface->width/2; y = client->surface->y - 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on top center */ y += 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside top center */ y -= 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_bottom_center) { struct client *client; int x, y; client = create_client_and_test_surface(100, 45, 67, 100); assert(client); /* move pointer outside bottom center */ x = client->surface->x + client->surface->width/2; y = client->surface->y + client->surface->height; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on bottom center */ y -= 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside bottom center */ y += 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_left_center) { struct client *client; int x, y; client = create_client_and_test_surface(167, 45, 78, 100); assert(client); /* move pointer outside left center */ x = client->surface->x - 1; y = client->surface->y + client->surface->height/2; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on left center */ x += 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside left center */ x -= 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_right_center) { struct client *client; int x, y; client = create_client_and_test_surface(110, 37, 100, 46); assert(client); /* move pointer outside right center */ x = client->surface->x + client->surface->width; y = client->surface->y + client->surface->height/2; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer on right center */ x -= 1; assert(surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); /* move pointer outside right center */ x += 1; assert(!surface_contains(client->surface, x, y)); check_pointer_move(client, x, y); } TEST(test_pointer_surface_move) { struct client *client; client = create_client_and_test_surface(100, 100, 100, 100); assert(client); /* move pointer outside of client */ assert(!surface_contains(client->surface, 50, 50)); check_pointer_move(client, 50, 50); /* move client center to pointer */ move_client(client, 0, 0); assert(surface_contains(client->surface, 50, 50)); check_pointer(client, 50, 50); } static int output_contains_client(struct client *client) { struct output *output = client->output; struct surface *surface = client->surface; return !(output->x >= surface->x + surface->width || output->x + output->width <= surface->x || output->y >= surface->y + surface->height || output->y + output->height <= surface->y); } static void check_client_move(struct client *client, int x, int y) { move_client(client, x, y); if (output_contains_client(client)) { assert(client->surface->output == client->output); } else { assert(client->surface->output == NULL); } } TEST(test_surface_output) { struct client *client; int x, y; client = create_client_and_test_surface(100, 100, 100, 100); assert(client); assert(output_contains_client(client)); /* not visible */ x = 0; y = -client->surface->height; check_client_move(client, x, y); /* visible */ check_client_move(client, x, ++y); /* not visible */ x = -client->surface->width; y = 0; check_client_move(client, x, y); /* visible */ check_client_move(client, ++x, y); /* not visible */ x = client->output->width; y = 0; check_client_move(client, x, y); /* visible */ check_client_move(client, --x, y); assert(output_contains_client(client)); /* not visible */ x = 0; y = client->output->height; check_client_move(client, x, y); assert(!output_contains_client(client)); /* visible */ check_client_move(client, x, --y); assert(output_contains_client(client)); } static void buffer_release_handler(void *data, struct wl_buffer *buffer) { int *released = data; *released = 1; } static struct wl_buffer_listener buffer_listener = { buffer_release_handler }; TEST(buffer_release) { struct client *client; struct wl_surface *surface; struct wl_buffer *buf1; struct wl_buffer *buf2; struct wl_buffer *buf3; int buf1_released = 0; int buf2_released = 0; int buf3_released = 0; int frame; client = create_client_and_test_surface(100, 100, 100, 100); assert(client); surface = client->surface->wl_surface; buf1 = create_shm_buffer(client, 100, 100, NULL); wl_buffer_add_listener(buf1, &buffer_listener, &buf1_released); buf2 = create_shm_buffer(client, 100, 100, NULL); wl_buffer_add_listener(buf2, &buffer_listener, &buf2_released); buf3 = create_shm_buffer(client, 100, 100, NULL); wl_buffer_add_listener(buf3, &buffer_listener, &buf3_released); /* * buf1 must never be released, since it is replaced before * it is committed, therefore it never becomes busy. */ wl_surface_attach(surface, buf1, 0, 0); wl_surface_attach(surface, buf2, 0, 0); frame_callback_set(surface, &frame); wl_surface_commit(surface); frame_callback_wait(client, &frame); assert(buf1_released == 0); /* buf2 may or may not be released */ assert(buf3_released == 0); wl_surface_attach(surface, buf3, 0, 0); frame_callback_set(surface, &frame); wl_surface_commit(surface); frame_callback_wait(client, &frame); assert(buf1_released == 0); assert(buf2_released == 1); /* buf3 may or may not be released */ wl_surface_attach(surface, client->surface->wl_buffer, 0, 0); frame_callback_set(surface, &frame); wl_surface_commit(surface); frame_callback_wait(client, &frame); assert(buf1_released == 0); assert(buf2_released == 1); assert(buf3_released == 1); } weston-1.9.0/configure0000775000175000017500000232446412600133000011672 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for weston 1.9.0. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.9.0 $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='weston' PACKAGE_TARNAME='weston' PACKAGE_VERSION='1.9.0' PACKAGE_STRING='weston 1.9.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.9.0' PACKAGE_URL='http://wayland.freedesktop.org' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_GIT_REPO_FALSE HAVE_GIT_REPO_TRUE WAYLAND_SCANNER_LIBS WAYLAND_SCANNER_CFLAGS wayland_scanner HAVE_LCMS_FALSE HAVE_LCMS_TRUE LCMS_LIBS LCMS_CFLAGS INSTALL_DEMO_CLIENTS_FALSE INSTALL_DEMO_CLIENTS_TRUE LIBUNWIND_LIBS LIBUNWIND_CFLAGS HAVE_LIBUNWIND_FALSE HAVE_LIBUNWIND_TRUE GCC_CFLAGS BUILD_SETBACKLIGHT_FALSE BUILD_SETBACKLIGHT_TRUE SETBACKLIGHT_LIBS SETBACKLIGHT_CFLAGS WCAP_LIBS WCAP_CFLAGS BUILD_WCAP_TOOLS_FALSE BUILD_WCAP_TOOLS_TRUE ENABLE_IVI_SHELL_FALSE ENABLE_IVI_SHELL_TRUE ENABLE_JUNIT_XML_FALSE ENABLE_JUNIT_XML_TRUE LIBXML2_LIBS LIBXML2_CFLAGS ENABLE_DBUS_FALSE ENABLE_DBUS_TRUE DBUS_LIBS DBUS_CFLAGS ENABLE_COLORD_FALSE ENABLE_COLORD_TRUE COLORD_LIBS COLORD_CFLAGS ENABLE_FULLSCREEN_SHELL_FALSE ENABLE_FULLSCREEN_SHELL_TRUE ENABLE_DESKTOP_SHELL_FALSE ENABLE_DESKTOP_SHELL_TRUE BUILD_SUBSURFACES_CLIENT_FALSE BUILD_SUBSURFACES_CLIENT_TRUE BUILD_FULL_GL_CLIENTS_FALSE BUILD_FULL_GL_CLIENTS_TRUE HAVE_CAIRO_GLESV2_FALSE HAVE_CAIRO_GLESV2_TRUE HAVE_PANGO_FALSE HAVE_PANGO_TRUE PAM_LIBS BUILD_WESTON_LAUNCH_FALSE BUILD_WESTON_LAUNCH_TRUE SYSTEMD_LOGIN_209_LIBS SYSTEMD_LOGIN_209_CFLAGS HAVE_SYSTEMD_LOGIN_FALSE HAVE_SYSTEMD_LOGIN_TRUE SYSTEMD_LOGIN_LIBS SYSTEMD_LOGIN_CFLAGS PANGO_LIBS PANGO_CFLAGS CAIRO_EGL_LIBS CAIRO_EGL_CFLAGS WESTON_INFO_LIBS WESTON_INFO_CFLAGS SERVER_LIBS SERVER_CFLAGS CLIENT_LIBS CLIENT_CFLAGS BUILD_CLIENTS_FALSE BUILD_CLIENTS_TRUE BUILD_SIMPLE_INTEL_DMABUF_CLIENT_FALSE BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE SIMPLE_DMABUF_CLIENT_LIBS SIMPLE_DMABUF_CLIENT_CFLAGS SIMPLE_EGL_CLIENT_LIBS SIMPLE_EGL_CLIENT_CFLAGS BUILD_SIMPLE_EGL_CLIENTS_FALSE BUILD_SIMPLE_EGL_CLIENTS_TRUE SIMPLE_CLIENT_LIBS SIMPLE_CLIENT_CFLAGS BUILD_SIMPLE_CLIENTS_FALSE BUILD_SIMPLE_CLIENTS_TRUE TEST_CLIENT_LIBS TEST_CLIENT_CFLAGS CAIRO_LIBS CAIRO_CFLAGS JPEG_LIBS ENABLE_VAAPI_RECORDER_FALSE ENABLE_VAAPI_RECORDER_TRUE LIBVA_LIBS LIBVA_CFLAGS WEBP_LIBS WEBP_CFLAGS PNG_LIBS PNG_CFLAGS PIXMAN_LIBS PIXMAN_CFLAGS SCREEN_SHARE_LIBS SCREEN_SHARE_CFLAGS ENABLE_SCREEN_SHARING_FALSE ENABLE_SCREEN_SHARING_TRUE RDP_COMPOSITOR_LIBS RDP_COMPOSITOR_CFLAGS ENABLE_RDP_COMPOSITOR_FALSE ENABLE_RDP_COMPOSITOR_TRUE FBDEV_COMPOSITOR_LIBS FBDEV_COMPOSITOR_CFLAGS ENABLE_FBDEV_COMPOSITOR_FALSE ENABLE_FBDEV_COMPOSITOR_TRUE INSTALL_RPI_COMPOSITOR_FALSE INSTALL_RPI_COMPOSITOR_TRUE RPI_BCM_HOST_LIBS RPI_BCM_HOST_CFLAGS RPI_COMPOSITOR_LIBS RPI_COMPOSITOR_CFLAGS ENABLE_RPI_COMPOSITOR_FALSE ENABLE_RPI_COMPOSITOR_TRUE ENABLE_HEADLESS_COMPOSITOR_FALSE ENABLE_HEADLESS_COMPOSITOR_TRUE WAYLAND_COMPOSITOR_LIBS WAYLAND_COMPOSITOR_CFLAGS ENABLE_WAYLAND_COMPOSITOR_FALSE ENABLE_WAYLAND_COMPOSITOR_TRUE COMPOSITOR_LIBS COMPOSITOR_CFLAGS LIBINPUT_BACKEND_LIBS LIBINPUT_BACKEND_CFLAGS DRM_COMPOSITOR_GBM_LIBS DRM_COMPOSITOR_GBM_CFLAGS DRM_COMPOSITOR_LIBS DRM_COMPOSITOR_CFLAGS ENABLE_DRM_COMPOSITOR_FALSE ENABLE_DRM_COMPOSITOR_TRUE X11_COMPOSITOR_LIBS X11_COMPOSITOR_CFLAGS X11_COMPOSITOR_XKB_LIBS X11_COMPOSITOR_XKB_CFLAGS XCB_LIBS XCB_CFLAGS ENABLE_X11_COMPOSITOR_FALSE ENABLE_X11_COMPOSITOR_TRUE LIBDRM_LIBS LIBDRM_CFLAGS XWAYLAND_TEST_LIBS XWAYLAND_TEST_CFLAGS XSERVER_PATH XWAYLAND_LIBS XWAYLAND_CFLAGS ENABLE_XWAYLAND_TEST_FALSE ENABLE_XWAYLAND_TEST_TRUE ENABLE_XWAYLAND_FALSE ENABLE_XWAYLAND_TRUE ENABLE_SETUID_INSTALL_FALSE ENABLE_SETUID_INSTALL_TRUE GL_RENDERER_LIBS GL_RENDERER_CFLAGS EGL_TESTS_LIBS EGL_TESTS_CFLAGS EGL_LIBS EGL_CFLAGS ENABLE_EGL_FALSE ENABLE_EGL_TRUE ENABLE_DEVDOCS_FALSE ENABLE_DEVDOCS_TRUE DOXYGEN DLOPEN_LIBS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG WESTON_SHELL_CLIENT WESTON_NATIVE_BACKEND OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL SED AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC WESTON_VERSION WESTON_VERSION_MICRO WESTON_VERSION_MINOR WESTON_VERSION_MAJOR target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_largefile enable_dependency_tracking enable_silent_rules enable_static enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_devdocs enable_egl enable_xkbcommon enable_setuid_install enable_xwayland enable_xwayland_test with_xserver_path enable_x11_compositor enable_drm_compositor enable_wayland_compositor enable_headless_compositor enable_rpi_compositor enable_fbdev_compositor enable_rdp_compositor enable_screen_sharing with_cairo with_cairo_glesv2 enable_vaapi_recorder enable_simple_clients enable_simple_egl_clients enable_simple_intel_dmabuf_client enable_clients enable_resize_optimization enable_weston_launch enable_fullscreen_shell enable_colord enable_dbus enable_junit_xml enable_ivi_shell enable_wcap_tools enable_libunwind enable_demo_clients_install ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP WESTON_NATIVE_BACKEND WESTON_SHELL_CLIENT PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR EGL_CFLAGS EGL_LIBS EGL_TESTS_CFLAGS EGL_TESTS_LIBS GL_RENDERER_CFLAGS GL_RENDERER_LIBS XWAYLAND_CFLAGS XWAYLAND_LIBS XWAYLAND_TEST_CFLAGS XWAYLAND_TEST_LIBS LIBDRM_CFLAGS LIBDRM_LIBS XCB_CFLAGS XCB_LIBS X11_COMPOSITOR_XKB_CFLAGS X11_COMPOSITOR_XKB_LIBS X11_COMPOSITOR_CFLAGS X11_COMPOSITOR_LIBS DRM_COMPOSITOR_CFLAGS DRM_COMPOSITOR_LIBS DRM_COMPOSITOR_GBM_CFLAGS DRM_COMPOSITOR_GBM_LIBS LIBINPUT_BACKEND_CFLAGS LIBINPUT_BACKEND_LIBS COMPOSITOR_CFLAGS COMPOSITOR_LIBS WAYLAND_COMPOSITOR_CFLAGS WAYLAND_COMPOSITOR_LIBS RPI_COMPOSITOR_CFLAGS RPI_COMPOSITOR_LIBS RPI_BCM_HOST_CFLAGS RPI_BCM_HOST_LIBS FBDEV_COMPOSITOR_CFLAGS FBDEV_COMPOSITOR_LIBS RDP_COMPOSITOR_CFLAGS RDP_COMPOSITOR_LIBS SCREEN_SHARE_CFLAGS SCREEN_SHARE_LIBS PIXMAN_CFLAGS PIXMAN_LIBS PNG_CFLAGS PNG_LIBS WEBP_CFLAGS WEBP_LIBS LIBVA_CFLAGS LIBVA_LIBS CAIRO_CFLAGS CAIRO_LIBS TEST_CLIENT_CFLAGS TEST_CLIENT_LIBS SIMPLE_CLIENT_CFLAGS SIMPLE_CLIENT_LIBS SIMPLE_EGL_CLIENT_CFLAGS SIMPLE_EGL_CLIENT_LIBS SIMPLE_DMABUF_CLIENT_CFLAGS SIMPLE_DMABUF_CLIENT_LIBS CLIENT_CFLAGS CLIENT_LIBS SERVER_CFLAGS SERVER_LIBS WESTON_INFO_CFLAGS WESTON_INFO_LIBS CAIRO_EGL_CFLAGS CAIRO_EGL_LIBS PANGO_CFLAGS PANGO_LIBS SYSTEMD_LOGIN_CFLAGS SYSTEMD_LOGIN_LIBS SYSTEMD_LOGIN_209_CFLAGS SYSTEMD_LOGIN_209_LIBS COLORD_CFLAGS COLORD_LIBS DBUS_CFLAGS DBUS_LIBS LIBXML2_CFLAGS LIBXML2_LIBS WCAP_CFLAGS WCAP_LIBS SETBACKLIGHT_CFLAGS SETBACKLIGHT_LIBS LIBUNWIND_CFLAGS LIBUNWIND_LIBS LCMS_CFLAGS LCMS_LIBS WAYLAND_SCANNER_CFLAGS WAYLAND_SCANNER_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures weston 1.9.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/weston] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of weston 1.9.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-devdocs do not enable building of developer documentation --disable-egl --disable-xkbcommon Disable libxkbcommon support: This is only useful in environments where you do not have a hardware keyboard. If libxkbcommon support is disabled clients will not be sent a keymap and and must know how to interpret the keycode sent for any key event. --enable-setuid-install --enable-xwayland --enable-xwayland-test --enable-x11-compositor --enable-drm-compositor --enable-wayland-compositor --enable-headless-compositor --disable-rpi-compositor do not build the Raspberry Pi backend --enable-fbdev-compositor --enable-rdp-compositor --enable-screen-sharing --enable-vaapi-recorder --disable-simple-clients do not build the simple wl_shm clients --disable-simple-egl-clients do not build the simple EGL clients --disable-simple-intel-dmabuf-client do not build the simple intel dmabuf client --enable-clients --disable-resize-optimization disable resize optimization allocating a big buffer in toytoolkit --enable-weston-launch --disable-fullscreen-shell do not build fullscreen-shell server plugin --disable-colord do not build colord CMS support --disable-dbus do not build with dbus support --disable-junit-xml do not build with JUnit XML output --disable-ivi-shell do not build ivi-shell server plugin and client --disable-wcap-tools --disable-libunwind Disable libunwind usage for backtraces --enable-demo-clients-install Install demo clients built with weston Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-xserver-path=PATH Path to X server --with-cairo=[image|gl|glesv2] Which Cairo renderer to use for the clients --with-cairo-glesv2 Use GLESv2 cairo Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor WESTON_NATIVE_BACKEND Set the native backend to use, if Weston is not running under Wayland nor X11. [default=drm-backend.so] WESTON_SHELL_CLIENT Set the default desktop shell client to load if none is specified in weston.ini. [default=weston-desktop-shell] PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path EGL_CFLAGS C compiler flags for EGL, overriding pkg-config EGL_LIBS linker flags for EGL, overriding pkg-config EGL_TESTS_CFLAGS C compiler flags for EGL_TESTS, overriding pkg-config EGL_TESTS_LIBS linker flags for EGL_TESTS, overriding pkg-config GL_RENDERER_CFLAGS C compiler flags for GL_RENDERER, overriding pkg-config GL_RENDERER_LIBS linker flags for GL_RENDERER, overriding pkg-config XWAYLAND_CFLAGS C compiler flags for XWAYLAND, overriding pkg-config XWAYLAND_LIBS linker flags for XWAYLAND, overriding pkg-config XWAYLAND_TEST_CFLAGS C compiler flags for XWAYLAND_TEST, overriding pkg-config XWAYLAND_TEST_LIBS linker flags for XWAYLAND_TEST, overriding pkg-config LIBDRM_CFLAGS C compiler flags for LIBDRM, overriding pkg-config LIBDRM_LIBS linker flags for LIBDRM, overriding pkg-config XCB_CFLAGS C compiler flags for XCB, overriding pkg-config XCB_LIBS linker flags for XCB, overriding pkg-config X11_COMPOSITOR_XKB_CFLAGS C compiler flags for X11_COMPOSITOR_XKB, overriding pkg-config X11_COMPOSITOR_XKB_LIBS linker flags for X11_COMPOSITOR_XKB, overriding pkg-config X11_COMPOSITOR_CFLAGS C compiler flags for X11_COMPOSITOR, overriding pkg-config X11_COMPOSITOR_LIBS linker flags for X11_COMPOSITOR, overriding pkg-config DRM_COMPOSITOR_CFLAGS C compiler flags for DRM_COMPOSITOR, overriding pkg-config DRM_COMPOSITOR_LIBS linker flags for DRM_COMPOSITOR, overriding pkg-config DRM_COMPOSITOR_GBM_CFLAGS C compiler flags for DRM_COMPOSITOR_GBM, overriding pkg-config DRM_COMPOSITOR_GBM_LIBS linker flags for DRM_COMPOSITOR_GBM, overriding pkg-config LIBINPUT_BACKEND_CFLAGS C compiler flags for LIBINPUT_BACKEND, overriding pkg-config LIBINPUT_BACKEND_LIBS linker flags for LIBINPUT_BACKEND, overriding pkg-config COMPOSITOR_CFLAGS C compiler flags for COMPOSITOR, overriding pkg-config COMPOSITOR_LIBS linker flags for COMPOSITOR, overriding pkg-config WAYLAND_COMPOSITOR_CFLAGS C compiler flags for WAYLAND_COMPOSITOR, overriding pkg-config WAYLAND_COMPOSITOR_LIBS linker flags for WAYLAND_COMPOSITOR, overriding pkg-config RPI_COMPOSITOR_CFLAGS C compiler flags for RPI_COMPOSITOR, overriding pkg-config RPI_COMPOSITOR_LIBS linker flags for RPI_COMPOSITOR, overriding pkg-config RPI_BCM_HOST_CFLAGS C compiler flags for RPI_BCM_HOST, overriding pkg-config RPI_BCM_HOST_LIBS linker flags for RPI_BCM_HOST, overriding pkg-config FBDEV_COMPOSITOR_CFLAGS C compiler flags for FBDEV_COMPOSITOR, overriding pkg-config FBDEV_COMPOSITOR_LIBS linker flags for FBDEV_COMPOSITOR, overriding pkg-config RDP_COMPOSITOR_CFLAGS C compiler flags for RDP_COMPOSITOR, overriding pkg-config RDP_COMPOSITOR_LIBS linker flags for RDP_COMPOSITOR, overriding pkg-config SCREEN_SHARE_CFLAGS C compiler flags for SCREEN_SHARE, overriding pkg-config SCREEN_SHARE_LIBS linker flags for SCREEN_SHARE, overriding pkg-config PIXMAN_CFLAGS C compiler flags for PIXMAN, overriding pkg-config PIXMAN_LIBS linker flags for PIXMAN, overriding pkg-config PNG_CFLAGS C compiler flags for PNG, overriding pkg-config PNG_LIBS linker flags for PNG, overriding pkg-config WEBP_CFLAGS C compiler flags for WEBP, overriding pkg-config WEBP_LIBS linker flags for WEBP, overriding pkg-config LIBVA_CFLAGS C compiler flags for LIBVA, overriding pkg-config LIBVA_LIBS linker flags for LIBVA, overriding pkg-config CAIRO_CFLAGS C compiler flags for CAIRO, overriding pkg-config CAIRO_LIBS linker flags for CAIRO, overriding pkg-config TEST_CLIENT_CFLAGS C compiler flags for TEST_CLIENT, overriding pkg-config TEST_CLIENT_LIBS linker flags for TEST_CLIENT, overriding pkg-config SIMPLE_CLIENT_CFLAGS C compiler flags for SIMPLE_CLIENT, overriding pkg-config SIMPLE_CLIENT_LIBS linker flags for SIMPLE_CLIENT, overriding pkg-config SIMPLE_EGL_CLIENT_CFLAGS C compiler flags for SIMPLE_EGL_CLIENT, overriding pkg-config SIMPLE_EGL_CLIENT_LIBS linker flags for SIMPLE_EGL_CLIENT, overriding pkg-config SIMPLE_DMABUF_CLIENT_CFLAGS C compiler flags for SIMPLE_DMABUF_CLIENT, overriding pkg-config SIMPLE_DMABUF_CLIENT_LIBS linker flags for SIMPLE_DMABUF_CLIENT, overriding pkg-config CLIENT_CFLAGS C compiler flags for CLIENT, overriding pkg-config CLIENT_LIBS linker flags for CLIENT, overriding pkg-config SERVER_CFLAGS C compiler flags for SERVER, overriding pkg-config SERVER_LIBS linker flags for SERVER, overriding pkg-config WESTON_INFO_CFLAGS C compiler flags for WESTON_INFO, overriding pkg-config WESTON_INFO_LIBS linker flags for WESTON_INFO, overriding pkg-config CAIRO_EGL_CFLAGS C compiler flags for CAIRO_EGL, overriding pkg-config CAIRO_EGL_LIBS linker flags for CAIRO_EGL, overriding pkg-config PANGO_CFLAGS C compiler flags for PANGO, overriding pkg-config PANGO_LIBS linker flags for PANGO, overriding pkg-config SYSTEMD_LOGIN_CFLAGS C compiler flags for SYSTEMD_LOGIN, overriding pkg-config SYSTEMD_LOGIN_LIBS linker flags for SYSTEMD_LOGIN, overriding pkg-config SYSTEMD_LOGIN_209_CFLAGS C compiler flags for SYSTEMD_LOGIN_209, overriding pkg-config SYSTEMD_LOGIN_209_LIBS linker flags for SYSTEMD_LOGIN_209, overriding pkg-config COLORD_CFLAGS C compiler flags for COLORD, overriding pkg-config COLORD_LIBS linker flags for COLORD, overriding pkg-config DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config LIBXML2_CFLAGS C compiler flags for LIBXML2, overriding pkg-config LIBXML2_LIBS linker flags for LIBXML2, overriding pkg-config WCAP_CFLAGS C compiler flags for WCAP, overriding pkg-config WCAP_LIBS linker flags for WCAP, overriding pkg-config SETBACKLIGHT_CFLAGS C compiler flags for SETBACKLIGHT, overriding pkg-config SETBACKLIGHT_LIBS linker flags for SETBACKLIGHT, overriding pkg-config LIBUNWIND_CFLAGS C compiler flags for LIBUNWIND, overriding pkg-config LIBUNWIND_LIBS linker flags for LIBUNWIND, overriding pkg-config LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config LCMS_LIBS linker flags for LCMS, overriding pkg-config WAYLAND_SCANNER_CFLAGS C compiler flags for WAYLAND_SCANNER, overriding pkg-config WAYLAND_SCANNER_LIBS linker flags for WAYLAND_SCANNER, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . weston home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF weston configure 1.9.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------------------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=1.9.0 ## ## -------------------------------------------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by weston $as_me 1.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu WESTON_VERSION_MAJOR=1 WESTON_VERSION_MINOR=9 WESTON_VERSION_MICRO=0 WESTON_VERSION=1.9.0 ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='weston' VERSION='1.9.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # Check for programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # Initialize libtool case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : DLOPEN_LIBS="-ldl" fi fi ac_fn_c_check_decl "$LINENO" "SFD_CLOEXEC" "ac_cv_have_decl_SFD_CLOEXEC" "#include " if test "x$ac_cv_have_decl_SFD_CLOEXEC" = xyes; then : else as_fn_error $? "\"SFD_CLOEXEC is needed to compile weston\"" "$LINENO" 5 fi ac_fn_c_check_decl "$LINENO" "TFD_CLOEXEC" "ac_cv_have_decl_TFD_CLOEXEC" "#include " if test "x$ac_cv_have_decl_TFD_CLOEXEC" = xyes; then : else as_fn_error $? "\"TFD_CLOEXEC is needed to compile weston\"" "$LINENO" 5 fi ac_fn_c_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "#include " if test "x$ac_cv_have_decl_CLOCK_MONOTONIC" = xyes; then : else as_fn_error $? "\"CLOCK_MONOTONIC is needed to compile weston\"" "$LINENO" 5 fi for ac_header in execinfo.h do : ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" if test "x$ac_cv_header_execinfo_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EXECINFO_H 1 _ACEOF fi done for ac_func in mkostemp strchrnul initgroups posix_fallocate do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done COMPOSITOR_MODULES="wayland-server >= 1.9.0 pixman-1 >= 0.25.2" ac_config_files="$ac_config_files doc/doxygen/tools.doxygen doc/doxygen/tooldev.doxygen" # Check whether --enable-devdocs was given. if test "${enable_devdocs+set}" = set; then : enableval=$enable_devdocs; else enable_devdocs=auto fi if test "x$enable_devdocs" != "xno"; then for ac_prog in doxygen do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOXYGEN"; then ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DOXYGEN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DOXYGEN=$ac_cv_prog_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DOXYGEN" && break done if test "x$DOXYGEN" = "x" -a "x$enable_devdocs" = "xyes"; then as_fn_error $? "Developer documentation explicitly requested, but Doxygen couldn't be found" "$LINENO" 5 fi if test "x$DOXYGEN" != "x"; then enable_devdocs=yes else enable_devdocs=no fi fi if test "x$enable_devdocs" = "xyes"; then ENABLE_DEVDOCS_TRUE= ENABLE_DEVDOCS_FALSE='#' else ENABLE_DEVDOCS_TRUE='#' ENABLE_DEVDOCS_FALSE= fi # Check whether --enable-egl was given. if test "${enable_egl+set}" = set; then : enableval=$enable_egl; else enable_egl=yes fi if test x$enable_egl = xyes; then ENABLE_EGL_TRUE= ENABLE_EGL_FALSE='#' else ENABLE_EGL_TRUE='#' ENABLE_EGL_FALSE= fi if test x$enable_egl = xyes; then $as_echo "#define ENABLE_EGL 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL" >&5 $as_echo_n "checking for EGL... " >&6; } if test -n "$EGL_CFLAGS"; then pkg_cv_EGL_CFLAGS="$EGL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 7.10 glesv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl >= 7.10 glesv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EGL_CFLAGS=`$PKG_CONFIG --cflags "egl >= 7.10 glesv2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$EGL_LIBS"; then pkg_cv_EGL_LIBS="$EGL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 7.10 glesv2\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl >= 7.10 glesv2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EGL_LIBS=`$PKG_CONFIG --libs "egl >= 7.10 glesv2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "egl >= 7.10 glesv2" 2>&1` else EGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "egl >= 7.10 glesv2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EGL_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (egl >= 7.10 glesv2) were not met: $EGL_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables EGL_CFLAGS and EGL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables EGL_CFLAGS and EGL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else EGL_CFLAGS=$pkg_cv_EGL_CFLAGS EGL_LIBS=$pkg_cv_EGL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL_TESTS" >&5 $as_echo_n "checking for EGL_TESTS... " >&6; } if test -n "$EGL_TESTS_CFLAGS"; then pkg_cv_EGL_TESTS_CFLAGS="$EGL_TESTS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 7.10 glesv2 wayland-client wayland-egl\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl >= 7.10 glesv2 wayland-client wayland-egl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EGL_TESTS_CFLAGS=`$PKG_CONFIG --cflags "egl >= 7.10 glesv2 wayland-client wayland-egl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$EGL_TESTS_LIBS"; then pkg_cv_EGL_TESTS_LIBS="$EGL_TESTS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 7.10 glesv2 wayland-client wayland-egl\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl >= 7.10 glesv2 wayland-client wayland-egl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_EGL_TESTS_LIBS=`$PKG_CONFIG --libs "egl >= 7.10 glesv2 wayland-client wayland-egl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then EGL_TESTS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "egl >= 7.10 glesv2 wayland-client wayland-egl" 2>&1` else EGL_TESTS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "egl >= 7.10 glesv2 wayland-client wayland-egl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EGL_TESTS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (egl >= 7.10 glesv2 wayland-client wayland-egl) were not met: $EGL_TESTS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables EGL_TESTS_CFLAGS and EGL_TESTS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables EGL_TESTS_CFLAGS and EGL_TESTS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else EGL_TESTS_CFLAGS=$pkg_cv_EGL_TESTS_CFLAGS EGL_TESTS_LIBS=$pkg_cv_EGL_TESTS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL_RENDERER" >&5 $as_echo_n "checking for GL_RENDERER... " >&6; } if test -n "$GL_RENDERER_CFLAGS"; then pkg_cv_GL_RENDERER_CFLAGS="$GL_RENDERER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GL_RENDERER_CFLAGS=`$PKG_CONFIG --cflags "libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GL_RENDERER_LIBS"; then pkg_cv_GL_RENDERER_LIBS="$GL_RENDERER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GL_RENDERER_LIBS=`$PKG_CONFIG --libs "libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GL_RENDERER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm" 2>&1` else GL_RENDERER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GL_RENDERER_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libdrm) were not met: $GL_RENDERER_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GL_RENDERER_CFLAGS and GL_RENDERER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GL_RENDERER_CFLAGS and GL_RENDERER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GL_RENDERER_CFLAGS=$pkg_cv_GL_RENDERER_CFLAGS GL_RENDERER_LIBS=$pkg_cv_GL_RENDERER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-xkbcommon was given. if test "${enable_xkbcommon+set}" = set; then : enableval=$enable_xkbcommon; else enable_xkbcommon=yes fi if test x$enable_xkbcommon = xyes; then $as_echo "#define ENABLE_XKBCOMMON 1" >>confdefs.h COMPOSITOR_MODULES="$COMPOSITOR_MODULES xkbcommon >= 0.3.0" fi # Check whether --enable-setuid-install was given. if test "${enable_setuid_install+set}" = set; then : enableval=$enable_setuid_install; else enable_setuid_install=yes fi if test x$enable_setuid_install = xyes; then ENABLE_SETUID_INSTALL_TRUE= ENABLE_SETUID_INSTALL_FALSE='#' else ENABLE_SETUID_INSTALL_TRUE='#' ENABLE_SETUID_INSTALL_FALSE= fi # Check whether --enable-xwayland was given. if test "${enable_xwayland+set}" = set; then : enableval=$enable_xwayland; else enable_xwayland=yes fi # Check whether --enable-xwayland-test was given. if test "${enable_xwayland_test+set}" = set; then : enableval=$enable_xwayland_test; else enable_xwayland_test=yes fi if test x$enable_xwayland = xyes; then ENABLE_XWAYLAND_TRUE= ENABLE_XWAYLAND_FALSE='#' else ENABLE_XWAYLAND_TRUE='#' ENABLE_XWAYLAND_FALSE= fi if test x$enable_xwayland = xyes -a x$enable_xwayland_test = xyes; then ENABLE_XWAYLAND_TEST_TRUE= ENABLE_XWAYLAND_TEST_FALSE='#' else ENABLE_XWAYLAND_TEST_TRUE='#' ENABLE_XWAYLAND_TEST_FALSE= fi if test x$enable_xwayland = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWAYLAND" >&5 $as_echo_n "checking for XWAYLAND... " >&6; } if test -n "$XWAYLAND_CFLAGS"; then pkg_cv_XWAYLAND_CFLAGS="$XWAYLAND_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb xcb-xfixes xcb-composite xcursor cairo-xcb\""; } >&5 ($PKG_CONFIG --exists --print-errors "xcb xcb-xfixes xcb-composite xcursor cairo-xcb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWAYLAND_CFLAGS=`$PKG_CONFIG --cflags "xcb xcb-xfixes xcb-composite xcursor cairo-xcb" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XWAYLAND_LIBS"; then pkg_cv_XWAYLAND_LIBS="$XWAYLAND_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb xcb-xfixes xcb-composite xcursor cairo-xcb\""; } >&5 ($PKG_CONFIG --exists --print-errors "xcb xcb-xfixes xcb-composite xcursor cairo-xcb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWAYLAND_LIBS=`$PKG_CONFIG --libs "xcb xcb-xfixes xcb-composite xcursor cairo-xcb" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XWAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xcb xcb-xfixes xcb-composite xcursor cairo-xcb" 2>&1` else XWAYLAND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xcb xcb-xfixes xcb-composite xcursor cairo-xcb" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWAYLAND_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xcb xcb-xfixes xcb-composite xcursor cairo-xcb) were not met: $XWAYLAND_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XWAYLAND_CFLAGS and XWAYLAND_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XWAYLAND_CFLAGS and XWAYLAND_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XWAYLAND_CFLAGS=$pkg_cv_XWAYLAND_CFLAGS XWAYLAND_LIBS=$pkg_cv_XWAYLAND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define BUILD_XWAYLAND 1" >>confdefs.h # Check whether --with-xserver-path was given. if test "${with_xserver_path+set}" = set; then : withval=$with_xserver_path; XSERVER_PATH="$withval" else XSERVER_PATH="/usr/bin/Xwayland" fi if test x$enable_xwayland_test = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XWAYLAND_TEST" >&5 $as_echo_n "checking for XWAYLAND_TEST... " >&6; } if test -n "$XWAYLAND_TEST_CFLAGS"; then pkg_cv_XWAYLAND_TEST_CFLAGS="$XWAYLAND_TEST_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWAYLAND_TEST_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XWAYLAND_TEST_LIBS"; then pkg_cv_XWAYLAND_TEST_LIBS="$XWAYLAND_TEST_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XWAYLAND_TEST_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XWAYLAND_TEST_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1` else XWAYLAND_TEST_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XWAYLAND_TEST_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (x11) were not met: $XWAYLAND_TEST_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XWAYLAND_TEST_CFLAGS and XWAYLAND_TEST_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XWAYLAND_TEST_CFLAGS and XWAYLAND_TEST_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XWAYLAND_TEST_CFLAGS=$pkg_cv_XWAYLAND_TEST_CFLAGS XWAYLAND_TEST_LIBS=$pkg_cv_XWAYLAND_TEST_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBDRM" >&5 $as_echo_n "checking for LIBDRM... " >&6; } if test -n "$LIBDRM_CFLAGS"; then pkg_cv_LIBDRM_CFLAGS="$LIBDRM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBDRM_CFLAGS=`$PKG_CONFIG --cflags "libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBDRM_LIBS"; then pkg_cv_LIBDRM_LIBS="$LIBDRM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBDRM_LIBS=`$PKG_CONFIG --libs "libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBDRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm" 2>&1` else LIBDRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBDRM_PKG_ERRORS" >&5 have_libdrm=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libdrm=no else LIBDRM_CFLAGS=$pkg_cv_LIBDRM_CFLAGS LIBDRM_LIBS=$pkg_cv_LIBDRM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBDRM 1" >>confdefs.h have_libdrm=yes fi # Check whether --enable-x11-compositor was given. if test "${enable_x11_compositor+set}" = set; then : enableval=$enable_x11_compositor; else enable_x11_compositor=yes fi if test x$enable_x11_compositor = xyes; then ENABLE_X11_COMPOSITOR_TRUE= ENABLE_X11_COMPOSITOR_FALSE='#' else ENABLE_X11_COMPOSITOR_TRUE='#' ENABLE_X11_COMPOSITOR_FALSE= fi if test x$enable_x11_compositor = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCB" >&5 $as_echo_n "checking for XCB... " >&6; } if test -n "$XCB_CFLAGS"; then pkg_cv_XCB_CFLAGS="$XCB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb\""; } >&5 ($PKG_CONFIG --exists --print-errors "xcb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XCB_CFLAGS=`$PKG_CONFIG --cflags "xcb" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XCB_LIBS"; then pkg_cv_XCB_LIBS="$XCB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb\""; } >&5 ($PKG_CONFIG --exists --print-errors "xcb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XCB_LIBS=`$PKG_CONFIG --libs "xcb" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XCB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xcb" 2>&1` else XCB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xcb" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XCB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xcb) were not met: $XCB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XCB_CFLAGS and XCB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XCB_CFLAGS and XCB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XCB_CFLAGS=$pkg_cv_XCB_CFLAGS XCB_LIBS=$pkg_cv_XCB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi xcb_save_LIBS=$LIBS xcb_save_CFLAGS=$CFLAGS CFLAGS=$XCB_CFLAGS LIBS=$XCB_LIBS for ac_func in xcb_poll_for_queued_event do : ac_fn_c_check_func "$LINENO" "xcb_poll_for_queued_event" "ac_cv_func_xcb_poll_for_queued_event" if test "x$ac_cv_func_xcb_poll_for_queued_event" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_XCB_POLL_FOR_QUEUED_EVENT 1 _ACEOF fi done LIBS=$xcb_save_LIBS CFLAGS=$xcb_save_CFLAGS X11_COMPOSITOR_MODULES="x11 x11-xcb xcb-shm" pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11_COMPOSITOR_XKB" >&5 $as_echo_n "checking for X11_COMPOSITOR_XKB... " >&6; } if test -n "$X11_COMPOSITOR_XKB_CFLAGS"; then pkg_cv_X11_COMPOSITOR_XKB_CFLAGS="$X11_COMPOSITOR_XKB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb-xkb\""; } >&5 ($PKG_CONFIG --exists --print-errors "xcb-xkb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_COMPOSITOR_XKB_CFLAGS=`$PKG_CONFIG --cflags "xcb-xkb" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$X11_COMPOSITOR_XKB_LIBS"; then pkg_cv_X11_COMPOSITOR_XKB_LIBS="$X11_COMPOSITOR_XKB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb-xkb\""; } >&5 ($PKG_CONFIG --exists --print-errors "xcb-xkb") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_COMPOSITOR_XKB_LIBS=`$PKG_CONFIG --libs "xcb-xkb" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then X11_COMPOSITOR_XKB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xcb-xkb" 2>&1` else X11_COMPOSITOR_XKB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xcb-xkb" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$X11_COMPOSITOR_XKB_PKG_ERRORS" >&5 have_xcb_xkb="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_xcb_xkb="no" else X11_COMPOSITOR_XKB_CFLAGS=$pkg_cv_X11_COMPOSITOR_XKB_CFLAGS X11_COMPOSITOR_XKB_LIBS=$pkg_cv_X11_COMPOSITOR_XKB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_xcb_xkb="yes" fi if test "x$have_xcb_xkb" = xyes; then # Most versions of XCB have totally broken XKB bindings, where the # events don't work. Make sure we can actually use them. xcb_xkb_save_CFLAGS=$CFLAGS CFLAGS=$X11_COMPOSITOR_XKB_CFLAGS ac_fn_c_check_member "$LINENO" "struct xcb_xkb_state_notify_event_t" "xkbType" "ac_cv_member_struct_xcb_xkb_state_notify_event_t_xkbType" "#include " if test "x$ac_cv_member_struct_xcb_xkb_state_notify_event_t_xkbType" = xyes; then : else have_xcb_xkb=no fi CFLAGS=$xcb_xkb_save_CFLAGS fi if test "x$have_xcb_xkb" = xyes; then X11_COMPOSITOR_MODULES="$X11_COMPOSITOR_MODULES xcb-xkb" $as_echo "#define HAVE_XCB_XKB 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11_COMPOSITOR" >&5 $as_echo_n "checking for X11_COMPOSITOR... " >&6; } if test -n "$X11_COMPOSITOR_CFLAGS"; then pkg_cv_X11_COMPOSITOR_CFLAGS="$X11_COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$X11_COMPOSITOR_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$X11_COMPOSITOR_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "$X11_COMPOSITOR_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$X11_COMPOSITOR_LIBS"; then pkg_cv_X11_COMPOSITOR_LIBS="$X11_COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$X11_COMPOSITOR_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$X11_COMPOSITOR_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_X11_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "$X11_COMPOSITOR_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then X11_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$X11_COMPOSITOR_MODULES" 2>&1` else X11_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$X11_COMPOSITOR_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$X11_COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($X11_COMPOSITOR_MODULES) were not met: $X11_COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables X11_COMPOSITOR_CFLAGS and X11_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables X11_COMPOSITOR_CFLAGS and X11_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else X11_COMPOSITOR_CFLAGS=$pkg_cv_X11_COMPOSITOR_CFLAGS X11_COMPOSITOR_LIBS=$pkg_cv_X11_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define BUILD_X11_COMPOSITOR 1" >>confdefs.h fi # Check whether --enable-drm-compositor was given. if test "${enable_drm_compositor+set}" = set; then : enableval=$enable_drm_compositor; else enable_drm_compositor=yes fi if test x$enable_drm_compositor = xyes; then ENABLE_DRM_COMPOSITOR_TRUE= ENABLE_DRM_COMPOSITOR_FALSE='#' else ENABLE_DRM_COMPOSITOR_TRUE='#' ENABLE_DRM_COMPOSITOR_FALSE= fi if test x$enable_drm_compositor = xyes; then $as_echo "#define BUILD_DRM_COMPOSITOR 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM_COMPOSITOR" >&5 $as_echo_n "checking for DRM_COMPOSITOR... " >&6; } if test -n "$DRM_COMPOSITOR_CFLAGS"; then pkg_cv_DRM_COMPOSITOR_CFLAGS="$DRM_COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRM_COMPOSITOR_LIBS"; then pkg_cv_DRM_COMPOSITOR_LIBS="$DRM_COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DRM_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0" 2>&1` else DRM_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRM_COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0) were not met: $DRM_COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DRM_COMPOSITOR_CFLAGS and DRM_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DRM_COMPOSITOR_CFLAGS and DRM_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DRM_COMPOSITOR_CFLAGS=$pkg_cv_DRM_COMPOSITOR_CFLAGS DRM_COMPOSITOR_LIBS=$pkg_cv_DRM_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM_COMPOSITOR_GBM" >&5 $as_echo_n "checking for DRM_COMPOSITOR_GBM... " >&6; } if test -n "$DRM_COMPOSITOR_GBM_CFLAGS"; then pkg_cv_DRM_COMPOSITOR_GBM_CFLAGS="$DRM_COMPOSITOR_GBM_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gbm >= 10.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "gbm >= 10.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_COMPOSITOR_GBM_CFLAGS=`$PKG_CONFIG --cflags "gbm >= 10.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DRM_COMPOSITOR_GBM_LIBS"; then pkg_cv_DRM_COMPOSITOR_GBM_LIBS="$DRM_COMPOSITOR_GBM_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gbm >= 10.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "gbm >= 10.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DRM_COMPOSITOR_GBM_LIBS=`$PKG_CONFIG --libs "gbm >= 10.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DRM_COMPOSITOR_GBM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gbm >= 10.2" 2>&1` else DRM_COMPOSITOR_GBM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gbm >= 10.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRM_COMPOSITOR_GBM_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gbm does not support dmabuf import, will omit that capability" >&5 $as_echo "$as_me: WARNING: gbm does not support dmabuf import, will omit that capability" >&2;} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gbm does not support dmabuf import, will omit that capability" >&5 $as_echo "$as_me: WARNING: gbm does not support dmabuf import, will omit that capability" >&2;} else DRM_COMPOSITOR_GBM_CFLAGS=$pkg_cv_DRM_COMPOSITOR_GBM_CFLAGS DRM_COMPOSITOR_GBM_LIBS=$pkg_cv_DRM_COMPOSITOR_GBM_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_GBM_FD_IMPORT 1" >>confdefs.h fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBINPUT_BACKEND" >&5 $as_echo_n "checking for LIBINPUT_BACKEND... " >&6; } if test -n "$LIBINPUT_BACKEND_CFLAGS"; then pkg_cv_LIBINPUT_BACKEND_CFLAGS="$LIBINPUT_BACKEND_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libinput >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libinput >= 0.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBINPUT_BACKEND_CFLAGS=`$PKG_CONFIG --cflags "libinput >= 0.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBINPUT_BACKEND_LIBS"; then pkg_cv_LIBINPUT_BACKEND_LIBS="$LIBINPUT_BACKEND_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libinput >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libinput >= 0.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBINPUT_BACKEND_LIBS=`$PKG_CONFIG --libs "libinput >= 0.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBINPUT_BACKEND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libinput >= 0.8.0" 2>&1` else LIBINPUT_BACKEND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libinput >= 0.8.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBINPUT_BACKEND_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libinput >= 0.8.0) were not met: $LIBINPUT_BACKEND_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBINPUT_BACKEND_CFLAGS and LIBINPUT_BACKEND_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBINPUT_BACKEND_CFLAGS and LIBINPUT_BACKEND_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBINPUT_BACKEND_CFLAGS=$pkg_cv_LIBINPUT_BACKEND_CFLAGS LIBINPUT_BACKEND_LIBS=$pkg_cv_LIBINPUT_BACKEND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for COMPOSITOR" >&5 $as_echo_n "checking for COMPOSITOR... " >&6; } if test -n "$COMPOSITOR_CFLAGS"; then pkg_cv_COMPOSITOR_CFLAGS="$COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$COMPOSITOR_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$COMPOSITOR_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "$COMPOSITOR_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$COMPOSITOR_LIBS"; then pkg_cv_COMPOSITOR_LIBS="$COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$COMPOSITOR_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "$COMPOSITOR_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "$COMPOSITOR_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$COMPOSITOR_MODULES" 2>&1` else COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$COMPOSITOR_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($COMPOSITOR_MODULES) were not met: $COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables COMPOSITOR_CFLAGS and COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables COMPOSITOR_CFLAGS and COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else COMPOSITOR_CFLAGS=$pkg_cv_COMPOSITOR_CFLAGS COMPOSITOR_LIBS=$pkg_cv_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-wayland-compositor was given. if test "${enable_wayland_compositor+set}" = set; then : enableval=$enable_wayland_compositor; else enable_wayland_compositor=yes fi if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then ENABLE_WAYLAND_COMPOSITOR_TRUE= ENABLE_WAYLAND_COMPOSITOR_FALSE='#' else ENABLE_WAYLAND_COMPOSITOR_TRUE='#' ENABLE_WAYLAND_COMPOSITOR_FALSE= fi if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then $as_echo "#define BUILD_WAYLAND_COMPOSITOR 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND_COMPOSITOR" >&5 $as_echo_n "checking for WAYLAND_COMPOSITOR... " >&6; } if test -n "$WAYLAND_COMPOSITOR_CFLAGS"; then pkg_cv_WAYLAND_COMPOSITOR_CFLAGS="$WAYLAND_COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.5.91 wayland-egl wayland-cursor\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.5.91 wayland-egl wayland-cursor") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WAYLAND_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.5.91 wayland-egl wayland-cursor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$WAYLAND_COMPOSITOR_LIBS"; then pkg_cv_WAYLAND_COMPOSITOR_LIBS="$WAYLAND_COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.5.91 wayland-egl wayland-cursor\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.5.91 wayland-egl wayland-cursor") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WAYLAND_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.5.91 wayland-egl wayland-cursor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then WAYLAND_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.5.91 wayland-egl wayland-cursor" 2>&1` else WAYLAND_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.5.91 wayland-egl wayland-cursor" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WAYLAND_COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-client >= 1.5.91 wayland-egl wayland-cursor) were not met: $WAYLAND_COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables WAYLAND_COMPOSITOR_CFLAGS and WAYLAND_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables WAYLAND_COMPOSITOR_CFLAGS and WAYLAND_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else WAYLAND_COMPOSITOR_CFLAGS=$pkg_cv_WAYLAND_COMPOSITOR_CFLAGS WAYLAND_COMPOSITOR_LIBS=$pkg_cv_WAYLAND_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-headless-compositor was given. if test "${enable_headless_compositor+set}" = set; then : enableval=$enable_headless_compositor; else enable_headless_compositor=yes fi if test x$enable_headless_compositor = xyes; then ENABLE_HEADLESS_COMPOSITOR_TRUE= ENABLE_HEADLESS_COMPOSITOR_FALSE='#' else ENABLE_HEADLESS_COMPOSITOR_TRUE='#' ENABLE_HEADLESS_COMPOSITOR_FALSE= fi if test x$enable_headless_compositor = xyes; then $as_echo "#define BUILD_HEADLESS_COMPOSITOR 1" >>confdefs.h fi # Check whether --enable-rpi-compositor was given. if test "${enable_rpi_compositor+set}" = set; then : enableval=$enable_rpi_compositor; else enable_rpi_compositor=yes fi if test "x$enable_rpi_compositor" = "xyes"; then ENABLE_RPI_COMPOSITOR_TRUE= ENABLE_RPI_COMPOSITOR_FALSE='#' else ENABLE_RPI_COMPOSITOR_TRUE='#' ENABLE_RPI_COMPOSITOR_FALSE= fi have_bcm_host="no" if test "x$enable_rpi_compositor" = "xyes"; then $as_echo "#define BUILD_RPI_COMPOSITOR 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPI_COMPOSITOR" >&5 $as_echo_n "checking for RPI_COMPOSITOR... " >&6; } if test -n "$RPI_COMPOSITOR_CFLAGS"; then pkg_cv_RPI_COMPOSITOR_CFLAGS="$RPI_COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 136 mtdev >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 136 mtdev >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RPI_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 136 mtdev >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$RPI_COMPOSITOR_LIBS"; then pkg_cv_RPI_COMPOSITOR_LIBS="$RPI_COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 136 mtdev >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 136 mtdev >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RPI_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "libudev >= 136 mtdev >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then RPI_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 136 mtdev >= 1.1.0" 2>&1` else RPI_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 136 mtdev >= 1.1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$RPI_COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libudev >= 136 mtdev >= 1.1.0) were not met: $RPI_COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables RPI_COMPOSITOR_CFLAGS and RPI_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables RPI_COMPOSITOR_CFLAGS and RPI_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else RPI_COMPOSITOR_CFLAGS=$pkg_cv_RPI_COMPOSITOR_CFLAGS RPI_COMPOSITOR_LIBS=$pkg_cv_RPI_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPI_BCM_HOST" >&5 $as_echo_n "checking for RPI_BCM_HOST... " >&6; } if test -n "$RPI_BCM_HOST_CFLAGS"; then pkg_cv_RPI_BCM_HOST_CFLAGS="$RPI_BCM_HOST_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5 ($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RPI_BCM_HOST_CFLAGS=`$PKG_CONFIG --cflags "bcm_host" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$RPI_BCM_HOST_LIBS"; then pkg_cv_RPI_BCM_HOST_LIBS="$RPI_BCM_HOST_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bcm_host\""; } >&5 ($PKG_CONFIG --exists --print-errors "bcm_host") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RPI_BCM_HOST_LIBS=`$PKG_CONFIG --libs "bcm_host" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then RPI_BCM_HOST_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bcm_host" 2>&1` else RPI_BCM_HOST_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bcm_host" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$RPI_BCM_HOST_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Raspberry Pi BCM host libraries not found, will use stubs instead." >&5 $as_echo "$as_me: WARNING: Raspberry Pi BCM host libraries not found, will use stubs instead." >&2;} elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Raspberry Pi BCM host libraries not found, will use stubs instead." >&5 $as_echo "$as_me: WARNING: Raspberry Pi BCM host libraries not found, will use stubs instead." >&2;} else RPI_BCM_HOST_CFLAGS=$pkg_cv_RPI_BCM_HOST_CFLAGS RPI_BCM_HOST_LIBS=$pkg_cv_RPI_BCM_HOST_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_bcm_host="yes" $as_echo "#define HAVE_BCM_HOST 1" >>confdefs.h fi fi if test "x$have_bcm_host" = "xyes"; then INSTALL_RPI_COMPOSITOR_TRUE= INSTALL_RPI_COMPOSITOR_FALSE='#' else INSTALL_RPI_COMPOSITOR_TRUE='#' INSTALL_RPI_COMPOSITOR_FALSE= fi # Check whether --enable-fbdev-compositor was given. if test "${enable_fbdev_compositor+set}" = set; then : enableval=$enable_fbdev_compositor; else enable_fbdev_compositor=yes fi if test x$enable_fbdev_compositor = xyes; then ENABLE_FBDEV_COMPOSITOR_TRUE= ENABLE_FBDEV_COMPOSITOR_FALSE='#' else ENABLE_FBDEV_COMPOSITOR_TRUE='#' ENABLE_FBDEV_COMPOSITOR_FALSE= fi if test x$enable_fbdev_compositor = xyes; then : $as_echo "#define BUILD_FBDEV_COMPOSITOR 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FBDEV_COMPOSITOR" >&5 $as_echo_n "checking for FBDEV_COMPOSITOR... " >&6; } if test -n "$FBDEV_COMPOSITOR_CFLAGS"; then pkg_cv_FBDEV_COMPOSITOR_CFLAGS="$FBDEV_COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 136 mtdev >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 136 mtdev >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FBDEV_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 136 mtdev >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FBDEV_COMPOSITOR_LIBS"; then pkg_cv_FBDEV_COMPOSITOR_LIBS="$FBDEV_COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 136 mtdev >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev >= 136 mtdev >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FBDEV_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "libudev >= 136 mtdev >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FBDEV_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 136 mtdev >= 1.1.0" 2>&1` else FBDEV_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 136 mtdev >= 1.1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FBDEV_COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libudev >= 136 mtdev >= 1.1.0) were not met: $FBDEV_COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables FBDEV_COMPOSITOR_CFLAGS and FBDEV_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables FBDEV_COMPOSITOR_CFLAGS and FBDEV_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else FBDEV_COMPOSITOR_CFLAGS=$pkg_cv_FBDEV_COMPOSITOR_CFLAGS FBDEV_COMPOSITOR_LIBS=$pkg_cv_FBDEV_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-rdp-compositor was given. if test "${enable_rdp_compositor+set}" = set; then : enableval=$enable_rdp_compositor; else enable_rdp_compositor=no fi if test x$enable_rdp_compositor = xyes; then ENABLE_RDP_COMPOSITOR_TRUE= ENABLE_RDP_COMPOSITOR_FALSE='#' else ENABLE_RDP_COMPOSITOR_TRUE='#' ENABLE_RDP_COMPOSITOR_FALSE= fi if test x$enable_rdp_compositor = xyes; then $as_echo "#define BUILD_RDP_COMPOSITOR 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RDP_COMPOSITOR" >&5 $as_echo_n "checking for RDP_COMPOSITOR... " >&6; } if test -n "$RDP_COMPOSITOR_CFLAGS"; then pkg_cv_RDP_COMPOSITOR_CFLAGS="$RDP_COMPOSITOR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freerdp >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "freerdp >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RDP_COMPOSITOR_CFLAGS=`$PKG_CONFIG --cflags "freerdp >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$RDP_COMPOSITOR_LIBS"; then pkg_cv_RDP_COMPOSITOR_LIBS="$RDP_COMPOSITOR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freerdp >= 1.1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "freerdp >= 1.1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_RDP_COMPOSITOR_LIBS=`$PKG_CONFIG --libs "freerdp >= 1.1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then RDP_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "freerdp >= 1.1.0" 2>&1` else RDP_COMPOSITOR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "freerdp >= 1.1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$RDP_COMPOSITOR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (freerdp >= 1.1.0) were not met: $RDP_COMPOSITOR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables RDP_COMPOSITOR_CFLAGS and RDP_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables RDP_COMPOSITOR_CFLAGS and RDP_COMPOSITOR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else RDP_COMPOSITOR_CFLAGS=$pkg_cv_RDP_COMPOSITOR_CFLAGS RDP_COMPOSITOR_LIBS=$pkg_cv_RDP_COMPOSITOR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi SAVED_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS" for ac_header in freerdp/version.h do : ac_fn_c_check_header_mongrel "$LINENO" "freerdp/version.h" "ac_cv_header_freerdp_version_h" "$ac_includes_default" if test "x$ac_cv_header_freerdp_version_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FREERDP_VERSION_H 1 _ACEOF fi done CPPFLAGS="$SAVED_CPPFLAGS" fi # Check whether --enable-screen-sharing was given. if test "${enable_screen_sharing+set}" = set; then : enableval=$enable_screen_sharing; else enable_screen_sharing=no fi if test x$enable_screen_sharing = xyes; then ENABLE_SCREEN_SHARING_TRUE= ENABLE_SCREEN_SHARING_FALSE='#' else ENABLE_SCREEN_SHARING_TRUE='#' ENABLE_SCREEN_SHARING_FALSE= fi if test x$enable_screen_sharing = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SCREEN_SHARE" >&5 $as_echo_n "checking for SCREEN_SHARE... " >&6; } if test -n "$SCREEN_SHARE_CFLAGS"; then pkg_cv_SCREEN_SHARE_CFLAGS="$SCREEN_SHARE_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SCREEN_SHARE_CFLAGS=`$PKG_CONFIG --cflags "wayland-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SCREEN_SHARE_LIBS"; then pkg_cv_SCREEN_SHARE_LIBS="$SCREEN_SHARE_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SCREEN_SHARE_LIBS=`$PKG_CONFIG --libs "wayland-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SCREEN_SHARE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client" 2>&1` else SCREEN_SHARE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SCREEN_SHARE_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-client) were not met: $SCREEN_SHARE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SCREEN_SHARE_CFLAGS and SCREEN_SHARE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SCREEN_SHARE_CFLAGS and SCREEN_SHARE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SCREEN_SHARE_CFLAGS=$pkg_cv_SCREEN_SHARE_CFLAGS SCREEN_SHARE_LIBS=$pkg_cv_SCREEN_SHARE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test x$enable_rdp_compositor != xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The screen-share.so module requires the RDP backend." >&5 $as_echo "$as_me: WARNING: The screen-share.so module requires the RDP backend." >&2;} fi fi # Check whether --with-cairo was given. if test "${with_cairo+set}" = set; then : withval=$with_cairo; else with_cairo="image" fi if test "x$with_cairo" = "ximage"; then cairo_modules="cairo" else if test "x$with_cairo" = "xgl"; then cairo_modules="cairo-gl" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The --with-cairo=gl option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs." >&5 $as_echo "$as_me: WARNING: The --with-cairo=gl option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs." >&2;} else if test "x$with_cairo" = "xglesv2"; then cairo_modules="cairo-glesv2" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The --with-cairo=gles2 option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs." >&5 $as_echo "$as_me: WARNING: The --with-cairo=gles2 option can cause increased resource usage and potential instability, and thus is not recommended. It is needed only for a few special demo programs." >&2;} else as_fn_error $? "Unknown cairo renderer requested" "$LINENO" 5 fi fi fi # Included for legacy compat # Check whether --with-cairo-glesv2 was given. if test "${with_cairo_glesv2+set}" = set; then : withval=$with_cairo_glesv2; fi if test "x$with_cairo_glesv2" = "xyes"; then cairo_modules="cairo-glesv2" with_cairo="glesv2" fi if test "x$cairo_modules" = "xcairo-glesv2"; then $as_echo "#define USE_CAIRO_GLESV2 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PIXMAN" >&5 $as_echo_n "checking for PIXMAN... " >&6; } if test -n "$PIXMAN_CFLAGS"; then pkg_cv_PIXMAN_CFLAGS="$PIXMAN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pixman-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "pixman-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PIXMAN_CFLAGS=`$PKG_CONFIG --cflags "pixman-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PIXMAN_LIBS"; then pkg_cv_PIXMAN_LIBS="$PIXMAN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pixman-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "pixman-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PIXMAN_LIBS=`$PKG_CONFIG --libs "pixman-1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PIXMAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pixman-1" 2>&1` else PIXMAN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pixman-1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PIXMAN_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (pixman-1) were not met: $PIXMAN_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PIXMAN_CFLAGS and PIXMAN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PIXMAN_CFLAGS and PIXMAN_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else PIXMAN_CFLAGS=$pkg_cv_PIXMAN_CFLAGS PIXMAN_LIBS=$pkg_cv_PIXMAN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PNG" >&5 $as_echo_n "checking for PNG... " >&6; } if test -n "$PNG_CFLAGS"; then pkg_cv_PNG_CFLAGS="$PNG_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PNG_LIBS"; then pkg_cv_PNG_LIBS="$PNG_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PNG_LIBS=`$PKG_CONFIG --libs "libpng" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpng" 2>&1` else PNG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpng" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PNG_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libpng) were not met: $PNG_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PNG_CFLAGS and PNG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PNG_CFLAGS and PNG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else PNG_CFLAGS=$pkg_cv_PNG_CFLAGS PNG_LIBS=$pkg_cv_PNG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WEBP" >&5 $as_echo_n "checking for WEBP... " >&6; } if test -n "$WEBP_CFLAGS"; then pkg_cv_WEBP_CFLAGS="$WEBP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebp\""; } >&5 ($PKG_CONFIG --exists --print-errors "libwebp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WEBP_CFLAGS=`$PKG_CONFIG --cflags "libwebp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$WEBP_LIBS"; then pkg_cv_WEBP_LIBS="$WEBP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libwebp\""; } >&5 ($PKG_CONFIG --exists --print-errors "libwebp") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WEBP_LIBS=`$PKG_CONFIG --libs "libwebp" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then WEBP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libwebp" 2>&1` else WEBP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libwebp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WEBP_PKG_ERRORS" >&5 have_webp=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_webp=no else WEBP_CFLAGS=$pkg_cv_WEBP_CFLAGS WEBP_LIBS=$pkg_cv_WEBP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_webp=yes fi if test "x$have_webp" = "xyes"; then : $as_echo "#define HAVE_WEBP 1" >>confdefs.h fi # Check whether --enable-vaapi-recorder was given. if test "${enable_vaapi_recorder+set}" = set; then : enableval=$enable_vaapi_recorder; else enable_vaapi_recorder=auto fi if test x$enable_vaapi_recorder != xno; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBVA" >&5 $as_echo_n "checking for LIBVA... " >&6; } if test -n "$LIBVA_CFLAGS"; then pkg_cv_LIBVA_CFLAGS="$LIBVA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= 0.34.0 libva-drm >= 0.34.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libva >= 0.34.0 libva-drm >= 0.34.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBVA_CFLAGS=`$PKG_CONFIG --cflags "libva >= 0.34.0 libva-drm >= 0.34.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBVA_LIBS"; then pkg_cv_LIBVA_LIBS="$LIBVA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libva >= 0.34.0 libva-drm >= 0.34.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libva >= 0.34.0 libva-drm >= 0.34.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBVA_LIBS=`$PKG_CONFIG --libs "libva >= 0.34.0 libva-drm >= 0.34.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBVA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libva >= 0.34.0 libva-drm >= 0.34.0" 2>&1` else LIBVA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libva >= 0.34.0 libva-drm >= 0.34.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBVA_PKG_ERRORS" >&5 have_libva=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libva=no else LIBVA_CFLAGS=$pkg_cv_LIBVA_CFLAGS LIBVA_LIBS=$pkg_cv_LIBVA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libva=yes fi if test "x$have_libva" = "xno" -a "x$enable_vaapi_recorder" = "xyes"; then as_fn_error $? "vaapi-recorder explicitly enabled, but libva couldn't be found" "$LINENO" 5 fi if test "x$have_libva" = "xyes"; then : $as_echo "#define BUILD_VAAPI_RECORDER 1" >>confdefs.h fi fi if test "x$have_libva" = xyes; then ENABLE_VAAPI_RECORDER_TRUE= ENABLE_VAAPI_RECORDER_FALSE='#' else ENABLE_VAAPI_RECORDER_TRUE='#' ENABLE_VAAPI_RECORDER_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateDecompress in -ljpeg" >&5 $as_echo_n "checking for jpeg_CreateDecompress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_CreateDecompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_CreateDecompress (); int main () { return jpeg_CreateDecompress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_CreateDecompress=yes else ac_cv_lib_jpeg_jpeg_CreateDecompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateDecompress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_CreateDecompress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_CreateDecompress" = xyes; then : have_jpeglib=yes fi if test x$have_jpeglib = xyes; then JPEG_LIBS="-ljpeg" else as_fn_error $? "libjpeg not found" "$LINENO" 5 fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO" >&5 $as_echo_n "checking for CAIRO... " >&6; } if test -n "$CAIRO_CFLAGS"; then pkg_cv_CAIRO_CFLAGS="$CAIRO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_LIBS"; then pkg_cv_CAIRO_LIBS="$CAIRO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1` else CAIRO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (cairo) were not met: $CAIRO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CAIRO_CFLAGS and CAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CAIRO_CFLAGS and CAIRO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CAIRO_CFLAGS=$pkg_cv_CAIRO_CFLAGS CAIRO_LIBS=$pkg_cv_CAIRO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TEST_CLIENT" >&5 $as_echo_n "checking for TEST_CLIENT... " >&6; } if test -n "$TEST_CLIENT_CFLAGS"; then pkg_cv_TEST_CLIENT_CFLAGS="$TEST_CLIENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.9.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.9.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TEST_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.9.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$TEST_CLIENT_LIBS"; then pkg_cv_TEST_CLIENT_LIBS="$TEST_CLIENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.9.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.9.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_TEST_CLIENT_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.9.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then TEST_CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.9.0" 2>&1` else TEST_CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.9.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$TEST_CLIENT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-client >= 1.9.0) were not met: $TEST_CLIENT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables TEST_CLIENT_CFLAGS and TEST_CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables TEST_CLIENT_CFLAGS and TEST_CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else TEST_CLIENT_CFLAGS=$pkg_cv_TEST_CLIENT_CFLAGS TEST_CLIENT_LIBS=$pkg_cv_TEST_CLIENT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-simple-clients was given. if test "${enable_simple_clients+set}" = set; then : enableval=$enable_simple_clients; else enable_simple_clients=yes fi if test "x$enable_simple_clients" = "xyes"; then BUILD_SIMPLE_CLIENTS_TRUE= BUILD_SIMPLE_CLIENTS_FALSE='#' else BUILD_SIMPLE_CLIENTS_TRUE='#' BUILD_SIMPLE_CLIENTS_FALSE= fi if test x$enable_simple_clients = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIMPLE_CLIENT" >&5 $as_echo_n "checking for SIMPLE_CLIENT... " >&6; } if test -n "$SIMPLE_CLIENT_CFLAGS"; then pkg_cv_SIMPLE_CLIENT_CFLAGS="$SIMPLE_CLIENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SIMPLE_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "wayland-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SIMPLE_CLIENT_LIBS"; then pkg_cv_SIMPLE_CLIENT_LIBS="$SIMPLE_CLIENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SIMPLE_CLIENT_LIBS=`$PKG_CONFIG --libs "wayland-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SIMPLE_CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client" 2>&1` else SIMPLE_CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SIMPLE_CLIENT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-client) were not met: $SIMPLE_CLIENT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SIMPLE_CLIENT_CFLAGS and SIMPLE_CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SIMPLE_CLIENT_CFLAGS and SIMPLE_CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SIMPLE_CLIENT_CFLAGS=$pkg_cv_SIMPLE_CLIENT_CFLAGS SIMPLE_CLIENT_LIBS=$pkg_cv_SIMPLE_CLIENT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-simple-egl-clients was given. if test "${enable_simple_egl_clients+set}" = set; then : enableval=$enable_simple_egl_clients; else enable_simple_egl_clients="$enable_egl" fi if test "x$enable_simple_egl_clients" = "xyes"; then BUILD_SIMPLE_EGL_CLIENTS_TRUE= BUILD_SIMPLE_EGL_CLIENTS_FALSE='#' else BUILD_SIMPLE_EGL_CLIENTS_TRUE='#' BUILD_SIMPLE_EGL_CLIENTS_FALSE= fi if test x$enable_simple_egl_clients = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIMPLE_EGL_CLIENT" >&5 $as_echo_n "checking for SIMPLE_EGL_CLIENT... " >&6; } if test -n "$SIMPLE_EGL_CLIENT_CFLAGS"; then pkg_cv_SIMPLE_EGL_CLIENT_CFLAGS="$SIMPLE_EGL_CLIENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SIMPLE_EGL_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SIMPLE_EGL_CLIENT_LIBS"; then pkg_cv_SIMPLE_EGL_CLIENT_LIBS="$SIMPLE_EGL_CLIENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor\""; } >&5 ($PKG_CONFIG --exists --print-errors "egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SIMPLE_EGL_CLIENT_LIBS=`$PKG_CONFIG --libs "egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SIMPLE_EGL_CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor" 2>&1` else SIMPLE_EGL_CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SIMPLE_EGL_CLIENT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor) were not met: $SIMPLE_EGL_CLIENT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SIMPLE_EGL_CLIENT_CFLAGS and SIMPLE_EGL_CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SIMPLE_EGL_CLIENT_CFLAGS and SIMPLE_EGL_CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SIMPLE_EGL_CLIENT_CFLAGS=$pkg_cv_SIMPLE_EGL_CLIENT_CFLAGS SIMPLE_EGL_CLIENT_LIBS=$pkg_cv_SIMPLE_EGL_CLIENT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-simple-intel-dmabuf-client was given. if test "${enable_simple_intel_dmabuf_client+set}" = set; then : enableval=$enable_simple_intel_dmabuf_client; else enable_simple_intel_dmabuf_client="auto" fi if ! test "x$enable_simple_intel_dmabuf_client" = "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIMPLE_DMABUF_CLIENT" >&5 $as_echo_n "checking for SIMPLE_DMABUF_CLIENT... " >&6; } if test -n "$SIMPLE_DMABUF_CLIENT_CFLAGS"; then pkg_cv_SIMPLE_DMABUF_CLIENT_CFLAGS="$SIMPLE_DMABUF_CLIENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client libdrm libdrm_intel\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client libdrm libdrm_intel") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SIMPLE_DMABUF_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "wayland-client libdrm libdrm_intel" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SIMPLE_DMABUF_CLIENT_LIBS"; then pkg_cv_SIMPLE_DMABUF_CLIENT_LIBS="$SIMPLE_DMABUF_CLIENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client libdrm libdrm_intel\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client libdrm libdrm_intel") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SIMPLE_DMABUF_CLIENT_LIBS=`$PKG_CONFIG --libs "wayland-client libdrm libdrm_intel" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SIMPLE_DMABUF_CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client libdrm libdrm_intel" 2>&1` else SIMPLE_DMABUF_CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client libdrm libdrm_intel" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SIMPLE_DMABUF_CLIENT_PKG_ERRORS" >&5 have_simple_dmabuf_client=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_simple_dmabuf_client=no else SIMPLE_DMABUF_CLIENT_CFLAGS=$pkg_cv_SIMPLE_DMABUF_CLIENT_CFLAGS SIMPLE_DMABUF_CLIENT_LIBS=$pkg_cv_SIMPLE_DMABUF_CLIENT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_simple_dmabuf_client=yes fi if test "x$have_simple_dmabuf_client" = "xno" -a "x$enable_simple_intel_dmabuf_client" = "xyes"; then as_fn_error $? "Intel dmabuf client explicitly enabled, but libdrm_intel couldn't be found" "$LINENO" 5 fi enable_simple_intel_dmabuf_client="$have_simple_dmabuf_client" fi if test "x$enable_simple_intel_dmabuf_client" = "xyes"; then BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE= BUILD_SIMPLE_INTEL_DMABUF_CLIENT_FALSE='#' else BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE='#' BUILD_SIMPLE_INTEL_DMABUF_CLIENT_FALSE= fi # Check whether --enable-clients was given. if test "${enable_clients+set}" = set; then : enableval=$enable_clients; else enable_clients=yes fi if test x$enable_clients = xyes; then BUILD_CLIENTS_TRUE= BUILD_CLIENTS_FALSE='#' else BUILD_CLIENTS_TRUE='#' BUILD_CLIENTS_FALSE= fi if test x$enable_clients = xyes; then $as_echo "#define BUILD_CLIENTS 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLIENT" >&5 $as_echo_n "checking for CLIENT... " >&6; } if test -n "$CLIENT_CFLAGS"; then pkg_cv_CLIENT_CFLAGS="$CLIENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CLIENT_LIBS"; then pkg_cv_CLIENT_LIBS="$CLIENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CLIENT_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor" 2>&1` else CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CLIENT_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-client >= 1.5.91 cairo >= 1.10.0 xkbcommon wayland-cursor) were not met: $CLIENT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables CLIENT_CFLAGS and CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables CLIENT_CFLAGS and CLIENT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else CLIENT_CFLAGS=$pkg_cv_CLIENT_CFLAGS CLIENT_LIBS=$pkg_cv_CLIENT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SERVER" >&5 $as_echo_n "checking for SERVER... " >&6; } if test -n "$SERVER_CFLAGS"; then pkg_cv_SERVER_CFLAGS="$SERVER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-server\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-server") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SERVER_CFLAGS=`$PKG_CONFIG --cflags "wayland-server" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SERVER_LIBS"; then pkg_cv_SERVER_LIBS="$SERVER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-server\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-server") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SERVER_LIBS=`$PKG_CONFIG --libs "wayland-server" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SERVER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-server" 2>&1` else SERVER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-server" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SERVER_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-server) were not met: $SERVER_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables SERVER_CFLAGS and SERVER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables SERVER_CFLAGS and SERVER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else SERVER_CFLAGS=$pkg_cv_SERVER_CFLAGS SERVER_LIBS=$pkg_cv_SERVER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WESTON_INFO" >&5 $as_echo_n "checking for WESTON_INFO... " >&6; } if test -n "$WESTON_INFO_CFLAGS"; then pkg_cv_WESTON_INFO_CFLAGS="$WESTON_INFO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.5.91\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.5.91") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WESTON_INFO_CFLAGS=`$PKG_CONFIG --cflags "wayland-client >= 1.5.91" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$WESTON_INFO_LIBS"; then pkg_cv_WESTON_INFO_LIBS="$WESTON_INFO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client >= 1.5.91\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-client >= 1.5.91") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WESTON_INFO_LIBS=`$PKG_CONFIG --libs "wayland-client >= 1.5.91" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then WESTON_INFO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client >= 1.5.91" 2>&1` else WESTON_INFO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client >= 1.5.91" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WESTON_INFO_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-client >= 1.5.91) were not met: $WESTON_INFO_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables WESTON_INFO_CFLAGS and WESTON_INFO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables WESTON_INFO_CFLAGS and WESTON_INFO_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else WESTON_INFO_CFLAGS=$pkg_cv_WESTON_INFO_CFLAGS WESTON_INFO_LIBS=$pkg_cv_WESTON_INFO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Only check for cairo-egl if a GL or GLES renderer requested if test "x$cairo_modules" = "xcairo-gl" -o "x$cairo_modules" = "xcairo-glesv2"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAIRO_EGL" >&5 $as_echo_n "checking for CAIRO_EGL... " >&6; } if test -n "$CAIRO_EGL_CFLAGS"; then pkg_cv_CAIRO_EGL_CFLAGS="$CAIRO_EGL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 \$cairo_modules\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_EGL_CFLAGS=`$PKG_CONFIG --cflags "wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CAIRO_EGL_LIBS"; then pkg_cv_CAIRO_EGL_LIBS="$CAIRO_EGL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 \$cairo_modules\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CAIRO_EGL_LIBS=`$PKG_CONFIG --libs "wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CAIRO_EGL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules" 2>&1` else CAIRO_EGL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-egl egl >= 7.10 cairo-egl >= 1.11.3 $cairo_modules" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CAIRO_EGL_PKG_ERRORS" >&5 have_cairo_egl=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_cairo_egl=no else CAIRO_EGL_CFLAGS=$pkg_cv_CAIRO_EGL_CFLAGS CAIRO_EGL_LIBS=$pkg_cv_CAIRO_EGL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_cairo_egl=yes fi if test "x$have_cairo_egl" = "xyes"; then : $as_echo "#define HAVE_CAIRO_EGL 1" >>confdefs.h else as_fn_error $? "cairo-egl not used because $CAIRO_EGL_PKG_ERRORS" "$LINENO" 5 fi else have_cairo_egl=no fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANGO" >&5 $as_echo_n "checking for PANGO... " >&6; } if test -n "$PANGO_CFLAGS"; then pkg_cv_PANGO_CFLAGS="$PANGO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangocairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "pangocairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PANGO_CFLAGS=`$PKG_CONFIG --cflags "pangocairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PANGO_LIBS"; then pkg_cv_PANGO_LIBS="$PANGO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pangocairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "pangocairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PANGO_LIBS=`$PKG_CONFIG --libs "pangocairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PANGO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pangocairo" 2>&1` else PANGO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pangocairo" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PANGO_PKG_ERRORS" >&5 have_pango=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_pango=no else PANGO_CFLAGS=$pkg_cv_PANGO_CFLAGS PANGO_LIBS=$pkg_cv_PANGO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_pango=yes fi fi # Check whether --enable-resize-optimization was given. if test "${enable_resize_optimization+set}" = set; then : enableval=$enable_resize_optimization; else enable_resize_optimization=yes fi if test "x$enable_resize_optimization" = "xyes"; then : $as_echo "#define USE_RESIZE_POOL 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 $as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } if test -n "$SYSTEMD_LOGIN_CFLAGS"; then pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 198\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 198") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 198" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SYSTEMD_LOGIN_LIBS"; then pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 198\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 198") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 198" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 198" 2>&1` else SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 198" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 have_systemd_login=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_systemd_login=no else SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_systemd_login=yes fi if test "x$have_systemd_login" = "xyes"; then : $as_echo "#define HAVE_SYSTEMD_LOGIN 1" >>confdefs.h fi if test "x$have_systemd_login" = "xyes"; then HAVE_SYSTEMD_LOGIN_TRUE= HAVE_SYSTEMD_LOGIN_FALSE='#' else HAVE_SYSTEMD_LOGIN_TRUE='#' HAVE_SYSTEMD_LOGIN_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN_209" >&5 $as_echo_n "checking for SYSTEMD_LOGIN_209... " >&6; } if test -n "$SYSTEMD_LOGIN_209_CFLAGS"; then pkg_cv_SYSTEMD_LOGIN_209_CFLAGS="$SYSTEMD_LOGIN_209_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 209\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 209") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_LOGIN_209_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 209" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SYSTEMD_LOGIN_209_LIBS"; then pkg_cv_SYSTEMD_LOGIN_209_LIBS="$SYSTEMD_LOGIN_209_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 209\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 209") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SYSTEMD_LOGIN_209_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 209" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SYSTEMD_LOGIN_209_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 209" 2>&1` else SYSTEMD_LOGIN_209_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 209" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SYSTEMD_LOGIN_209_PKG_ERRORS" >&5 have_systemd_login_209=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_systemd_login_209=no else SYSTEMD_LOGIN_209_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_209_CFLAGS SYSTEMD_LOGIN_209_LIBS=$pkg_cv_SYSTEMD_LOGIN_209_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_systemd_login_209=yes fi if test "x$have_systemd_login_209" = "xyes"; then : $as_echo "#define HAVE_SYSTEMD_LOGIN_209 1" >>confdefs.h fi # Check whether --enable-weston-launch was given. if test "${enable_weston_launch+set}" = set; then : enableval=$enable_weston_launch; else enable_weston_launch=yes fi if test x$enable_weston_launch == xyes; then BUILD_WESTON_LAUNCH_TRUE= BUILD_WESTON_LAUNCH_FALSE='#' else BUILD_WESTON_LAUNCH_TRUE='#' BUILD_WESTON_LAUNCH_FALSE= fi if test x$enable_weston_launch == xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_open_session in -lpam" >&5 $as_echo_n "checking for pam_open_session in -lpam... " >&6; } if ${ac_cv_lib_pam_pam_open_session+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pam_open_session (); int main () { return pam_open_session (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pam_pam_open_session=yes else ac_cv_lib_pam_pam_open_session=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_open_session" >&5 $as_echo "$ac_cv_lib_pam_pam_open_session" >&6; } if test "x$ac_cv_lib_pam_pam_open_session" = xyes; then : have_pam=yes else have_pam=no fi if test x$have_pam == xno; then as_fn_error $? "weston-launch requires pam" "$LINENO" 5 fi PAM_LIBS=-lpam fi if test "x$have_pango" = "xyes"; then HAVE_PANGO_TRUE= HAVE_PANGO_FALSE='#' else HAVE_PANGO_TRUE='#' HAVE_PANGO_FALSE= fi if test "x$have_cairo_egl" = "xyes" -a "x$cairo_modules" = "xcairo-glesv2" -a "x$enable_egl" = "xyes"; then HAVE_CAIRO_GLESV2_TRUE= HAVE_CAIRO_GLESV2_FALSE='#' else HAVE_CAIRO_GLESV2_TRUE='#' HAVE_CAIRO_GLESV2_FALSE= fi if test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes"; then BUILD_FULL_GL_CLIENTS_TRUE= BUILD_FULL_GL_CLIENTS_FALSE='#' else BUILD_FULL_GL_CLIENTS_TRUE='#' BUILD_FULL_GL_CLIENTS_FALSE= fi if test '(' "x$have_cairo_egl" != "xyes" -o "x$cairo_modules" = "xcairo-glesv2" ')' -a "x$enable_simple_egl_clients" = "xyes"; then BUILD_SUBSURFACES_CLIENT_TRUE= BUILD_SUBSURFACES_CLIENT_FALSE='#' else BUILD_SUBSURFACES_CLIENT_TRUE='#' BUILD_SUBSURFACES_CLIENT_FALSE= fi if true; then ENABLE_DESKTOP_SHELL_TRUE= ENABLE_DESKTOP_SHELL_FALSE='#' else ENABLE_DESKTOP_SHELL_TRUE='#' ENABLE_DESKTOP_SHELL_FALSE= fi # Check whether --enable-fullscreen-shell was given. if test "${enable_fullscreen_shell+set}" = set; then : enableval=$enable_fullscreen_shell; else enable_fullscreen_shell=yes fi if test "x$enable_fullscreen_shell" = "xyes"; then ENABLE_FULLSCREEN_SHELL_TRUE= ENABLE_FULLSCREEN_SHELL_FALSE='#' else ENABLE_FULLSCREEN_SHELL_TRUE='#' ENABLE_FULLSCREEN_SHELL_FALSE= fi # CMS modules # Check whether --enable-colord was given. if test "${enable_colord+set}" = set; then : enableval=$enable_colord; else enable_colord=auto fi if test "x$enable_colord" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for COLORD" >&5 $as_echo_n "checking for COLORD... " >&6; } if test -n "$COLORD_CFLAGS"; then pkg_cv_COLORD_CFLAGS="$COLORD_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"colord >= 0.1.27\""; } >&5 ($PKG_CONFIG --exists --print-errors "colord >= 0.1.27") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_COLORD_CFLAGS=`$PKG_CONFIG --cflags "colord >= 0.1.27" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$COLORD_LIBS"; then pkg_cv_COLORD_LIBS="$COLORD_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"colord >= 0.1.27\""; } >&5 ($PKG_CONFIG --exists --print-errors "colord >= 0.1.27") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_COLORD_LIBS=`$PKG_CONFIG --libs "colord >= 0.1.27" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then COLORD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "colord >= 0.1.27" 2>&1` else COLORD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "colord >= 0.1.27" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$COLORD_PKG_ERRORS" >&5 have_colord=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_colord=no else COLORD_CFLAGS=$pkg_cv_COLORD_CFLAGS COLORD_LIBS=$pkg_cv_COLORD_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_colord=yes fi if test "x$have_colord" = "xno" -a "x$enable_colord" = "xyes"; then as_fn_error $? "colord support explicitly requested, but colord couldn't be found" "$LINENO" 5 fi if test "x$have_colord" = "xyes"; then enable_colord=yes fi fi if test "x$enable_colord" = "xyes"; then ENABLE_COLORD_TRUE= ENABLE_COLORD_FALSE='#' else ENABLE_COLORD_TRUE='#' ENABLE_COLORD_FALSE= fi # dbus support # Check whether --enable-dbus was given. if test "${enable_dbus+set}" = set; then : enableval=$enable_dbus; else enable_dbus=auto fi if test "x$enable_dbus" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 $as_echo_n "checking for DBUS... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_LIBS"; then pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 1.6" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 have_dbus=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_dbus=no else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_dbus=yes fi if test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"; then as_fn_error $? "dbus support explicitly requested, but libdbus couldn't be found" "$LINENO" 5 fi if test "x$have_dbus" = "xyes"; then enable_dbus=yes $as_echo "#define HAVE_DBUS 1" >>confdefs.h else enable_dbus=no fi fi if test "x$enable_dbus" = "xyes"; then ENABLE_DBUS_TRUE= ENABLE_DBUS_FALSE='#' else ENABLE_DBUS_TRUE='#' ENABLE_DBUS_FALSE= fi # Note that other features might want libxml2, or this feature might use # alternative xml libraries at some point. Therefore the feature and # pre-requisite concepts are split. # Check whether --enable-junit_xml was given. if test "${enable_junit_xml+set}" = set; then : enableval=$enable_junit_xml; else enable_junit_xml=auto fi if test "x$enable_junit_xml" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML2" >&5 $as_echo_n "checking for LIBXML2... " >&6; } if test -n "$LIBXML2_CFLAGS"; then pkg_cv_LIBXML2_CFLAGS="$LIBXML2_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBXML2_LIBS"; then pkg_cv_LIBXML2_LIBS="$LIBXML2_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.6\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.6") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML2_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.6" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBXML2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0 >= 2.6" 2>&1` else LIBXML2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0 >= 2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBXML2_PKG_ERRORS" >&5 have_libxml2=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libxml2=no else LIBXML2_CFLAGS=$pkg_cv_LIBXML2_CFLAGS LIBXML2_LIBS=$pkg_cv_LIBXML2_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libxml2=yes fi if test "x$have_libxml2" = "xno" -a "x$enable_junit_xml" = "xyes"; then as_fn_error $? "JUnit XML support explicitly requested, but libxml2 couldn't be found" "$LINENO" 5 fi if test "x$have_libxml2" = "xyes"; then enable_junit_xml=yes $as_echo "#define ENABLE_JUNIT_XML 1" >>confdefs.h else enable_junit_xml=no fi fi if test "x$enable_junit_xml" = "xyes"; then ENABLE_JUNIT_XML_TRUE= ENABLE_JUNIT_XML_FALSE='#' else ENABLE_JUNIT_XML_TRUE='#' ENABLE_JUNIT_XML_FALSE= fi # ivi-shell support # Check whether --enable-ivi-shell was given. if test "${enable_ivi_shell+set}" = set; then : enableval=$enable_ivi_shell; else enable_ivi_shell=yes fi if test "x$enable_ivi_shell" = "xyes"; then ENABLE_IVI_SHELL_TRUE= ENABLE_IVI_SHELL_FALSE='#' else ENABLE_IVI_SHELL_TRUE='#' ENABLE_IVI_SHELL_FALSE= fi # Check whether --enable-wcap-tools was given. if test "${enable_wcap_tools+set}" = set; then : enableval=$enable_wcap_tools; else enable_wcap_tools=yes fi if test x$enable_wcap_tools = xyes; then BUILD_WCAP_TOOLS_TRUE= BUILD_WCAP_TOOLS_FALSE='#' else BUILD_WCAP_TOOLS_TRUE='#' BUILD_WCAP_TOOLS_FALSE= fi if test x$enable_wcap_tools = xyes; then $as_echo "#define BUILD_WCAP_TOOLS 1" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WCAP" >&5 $as_echo_n "checking for WCAP... " >&6; } if test -n "$WCAP_CFLAGS"; then pkg_cv_WCAP_CFLAGS="$WCAP_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WCAP_CFLAGS=`$PKG_CONFIG --cflags "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$WCAP_LIBS"; then pkg_cv_WCAP_LIBS="$WCAP_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cairo\""; } >&5 ($PKG_CONFIG --exists --print-errors "cairo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WCAP_LIBS=`$PKG_CONFIG --libs "cairo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then WCAP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cairo" 2>&1` else WCAP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cairo" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WCAP_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (cairo) were not met: $WCAP_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables WCAP_CFLAGS and WCAP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables WCAP_CFLAGS and WCAP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else WCAP_CFLAGS=$pkg_cv_WCAP_CFLAGS WCAP_LIBS=$pkg_cv_WCAP_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi WCAP_LIBS="$WCAP_LIBS -lm" fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SETBACKLIGHT" >&5 $as_echo_n "checking for SETBACKLIGHT... " >&6; } if test -n "$SETBACKLIGHT_CFLAGS"; then pkg_cv_SETBACKLIGHT_CFLAGS="$SETBACKLIGHT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SETBACKLIGHT_CFLAGS=`$PKG_CONFIG --cflags "libudev libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$SETBACKLIGHT_LIBS"; then pkg_cv_SETBACKLIGHT_LIBS="$SETBACKLIGHT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev libdrm\""; } >&5 ($PKG_CONFIG --exists --print-errors "libudev libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_SETBACKLIGHT_LIBS=`$PKG_CONFIG --libs "libudev libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SETBACKLIGHT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev libdrm" 2>&1` else SETBACKLIGHT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev libdrm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SETBACKLIGHT_PKG_ERRORS" >&5 enable_setbacklight=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_setbacklight=no else SETBACKLIGHT_CFLAGS=$pkg_cv_SETBACKLIGHT_CFLAGS SETBACKLIGHT_LIBS=$pkg_cv_SETBACKLIGHT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_setbacklight=yes fi if test "x$enable_setbacklight" = "xyes"; then BUILD_SETBACKLIGHT_TRUE= BUILD_SETBACKLIGHT_FALSE='#' else BUILD_SETBACKLIGHT_TRUE='#' BUILD_SETBACKLIGHT_FALSE= fi if test "x$GCC" = "xyes"; then GCC_CFLAGS="-Wall -Wextra -Wno-unused-parameter \ -Wno-missing-field-initializers -g -fvisibility=hidden \ -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare" fi # Check whether --enable-libunwind was given. if test "${enable_libunwind+set}" = set; then : enableval=$enable_libunwind; else enable_libunwind=auto fi if test "x$enable_libunwind" = xyes; then HAVE_LIBUNWIND_TRUE= HAVE_LIBUNWIND_FALSE='#' else HAVE_LIBUNWIND_TRUE='#' HAVE_LIBUNWIND_FALSE= fi if test "x$enable_libunwind" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUNWIND" >&5 $as_echo_n "checking for LIBUNWIND... " >&6; } if test -n "$LIBUNWIND_CFLAGS"; then pkg_cv_LIBUNWIND_CFLAGS="$LIBUNWIND_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUNWIND_CFLAGS=`$PKG_CONFIG --cflags "libunwind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUNWIND_LIBS"; then pkg_cv_LIBUNWIND_LIBS="$LIBUNWIND_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUNWIND_LIBS=`$PKG_CONFIG --libs "libunwind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libunwind" 2>&1` else LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libunwind" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUNWIND_PKG_ERRORS" >&5 have_libunwind=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_libunwind=no else LIBUNWIND_CFLAGS=$pkg_cv_LIBUNWIND_CFLAGS LIBUNWIND_LIBS=$pkg_cv_LIBUNWIND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_libunwind=yes fi if test "x$have_libunwind" = "xno" -a "x$enable_libunwind" = "xyes"; then as_fn_error $? "libunwind support explicitly requested, but libunwind couldn't be found" "$LINENO" 5 fi if test "x$have_libunwind" = "xyes"; then enable_libunwind=yes $as_echo "#define HAVE_LIBUNWIND 1" >>confdefs.h fi fi if test "x$WESTON_NATIVE_BACKEND" = "x"; then WESTON_NATIVE_BACKEND="drm-backend.so" fi { $as_echo "$as_me:${as_lineno-$LINENO}: Weston's native backend: $WESTON_NATIVE_BACKEND" >&5 $as_echo "$as_me: Weston's native backend: $WESTON_NATIVE_BACKEND" >&6;} cat >>confdefs.h <<_ACEOF #define WESTON_NATIVE_BACKEND "$WESTON_NATIVE_BACKEND" _ACEOF if test "x$WESTON_SHELL_CLIENT" = "x"; then WESTON_SHELL_CLIENT="weston-desktop-shell" fi { $as_echo "$as_me:${as_lineno-$LINENO}: Weston's default desktop shell client: $WESTON_SHELL_CLIENT" >&5 $as_echo "$as_me: Weston's default desktop shell client: $WESTON_SHELL_CLIENT" >&6;} cat >>confdefs.h <<_ACEOF #define WESTON_SHELL_CLIENT "$WESTON_SHELL_CLIENT" _ACEOF # Check whether --enable-demo-clients-install was given. if test "${enable_demo_clients_install+set}" = set; then : enableval=$enable_demo_clients_install; else enable_demo_clients_install=no fi if test "x$enable_demo_clients_install" = "xyes"; then INSTALL_DEMO_CLIENTS_TRUE= INSTALL_DEMO_CLIENTS_FALSE='#' else INSTALL_DEMO_CLIENTS_TRUE='#' INSTALL_DEMO_CLIENTS_FALSE= fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LCMS" >&5 $as_echo_n "checking for LCMS... " >&6; } if test -n "$LCMS_CFLAGS"; then pkg_cv_LCMS_CFLAGS="$LCMS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lcms2\""; } >&5 ($PKG_CONFIG --exists --print-errors "lcms2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LCMS_CFLAGS=`$PKG_CONFIG --cflags "lcms2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LCMS_LIBS"; then pkg_cv_LCMS_LIBS="$LCMS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lcms2\""; } >&5 ($PKG_CONFIG --exists --print-errors "lcms2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LCMS_LIBS=`$PKG_CONFIG --libs "lcms2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LCMS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lcms2" 2>&1` else LCMS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lcms2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LCMS_PKG_ERRORS" >&5 have_lcms=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_lcms=no else LCMS_CFLAGS=$pkg_cv_LCMS_CFLAGS LCMS_LIBS=$pkg_cv_LCMS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_lcms=yes fi if test "x$have_lcms" = xyes; then $as_echo "#define HAVE_LCMS 1" >>confdefs.h fi if test "x$have_lcms" = xyes; then HAVE_LCMS_TRUE= HAVE_LCMS_FALSE='#' else HAVE_LCMS_TRUE='#' HAVE_LCMS_FALSE= fi # Extract the first word of "wayland-scanner", so it can be a program name with args. set dummy wayland-scanner; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_wayland_scanner+:} false; then : $as_echo_n "(cached) " >&6 else case $wayland_scanner in [\\/]* | ?:[\\/]*) ac_cv_path_wayland_scanner="$wayland_scanner" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_wayland_scanner="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi wayland_scanner=$ac_cv_path_wayland_scanner if test -n "$wayland_scanner"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $wayland_scanner" >&5 $as_echo "$wayland_scanner" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$wayland_scanner = x; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND_SCANNER" >&5 $as_echo_n "checking for WAYLAND_SCANNER... " >&6; } if test -n "$WAYLAND_SCANNER_CFLAGS"; then pkg_cv_WAYLAND_SCANNER_CFLAGS="$WAYLAND_SCANNER_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-scanner\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-scanner") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WAYLAND_SCANNER_CFLAGS=`$PKG_CONFIG --cflags "wayland-scanner" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$WAYLAND_SCANNER_LIBS"; then pkg_cv_WAYLAND_SCANNER_LIBS="$WAYLAND_SCANNER_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-scanner\""; } >&5 ($PKG_CONFIG --exists --print-errors "wayland-scanner") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_WAYLAND_SCANNER_LIBS=`$PKG_CONFIG --libs "wayland-scanner" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then WAYLAND_SCANNER_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-scanner" 2>&1` else WAYLAND_SCANNER_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-scanner" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$WAYLAND_SCANNER_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (wayland-scanner) were not met: $WAYLAND_SCANNER_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables WAYLAND_SCANNER_CFLAGS and WAYLAND_SCANNER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables WAYLAND_SCANNER_CFLAGS and WAYLAND_SCANNER_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else WAYLAND_SCANNER_CFLAGS=$pkg_cv_WAYLAND_SCANNER_CFLAGS WAYLAND_SCANNER_LIBS=$pkg_cv_WAYLAND_SCANNER_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` fi ac_config_files="$ac_config_files Makefile src/version.h src/weston.pc" if test -f $srcdir/.git/logs/HEAD; then HAVE_GIT_REPO_TRUE= HAVE_GIT_REPO_FALSE='#' else HAVE_GIT_REPO_TRUE='#' HAVE_GIT_REPO_FALSE= fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${ENABLE_DEVDOCS_TRUE}" && test -z "${ENABLE_DEVDOCS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DEVDOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_EGL_TRUE}" && test -z "${ENABLE_EGL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_EGL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SETUID_INSTALL_TRUE}" && test -z "${ENABLE_SETUID_INSTALL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SETUID_INSTALL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_XWAYLAND_TRUE}" && test -z "${ENABLE_XWAYLAND_FALSE}"; then as_fn_error $? "conditional \"ENABLE_XWAYLAND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_XWAYLAND_TEST_TRUE}" && test -z "${ENABLE_XWAYLAND_TEST_FALSE}"; then as_fn_error $? "conditional \"ENABLE_XWAYLAND_TEST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_X11_COMPOSITOR_TRUE}" && test -z "${ENABLE_X11_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_X11_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DRM_COMPOSITOR_TRUE}" && test -z "${ENABLE_DRM_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DRM_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_WAYLAND_COMPOSITOR_TRUE}" && test -z "${ENABLE_WAYLAND_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_WAYLAND_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_HEADLESS_COMPOSITOR_TRUE}" && test -z "${ENABLE_HEADLESS_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_HEADLESS_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RPI_COMPOSITOR_TRUE}" && test -z "${ENABLE_RPI_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RPI_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_RPI_COMPOSITOR_TRUE}" && test -z "${INSTALL_RPI_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"INSTALL_RPI_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FBDEV_COMPOSITOR_TRUE}" && test -z "${ENABLE_FBDEV_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FBDEV_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_RDP_COMPOSITOR_TRUE}" && test -z "${ENABLE_RDP_COMPOSITOR_FALSE}"; then as_fn_error $? "conditional \"ENABLE_RDP_COMPOSITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_SCREEN_SHARING_TRUE}" && test -z "${ENABLE_SCREEN_SHARING_FALSE}"; then as_fn_error $? "conditional \"ENABLE_SCREEN_SHARING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_VAAPI_RECORDER_TRUE}" && test -z "${ENABLE_VAAPI_RECORDER_FALSE}"; then as_fn_error $? "conditional \"ENABLE_VAAPI_RECORDER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SIMPLE_CLIENTS_TRUE}" && test -z "${BUILD_SIMPLE_CLIENTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_SIMPLE_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SIMPLE_EGL_CLIENTS_TRUE}" && test -z "${BUILD_SIMPLE_EGL_CLIENTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_SIMPLE_EGL_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SIMPLE_INTEL_DMABUF_CLIENT_TRUE}" && test -z "${BUILD_SIMPLE_INTEL_DMABUF_CLIENT_FALSE}"; then as_fn_error $? "conditional \"BUILD_SIMPLE_INTEL_DMABUF_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_CLIENTS_TRUE}" && test -z "${BUILD_CLIENTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SYSTEMD_LOGIN_TRUE}" && test -z "${HAVE_SYSTEMD_LOGIN_FALSE}"; then as_fn_error $? "conditional \"HAVE_SYSTEMD_LOGIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_WESTON_LAUNCH_TRUE}" && test -z "${BUILD_WESTON_LAUNCH_FALSE}"; then as_fn_error $? "conditional \"BUILD_WESTON_LAUNCH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PANGO_TRUE}" && test -z "${HAVE_PANGO_FALSE}"; then as_fn_error $? "conditional \"HAVE_PANGO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CAIRO_GLESV2_TRUE}" && test -z "${HAVE_CAIRO_GLESV2_FALSE}"; then as_fn_error $? "conditional \"HAVE_CAIRO_GLESV2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_FULL_GL_CLIENTS_TRUE}" && test -z "${BUILD_FULL_GL_CLIENTS_FALSE}"; then as_fn_error $? "conditional \"BUILD_FULL_GL_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SUBSURFACES_CLIENT_TRUE}" && test -z "${BUILD_SUBSURFACES_CLIENT_FALSE}"; then as_fn_error $? "conditional \"BUILD_SUBSURFACES_CLIENT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DESKTOP_SHELL_TRUE}" && test -z "${ENABLE_DESKTOP_SHELL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DESKTOP_SHELL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_FULLSCREEN_SHELL_TRUE}" && test -z "${ENABLE_FULLSCREEN_SHELL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_FULLSCREEN_SHELL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_COLORD_TRUE}" && test -z "${ENABLE_COLORD_FALSE}"; then as_fn_error $? "conditional \"ENABLE_COLORD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DBUS_TRUE}" && test -z "${ENABLE_DBUS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DBUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_JUNIT_XML_TRUE}" && test -z "${ENABLE_JUNIT_XML_FALSE}"; then as_fn_error $? "conditional \"ENABLE_JUNIT_XML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_IVI_SHELL_TRUE}" && test -z "${ENABLE_IVI_SHELL_FALSE}"; then as_fn_error $? "conditional \"ENABLE_IVI_SHELL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_WCAP_TOOLS_TRUE}" && test -z "${BUILD_WCAP_TOOLS_FALSE}"; then as_fn_error $? "conditional \"BUILD_WCAP_TOOLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SETBACKLIGHT_TRUE}" && test -z "${BUILD_SETBACKLIGHT_FALSE}"; then as_fn_error $? "conditional \"BUILD_SETBACKLIGHT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LIBUNWIND_TRUE}" && test -z "${HAVE_LIBUNWIND_FALSE}"; then as_fn_error $? "conditional \"HAVE_LIBUNWIND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_DEMO_CLIENTS_TRUE}" && test -z "${INSTALL_DEMO_CLIENTS_FALSE}"; then as_fn_error $? "conditional \"INSTALL_DEMO_CLIENTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LCMS_TRUE}" && test -z "${HAVE_LCMS_FALSE}"; then as_fn_error $? "conditional \"HAVE_LCMS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GIT_REPO_TRUE}" && test -z "${HAVE_GIT_REPO_FALSE}"; then as_fn_error $? "conditional \"HAVE_GIT_REPO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by weston $as_me 1.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . weston home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ weston config.status 1.9.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "doc/doxygen/tools.doxygen") CONFIG_FILES="$CONFIG_FILES doc/doxygen/tools.doxygen" ;; "doc/doxygen/tooldev.doxygen") CONFIG_FILES="$CONFIG_FILES doc/doxygen/tooldev.doxygen" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;; "src/weston.pc") CONFIG_FILES="$CONFIG_FILES src/weston.pc" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Native Backend ${WESTON_NATIVE_BACKEND} setuid Install ${enable_setuid_install} Cairo Renderer ${with_cairo} EGL ${enable_egl} libxkbcommon ${enable_xkbcommon} xcb_xkb ${have_xcb_xkb} XWayland ${enable_xwayland} dbus ${enable_dbus} ivi-shell ${enable_ivi_shell} Build wcap utility ${enable_wcap_tools} Build Fullscreen Shell ${enable_fullscreen_shell} Enable developer documentation ${enable_devdocs} weston-launch utility ${enable_weston_launch} systemd-login support ${have_systemd_login} DRM Compositor ${enable_drm_compositor} X11 Compositor ${enable_x11_compositor} Wayland Compositor ${enable_wayland_compositor} Headless Compositor ${enable_headless_compositor} RPI Compositor ${enable_rpi_compositor} FBDEV Compositor ${enable_fbdev_compositor} RDP Compositor ${enable_rdp_compositor} Screen Sharing ${enable_screen_sharing} JUnit XML output ${enable_junit_xml} Raspberry Pi BCM headers ${have_bcm_host} Build Clients ${enable_clients} Build EGL Clients ${have_cairo_egl} Build Simple Clients ${enable_simple_clients} Build Simple EGL Clients ${enable_simple_egl_clients} Install Demo Clients ${enable_demo_clients_install} Colord Support ${have_colord} LCMS2 Support ${have_lcms} libwebp Support ${have_webp} libunwind Support ${have_libunwind} VA H.264 encoding Support ${have_libva} " >&5 $as_echo " Native Backend ${WESTON_NATIVE_BACKEND} setuid Install ${enable_setuid_install} Cairo Renderer ${with_cairo} EGL ${enable_egl} libxkbcommon ${enable_xkbcommon} xcb_xkb ${have_xcb_xkb} XWayland ${enable_xwayland} dbus ${enable_dbus} ivi-shell ${enable_ivi_shell} Build wcap utility ${enable_wcap_tools} Build Fullscreen Shell ${enable_fullscreen_shell} Enable developer documentation ${enable_devdocs} weston-launch utility ${enable_weston_launch} systemd-login support ${have_systemd_login} DRM Compositor ${enable_drm_compositor} X11 Compositor ${enable_x11_compositor} Wayland Compositor ${enable_wayland_compositor} Headless Compositor ${enable_headless_compositor} RPI Compositor ${enable_rpi_compositor} FBDEV Compositor ${enable_fbdev_compositor} RDP Compositor ${enable_rdp_compositor} Screen Sharing ${enable_screen_sharing} JUnit XML output ${enable_junit_xml} Raspberry Pi BCM headers ${have_bcm_host} Build Clients ${enable_clients} Build EGL Clients ${have_cairo_egl} Build Simple Clients ${enable_simple_clients} Build Simple EGL Clients ${enable_simple_egl_clients} Install Demo Clients ${enable_demo_clients_install} Colord Support ${have_colord} LCMS2 Support ${have_lcms} libwebp Support ${have_webp} libunwind Support ${have_libunwind} VA H.264 encoding Support ${have_libva} " >&6; } weston-1.9.0/tools/0000775000175000017500000000000012600133270011175 500000000000000weston-1.9.0/tools/zunitc/0000775000175000017500000000000012600133270012511 500000000000000weston-1.9.0/tools/zunitc/src/0000775000175000017500000000000012600133270013300 500000000000000weston-1.9.0/tools/zunitc/src/zuc_context.h0000664000175000017500000000326412547570345015765 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_CONTEXT_H #define ZUC_CONTEXT_H #include "zuc_types.h" struct zuc_slinked; /** * Internal context for processing. * Collecting data members here minimizes use of globals. */ struct zuc_context { int case_count; struct zuc_case **cases; bool fatal; int repeat; int random; unsigned int seed; bool spawn; bool break_on_failure; bool output_tap; bool output_junit; int fds[2]; char *filter; struct zuc_slinked *listeners; struct zuc_case *curr_case; struct zuc_test *curr_test; }; #endif /* ZUC_CONTEXT_H */ weston-1.9.0/tools/zunitc/src/zuc_junit_reporter.c0000664000175000017500000002666212561200202017330 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "zuc_junit_reporter.h" #if ENABLE_JUNIT_XML #include #include #include #include #include #include #include #include #include "zuc_event_listener.h" #include "zuc_types.h" #include "shared/zalloc.h" /** * Hardcoded output name. * @todo follow-up with refactoring to avoid filename hardcoding. * Will allow for better testing in parallel etc. in general. */ #define XML_FNAME "test_detail.xml" #define ISO_8601_FORMAT "%Y-%m-%dT%H:%M:%SZ" /** * Internal data. */ struct junit_data { int fd; time_t begin; }; #define MAX_64BIT_STRLEN 20 static void set_attribute(xmlNodePtr node, const char *name, int value) { xmlChar scratch[MAX_64BIT_STRLEN + 1] = {}; xmlStrPrintf(scratch, sizeof(scratch), BAD_CAST "%d", value); xmlSetProp(node, BAD_CAST name, scratch); } /** * Output the given event. * * @param parent the parent node to add new content to. * @param event the event to write out. */ static void emit_event(xmlNodePtr parent, struct zuc_event *event) { char *msg = NULL; switch (event->op) { case ZUC_OP_TRUE: if (asprintf(&msg, "%s:%d: error: Value of: %s\n" " Actual: false\n" "Expected: true\n", event->file, event->line, event->expr1) < 0) { msg = NULL; } break; case ZUC_OP_FALSE: if (asprintf(&msg, "%s:%d: error: Value of: %s\n" " Actual: true\n" "Expected: false\n", event->file, event->line, event->expr1) < 0) { msg = NULL; } break; case ZUC_OP_NULL: if (asprintf(&msg, "%s:%d: error: Value of: %s\n" " Actual: %p\n" "Expected: %p\n", event->file, event->line, event->expr1, (void *)event->val1, NULL) < 0) { msg = NULL; } break; case ZUC_OP_NOT_NULL: if (asprintf(&msg, "%s:%d: error: Value of: %s\n" " Actual: %p\n" "Expected: not %p\n", event->file, event->line, event->expr1, (void *)event->val1, NULL) < 0) { msg = NULL; } break; case ZUC_OP_EQ: if (event->valtype == ZUC_VAL_CSTR) { if (asprintf(&msg, "%s:%d: error: Value of: %s\n" " Actual: %s\n" "Expected: %s\n" "Which is: %s\n", event->file, event->line, event->expr2, (char *)event->val2, event->expr1, (char *)event->val1) < 0) { msg = NULL; } } else { if (asprintf(&msg, "%s:%d: error: Value of: %s\n" " Actual: %ld\n" "Expected: %s\n" "Which is: %ld\n", event->file, event->line, event->expr2, event->val2, event->expr1, event->val1) < 0) { msg = NULL; } } break; case ZUC_OP_NE: if (event->valtype == ZUC_VAL_CSTR) { if (asprintf(&msg, "%s:%d: error: " "Expected: (%s) %s (%s)," " actual: %s == %s\n", event->file, event->line, event->expr1, zuc_get_opstr(event->op), event->expr2, (char *)event->val1, (char *)event->val2) < 0) { msg = NULL; } } else { if (asprintf(&msg, "%s:%d: error: " "Expected: (%s) %s (%s)," " actual: %ld vs %ld\n", event->file, event->line, event->expr1, zuc_get_opstr(event->op), event->expr2, event->val1, event->val2) < 0) { msg = NULL; } } break; case ZUC_OP_TERMINATE: { char const *level = (event->val1 == 0) ? "error" : (event->val1 == 1) ? "warning" : "note"; if (asprintf(&msg, "%s:%d: %s: %s\n", event->file, event->line, level, event->expr1) < 0) { msg = NULL; } break; } case ZUC_OP_TRACEPOINT: if (asprintf(&msg, "%s:%d: note: %s\n", event->file, event->line, event->expr1) < 0) { msg = NULL; } break; default: if (asprintf(&msg, "%s:%d: error: " "Expected: (%s) %s (%s), actual: %ld vs %ld\n", event->file, event->line, event->expr1, zuc_get_opstr(event->op), event->expr2, event->val1, event->val2) < 0) { msg = NULL; } } if ((event->op == ZUC_OP_TERMINATE) && (event->val1 > 1)) { xmlNewChild(parent, NULL, BAD_CAST "skipped", NULL); } else { xmlNodePtr node = xmlNewChild(parent, NULL, BAD_CAST "failure", NULL); if (msg) { xmlSetProp(node, BAD_CAST "message", BAD_CAST msg); } xmlSetProp(node, BAD_CAST "type", BAD_CAST ""); if (msg) { xmlNodePtr cdata = xmlNewCDataBlock(node->doc, BAD_CAST msg, strlen(msg)); xmlAddChild(node, cdata); } } free(msg); } /** * Formats a time in milliseconds to the normal JUnit elapsed form, or * NULL if there is a problem. * The caller should release this with free() * * @return the formatted time string upon success, NULL otherwise. */ static char * as_duration(long ms) { char *str = NULL; if (asprintf(&str, "%1.3f", ms / 1000.0) < 0) { str = NULL; } else { /* * Special case to match behavior of standard JUnit output * writers. Asumption is certain readers might have * limitations, etc. so it is best to keep 100% identical * output. */ if (!strcmp("0.000", str)) { free(str); str = strdup("0"); } } return str; } /** * Returns the status string for the tests (run/notrun). * * @param test the test to check status of. * @return the status string. */ static char const * get_test_status(struct zuc_test *test) { if (test->disabled || test->skipped) return "notrun"; else return "run"; } /** * Output the given test. * * @param parent the parent node to add new content to. * @param test the test to write out. */ static void emit_test(xmlNodePtr parent, struct zuc_test *test) { char *time_str = as_duration(test->elapsed); xmlNodePtr node = xmlNewChild(parent, NULL, BAD_CAST "testcase", NULL); xmlSetProp(node, BAD_CAST "name", BAD_CAST test->name); xmlSetProp(node, BAD_CAST "status", BAD_CAST get_test_status(test)); if (time_str) { xmlSetProp(node, BAD_CAST "time", BAD_CAST time_str); free(time_str); time_str = NULL; } xmlSetProp(node, BAD_CAST "classname", BAD_CAST test->test_case->name); if ((test->failed || test->fatal || test->skipped) && test->events) { struct zuc_event *evt; for (evt = test->events; evt; evt = evt->next) emit_event(node, evt); } } /** * Output the given test case. * * @param parent the parent node to add new content to. * @param test_case the test case to write out. */ static void emit_case(xmlNodePtr parent, struct zuc_case *test_case) { int i; int skipped = 0; int disabled = 0; int failures = 0; xmlNodePtr node = NULL; char *time_str = as_duration(test_case->elapsed); for (i = 0; i < test_case->test_count; ++i) { if (test_case->tests[i]->disabled ) disabled++; if (test_case->tests[i]->skipped ) skipped++; if (test_case->tests[i]->failed || test_case->tests[i]->fatal ) failures++; } node = xmlNewChild(parent, NULL, BAD_CAST "testsuite", NULL); xmlSetProp(node, BAD_CAST "name", BAD_CAST test_case->name); set_attribute(node, "tests", test_case->test_count); set_attribute(node, "failures", failures); set_attribute(node, "disabled", disabled); set_attribute(node, "skipped", skipped); if (time_str) { xmlSetProp(node, BAD_CAST "time", BAD_CAST time_str); free(time_str); time_str = NULL; } for (i = 0; i < test_case->test_count; ++i) emit_test(node, test_case->tests[i]); } /** * Formats a time in milliseconds to the full ISO-8601 date/time string * format, or NULL if there is a problem. * The caller should release this with free() * * @return the formatted time string upon success, NULL otherwise. */ static char * as_iso_8601(time_t const *t) { char *result = NULL; char buf[32] = {}; struct tm when; if (gmtime_r(t, &when) != NULL) if (strftime(buf, sizeof(buf), ISO_8601_FORMAT, &when)) result = strdup(buf); return result; } static void run_started(void *data, int live_case_count, int live_test_count, int disabled_count) { struct junit_data *jdata = data; jdata->begin = time(NULL); jdata->fd = open(XML_FNAME, O_WRONLY | O_CLOEXEC | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH); } static void run_ended(void *data, int case_count, struct zuc_case **cases, int live_case_count, int live_test_count, int total_passed, int total_failed, int total_disabled, long total_elapsed) { int i; long time = 0; char *time_str = NULL; char *timestamp = NULL; xmlNodePtr root = NULL; xmlDocPtr doc = NULL; xmlChar *xmlchars = NULL; int xmlsize = 0; struct junit_data *jdata = data; for (i = 0; i < case_count; ++i) time += cases[i]->elapsed; time_str = as_duration(time); timestamp = as_iso_8601(&jdata->begin); /* here would be where to add errors? */ doc = xmlNewDoc(BAD_CAST "1.0"); root = xmlNewNode(NULL, BAD_CAST "testsuites"); xmlDocSetRootElement(doc, root); set_attribute(root, "tests", live_test_count); set_attribute(root, "failures", total_failed); set_attribute(root, "disabled", total_disabled); if (timestamp) { xmlSetProp(root, BAD_CAST "timestamp", BAD_CAST timestamp); free(timestamp); timestamp = NULL; } if (time_str) { xmlSetProp(root, BAD_CAST "time", BAD_CAST time_str); free(time_str); time_str = NULL; } xmlSetProp(root, BAD_CAST "name", BAD_CAST "AllTests"); for (i = 0; i < case_count; ++i) { emit_case(root, cases[i]); } xmlDocDumpFormatMemoryEnc(doc, &xmlchars, &xmlsize, "UTF-8", 1); dprintf(jdata->fd, "%s", (char *) xmlchars); xmlFree(xmlchars); xmlchars = NULL; xmlFreeDoc(doc); if ((jdata->fd != fileno(stdout)) && (jdata->fd != fileno(stderr)) && (jdata->fd != -1)) { close(jdata->fd); jdata->fd = -1; } } static void destroy(void *data) { xmlCleanupParser(); free(data); } struct zuc_event_listener * zuc_junit_reporter_create(void) { struct zuc_event_listener *listener = zalloc(sizeof(struct zuc_event_listener)); struct junit_data *data = zalloc(sizeof(struct junit_data)); data->fd = -1; listener->data = data; listener->destroy = destroy; listener->run_started = run_started; listener->run_ended = run_ended; return listener; } #else /* ENABLE_JUNIT_XML */ #include "shared/zalloc.h" #include "zuc_event_listener.h" /* * Simple stub version if junit output (including libxml2 support) has * been disabled. * Will return NULL to cause failures as calling this when the #define * has not been enabled is an invalid scenario. */ struct zuc_event_listener * zuc_junit_reporter_create(void) { return NULL; } #endif /* ENABLE_JUNIT_XML */ weston-1.9.0/tools/zunitc/src/zuc_collector.h0000664000175000017500000000437212547570345016270 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_COLLECTOR_H #define ZUC_COLLECTOR_H struct zuc_event_listener; struct zuc_test; /** * Creates a new instance of an even collector that will attatch events * to the current test directly or via connection from child to parent. * * @param pipe_fd pointer to the file descriptor to use for communication if * needed. If the value is -1 the events will be attached directly to the * current test. Otherwise events will be passed back via IPC over this * pipe with the expectation that the payload will be handled in the parent * process via zuc_process_message(). * @return a new collector intance. * @see zuc_process_message() */ struct zuc_event_listener * zuc_collector_create(int *pipe_fd); /** * Reads events from the given pipe and processes them. * * @param test the currently active test to attache events for. * @param pipe_fd the file descriptor of the pipe to read from. * @return a positive value if a message was received, 0 if the end has * been reached and -1 if an error has occurred. */ int zuc_process_message(struct zuc_test *test, int pipe_fd); #endif /* ZUC_COLLECTOR_H */ weston-1.9.0/tools/zunitc/src/main.c0000664000175000017500000000335712547570345014342 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" /* * Common main() for test programs. */ #include #include #include "zunitc/zunitc.h" int main(int argc, char* argv[]) { bool helped = false; int rc = zuc_initialize(&argc, argv, &helped); if ((rc == EXIT_SUCCESS) && !helped) { /* Stop if any unrecognized parameters were encountered. */ if (argc > 1) { printf("%s: unrecognized option '%s'\n", argv[0], argv[1]); printf("Try '%s --help' for more information.\n", argv[0]); rc = EXIT_FAILURE; } else { rc = ZUC_RUN_TESTS(); } } zuc_cleanup(); return rc; } weston-1.9.0/tools/zunitc/src/zuc_event_listener.h0000664000175000017500000001117712547570345017331 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_EVENT_HANDLER_H #define ZUC_EVENT_HANDLER_H #include #include "zuc_context.h" #include "zuc_event.h" struct zuc_test; struct zuc_case; /** * Interface to allow components to process testing events as they occur. * * Event listeners that will stream output as testing progresses are often * named "*_logger" whereas those that produce their output upon test run * completion are named "*_reporter". */ struct zuc_event_listener { /** * User data pointer. */ void *data; /** * Destructor. * @param data the user data associated with this instance. */ void (*destroy)(void *data); /** * Handler for simple pre-run state. * * @param pass_count total number of expected test passes. * @param pass_num current pass iteration number. * @param seed random seed being used, or 0 for no randomization. * @param filter filter string used for tests, or NULL/blank for none. */ void (*pre_run)(void *data, int pass_count, int pass_num, int seed, const char *filter); /** * Handler for test runs starting. * * @param data the user data associated with this instance. * @param live_case_count number of active test cases in this run. * @param live_test_count number of active tests in this run. * @param disabled_count number of disabled tests in this run. */ void (*run_started)(void *data, int live_case_count, int live_test_count, int disabled_count); /** * Handler for test runs ending. * * @param data the user data associated with this instance. */ void (*run_ended)(void *data, int case_count, struct zuc_case** cases, int live_case_count, int live_test_count, int total_passed, int total_failed, int total_disabled, long total_elapsed); /** * Handler for test case starting. * * @param data the user data associated with this instance. */ void (*case_started)(void *data, struct zuc_case *test_case, int live_test_count, int disabled_count); /** * Handler for test case ending. * * @param data the user data associated with this instance. */ void (*case_ended)(void *data, struct zuc_case *test_case); /** * Handler for test starting. * * @param data the user data associated with this instance. */ void (*test_started)(void *data, struct zuc_test *test); /** * Handler for test ending. * * @param data the user data associated with this instance. */ void (*test_ended)(void *data, struct zuc_test *test); /** * Handler for disabled test notification. * * @param data the user data associated with this instance. */ void (*test_disabled)(void *data, struct zuc_test *test); /** * Handler for check/assertion fired due to failure, warning, etc. * * @param data the user data associated with this instance. */ void (*check_triggered)(void *data, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2); /** * Handler for tracepoints and such that may be displayed later. * * @param data the user data associated with this instance. */ void (*collect_event)(void *data, char const *file, int line, const char *expr1); }; /** * Registers an event listener instance to be called. */ void zuc_add_event_listener(struct zuc_event_listener *event_listener); #endif /* ZUC_EVENT_HANDLER_H */ weston-1.9.0/tools/zunitc/src/zuc_junit_reporter.h0000664000175000017500000000265312552265076017353 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_JUNIT_REPORTER_H #define ZUC_JUNIT_REPORTER_H struct zuc_event_listener; /** * Creates an instance of a reporter that will write data in the JUnit * XML format. */ struct zuc_event_listener * zuc_junit_reporter_create(void); #endif /* ZUC_JUNIT_REPORTER_H */ weston-1.9.0/tools/zunitc/src/zuc_collector.c0000664000175000017500000002436612547570345016270 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "zuc_collector.h" #include #include #include #include #include "shared/zalloc.h" #include "zuc_event_listener.h" #include "zunitc/zunitc_impl.h" #include #include #include /** * @file * General handling of collecting events during testing to pass back to * main tracking of fork()'d tests. * * @note implementation of zuc_process_message() is included here so that * all child->parent IPC is in a single source file for easier maintenance * and updating. */ /** * Internal data struct for processing. */ struct collector_data { int *fd; /**< file descriptor to output to. */ struct zuc_test *test; /**< current test, or NULL. */ }; /** * Stores an int32_t into the given buffer. * * @param ptr the buffer to store to. * @param val the value to store. * @return a pointer to the position in the buffer after the stored value. */ static char * pack_int32(char *ptr, int32_t val); /** * Stores an intptr_t into the given buffer. * * @param ptr the buffer to store to. * @param val the value to store. * @return a pointer to the position in the buffer after the stored value. */ static char * pack_intptr_t(char *ptr, intptr_t val); /** * Extracts a int32_t from the given buffer. * * @param ptr the buffer to extract from. * @param val the value to set. * @return a pointer to the position in the buffer after the extracted * value. */ static char const * unpack_int32(char const *ptr, int32_t *val); /** * Extracts a intptr_t from the given buffer. * * @param ptr the buffer to extract from. * @param val the value to set. * @return a pointer to the position in the buffer after the extracted * value. */ static char const * unpack_intptr_t(char const *ptr, intptr_t *val); /** * Extracts a length-prefixed string from the given buffer. * * @param ptr the buffer to extract from. * @param str the value to set. * @return a pointer to the position in the buffer after the extracted * value. */ static char const * unpack_string(char const *ptr, char **str); /** * Extracts an event from the given buffer. * * @param ptr the buffer to extract from. * @param len the length of the given buffer. * @return an event that was packed in the buffer */ static struct zuc_event * unpack_event(char const *ptr, int32_t len); /** * Handles an event by either attaching it directly or sending it over IPC * as needed. */ static void store_event(struct collector_data *cdata, enum zuc_event_type event_type, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2); static void destroy(void *data); static void test_started(void *data, struct zuc_test *test); static void test_ended(void *data, struct zuc_test *test); static void check_triggered(void *data, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2); static void collect_event(void *data, char const *file, int line, const char *expr1); struct zuc_event_listener * zuc_collector_create(int *pipe_fd) { struct zuc_event_listener *listener = zalloc(sizeof(struct zuc_event_listener)); listener->data = zalloc(sizeof(struct collector_data)); ((struct collector_data *)listener->data)->fd = pipe_fd; listener->destroy = destroy; listener->test_started = test_started; listener->test_ended = test_ended; listener->check_triggered = check_triggered; listener->collect_event = collect_event; return listener; } char * pack_int32(char *ptr, int32_t val) { memcpy(ptr, &val, sizeof(val)); return ptr + sizeof(val); } char * pack_intptr_t(char *ptr, intptr_t val) { memcpy(ptr, &val, sizeof(val)); return ptr + sizeof(val); } static char * pack_cstr(char *ptr, intptr_t val, int len) { if (val == 0) { /* a null pointer */ ptr = pack_int32(ptr, -1); } else { ptr = pack_int32(ptr, len); memcpy(ptr, (const char *)val, len); ptr += len; } return ptr; } void destroy(void *data) { free(data); } void test_started(void *data, struct zuc_test *test) { struct collector_data *cdata = data; cdata->test = test; } void test_ended(void *data, struct zuc_test *test) { struct collector_data *cdata = data; cdata->test = NULL; } void check_triggered(void *data, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2) { struct collector_data *cdata = data; if (op != ZUC_OP_TRACEPOINT) store_event(cdata, ZUC_EVENT_IMMEDIATE, file, line, state, op, valtype, val1, val2, expr1, expr2); } void collect_event(void *data, char const *file, int line, const char *expr1) { struct collector_data *cdata = data; store_event(cdata, ZUC_EVENT_DEFERRED, file, line, ZUC_CHECK_OK, ZUC_OP_TRACEPOINT, ZUC_VAL_INT, 0, 0, expr1, ""); } void store_event(struct collector_data *cdata, enum zuc_event_type event_type, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2) { struct zuc_event *event = zalloc(sizeof(*event)); event->file = strdup(file); event->line = line; event->state = state; event->op = op; event->valtype = valtype; event->val1 = val1; event->val2 = val2; if (valtype == ZUC_VAL_CSTR) { if (val1) event->val1 = (intptr_t)strdup((const char *)val1); if (val2) event->val2 = (intptr_t)strdup((const char *)val2); } event->expr1 = strdup(expr1); event->expr2 = strdup(expr2); zuc_attach_event(cdata->test, event, event_type, false); if (*cdata->fd == -1) { } else { /* Need to pass it back */ int sent; int count; int expr1_len = strlen(expr1); int expr2_len = strlen(expr2); int val1_len = ((valtype == ZUC_VAL_CSTR) && val1) ? strlen((char *)val1) : 0; int val2_len = ((valtype == ZUC_VAL_CSTR) && val2) ? strlen((char *)val2) : 0; int file_len = strlen(file); int len = (sizeof(int32_t) * 9) + file_len + (sizeof(intptr_t) * 2) + ((valtype == ZUC_VAL_CSTR) ? (sizeof(int32_t) * 2) + val1_len + val2_len : 0) + expr1_len + expr2_len; char *buf = zalloc(len); char *ptr = pack_int32(buf, len - 4); ptr = pack_int32(ptr, event_type); ptr = pack_int32(ptr, file_len); memcpy(ptr, file, file_len); ptr += file_len; ptr = pack_int32(ptr, line); ptr = pack_int32(ptr, state); ptr = pack_int32(ptr, op); ptr = pack_int32(ptr, valtype); if (valtype == ZUC_VAL_CSTR) { ptr = pack_cstr(ptr, val1, val1_len); ptr = pack_cstr(ptr, val2, val2_len); } else { ptr = pack_intptr_t(ptr, val1); ptr = pack_intptr_t(ptr, val2); } ptr = pack_int32(ptr, expr1_len); if (expr1_len) { memcpy(ptr, expr1, expr1_len); ptr += expr1_len; } ptr = pack_int32(ptr, expr2_len); if (expr2_len) { memcpy(ptr, expr2, expr2_len); ptr += expr2_len; } sent = 0; while (sent < len) { count = write(*cdata->fd, buf, len); if (count == -1) break; sent += count; } free(buf); } } char const * unpack_int32(char const *ptr, int32_t *val) { memcpy(val, ptr, sizeof(*val)); return ptr + sizeof(*val); } char const * unpack_intptr_t(char const *ptr, intptr_t *val) { memcpy(val, ptr, sizeof(*val)); return ptr + sizeof(*val); } char const * unpack_string(char const *ptr, char **str) { int32_t len = 0; ptr = unpack_int32(ptr, &len); *str = zalloc(len + 1); if (len) memcpy(*str, ptr, len); ptr += len; return ptr; } static char const * unpack_cstr(char const *ptr, char **str) { int32_t len = 0; ptr = unpack_int32(ptr, &len); if (len < 0) { *str = NULL; } else { *str = zalloc(len + 1); if (len) memcpy(*str, ptr, len); ptr += len; } return ptr; } struct zuc_event * unpack_event(char const *ptr, int32_t len) { int32_t val = 0; struct zuc_event *evt = zalloc(sizeof(*evt)); char const *tmp = unpack_string(ptr, &evt->file); tmp = unpack_int32(tmp, &evt->line); tmp = unpack_int32(tmp, &val); evt->state = val; tmp = unpack_int32(tmp, &val); evt->op = val; tmp = unpack_int32(tmp, &val); evt->valtype = val; if (evt->valtype == ZUC_VAL_CSTR) { char *ptr = NULL; tmp = unpack_cstr(tmp, &ptr); evt->val1 = (intptr_t)ptr; tmp = unpack_cstr(tmp, &ptr); evt->val2 = (intptr_t)ptr; } else { tmp = unpack_intptr_t(tmp, &evt->val1); tmp = unpack_intptr_t(tmp, &evt->val2); } tmp = unpack_string(tmp, &evt->expr1); tmp = unpack_string(tmp, &evt->expr2); return evt; } int zuc_process_message(struct zuc_test *test, int fd) { char buf[4] = {}; int got = read(fd, buf, 4); if (got == 4) { enum zuc_event_type event_type = ZUC_EVENT_IMMEDIATE; int32_t val = 0; int32_t len = 0; const char *tmp = NULL; char *raw = NULL; unpack_int32(buf, &len); raw = zalloc(len); got = read(fd, raw, len); tmp = unpack_int32(raw, &val); event_type = val; struct zuc_event *evt = unpack_event(tmp, len - (tmp - raw)); zuc_attach_event(test, evt, event_type, true); free(raw); } return got; } weston-1.9.0/tools/zunitc/src/zunitc_impl.c0000664000175000017500000010515412552265076015747 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "zunitc/zunitc_impl.h" #include "zunitc/zunitc.h" #include "zuc_base_logger.h" #include "zuc_collector.h" #include "zuc_context.h" #include "zuc_event_listener.h" #include "zuc_junit_reporter.h" #include "shared/config-parser.h" #include "shared/helpers.h" #include "shared/zalloc.h" /* * If CLOCK_MONOTONIC is present on the system it will give us reliable * results under certain edge conditions that normally require manual * admin actions to trigger. If not, CLOCK_REALTIME is a reasonable * fallback. */ #if _POSIX_MONOTONIC_CLOCK static const clockid_t TARGET_TIMER = CLOCK_MONOTONIC; #else static const clockid_t TARGET_TIMER = CLOCK_REALTIME; #endif static char const DISABLED_PREFIX[] = "DISABLED_"; #define MS_PER_SEC 1000L #define NANO_PER_MS 1000000L /** * Simple single-linked list structure. */ struct zuc_slinked { void *data; struct zuc_slinked *next; }; static struct zuc_context g_ctx = { .case_count = 0, .cases = NULL, .fatal = false, .repeat = 0, .random = 0, .spawn = true, .break_on_failure = false, .fds = {-1, -1}, .listeners = NULL, .curr_case = NULL, .curr_test = NULL, }; static char *g_progname = NULL; static char *g_progbasename = NULL; typedef int (*comp_pred2)(intptr_t lhs, intptr_t rhs); static bool test_has_skip(struct zuc_test *test) { return test->skipped; } static bool test_has_failure(struct zuc_test *test) { return test->fatal || test->failed; } bool zuc_has_skip(void) { return g_ctx.curr_test ? test_has_skip(g_ctx.curr_test) : false; } bool zuc_has_failure(void) { return g_ctx.curr_test ? test_has_failure(g_ctx.curr_test) : false; } void zuc_set_filter(const char *filter) { g_ctx.filter = strdup(filter); } void zuc_set_repeat(int repeat) { g_ctx.repeat = repeat; } void zuc_set_random(int random) { g_ctx.random = random; } void zuc_set_spawn(bool spawn) { g_ctx.spawn = spawn; } void zuc_set_break_on_failure(bool break_on_failure) { g_ctx.break_on_failure = break_on_failure; } void zuc_set_output_junit(bool enable) { g_ctx.output_junit = enable; } const char * zuc_get_program_name(void) { return g_progname; } const char * zuc_get_program_basename(void) { return g_progbasename; } static struct zuc_test * create_test(int order, zucimpl_test_fn fn, zucimpl_test_fn_f fn_f, char const *case_name, char const *test_name, struct zuc_case *parent) { struct zuc_test *test = zalloc(sizeof(struct zuc_test)); ZUC_ASSERTG_NOT_NULL(test, out); test->order = order; test->fn = fn; test->fn_f = fn_f; test->name = strdup(test_name); if ((!fn && !fn_f) || (strncmp(DISABLED_PREFIX, test_name, sizeof(DISABLED_PREFIX) - 1) == 0)) test->disabled = 1; test->test_case = parent; out: return test; } static int compare_regs(const void *lhs, const void *rhs) { int rc = strcmp((*(struct zuc_registration **)lhs)->tcase, (*(struct zuc_registration **)rhs)->tcase); if (rc == 0) rc = strcmp((*(struct zuc_registration **)lhs)->test, (*(struct zuc_registration **)rhs)->test); return rc; } /* gcc-specific markers for auto test case registration: */ extern const struct zuc_registration __start_zuc_tsect; extern const struct zuc_registration __stop_zuc_tsect; static void register_tests(void) { size_t case_count = 0; size_t count = &__stop_zuc_tsect - &__start_zuc_tsect; size_t i; int idx = 0; const char *last_name = NULL; void **array = zalloc(sizeof(void *) * count); ZUC_ASSERT_NOT_NULL(array); for (i = 0; i < count; ++i) array[i] = (void *)(&__start_zuc_tsect + i); qsort(array, count, sizeof(array[0]), compare_regs); /* Count transitions to get number of test cases. */ last_name = NULL; for (i = 0; i < count; ++i) { const struct zuc_registration *reg = (const struct zuc_registration *)array[i]; if (!last_name || (strcmp(last_name, reg->tcase))) { last_name = reg->tcase; case_count++; } } /* Create test case data items. */ struct zuc_case **case_array = zalloc(sizeof(struct zuc_case *) * case_count); ZUC_ASSERT_NOT_NULL(case_array); struct zuc_case *last_case = NULL; size_t case_num = 0; for (i = 0; i < count; ++i) { const struct zuc_registration *reg = (const struct zuc_registration *)array[i]; if (!last_case || (strcmp(last_case->name, reg->tcase))) { last_case = zalloc(sizeof(struct zuc_case)); ZUC_ASSERT_NOT_NULL(last_case); last_case->order = count; last_case->name = strdup(reg->tcase); last_case->fxt = reg->fxt; last_case->test_count = i; if (case_num > 0) { int tcount = i - case_array[case_num - 1]->test_count; case_array[case_num - 1]->test_count = tcount; } case_array[case_num++] = last_case; } } case_array[case_count - 1]->test_count = count - case_array[case_count - 1]->test_count; /* Reserve space for tests per test case. */ for (case_num = 0; case_num < case_count; ++case_num) { case_array[case_num]->tests = zalloc(case_array[case_num]->test_count * sizeof(struct zuc_test *)); ZUC_ASSERT_NOT_NULL(case_array[case_num]->tests); } last_name = NULL; case_num = -1; for (i = 0; i < count; ++i) { const struct zuc_registration *reg = (const struct zuc_registration *)array[i]; int order = count - (1 + (reg - &__start_zuc_tsect)); if (!last_name || (strcmp(last_name, reg->tcase))) { last_name = reg->tcase; case_num++; idx = 0; } if (order < case_array[case_num]->order) case_array[case_num]->order = order; case_array[case_num]->tests[idx] = create_test(order, reg->fn, reg->fn_f, reg->tcase, reg->test, case_array[case_num]); if (case_array[case_num]->fxt != reg->fxt) printf("%s:%d: error: Mismatched fixtures for '%s'\n", __FILE__, __LINE__, case_array[case_num]->name); idx++; } free(array); g_ctx.case_count = case_count; g_ctx.cases = case_array; } static int compare_case_order(const void *lhs, const void *rhs) { return (*(struct zuc_case **)lhs)->order - (*(struct zuc_case **)rhs)->order; } static int compare_test_order(const void *lhs, const void *rhs) { return (*(struct zuc_test **)lhs)->order - (*(struct zuc_test **)rhs)->order; } static void order_cases(int count, struct zuc_case **cases) { int i; qsort(cases, count, sizeof(*cases), compare_case_order); for (i = 0; i < count; ++i) { qsort(cases[i]->tests, cases[i]->test_count, sizeof(*cases[i]->tests), compare_test_order); } } static void free_events(struct zuc_event **events) { struct zuc_event *evt = *events; *events = NULL; while (evt) { struct zuc_event *old = evt; evt = evt->next; free(old->file); if (old->valtype == ZUC_VAL_CSTR) { free((void *)old->val1); free((void *)old->val2); } free(old->expr1); free(old->expr2); free(old); } } static void free_test(struct zuc_test *test) { free(test->name); free_events(&test->events); free_events(&test->deferred); free(test); } static void free_test_case(struct zuc_case *test_case) { int i; free(test_case->name); for (i = test_case->test_count - 1; i >= 0; --i) { free_test(test_case->tests[i]); test_case->tests[i] = NULL; } free(test_case->tests); free(test_case); } /** * A very simple matching that is compatible with the algorithm used in * Google Test. * * @param wildcard sequence of '?', '*' or normal characters to match. * @param str string to check for matching. * @return true if the wildcard matches the entire string, false otherwise. */ static bool wildcard_matches(char const *wildcard, char const *str) { switch (*wildcard) { case '\0': return !*str; case '?': return *str && wildcard_matches(wildcard + 1, str + 1); case '*': return (*str && wildcard_matches(wildcard, str + 1)) || wildcard_matches(wildcard + 1, str); default: return (*wildcard == *str) && wildcard_matches(wildcard + 1, str + 1); }; } static char** segment_str(char *str) { int count = 1; char **parts = NULL; char *saved = NULL; char *tok = NULL; int i = 0; for (i = 0; str[i]; ++i) if (str[i] == ':') count++; parts = zalloc(sizeof(char*) * (count + 1)); ZUC_ASSERTG_NOT_NULL(parts, out); tok = strtok_r(str, ":", &saved); i = 0; parts[i++] = tok; while (tok) { tok = strtok_r(NULL, ":", &saved); parts[i++] = tok; } out: return parts; } static void filter_cases(int *count, struct zuc_case **cases, char const *filter) { int i = 0; int j = 0; int num_pos = 0; int negative = -1; char *buf = strdup(filter); char **parts = segment_str(buf); for (i = 0; parts[i]; ++i) { if (parts[i][0] == '-') { parts[i]++; negative = i; break; } num_pos++; } for (i = 0; i < *count; ++i) { /* Walk backwards for easier pruning. */ for (j = cases[i]->test_count - 1; j >= 0; --j) { int x; bool keep = num_pos == 0; char *name = NULL; struct zuc_test *test = cases[i]->tests[j]; if (asprintf(&name, "%s.%s", cases[i]->name, test->name) < 0) { printf("%s:%d: error: %d\n", __FILE__, __LINE__, errno); exit(EXIT_FAILURE); } for (x = 0; (x < num_pos) && !keep; ++x) keep = wildcard_matches(parts[x], name); if (keep && (negative >= 0)) for (x = negative; parts[x] && keep; ++x) keep &= !wildcard_matches(parts[x], name); if (!keep) { int w; free_test(test); for (w = j + 1; w < cases[i]->test_count; w++) cases[i]->tests[w - 1] = cases[i]->tests[w]; cases[i]->test_count--; } free(name); } } free(parts); parts = NULL; free(buf); buf = NULL; /* Prune any cases with no more tests. */ for (i = *count - 1; i >= 0; --i) { if (cases[i]->test_count < 1) { free_test_case(cases[i]); for (j = i + 1; j < *count; ++j) cases[j - 1] = cases[j]; cases[*count - 1] = NULL; (*count)--; } } } static unsigned int get_seed_from_time(void) { time_t sec = time(NULL); unsigned int seed = (unsigned int) sec % 100000; if (seed < 2) seed = 2; return seed; } static void initialize(void) { static bool init = false; if (init) return; init = true; register_tests(); if (g_ctx.fatal) return; if (g_ctx.random > 1) { g_ctx.seed = g_ctx.random; } else if (g_ctx.random == 1) { g_ctx.seed = get_seed_from_time(); } if (g_ctx.case_count) { order_cases(g_ctx.case_count, g_ctx.cases); if (g_ctx.filter && g_ctx.filter[0]) filter_cases(&g_ctx.case_count, g_ctx.cases, g_ctx.filter); } } int zuc_initialize(int *argc, char *argv[], bool *help_flagged) { int rc = EXIT_FAILURE; int opt_help = 0; int opt_nofork = 0; int opt_list = 0; int opt_repeat = 0; int opt_random = 0; int opt_break_on_failure = 0; int opt_junit = 0; char *opt_filter = NULL; char *help_param = NULL; int argc_in = *argc; const struct weston_option options[] = { { WESTON_OPTION_BOOLEAN, "zuc-nofork", 0, &opt_nofork }, { WESTON_OPTION_BOOLEAN, "zuc-list-tests", 0, &opt_list }, { WESTON_OPTION_INTEGER, "zuc-repeat", 0, &opt_repeat }, { WESTON_OPTION_INTEGER, "zuc-random", 0, &opt_random }, { WESTON_OPTION_BOOLEAN, "zuc-break-on-failure", 0, &opt_break_on_failure }, #if ENABLE_JUNIT_XML { WESTON_OPTION_BOOLEAN, "zuc-output-xml", 0, &opt_junit }, #endif { WESTON_OPTION_STRING, "zuc-filter", 0, &opt_filter }, }; /* *If a test binary is linked to our libzunitcmain it might want * to access the program 'name' from argv[0] */ free(g_progname); g_progname = NULL; free(g_progbasename); g_progbasename = NULL; if ((*argc > 0) && argv) { char *path = NULL; char *base = NULL; g_progname = strdup(argv[0]); /* basename() might modify the input, so needs a writeable * string. * It also may return a statically allocated buffer subject to * being overwritten so needs to be dup'd. */ path = strdup(g_progname); base = basename(path); g_progbasename = strdup(base); free(path); } else { g_progname = strdup(""); printf("%s:%d: warning: No valid argv[0] for initialization\n", __FILE__, __LINE__); } initialize(); if (g_ctx.fatal) return EXIT_FAILURE; if (help_flagged) *help_flagged = false; { /* Help param will be a special case and need restoring. */ int i = 0; char **argv_in = NULL; const struct weston_option help_options[] = { { WESTON_OPTION_BOOLEAN, "help", 'h', &opt_help }, }; argv_in = zalloc(sizeof(char *) * argc_in); if (!argv_in) { printf("%s:%d: error: alloc failed.\n", __FILE__, __LINE__); return EXIT_FAILURE; } for (i = 0; i < argc_in; ++i) argv_in[i] = argv[i]; parse_options(help_options, ARRAY_LENGTH(help_options), argc, argv); if (*argc < argc_in) { for (i = 1; (i < argc_in) && !help_param; ++i) { bool found = false; int j = 0; for (j = 0; (j < *argc) && !found; ++j) found = (argv[j] == argv_in[i]); if (!found) help_param = argv_in[i]; } } free(argv_in); } parse_options(options, ARRAY_LENGTH(options), argc, argv); if (help_param && (*argc < argc_in)) argv[(*argc)++] = help_param; if (opt_filter) { zuc_set_filter(opt_filter); free(opt_filter); } if (opt_help) { printf("Usage: %s [OPTIONS]\n" " --zuc-break-on-failure\n" " --zuc-filter=FILTER\n" " --zuc-list-tests\n" " --zuc-nofork\n" #if ENABLE_JUNIT_XML " --zuc-output-xml\n" #endif " --zuc-random=N [0|1|]\n" " --zuc-repeat=N\n" " --help\n", argv[0]); if (help_flagged) *help_flagged = true; rc = EXIT_SUCCESS; } else if (opt_list) { zuc_list_tests(); rc = EXIT_FAILURE; } else { zuc_set_repeat(opt_repeat); zuc_set_random(opt_random); zuc_set_spawn(!opt_nofork); zuc_set_break_on_failure(opt_break_on_failure); zuc_set_output_junit(opt_junit); rc = EXIT_SUCCESS; } return rc; } static void dispatch_pre_run(struct zuc_context *ctx, int pass_count, int pass_num, int seed, const char *filter) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->pre_run) listener->pre_run(listener->data, pass_count, pass_num, seed, filter); } } static void dispatch_run_started(struct zuc_context *ctx, int live_case_count, int live_test_count, int disabled_count) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->run_started) listener->run_started(listener->data, live_case_count, live_test_count, disabled_count); } } static void dispatch_run_ended(struct zuc_context *ctx, int live_case_count, int live_test_count, int total_passed, int total_failed, int total_disabled, long total_elapsed) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->run_ended) listener->run_ended(listener->data, ctx->case_count, ctx->cases, live_case_count, live_test_count, total_passed, total_failed, total_disabled, total_elapsed); } } static void dispatch_case_started(struct zuc_context *ctx,struct zuc_case *test_case, int live_test_count, int disabled_count) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->case_started) listener->case_started(listener->data, test_case, live_test_count, disabled_count); } } static void dispatch_case_ended(struct zuc_context *ctx, struct zuc_case *test_case) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->case_ended) listener->case_ended(listener->data, test_case); } } static void dispatch_test_started(struct zuc_context *ctx, struct zuc_test *test) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->test_started) listener->test_started(listener->data, test); } } static void dispatch_test_ended(struct zuc_context *ctx, struct zuc_test *test) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->test_ended) listener->test_ended(listener->data, test); } } static void dispatch_test_disabled(struct zuc_context *ctx, struct zuc_test *test) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->test_disabled) listener->test_disabled(listener->data, test); } } static void dispatch_check_triggered(struct zuc_context *ctx, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->check_triggered) listener->check_triggered(listener->data, file, line, state, op, valtype, val1, val2, expr1, expr2); } } static void dispatch_collect_event(struct zuc_context *ctx, char const *file, int line, const char *expr1) { struct zuc_slinked *curr; for (curr = ctx->listeners; curr; curr = curr->next) { struct zuc_event_listener *listener = curr->data; if (listener->collect_event) listener->collect_event(listener->data, file, line, expr1); } } static void migrate_deferred_events(struct zuc_test *test, bool transferred) { struct zuc_event *evt = test->deferred; if (!evt) return; test->deferred = NULL; if (test->events) { struct zuc_event *old = test->events; while (old->next) old = old->next; old->next = evt; } else { test->events = evt; } while (evt && !transferred) { dispatch_check_triggered(&g_ctx, evt->file, evt->line, evt->state, evt->op, evt->valtype, evt->val1, evt->val2, evt->expr1, evt->expr2); evt = evt->next; } } static void mark_single_failed(struct zuc_test *test, enum zuc_fail_state state) { switch (state) { case ZUC_CHECK_OK: /* no internal state to change */ break; case ZUC_CHECK_SKIP: if (test) test->skipped = 1; break; case ZUC_CHECK_FAIL: if (test) test->failed = 1; break; case ZUC_CHECK_ERROR: case ZUC_CHECK_FATAL: if (test) test->fatal = 1; break; } if (g_ctx.break_on_failure) raise(SIGABRT); } static void mark_failed(struct zuc_test *test, enum zuc_fail_state state) { if (!test && g_ctx.curr_test) test = g_ctx.curr_test; if (test) { mark_single_failed(test, state); } else if (g_ctx.curr_case) { /* In setup or tear-down of test suite */ int i; for (i = 0; i < g_ctx.curr_case->test_count; ++i) mark_single_failed(g_ctx.curr_case->tests[i], state); } if ((state == ZUC_CHECK_FATAL) || (state == ZUC_CHECK_ERROR)) g_ctx.fatal = true; } void zuc_attach_event(struct zuc_test *test, struct zuc_event *event, enum zuc_event_type event_type, bool transferred) { if (!test) { /* * consider adding events directly to the case. * would be for use during per-suite setup and teardown. */ printf("%s:%d: error: No current test.\n", __FILE__, __LINE__); } else if (event_type == ZUC_EVENT_DEFERRED) { if (test->deferred) { struct zuc_event *curr = test->deferred; while (curr->next) curr = curr->next; curr->next = event; } else { test->deferred = event; } } else { if (test) migrate_deferred_events(test, transferred); if (test->events) { struct zuc_event *curr = test->events; while (curr->next) curr = curr->next; curr->next = event; } else { test->events = event; } mark_failed(test, event->state); } } void zuc_add_event_listener(struct zuc_event_listener *event_listener) { if (!event_listener) /* ensure null entries are not added */ return; if (!g_ctx.listeners) { g_ctx.listeners = zalloc(sizeof(struct zuc_slinked)); ZUC_ASSERT_NOT_NULL(g_ctx.listeners); g_ctx.listeners->data = event_listener; } else { struct zuc_slinked *curr = g_ctx.listeners; while (curr->next) curr = curr->next; curr->next = zalloc(sizeof(struct zuc_slinked)); ZUC_ASSERT_NOT_NULL(curr->next); curr->next->data = event_listener; } } void zuc_cleanup(void) { int i; free(g_ctx.filter); g_ctx.filter = 0; for (i = 0; i < 2; ++i) if (g_ctx.fds[i] != -1) { close(g_ctx.fds[i]); g_ctx.fds[i] = -1; } if (g_ctx.listeners) { struct zuc_slinked *curr = g_ctx.listeners; while (curr) { struct zuc_slinked *old = curr; struct zuc_event_listener *listener = curr->data; if (listener->destroy) listener->destroy(listener->data); free(listener); curr = curr->next; free(old); } g_ctx.listeners = NULL; } for (i = g_ctx.case_count - 1; i >= 0; --i) { free_test_case(g_ctx.cases[i]); g_ctx.cases[i] = NULL; } free(g_ctx.cases); g_ctx.cases = NULL; free(g_progname); g_progname = NULL; free(g_progbasename); g_progbasename = NULL; } static void shuffle_cases(int count, struct zuc_case **cases, unsigned int seed) { int i; unsigned int rseed = seed; for (i = 0; i < count; ++i) { int j; for (j = cases[i]->test_count - 1; j > 0 ; --j) { int val = rand_r(&rseed); int b = ((val / (double)RAND_MAX) * j + 0.5); if (j != b) { struct zuc_test *tmp = cases[i]->tests[j]; cases[i]->tests[j] = cases[i]->tests[b]; cases[i]->tests[b] = tmp; } } } for (i = count - 1; i > 0; --i) { int val = rand_r(&rseed); int j = ((val / (double)RAND_MAX) * i + 0.5); if (i != j) { struct zuc_case *tmp = cases[i]; cases[i] = cases[j]; cases[j] = tmp; } } } void zuc_list_tests(void) { int i; int j; initialize(); if (g_ctx.fatal) return; for (i = 0; i < g_ctx.case_count; ++i) { printf("%s.\n", g_ctx.cases[i]->name); for (j = 0; j < g_ctx.cases[i]->test_count; ++j) { printf(" %s\n", g_ctx.cases[i]->tests[j]->name); } } } static void spawn_test(struct zuc_test *test, void *test_data, void (*cleanup_fn)(void *data), void *cleanup_data) { pid_t pid = -1; if (!test || (!test->fn && !test->fn_f)) return; if (pipe2(g_ctx.fds, O_CLOEXEC)) { printf("%s:%d: error: Unable to create pipe: %d\n", __FILE__, __LINE__, errno); mark_failed(test, ZUC_CHECK_ERROR); return; } fflush(NULL); /* important. avoid duplication of output */ pid = fork(); switch (pid) { case -1: /* Error forking */ printf("%s:%d: error: Problem with fork: %d\n", __FILE__, __LINE__, errno); mark_failed(test, ZUC_CHECK_ERROR); close(g_ctx.fds[0]); g_ctx.fds[0] = -1; close(g_ctx.fds[1]); g_ctx.fds[1] = -1; break; case 0: { /* child */ int rc = EXIT_SUCCESS; close(g_ctx.fds[0]); g_ctx.fds[0] = -1; if (test->fn_f) test->fn_f(test_data); else test->fn(); if (test_has_failure(test)) rc = EXIT_FAILURE; else if (test_has_skip(test)) rc = ZUC_EXIT_SKIP; /* Avoid confusing memory tools like valgrind */ if (cleanup_fn) cleanup_fn(cleanup_data); zuc_cleanup(); exit(rc); break; } default: { /* parent */ ssize_t rc = 0; siginfo_t info = {}; close(g_ctx.fds[1]); g_ctx.fds[1] = -1; do { rc = zuc_process_message(g_ctx.curr_test, g_ctx.fds[0]); } while (rc > 0); close(g_ctx.fds[0]); g_ctx.fds[0] = -1; if (waitid(P_ALL, 0, &info, WEXITED)) { printf("%s:%d: error: waitid failed. (%d)\n", __FILE__, __LINE__, errno); mark_failed(test, ZUC_CHECK_ERROR); } else { switch (info.si_code) { case CLD_EXITED: { int exit_code = info.si_status; switch(exit_code) { case EXIT_SUCCESS: break; case ZUC_EXIT_SKIP: if (!test_has_skip(g_ctx.curr_test) && !test_has_failure(g_ctx.curr_test)) ZUC_SKIP("Child exited SKIP"); break; default: /* unexpected failure */ if (!test_has_failure(g_ctx.curr_test)) ZUC_ASSERT_EQ(0, exit_code); } break; } case CLD_KILLED: case CLD_DUMPED: printf("%s:%d: error: signaled: %d\n", __FILE__, __LINE__, info.si_status); mark_failed(test, ZUC_CHECK_ERROR); break; } } } } } static void run_single_test(struct zuc_test *test,const struct zuc_fixture *fxt, void *case_data, bool spawn) { long elapsed = 0; struct timespec begin; struct timespec end; void *test_data = NULL; void *cleanup_data = NULL; void (*cleanup_fn)(void *data) = NULL; memset(&begin, 0, sizeof(begin)); memset(&end, 0, sizeof(end)); g_ctx.curr_test = test; dispatch_test_started(&g_ctx, test); cleanup_fn = fxt ? fxt->tear_down : NULL; cleanup_data = NULL; if (fxt && fxt->set_up) { test_data = fxt->set_up(case_data); cleanup_data = test_data; } else { test_data = case_data; } clock_gettime(TARGET_TIMER, &begin); /* Need to re-check these, as fixtures might have changed test state. */ if (!test->fatal && !test->skipped) { if (spawn) { spawn_test(test, test_data, cleanup_fn, cleanup_data); } else { if (test->fn_f) test->fn_f(test_data); else test->fn(); } } clock_gettime(TARGET_TIMER, &end); elapsed = (end.tv_sec - begin.tv_sec) * MS_PER_SEC; if (end.tv_sec != begin.tv_sec) { elapsed -= (begin.tv_nsec) / NANO_PER_MS; elapsed += (end.tv_nsec) / NANO_PER_MS; } else { elapsed += (end.tv_nsec - begin.tv_nsec) / NANO_PER_MS; } test->elapsed = elapsed; if (cleanup_fn) cleanup_fn(cleanup_data); if (test->deferred) { if (test_has_failure(test)) migrate_deferred_events(test, false); else free_events(&test->deferred); } dispatch_test_ended(&g_ctx, test); g_ctx.curr_test = NULL; } static void run_single_case(struct zuc_case *test_case) { int count_live = test_case->test_count - test_case->disabled; g_ctx.curr_case = test_case; if (count_live) { int i = 0; const struct zuc_fixture *fxt = test_case->fxt; void *case_data = fxt ? (void *)fxt->data : NULL; dispatch_case_started(&g_ctx, test_case, count_live, test_case->disabled); if (fxt && fxt->set_up_test_case) case_data = fxt->set_up_test_case(fxt->data); for (i = 0; i < test_case->test_count; ++i) { struct zuc_test *curr = test_case->tests[i]; if (curr->disabled) { dispatch_test_disabled(&g_ctx, curr); } else { run_single_test(curr, fxt, case_data, g_ctx.spawn); if (curr->skipped) test_case->skipped++; if (curr->failed) test_case->failed++; if (curr->fatal) test_case->fatal++; if (!curr->failed && !curr->fatal) test_case->passed++; test_case->elapsed += curr->elapsed; } } if (fxt && fxt->tear_down_test_case) fxt->tear_down_test_case(case_data); dispatch_case_ended(&g_ctx, test_case); } g_ctx.curr_case = NULL; } static void reset_test_values(struct zuc_case **cases, int case_count) { int i; for (i = 0; i < case_count; ++i) { int j; cases[i]->disabled = 0; cases[i]->skipped = 0; cases[i]->failed = 0; cases[i]->fatal = 0; cases[i]->passed = 0; cases[i]->elapsed = 0; for (j = 0; j < cases[i]->test_count; ++j) { struct zuc_test *test = cases[i]->tests[j]; if (test->disabled) cases[i]->disabled++; test->skipped = 0; test->failed = 0; test->fatal = 0; test->elapsed = 0; free_events(&test->events); free_events(&test->deferred); } } } static int run_single_pass(void) { long total_elapsed = 0; int total_passed = 0; int total_failed = 0; int total_skipped = 0; int live_case_count = 0; int live_test_count = 0; int disabled_test_count = 0; int i; reset_test_values(g_ctx.cases, g_ctx.case_count); for (i = 0; i < g_ctx.case_count; ++i) { int live = g_ctx.cases[i]->test_count - g_ctx.cases[i]->disabled; if (live) { live_test_count += live; live_case_count++; } if (g_ctx.cases[i]->disabled) disabled_test_count++; } dispatch_run_started(&g_ctx, live_case_count, live_test_count, disabled_test_count); for (i = 0; i < g_ctx.case_count; ++i) { run_single_case(g_ctx.cases[i]); total_failed += g_ctx.cases[i]->test_count - (g_ctx.cases[i]->passed + g_ctx.cases[i]->disabled); total_passed += g_ctx.cases[i]->passed; total_elapsed += g_ctx.cases[i]->elapsed; total_skipped += g_ctx.cases[i]->skipped; } dispatch_run_ended(&g_ctx, live_case_count, live_test_count, total_passed, total_failed, disabled_test_count, total_elapsed); if (total_failed) return EXIT_FAILURE; else if (total_skipped) return ZUC_EXIT_SKIP; else return EXIT_SUCCESS; } int zucimpl_run_tests(void) { int rc = EXIT_SUCCESS; int i; int limit = g_ctx.repeat > 0 ? g_ctx.repeat : 1; initialize(); if (g_ctx.fatal) return EXIT_FAILURE; if (g_ctx.listeners == NULL) { zuc_add_event_listener(zuc_collector_create(&(g_ctx.fds[1]))); zuc_add_event_listener(zuc_base_logger_create()); if (g_ctx.output_junit) zuc_add_event_listener(zuc_junit_reporter_create()); } if (g_ctx.case_count < 1) { printf("%s:%d: error: Setup error: test tree is empty\n", __FILE__, __LINE__); rc = EXIT_FAILURE; } for (i = 0; (i < limit) && (g_ctx.case_count > 0); ++i) { int pass_code = EXIT_SUCCESS; dispatch_pre_run(&g_ctx, limit, i + 1, (g_ctx.random > 0) ? g_ctx.seed : 0, g_ctx.filter); order_cases(g_ctx.case_count, g_ctx.cases); if (g_ctx.random > 0) shuffle_cases(g_ctx.case_count, g_ctx.cases, g_ctx.seed); pass_code = run_single_pass(); if (pass_code == EXIT_FAILURE) rc = EXIT_FAILURE; else if ((pass_code == ZUC_EXIT_SKIP) && (rc == EXIT_SUCCESS)) rc = ZUC_EXIT_SKIP; g_ctx.seed++; } return rc; } int zucimpl_tracepoint(char const *file, int line, char const *fmt, ...) { int rc = -1; va_list argp; char *msg = NULL; va_start(argp, fmt); rc = vasprintf(&msg, fmt, argp); if (rc == -1) { msg = NULL; } va_end(argp); dispatch_collect_event(&g_ctx, file, line, msg); free(msg); return rc; } void zucimpl_terminate(char const *file, int line, bool fail, bool fatal, const char *msg) { enum zuc_fail_state state = ZUC_CHECK_SKIP; int level = 2; if (fail && fatal) { state = ZUC_CHECK_FATAL; level = 0; } else if (fail && !fatal) { state = ZUC_CHECK_FAIL; level = 0; } mark_failed(g_ctx.curr_test, state); if ((state != ZUC_CHECK_OK) && g_ctx.curr_test) migrate_deferred_events(g_ctx.curr_test, false); dispatch_check_triggered(&g_ctx, file, line, state, ZUC_OP_TERMINATE, ZUC_VAL_INT, level, 0, msg, ""); } static void validate_types(enum zuc_check_op op, enum zuc_check_valtype valtype) { bool is_valid = true; switch (op) { case ZUC_OP_NULL: case ZUC_OP_NOT_NULL: is_valid = is_valid && (valtype == ZUC_VAL_PTR); break; default: ; /* all rest OK */ } switch (valtype) { case ZUC_VAL_CSTR: is_valid = is_valid && ((op == ZUC_OP_EQ) || (op == ZUC_OP_NE)); break; default: ; /* all rest OK */ } if (!is_valid) printf("%s:%d: warning: Unexpected op+type %d/%d.\n", __FILE__, __LINE__, op, valtype); } static int pred2_unknown(intptr_t lhs, intptr_t rhs) { return 0; } static int pred2_true(intptr_t lhs, intptr_t rhs) { return lhs; } static int pred2_false(intptr_t lhs, intptr_t rhs) { return !lhs; } static int pred2_eq(intptr_t lhs, intptr_t rhs) { return lhs == rhs; } static int pred2_streq(intptr_t lhs, intptr_t rhs) { int status = 0; const char *lhptr = (const char *)lhs; const char *rhptr = (const char *)rhs; if (!lhptr && !rhptr) status = 1; else if (lhptr && rhptr) status = strcmp(lhptr, rhptr) == 0; return status; } static int pred2_ne(intptr_t lhs, intptr_t rhs) { return lhs != rhs; } static int pred2_strne(intptr_t lhs, intptr_t rhs) { int status = 0; const char *lhptr = (const char *)lhs; const char *rhptr = (const char *)rhs; if (lhptr != rhptr) { if (!lhptr || !rhptr) status = 1; else status = strcmp(lhptr, rhptr) != 0; } return status; } static int pred2_ge(intptr_t lhs, intptr_t rhs) { return lhs >= rhs; } static int pred2_gt(intptr_t lhs, intptr_t rhs) { return lhs > rhs; } static int pred2_le(intptr_t lhs, intptr_t rhs) { return lhs <= rhs; } static int pred2_lt(intptr_t lhs, intptr_t rhs) { return lhs < rhs; } static comp_pred2 get_pred2(enum zuc_check_op op, enum zuc_check_valtype valtype) { switch (op) { case ZUC_OP_TRUE: return pred2_true; break; case ZUC_OP_FALSE: return pred2_false; break; case ZUC_OP_NULL: return pred2_false; break; case ZUC_OP_NOT_NULL: return pred2_true; break; case ZUC_OP_EQ: if (valtype == ZUC_VAL_CSTR) return pred2_streq; else return pred2_eq; break; case ZUC_OP_NE: if (valtype == ZUC_VAL_CSTR) return pred2_strne; else return pred2_ne; break; case ZUC_OP_GE: return pred2_ge; break; case ZUC_OP_GT: return pred2_gt; break; case ZUC_OP_LE: return pred2_le; break; case ZUC_OP_LT: return pred2_lt; break; default: return pred2_unknown; } } int zucimpl_expect_pred2(char const *file, int line, enum zuc_check_op op, enum zuc_check_valtype valtype, bool fatal, intptr_t lhs, intptr_t rhs, const char *lhs_str, const char* rhs_str) { enum zuc_fail_state state = fatal ? ZUC_CHECK_FATAL : ZUC_CHECK_FAIL; comp_pred2 pred = get_pred2(op, valtype); int failed = !pred(lhs, rhs); validate_types(op, valtype); if (failed) { mark_failed(g_ctx.curr_test, state); if (g_ctx.curr_test) migrate_deferred_events(g_ctx.curr_test, false); dispatch_check_triggered(&g_ctx, file, line, fatal ? ZUC_CHECK_FATAL : ZUC_CHECK_FAIL, op, valtype, lhs, rhs, lhs_str, rhs_str); } return failed; } weston-1.9.0/tools/zunitc/src/zuc_event.h0000664000175000017500000000462012547570345015417 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_EVENT_H #define ZUC_EVENT_H #include #include "zunitc/zunitc_impl.h" /** * */ enum zuc_event_type { ZUC_EVENT_IMMEDIATE, ZUC_EVENT_DEFERRED }; /** * Status enum for posted events. */ enum zuc_fail_state { ZUC_CHECK_OK, /**< no problem. */ ZUC_CHECK_SKIP, /**< runtime skip directive encountered. */ ZUC_CHECK_FAIL, /**< non-fatal check fails. */ ZUC_CHECK_FATAL, /**< fatal assertion/check fails. */ ZUC_CHECK_ERROR /**< internal level problem. */ }; /** * Record of an event that occurs during testing such as assert macro * failures. */ struct zuc_event { char *file; int32_t line; enum zuc_fail_state state; enum zuc_check_op op; enum zuc_check_valtype valtype; intptr_t val1; intptr_t val2; char *expr1; char *expr2; struct zuc_event *next; }; /** * Attaches an event to the specified test. * * @param test the test to attach to. * @param event the event to attach. * @param event_type of event (immediate or deferred) to attach. * @param transferred true if the event has been processed elsewhere and * is being transferred for storage, false otherwise. */ void zuc_attach_event(struct zuc_test *test, struct zuc_event *event, enum zuc_event_type event_type, bool transferred); #endif /* ZUC_EVENT_H */ weston-1.9.0/tools/zunitc/src/zuc_base_logger.h0000664000175000017500000000263012547570345016546 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_BASE_LOGGER_H #define ZUC_BASE_LOGGER_H struct zuc_event_listener; /** * Creates a new logger that outputs data to console in the default * format. */ struct zuc_event_listener * zuc_base_logger_create(void); #endif /* ZUC_BASE_LOGGER_H */ weston-1.9.0/tools/zunitc/src/zuc_base_logger.c0000664000175000017500000002451412547570345016546 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include "zuc_base_logger.h" #include #include #include #include #include #include "zuc_event_listener.h" #include "zuc_types.h" #include "shared/zalloc.h" /* a few sequences for rudimentary ANSI graphics. */ #define CSI_GRN "\x1b[0;32m" #define CSI_RED "\x1b[0;31m" #define CSI_YLW "\x1b[0;33m" #define CSI_RST "\x1b[m" /** * Logical mappings of style levels. */ enum style_level { STYLE_GOOD, STYLE_WARN, STYLE_BAD }; /** * Structure for internal context. */ struct base_data { bool use_color; }; /** * Prints a formatted string with optional ANSI coloring. * * @param use_color true to colorize the output, false to output normally. * @param slevel the logical type to color for. * @param fmt the format string to print with. */ static void styled_printf(bool use_color, enum style_level slevel, const char *fmt, ...); static void destroy(void *data); static void pre_run(void *data, int pass_count, int pass_num, int seed, const char *filter); static void run_started(void *data, int live_case_count, int live_test_count, int disabled_count); static void run_ended(void *data, int case_count, struct zuc_case **cases, int live_case_count, int live_test_count, int total_passed, int total_failed, int total_disabled, long total_elapsed); static void case_started(void *data, struct zuc_case *test_case, int live_test_count, int disabled_count); static void case_ended(void *data, struct zuc_case *test_case); static void test_started(void *data, struct zuc_test *test); static void test_ended(void *data, struct zuc_test *test); static void check_triggered(void *data, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2); struct zuc_event_listener * zuc_base_logger_create(void) { struct zuc_event_listener *listener = zalloc(sizeof(struct zuc_event_listener)); listener->data = zalloc(sizeof(struct base_data)); listener->destroy = destroy; listener->pre_run = pre_run; listener->run_started = run_started; listener->run_ended = run_ended; listener->case_started = case_started; listener->case_ended = case_ended; listener->test_started = test_started; listener->test_ended = test_ended; listener->check_triggered = check_triggered; return listener; } void styled_printf(bool use_color, enum style_level slevel, const char *fmt, ...) { va_list argp; if (use_color) switch (slevel) { case STYLE_GOOD: printf(CSI_GRN); break; case STYLE_WARN: printf(CSI_YLW); break; case STYLE_BAD: printf(CSI_RED); break; default: break; } va_start(argp, fmt); vprintf(fmt, argp); va_end(argp); if (use_color) printf(CSI_RST); } void destroy(void *data) { free(data); } void pre_run(void *data, int pass_count, int pass_num, int seed, const char *filter) { struct base_data *bdata = data; bdata->use_color = isatty(fileno(stdout)) && getenv("TERM") && strcmp(getenv("TERM"), "dumb"); if (pass_count > 1) printf("\nRepeating all tests (iteration %d) . . .\n\n", pass_num); if (filter && filter[0]) styled_printf(bdata->use_color, STYLE_WARN, "Note: test filter = %s\n", filter); if (seed > 0) styled_printf(bdata->use_color, STYLE_WARN, "Note: Randomizing tests' orders" " with a seed of %u .\n", seed); } void run_started(void *data, int live_case_count, int live_test_count, int disabled_count) { struct base_data *bdata = data; styled_printf(bdata->use_color, STYLE_GOOD, "[==========]"); printf(" Running %d %s from %d test %s.\n", live_test_count, (live_test_count == 1) ? "test" : "tests", live_case_count, (live_case_count == 1) ? "case" : "cases"); } void run_ended(void *data, int case_count, struct zuc_case **cases, int live_case_count, int live_test_count, int total_passed, int total_failed, int total_disabled, long total_elapsed) { struct base_data *bdata = data; styled_printf(bdata->use_color, STYLE_GOOD, "[==========]"); printf(" %d %s from %d test %s ran. (%ld ms)\n", live_test_count, (live_test_count == 1) ? "test" : "tests", live_case_count, (live_case_count == 1) ? "case" : "cases", total_elapsed); if (total_passed) { styled_printf(bdata->use_color, STYLE_GOOD, "[ PASSED ]"); printf(" %d %s.\n", total_passed, (total_passed == 1) ? "test" : "tests"); } if (total_failed) { int case_num; styled_printf(bdata->use_color, STYLE_BAD, "[ FAILED ]"); printf(" %d %s, listed below:\n", total_failed, (total_failed == 1) ? "test" : "tests"); for (case_num = 0; case_num < case_count; ++case_num) { int i; for (i = 0; i < cases[case_num]->test_count; ++i) { struct zuc_test *curr = cases[case_num]->tests[i]; if (curr->failed || curr->fatal) { styled_printf(bdata->use_color, STYLE_BAD, "[ FAILED ]"); printf(" %s.%s\n", cases[case_num]->name, curr->name); } } } } if (total_failed || total_disabled) printf("\n"); if (total_failed) printf(" %d FAILED %s\n", total_failed, (total_failed == 1) ? "TEST" : "TESTS"); if (total_disabled) styled_printf(bdata->use_color, STYLE_WARN, " YOU HAVE %d DISABLED %s\n", total_disabled, (total_disabled == 1) ? "TEST" : "TESTS"); } void case_started(void *data, struct zuc_case *test_case, int live_test_count, int disabled_count) { struct base_data *bdata = data; styled_printf(bdata->use_color, STYLE_GOOD, "[----------]"); printf(" %d %s from %s.\n", live_test_count, (live_test_count == 1) ? "test" : "tests", test_case->name); } void case_ended(void *data, struct zuc_case *test_case) { struct base_data *bdata = data; styled_printf(bdata->use_color, STYLE_GOOD, "[----------]"); printf(" %d %s from %s (%ld ms)\n", test_case->test_count, (test_case->test_count == 1) ? "test" : "tests", test_case->name, test_case->elapsed); printf("\n"); } void test_started(void *data, struct zuc_test *test) { struct base_data *bdata = data; styled_printf(bdata->use_color, STYLE_GOOD, "[ RUN ]"); printf(" %s.%s\n", test->test_case->name, test->name); } void test_ended(void *data, struct zuc_test *test) { struct base_data *bdata = data; if (test->failed || test->fatal) { styled_printf(bdata->use_color, STYLE_BAD, "[ FAILED ]"); printf(" %s.%s (%ld ms)\n", test->test_case->name, test->name, test->elapsed); } else { styled_printf(bdata->use_color, STYLE_GOOD, "[ OK ]"); printf(" %s.%s (%ld ms)\n", test->test_case->name, test->name, test->elapsed); } } const char * zuc_get_opstr(enum zuc_check_op op) { switch (op) { case ZUC_OP_EQ: return "="; break; case ZUC_OP_NE: return "!="; break; case ZUC_OP_GE: return ">="; break; case ZUC_OP_GT: return ">"; break; case ZUC_OP_LE: return "<="; break; case ZUC_OP_LT: return "<"; break; default: return "???"; } } void check_triggered(void *data, char const *file, int line, enum zuc_fail_state state, enum zuc_check_op op, enum zuc_check_valtype valtype, intptr_t val1, intptr_t val2, const char *expr1, const char *expr2) { switch (op) { case ZUC_OP_TRUE: printf("%s:%d: error: Value of: %s\n", file, line, expr1); printf(" Actual: false\n"); printf("Expected: true\n"); break; case ZUC_OP_FALSE: printf("%s:%d: error: Value of: %s\n", file, line, expr1); printf(" Actual: true\n"); printf("Expected: false\n"); break; case ZUC_OP_NULL: printf("%s:%d: error: Value of: %s\n", file, line, expr1); printf(" Actual: %p\n", (void *)val1); printf("Expected: %p\n", NULL); break; case ZUC_OP_NOT_NULL: printf("%s:%d: error: Value of: %s\n", file, line, expr1); printf(" Actual: %p\n", (void *)val1); printf("Expected: not %p\n", NULL); break; case ZUC_OP_EQ: if (valtype == ZUC_VAL_CSTR) { printf("%s:%d: error: Value of: %s\n", file, line, expr2); printf(" Actual: %s\n", (const char *)val2); printf("Expected: %s\n", expr1); printf("Which is: %s\n", (const char *)val1); } else { printf("%s:%d: error: Value of: %s\n", file, line, expr2); printf(" Actual: %ld\n", val2); printf("Expected: %s\n", expr1); printf("Which is: %ld\n", val1); } break; case ZUC_OP_NE: if (valtype == ZUC_VAL_CSTR) { printf("%s:%d: error: ", file, line); printf("Expected: (%s) %s (%s), actual: %s == %s\n", expr1, zuc_get_opstr(op), expr2, (char *)val1, (char *)val2); } else { printf("%s:%d: error: ", file, line); printf("Expected: (%s) %s (%s), actual: %ld vs %ld\n", expr1, zuc_get_opstr(op), expr2, val1, val2); } break; case ZUC_OP_TERMINATE: { char const *level = (val1 == 0) ? "error" : (val1 == 1) ? "warning" : "note"; printf("%s:%d: %s: %s\n", file, line, level, expr1); break; } case ZUC_OP_TRACEPOINT: printf("%s:%d: note: %s\n", file, line, expr1); break; default: printf("%s:%d: error: ", file, line); printf("Expected: (%s) %s (%s), actual: %ld vs %ld\n", expr1, zuc_get_opstr(op), expr2, val1, val2); } } weston-1.9.0/tools/zunitc/src/zuc_types.h0000664000175000017500000000410212547570345015435 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef ZUC_TYPES_H #define ZUC_TYPES_H #include "zunitc/zunitc_impl.h" struct zuc_case; /** * Represents a specific test. */ struct zuc_test { int order; struct zuc_case *test_case; zucimpl_test_fn fn; zucimpl_test_fn_f fn_f; char *name; int disabled; int skipped; int failed; int fatal; long elapsed; struct zuc_event *events; struct zuc_event *deferred; }; /** * Represents a test case that can hold a collection of tests. */ struct zuc_case { int order; char *name; const struct zuc_fixture* fxt; int disabled; int skipped; int failed; int fatal; int passed; long elapsed; int test_count; struct zuc_test **tests; }; /** * Returns a human-readable version of the comparison opcode. * * @param op the opcode to get a string version of. * @return a human-readable string of the opcode. * (This value should not be freed) */ const char * zuc_get_opstr(enum zuc_check_op op); #endif /* ZUC_TYPES_H */ weston-1.9.0/tools/zunitc/inc/0000775000175000017500000000000012600133270013262 500000000000000weston-1.9.0/tools/zunitc/inc/zunitc/0000775000175000017500000000000012600133270014576 500000000000000weston-1.9.0/tools/zunitc/inc/zunitc/zunitc_impl.h0000664000175000017500000000533512547570345017254 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef Z_UNIT_C_IMPL_H #define Z_UNIT_C_IMPL_H /** * @file * Internal details to bridge the public API - should not be used * directly in user code. */ #include #include #ifdef __cplusplus extern "C" { #endif enum zuc_check_op { ZUC_OP_TRUE, ZUC_OP_FALSE, ZUC_OP_NULL, ZUC_OP_NOT_NULL, ZUC_OP_EQ, ZUC_OP_NE, ZUC_OP_GE, ZUC_OP_GT, ZUC_OP_LE, ZUC_OP_LT, ZUC_OP_TERMINATE, ZUC_OP_TRACEPOINT }; enum zuc_check_valtype { ZUC_VAL_INT, ZUC_VAL_CSTR, ZUC_VAL_PTR, }; typedef void (*zucimpl_test_fn)(void); typedef void (*zucimpl_test_fn_f)(void *); /** * Internal use structure for automatic test case registration. * Should not be used directly in code. */ struct zuc_registration { const char *tcase; /**< Name of the test case. */ const char *test; /**< Name of the specific test. */ const struct zuc_fixture* fxt; /**< Optional fixture for test/case. */ zucimpl_test_fn fn; /**< function implementing base test. */ zucimpl_test_fn_f fn_f; /**< function implementing test with fixture. */ } __attribute__ ((aligned (32))); int zucimpl_run_tests(void); void zucimpl_terminate(char const *file, int line, bool fail, bool fatal, const char *msg); int zucimpl_tracepoint(char const *file, int line, const char *fmt, ...) __attribute__ ((format (printf, 3, 4))); int zucimpl_expect_pred2(char const *file, int line, enum zuc_check_op, enum zuc_check_valtype valtype, bool fatal, intptr_t lhs, intptr_t rhs, const char *lhs_str, const char* rhs_str); #ifdef __cplusplus } #endif #endif /* Z_UNIT_C_IMPL_H */ weston-1.9.0/tools/zunitc/inc/zunitc/zunitc.h0000664000175000017500000005367212551143155016230 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef Z_UNIT_C_H #define Z_UNIT_C_H #include #include #include #include #include "zunitc/zunitc_impl.h" #if !__GNUC__ #error Framework currently requires gcc or compatible compiler. #endif #if INTPTR_MAX < INT_MAX #error Odd platform requires rework of value type from intptr_t to custom. #endif /** * @file * Simple unit test framework declarations. */ #ifdef __cplusplus extern "C" { #endif /** * @page zunitc */ /** * Structure to use when defining a test fixture. * @note likely pending refactoring as use cases are refined. */ struct zuc_fixture { /** * Initial optional seed data to pass to setup functions and/or tests. */ const void *data; /** * Per-suite setup called before invoking any of the tests * contained in the suite. * * @return a pointer to test data, or NULL. */ void *(*set_up_test_case)(const void *data); /** * Per-suite tear-down called after invoking all of the tests * contained in the suite. * * @param data pointer returned from the setup function. */ void (*tear_down_test_case)(void *data); /** * Setup called before running each of the tests in the suite. * * @param data optional data from suite setup, or NULL. * @return a pointer to test data, or NULL. */ void *(*set_up)(void *data); /** * Tear-down called after running each of the tests in the suite. * * @param data pointer returned from the setup function. */ void (*tear_down)(void *data); }; /** * Process exit code to mark skipped tests, consistent with * automake tests. */ #define ZUC_EXIT_SKIP 77 /** * Accesses the test executable program name. * This version will include any full or partial path used to * launch the executable. * * @note This depends on zuc_initialize() having been called. * * @return the name of the running program. * The caller should not free nor hold this pointer. It will not stay * valid across calls to zuc_initialize() or zuc_cleanup(). * @see zuc_get_program_basename() */ const char * zuc_get_program_name(void); /** * Accesses the test executable program name in trimmed format. * If the program is launched via a partial or full path, this * version trims to return only the basename. * * @note This depends on zuc_initialize() having been called. * * @return the name of the running program. * The caller should not free nor hold this pointer. It will not stay * valid across calls to zuc_initialize() or zuc_cleanup(). * @see zuc_get_program_name() */ const char * zuc_get_program_basename(void); /** * Initializes the test framework and consumes any known command-line * parameters from the list. * The exception is 'h/help' which will be left in place for follow-up * processing by the hosting app if so desired. * * @param argc pointer to argc value to read and possibly change. * @param argv array of parameter pointers to read and possibly change. * @param help_flagged if non-NULL will be set to true if the user * specifies the help flag (and framework help has been output). * @return EXIT_SUCCESS upon success setting or help, EXIT_FAILURE otherwise. */ int zuc_initialize(int *argc, char *argv[], bool *help_flagged); /** * Runs all tests that have been registered. * Expected return values include EXIT_FAILURE if any errors or failures * have occurred, ::ZUC_EXIT_SKIP if no failures have occurred but at least * one test reported skipped, otherwise EXIT_SUCCESS if nothing of note * was recorded. * * @note for consistency with other frameworks and to allow for additional * cleanup to be added later this is implemented as a wrapper macro. * * @return expected exit status - normally EXIT_SUCCESS, ::ZUC_EXIT_SKIP, * or EXIT_FAILURE. * Normally an application can use this value directly in calling exit(), * however there could be cases where some additional processing such as * resource cleanup or library shutdown that a program might want to do * first. */ #define ZUC_RUN_TESTS() \ zucimpl_run_tests() /** * Clears the test system in preparation for application shutdown. */ void zuc_cleanup(void); /** * Displays all known tests. * The list returned is affected by any filtering in place. * * @see zuc_set_filter() */ void zuc_list_tests(void); /** * Sets the filter string to use for tests. * The format is a series of patterns separated by a colon, with wildcards * and an optional flag for negative matching. For wildcards, the '*' * character will match any sequence and the '?' character will match any * single character. * The '-' character at the start of a pattern marks the end of the * patterns required to match and the begining of patterns that names * must not match. * Defaults to use all tests. * * @param filter the filter string to apply to tests. */ void zuc_set_filter(const char *filter); /** * Trigger specific failure/signal upon test failures; useful when * running under a debugger. * Currently this is implemented to raise a SIGABRT signal when any * failure is reported. * Defaults to false. * * @param break_on_failure true to cause a break when tests fail, false to * allow normal operation upon failures. */ void zuc_set_break_on_failure(bool break_on_failure); /** * Sets the number of times to repeat the tests. * Any number higher than 1 will cause the tests to be repeated the * specified number of times. * Defaults to 1/no repeating. * * @param repeat number of times to repeat the tests. */ void zuc_set_repeat(int repeat); /** * Randomizes the order in which tests are executed. * A value of 0 (the default) means tests are executed in their natural * ordering. A value of 1 will pick a random seed based on the time to * use for running tests in a pseudo-random order. A value greater than 1 * will be used directly for the initial seed. * * If the tests are also repeated, the seed will be incremented for each * subsequent run. * Defaults to 0/not randomize. * * @param random 0|1|seed value. * @see zuc_set_repeat() */ void zuc_set_random(int random); /** * Controls whether or not to run the tests as forked child processes. * Defaults to true. * * @param spawn true to spawn each test in a forked child process, * false to run tests directly. */ void zuc_set_spawn(bool spawn); /** * Enables output in the JUnit XML format. * Defaults to false. * * @param enable true to generate JUnit XML output, false to disable. */ void zuc_set_output_junit(bool enable); /** * Defines a test case that can be registered to run. */ #define ZUC_TEST(tcase, test) \ static void zuctest_##tcase##_##test(void); \ \ const struct zuc_registration zzz_##tcase##_##test \ __attribute__ ((section ("zuc_tsect"))) = \ { \ #tcase, #test, 0, \ zuctest_##tcase##_##test, \ 0 \ }; \ \ static void zuctest_##tcase##_##test(void) /** * Defines a test case that can be registered to run along with setup/teardown * support per-test and/or per test case. * * @note likely pending refactoring as use cases are refined. */ #define ZUC_TEST_F(tcase, test) \ static void zuctest_##tcase##_##test(void *data); \ \ const struct zuc_registration zzz_##tcase##_##test \ __attribute__ ((section ("zuc_tsect"))) = \ { \ #tcase, #test, &tcase, \ 0, \ zuctest_##tcase##_##test \ }; \ \ static void zuctest_##tcase##_##test(void *data) /** * Returns true if the currently executing test has encountered any skips. * * @return true if there is currently a test executing and it has * encountered any skips. * @see zuc_has_failure */ bool zuc_has_skip(void); /** * Returns true if the currently executing test has encountered any failures. * * @return true if there is currently a test executing and it has * encountered any failures. * @see zuc_has_skip */ bool zuc_has_failure(void); /** * Terminates the current test without marking it as failed. * * @param message the message to log as to why the test has been skipped. */ #define ZUC_SKIP(message) \ do { \ zucimpl_terminate(__FILE__, __LINE__, false, false, #message); \ return; \ } \ while (0) /** * Terminates the current test and marks it as failed. * * @param message the message to log as to why the test has failed. */ #define ZUC_FATAL(message) \ do { \ zucimpl_terminate(__FILE__, __LINE__, true, true, #message); \ return; \ } \ while (0) /** * Marks the current test as failed with a fatal issue, but does not * immediately return from the current function. ZUC_FATAL() is normally * preferred, but when further cleanup is needed, or the current function * needs to return a value, this macro may be required. * * @param message the message to log as to why the test has failed. * @see ZUC_FATAL() */ #define ZUC_MARK_FATAL(message) \ do { \ zucimpl_terminate(__FILE__, __LINE__, true, true, #message); \ } \ while (0) /** * Creates a message that will be processed in the case of failure. * If the test encounters any failures (fatal or non-fatal) then these * messages are included in output. Otherwise they are discarded at the * end of the test run. * * @param message the format string style message. */ #define ZUC_TRACEPOINT(message, ...) \ zucimpl_tracepoint(__FILE__, __LINE__, message, ##__VA_ARGS__); /** * Internal use macro for ASSERT implementation. * Should not be used directly in code. */ #define ZUCIMPL_ASSERT(opcode, valtype, lhs, rhs) \ do { \ if (zucimpl_expect_pred2(__FILE__, __LINE__, \ (opcode), (valtype), true, \ (intptr_t)(lhs), (intptr_t)(rhs), \ #lhs, #rhs)) { \ return; \ } \ } \ while (0) /** * Internal use macro for ASSERT with Goto implementation. * Should not be used directly in code. */ #define ZUCIMPL_ASSERTG(label, opcode, valtype, lhs, rhs) \ do { \ if (zucimpl_expect_pred2(__FILE__, __LINE__, \ (opcode), (valtype), true, \ (intptr_t)(lhs), (intptr_t)(rhs), \ #lhs, #rhs)) { \ goto label; \ } \ } \ while (0) /** * Verifies that the specified expression is true, marks the test as failed * and terminates the test if it is not. * * @param condition the expression that is expected to be true. * @note it is far better to use a more specific check when possible * (e.g. ZUC_ASSERT_EQ(), ZUC_ASSERT_NE(), etc.) * @see ZUC_ASSERTG_TRUE() */ #define ZUC_ASSERT_TRUE(condition) \ ZUCIMPL_ASSERT(ZUC_OP_TRUE, ZUC_VAL_INT, condition, 0) /** * Verifies that the specified expression is false, marks the test as * failed and terminates the test if it is not. * * @param condition the expression that is expected to be false. * @note it is far better to use a more specific check when possible * (e.g. ZUC_ASSERT_EQ(), ZUC_ASSERT_NE(), etc.) * @see ZUC_ASSERTG_FALSE() */ #define ZUC_ASSERT_FALSE(condition) \ ZUCIMPL_ASSERT(ZUC_OP_FALSE, ZUC_VAL_INT, condition, 0) /** * Verifies that the specified expression is NULL, marks the test as failed * and terminates the test if it is not. * * @param condition the expression that is expected to be a NULL pointer. * @see ZUC_ASSERTG_NULL() */ #define ZUC_ASSERT_NULL(condition) \ ZUCIMPL_ASSERT(ZUC_OP_NULL, ZUC_VAL_PTR, condition, 0) /** * Verifies that the specified expression is non-NULL, marks the test as * failed and terminates the test if it is not. * * @param condition the expression that is expected to be a non-NULL pointer. * @see ZUC_ASSERTG_NOT_NULL() */ #define ZUC_ASSERT_NOT_NULL(condition) \ ZUCIMPL_ASSERT(ZUC_OP_NOT_NULL, ZUC_VAL_PTR, condition, 0) /** * Verifies that the values of the specified expressions match, marks the * test as failed and terminates the test if they do not. * * @param expected the value the result should hold. * @param actual the actual value seen in testing. * @see ZUC_ASSERTG_EQ() */ #define ZUC_ASSERT_EQ(expected, actual) \ ZUCIMPL_ASSERT(ZUC_OP_EQ, ZUC_VAL_INT, expected, actual) /** * Verifies that the values of the specified expressions differ, marks the * test as failed and terminates the test if they do not. * * @param expected the value the result should not hold. * @param actual the actual value seen in testing. * @see ZUC_ASSERTG_NE() */ #define ZUC_ASSERT_NE(expected, actual) \ ZUCIMPL_ASSERT(ZUC_OP_NE, ZUC_VAL_INT, expected, actual) /** * Verifies that the value of the first expression is less than the value * of the second expression, marks the test as failed and terminates the * test if it is not. * * @param lesser the expression whose value should be lesser than the other. * @param greater the expression whose value should be greater than the other. * @see ZUC_ASSERTG_LT() */ #define ZUC_ASSERT_LT(lesser, greater) \ ZUCIMPL_ASSERT(ZUC_OP_LT, ZUC_VAL_INT, lesser, greater) /** * Verifies that the value of the first expression is less than or equal * to the value of the second expression, marks the test as failed and * terminates the test if it is not. * * @param lesser the expression whose value should be lesser than or equal to * the other. * @param greater the expression whose value should be greater than or equal to * the other. * @see ZUC_ASSERTG_LE() */ #define ZUC_ASSERT_LE(lesser, greater) \ ZUCIMPL_ASSERT(ZUC_OP_LE, ZUC_VAL_INT, lesser, greater) /** * Verifies that the value of the first expression is greater than the * value of the second expression, marks the test as failed and terminates * the test if it is not. * * @param greater the expression whose value should be greater than the other. * @param lesser the expression whose value should be lesser than the other. * @see ZUC_ASSERTG_GT() */ #define ZUC_ASSERT_GT(greater, lesser) \ ZUCIMPL_ASSERT(ZUC_OP_GT, ZUC_VAL_INT, greater, lesser) /** * Verifies that the value of the first expression is greater than or equal * to the value of the second expression, marks the test as failed and * terminates the test if it is not. * * @param greater the expression whose value should be greater than or equal to * the other. * @param lesser the expression whose value should be lesser than or equal to * the other. * @see ZUC_ASSERTG_GE() */ #define ZUC_ASSERT_GE(greater, lesser) \ ZUCIMPL_ASSERT(ZUC_OP_GE, ZUC_VAL_INT, greater, lesser) /** * Verifies that the values of the specified expressions match when * compared as null-terminated C-style strings, marks the test as failed * and terminates the test if they do not. * * @param expected the value the result should hold. * @param actual the actual value seen in testing. * @see ZUC_ASSERTG_STREQ() */ #define ZUC_ASSERT_STREQ(expected, actual) \ ZUCIMPL_ASSERT(ZUC_OP_EQ, ZUC_VAL_CSTR, expected, actual) /** * Verifies that the values of the specified expressions differ when * compared as null-terminated C-style strings, marks the test as failed * and terminates the test if they do not. * * @param expected the value the result should not hold. * @param actual the actual value seen in testing. * @see ZUC_ASSERTG_STRNE() */ #define ZUC_ASSERT_STRNE(expected, actual) \ ZUCIMPL_ASSERT(ZUC_OP_NE, ZUC_VAL_CSTR, expected, actual) /** * Verifies that the specified expression is true, marks the test as failed * and terminates the test via a 'goto' if it is not. * * @param condition the expression that is expected to be true. * @note it is far better to use a more specific check when possible * (e.g. ZUC_ASSERTG_EQ(), ZUC_ASSERTG_NE(), etc.) * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_TRUE() */ #define ZUC_ASSERTG_TRUE(condition, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_TRUE, ZUC_VAL_INT, condition, 0) /** * Verifies that the specified expression is false, marks the test as * failed and terminates the test via a 'goto' if it is not. * * @param condition the expression that is expected to be false. * @note it is far better to use a more specific check when possible * (e.g. ZUC_ASSERTG_EQ(), ZUC_ASSERTG_NE(), etc.) * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_FALSE() */ #define ZUC_ASSERTG_FALSE(condition, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_FALSE, ZUC_VAL_INT, condition, 0) /** * Verifies that the specified expression is NULL, marks the test as failed * and terminates the test via a 'goto' if it is not. * * @param condition the expression that is expected to be a NULL pointer. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_NULL() */ #define ZUC_ASSERTG_NULL(condition, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_NULL, ZUC_VAL_PTR, condition, 0) /** * Verifies that the specified expression is non-NULL, marks the test as * failed and terminates the test via a 'goto' if it is not. * * @param condition the expression that is expected to be a non-NULL pointer. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_NOT_NULL() */ #define ZUC_ASSERTG_NOT_NULL(condition, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_NOT_NULL, ZUC_VAL_PTR, condition, 0) /** * Verifies that the values of the specified expressions match, marks the * test as failed and terminates the test via a 'goto' if they do not. * * @param expected the value the result should hold. * @param actual the actual value seen in testing. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_EQ() */ #define ZUC_ASSERTG_EQ(expected, actual, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_EQ, ZUC_VAL_INT, expected, actual) /** * Verifies that the values of the specified expressions differ, marks the * test as failed and terminates the test via a 'goto' if they do not. * * @param expected the value the result should not hold. * @param actual the actual value seen in testing. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_NE() */ #define ZUC_ASSERTG_NE(expected, actual, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_NE, ZUC_VAL_INT, expected, actual) /** * Verifies that the value of the first expression is less than the value * of the second expression, marks the test as failed and terminates the * test if it is not. * * @param lesser the expression whose value should be lesser than the other. * @param greater the expression whose value should be greater than the other. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_LT() */ #define ZUC_ASSERTG_LT(lesser, greater, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_LT, ZUC_VAL_INT, lesser, greater) /** * Verifies that the value of the first expression is less than or equal * to the value of the second expression, marks the test as failed and * terminates the test via a 'goto' if it is not. * * @param lesser the expression whose value should be lesser than or equal to * the other. * @param greater the expression whose value should be greater than or equal to * the other. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_LE() */ #define ZUC_ASSERTG_LE(lesser, greater, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_LE, ZUC_VAL_INT, lesser, greater) /** * Verifies that the value of the first expression is greater than the * value of the second expression, marks the test as failed and terminates * the test if it is not. * * @param greater the expression whose value should be greater than the other. * @param lesser the expression whose value should be lesser than the other. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_GT() */ #define ZUC_ASSERTG_GT(greater, lesser, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_GT, ZUC_VAL_INT, greater, lesser) /** * Verifies that the value of the first expression is greater than or equal * to the value of the second expression, marks the test as failed and * terminates the test via a 'goto' if it is not. * * @param greater the expression whose value should be greater than or equal to * the other. * @param lesser the expression whose value should be lesser than or equal to * the other. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_GE() */ #define ZUC_ASSERTG_GE(greater, lesser, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_GE, ZUC_VAL_INT, greater, lesser) /** * Verifies that the values of the specified expressions match when * compared as null-terminated C-style strings, marks the test as failed * and terminates the test via a 'goto' if they do not. * * @param expected the value the result should hold. * @param actual the actual value seen in testing. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_STREQ() */ #define ZUC_ASSERTG_STREQ(expected, actual, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_EQ, ZUC_VAL_CSTR, expected, actual) /** * Verifies that the values of the specified expressions differ when * compared as null-terminated C-style strings, marks the test as failed * and terminates the test via a 'goto' if they do not. * * @param expected the value the result should not hold. * @param actual the actual value seen in testing. * @param label the target for 'goto' if the assertion fails. * @see ZUC_ASSERT_STRNE() */ #define ZUC_ASSERTG_STRNE(expected, actual, label) \ ZUCIMPL_ASSERTG(label, ZUC_OP_NE, ZUC_VAL_CSTR, expected, actual) #ifdef __cplusplus } /* extern "C" */ #endif #endif /* Z_UNIT_C_H */ weston-1.9.0/tools/zunitc/test/0000775000175000017500000000000012600133270013470 500000000000000weston-1.9.0/tools/zunitc/test/fixtures_test.c0000664000175000017500000000506212547570345016511 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" /** * Tests of fixtures. */ #include #include #include #include #include "zunitc/zunitc.h" /* Use a simple string for a simplistic fixture */ static struct zuc_fixture fixture_minimal = { .data = "for all good men to", }; ZUC_TEST_F(fixture_minimal, just_as_is) { const char *str = data; ZUC_ASSERT_NOT_NULL(str); ZUC_ASSERT_EQ(0, strcmp("for all good men to", str)); } /* * Not important what or how data is manipulated, just that this function * does something non-transparent to it. */ static void * setup_test_config(void *data) { int i; const char *str = data; char *upper = NULL; ZUC_ASSERTG_NOT_NULL(data, out); upper = strdup(str); ZUC_ASSERTG_NOT_NULL(upper, out); for (i = 0; upper[i]; ++i) upper[i] = (char)toupper(upper[i]); out: return upper; } static void teardown_test_config(void *data) { ZUC_ASSERT_NOT_NULL(data); free(data); } static struct zuc_fixture fixture_data0 = { .data = "Now is the time", .set_up = setup_test_config, .tear_down = teardown_test_config }; ZUC_TEST_F(fixture_data0, base) { const char *str = data; ZUC_ASSERT_NOT_NULL(str); ZUC_ASSERT_EQ(0, strcmp("NOW IS THE TIME", str)); } /* Use the same fixture for a second test. */ ZUC_TEST_F(fixture_data0, no_lower) { int i; const char *str = data; ZUC_ASSERT_NOT_NULL(str); for (i = 0; str[i]; ++i) ZUC_ASSERT_EQ(0, islower(str[i])); } weston-1.9.0/tools/zunitc/test/zunitc_test.c0000664000175000017500000002230612547570345016154 00000000000000/* * Copyright © 2015 Samsung Electronics Co., Ltd * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" /* * A simple file to show tests being setup and run. */ #include #include #include #include #include "zunitc/zunitc.h" /* * The SKIP and FAIL sets of tests are those that will cause 'make check' * to fail so are disabled by default. They can be re-enabled when working * on the test framework itself. */ /* #define ENABLE_FAIL_TESTS */ /* #define ENABLE_SKIP_TESTS */ ZUC_TEST(base_test, math_is_sane) { ZUC_ASSERT_EQ(4, 2 + 2); } ZUC_TEST(base_test, math_is_hard) { ZUC_TRACEPOINT("Tracepoint here."); ZUC_TRACEPOINT("Checking %d", 4); #ifdef ENABLE_FAIL_TESTS ZUC_ASSERT_EQ(5, 2 + 2); ZUC_TRACEPOINT("flip %1.3f", 3.1415927); /* not seen */ #endif } #ifdef ENABLE_FAIL_TESTS ZUC_TEST(base_test, tracepoint_after_assert) { ZUC_TRACEPOINT("Should be seen in output"); ZUC_ASSERT_EQ(5, 2 + 2); ZUC_TRACEPOINT("Should NOT be seen in output"); } #endif #ifdef ENABLE_FAIL_TESTS ZUC_TEST(base_test, math_is_more_hard) { ZUC_ASSERT_EQ(5, 2 + 2); } ZUC_TEST(base_test, math_is_more_hard2) { ZUC_ASSERT_EQ(7, 9); } #endif ZUC_TEST(base_test, time_counted) { ZUC_TRACEPOINT("Never seen"); ZUC_TRACEPOINT("Sleepy Time %d", 10000 * 5); ZUC_ASSERT_EQ(0, usleep(10000 * 5)); /* 50ms to show up in reporting */ } ZUC_TEST(other_test, math_monkey) { ZUC_ASSERT_TRUE(1); ZUC_ASSERT_TRUE(3); ZUC_ASSERT_FALSE(0); ZUC_ASSERT_TRUE(1); ZUC_ASSERT_TRUE(3); ZUC_ASSERT_FALSE(0); ZUC_ASSERT_EQ(5, 2 + 3); ZUC_ASSERT_EQ(5, 2 + 3); int b = 9; ZUC_ASSERT_NE(1, 2); ZUC_ASSERT_NE(b, b + 2); ZUC_ASSERT_NE(1, 2); ZUC_ASSERT_NE(b, b + 1); ZUC_ASSERT_LT(1, 2); ZUC_ASSERT_LT(1, 3); ZUC_ASSERT_LE(1, 2); ZUC_ASSERT_LE(1, 3); ZUC_ASSERT_LE(1, 1); ZUC_ASSERT_LE(1, 1); ZUC_ASSERT_GT(2, 1); ZUC_ASSERT_GT(3, 1); ZUC_ASSERT_GE(1, 1); ZUC_ASSERT_GE(1, 1); ZUC_ASSERT_GE(2, 1); ZUC_ASSERT_GE(3, 1); } static void force_fatal_failure(void) { #ifdef ENABLE_FAIL_TESTS bool expected_to_fail_here = true; ZUC_ASSERT_FALSE(expected_to_fail_here); ZUC_FATAL("Should never reach here"); ZUC_ASSERT_NE(1, 1); #endif } #ifdef ENABLE_FAIL_TESTS ZUC_TEST(infrastructure, fail_keeps_testing) { ZUC_FATAL("Should always reach here"); ZUC_ASSERT_NE(1, 1); /* in case ZUC_FATAL doesn't work. */ } #endif #ifdef ENABLE_FAIL_TESTS ZUC_TEST(infrastructure, fatal_stops_test) { ZUC_FATAL("Time to kill testing"); ZUC_FATAL("Should never reach here"); ZUC_ASSERT_NE(1, 1); /* in case ZUC_FATAL doesn't work. */ } #endif #ifdef ENABLE_SKIP_TESTS ZUC_TEST(infrastructure, skip_stops_test) { ZUC_SKIP("Time to skip testing"); ZUC_FATAL("Should never reach here"); ZUC_ASSERT_NE(1, 1); /* in case ZUC_FATAL doesn't work. */ } #endif struct fixture_data { int case_counter; int test_counter; }; static struct fixture_data fixture_info = {0, 0}; static void * complex_test_set_up_case(const void *data) { fixture_info.case_counter++; return &fixture_info; } static void complex_test_tear_down_case(void *data) { ZUC_ASSERT_TRUE(&fixture_info == data); fixture_info.case_counter--; } static void * complex_test_set_up(void *data) { fixture_info.test_counter = fixture_info.case_counter; return &fixture_info; } static void complex_test_tear_down(void *data) { ZUC_ASSERT_EQ(1, fixture_info.case_counter); } struct zuc_fixture complex_test = { .set_up = complex_test_set_up, .tear_down = complex_test_tear_down, .set_up_test_case = complex_test_set_up_case, .tear_down_test_case = complex_test_tear_down_case }; /* * Note that these next cases all try to modify the test_counter member, * but the fixture should reset that. */ ZUC_TEST_F(complex_test, bases_cenario) { struct fixture_data *fdata = data; ZUC_ASSERT_NOT_NULL(fdata); ZUC_ASSERT_EQ(4, 3 + 1); ZUC_ASSERT_EQ(1, fdata->case_counter); ZUC_ASSERT_EQ(1, fdata->test_counter); fdata->test_counter++; ZUC_ASSERT_EQ(2, fdata->test_counter); } ZUC_TEST_F(complex_test, something) { struct fixture_data *fdata = data; ZUC_ASSERT_NOT_NULL(fdata); ZUC_ASSERT_EQ(4, 3 + 1); ZUC_ASSERT_EQ(1, fdata->case_counter); ZUC_ASSERT_EQ(1, fdata->test_counter); fdata->test_counter++; ZUC_ASSERT_EQ(2, fdata->test_counter); } ZUC_TEST_F(complex_test, else_here) { struct fixture_data *fdata = data; ZUC_ASSERT_NOT_NULL(fdata); ZUC_ASSERT_EQ(4, 3 + 1); ZUC_ASSERT_EQ(1, fdata->case_counter); ZUC_ASSERT_EQ(1, fdata->test_counter); fdata->test_counter++; ZUC_ASSERT_EQ(2, fdata->test_counter); } ZUC_TEST(more, DISABLED_not_run) { ZUC_ASSERT_EQ(1, 2); } ZUC_TEST(more, failure_states) { #ifdef ENABLE_FAIL_TESTS bool expected_to_fail_here = true; #endif ZUC_ASSERT_FALSE(zuc_has_failure()); #ifdef ENABLE_FAIL_TESTS ZUC_ASSERT_FALSE(expected_to_fail_here); /* should fail */ ZUC_ASSERT_TRUE(zuc_has_failure()); #endif } ZUC_TEST(more, failure_sub_fatal) { ZUC_ASSERT_FALSE(zuc_has_failure()); force_fatal_failure(); #ifdef ENABLE_FAIL_TESTS ZUC_ASSERT_TRUE(zuc_has_failure()); #endif } ZUC_TEST(pointers, null) { const char *a = NULL; ZUC_ASSERT_NULL(NULL); ZUC_ASSERT_NULL(0); ZUC_ASSERT_NULL(a); } #ifdef ENABLE_FAIL_TESTS ZUC_TEST(pointers, null_fail) { const char *a = "a"; ZUC_ASSERT_NULL(!NULL); ZUC_ASSERT_NULL(!0); ZUC_ASSERT_NULL(a); } #endif ZUC_TEST(pointers, not_null) { const char *a = "a"; ZUC_ASSERT_NOT_NULL(!NULL); ZUC_ASSERT_NOT_NULL(!0); ZUC_ASSERT_NOT_NULL(a); } #ifdef ENABLE_FAIL_TESTS ZUC_TEST(pointers, not_null_fail) { const char *a = NULL; ZUC_ASSERT_NOT_NULL(NULL); ZUC_ASSERT_NOT_NULL(0); ZUC_ASSERT_NOT_NULL(a); } #endif ZUC_TEST(strings, eq) { /* Note that we use strdup() to ensure different addresses. */ char *str_a = strdup("a"); const char *str_nil = NULL; ZUC_ASSERT_STREQ(str_a, str_a); ZUC_ASSERT_STREQ("a", str_a); ZUC_ASSERT_STREQ(str_a, "a"); ZUC_ASSERT_STREQ(str_nil, str_nil); ZUC_ASSERT_STREQ(NULL, str_nil); ZUC_ASSERT_STREQ(str_nil, NULL); free(str_a); } #ifdef ENABLE_FAIL_TESTS ZUC_TEST(strings, eq_fail) { /* Note that we use strdup() to ensure different addresses. */ char *str_a = strdup("a"); char *str_b = strdup("b"); const char *str_nil = NULL; ZUC_ASSERT_STREQ(str_a, str_b); ZUC_ASSERT_STREQ("b", str_a); ZUC_ASSERT_STREQ(str_a, "b"); ZUC_ASSERT_STREQ(str_nil, str_a); ZUC_ASSERT_STREQ(str_nil, str_b); ZUC_ASSERT_STREQ(str_a, str_nil); ZUC_ASSERT_STREQ(str_b, str_nil); ZUC_ASSERT_STREQ(NULL, str_a); ZUC_ASSERT_STREQ(NULL, str_b); ZUC_ASSERT_STREQ(str_a, NULL); ZUC_ASSERT_STREQ(str_b, NULL); free(str_a); free(str_b); } #endif ZUC_TEST(strings, ne) { /* Note that we use strdup() to ensure different addresses. */ char *str_a = strdup("a"); char *str_b = strdup("b"); const char *str_nil = NULL; ZUC_ASSERT_STRNE(str_a, str_b); ZUC_ASSERT_STRNE("b", str_a); ZUC_ASSERT_STRNE(str_a, "b"); ZUC_ASSERT_STRNE(str_nil, str_a); ZUC_ASSERT_STRNE(str_nil, str_b); ZUC_ASSERT_STRNE(str_a, str_nil); ZUC_ASSERT_STRNE(str_b, str_nil); ZUC_ASSERT_STRNE(NULL, str_a); ZUC_ASSERT_STRNE(NULL, str_b); ZUC_ASSERT_STRNE(str_a, NULL); ZUC_ASSERT_STRNE(str_b, NULL); free(str_a); free(str_b); } #ifdef ENABLE_FAIL_TESTS ZUC_TEST(strings, ne_fail01) { /* Note that we use strdup() to ensure different addresses. */ char *str_a = strdup("a"); ZUC_ASSERTG_STRNE(str_a, str_a, err); err: free(str_a); } ZUC_TEST(strings, ne_fail02) { /* Note that we use strdup() to ensure different addresses. */ char *str_a = strdup("a"); ZUC_ASSERTG_STRNE("a", str_a, err); err: free(str_a); } ZUC_TEST(strings, ne_fail03) { /* Note that we use strdup() to ensure different addresses. */ char *str_a = strdup("a"); ZUC_ASSERTG_STRNE(str_a, "a", err); err: free(str_a); } ZUC_TEST(strings, ne_fail04) { const char *str_nil = NULL; ZUC_ASSERT_STRNE(str_nil, str_nil); } ZUC_TEST(strings, ne_fail05) { const char *str_nil = NULL; ZUC_ASSERT_STRNE(NULL, str_nil); } ZUC_TEST(strings, ne_fail06) { const char *str_nil = NULL; ZUC_ASSERT_STRNE(str_nil, NULL); } #endif ZUC_TEST(base_test, later) { /* an additional test for the same case but later in source */ ZUC_ASSERT_EQ(3, 5 - 2); } ZUC_TEST(base_test, zed) { /* an additional test for the same case but later in source */ ZUC_ASSERT_EQ(3, 5 - 2); } weston-1.9.0/config.h.in0000664000175000017500000001171312600133046012004 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Build the Wayland clients */ #undef BUILD_CLIENTS /* Build the DRM compositor */ #undef BUILD_DRM_COMPOSITOR /* Build the fbdev compositor */ #undef BUILD_FBDEV_COMPOSITOR /* Build the headless compositor */ #undef BUILD_HEADLESS_COMPOSITOR /* Build the RDP compositor */ #undef BUILD_RDP_COMPOSITOR /* Build the compositor for Raspberry Pi */ #undef BUILD_RPI_COMPOSITOR /* Build the vaapi recorder */ #undef BUILD_VAAPI_RECORDER /* Build the Wayland (nested) compositor */ #undef BUILD_WAYLAND_COMPOSITOR /* Build the wcap tools */ #undef BUILD_WCAP_TOOLS /* Build the X11 compositor */ #undef BUILD_X11_COMPOSITOR /* Build the X server launcher */ #undef BUILD_XWAYLAND /* Build Weston with EGL support */ #undef ENABLE_EGL /* Build Weston with JUnit output support */ #undef ENABLE_JUNIT_XML /* Build Weston with libxkbcommon support */ #undef ENABLE_XKBCOMMON /* have Raspberry Pi BCM headers */ #undef HAVE_BCM_HOST /* Have cairo-egl */ #undef HAVE_CAIRO_EGL /* Build with dbus support */ #undef HAVE_DBUS /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_FREERDP_VERSION_H /* gbm supports dmabuf import */ #undef HAVE_GBM_FD_IMPORT /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Have lcms support */ #undef HAVE_LCMS /* Define if libdrm is available */ #undef HAVE_LIBDRM /* Have libunwind support */ #undef HAVE_LIBUNWIND /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkostemp' function. */ #undef HAVE_MKOSTEMP /* Define to 1 if you have the `posix_fallocate' function. */ #undef HAVE_POSIX_FALLOCATE /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchrnul' function. */ #undef HAVE_STRCHRNUL /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Have systemd-login */ #undef HAVE_SYSTEMD_LOGIN /* Have systemd-login >= 209 */ #undef HAVE_SYSTEMD_LOGIN_209 /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Have webp */ #undef HAVE_WEBP /* Define to 1 if you have the `xcb_poll_for_queued_event' function. */ #undef HAVE_XCB_POLL_FOR_QUEUED_EVENT /* libxcb supports XKB protocol */ #undef HAVE_XCB_XKB /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Use the GLESv2 GL cairo backend */ #undef USE_CAIRO_GLESV2 /* Use resize memory pool as a performance optimization */ #undef USE_RESIZE_POOL /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* The default backend to load, if not wayland nor x11. */ #undef WESTON_NATIVE_BACKEND /* The default desktop shell client to load. */ #undef WESTON_SHELL_CLIENT /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE weston-1.9.0/protocol/0000775000175000017500000000000012600133270011676 500000000000000weston-1.9.0/protocol/xdg-shell.xml0000664000175000017500000006404212544564625014260 00000000000000 Copyright © 2008-2013 Kristian Høgsberg Copyright © 2013 Rafael Antognolli Copyright © 2013 Jasper St. Pierre Copyright © 2010-2013 Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xdg_shell allows clients to turn a wl_surface into a "real window" which can be dragged, resized, stacked, and moved around by the user. Everything about this interface is suited towards traditional desktop environments. The 'current' member of this enum gives the version of the protocol. Implementations can compare this to the version they implement using static_assert to ensure the protocol and implementation versions match. Destroy this xdg_shell object. Destroying a bound xdg_shell object while there are surfaces still alive created by this xdg_shell object instance is illegal and will result in a protocol error. Negotiate the unstable version of the interface. This mechanism is in place to ensure client and server agree on the unstable versions of the protocol that they speak or exit cleanly if they don't agree. This request will go away once the xdg-shell protocol is stable. This creates an xdg_surface for the given surface and gives it the xdg_surface role. A wl_surface can only be given an xdg_surface role once. If get_xdg_surface is called with a wl_surface that already has an active xdg_surface associated with it, or if it had any other role, an error is raised. See the documentation of xdg_surface for more details about what an xdg_surface is and how it is used. This creates an xdg_popup for the given surface and gives it the xdg_popup role. A wl_surface can only be given an xdg_popup role once. If get_xdg_popup is called with a wl_surface that already has an active xdg_popup associated with it, or if it had any other role, an error is raised. This request must be used in response to some sort of user action like a button press, key press, or touch down event. See the documentation of xdg_popup for more details about what an xdg_popup is and how it is used. The ping event asks the client if it's still alive. Pass the serial specified in the event back to the compositor by sending a "pong" request back with the specified serial. Compositors can use this to determine if the client is still alive. It's unspecified what will happen if the client doesn't respond to the ping request, or in what timeframe. Clients should try to respond in a reasonable amount of time. A compositor is free to ping in any way it wants, but a client must always respond to any xdg_shell object it created. A client must respond to a ping event with a pong request or the client may be deemed unresponsive. An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface. It provides requests to treat surfaces like windows, allowing to set properties like maximized, fullscreen, minimized, and to move and resize them, and associate metadata like title and app id. The client must call wl_surface.commit on the corresponding wl_surface for the xdg_surface state to take effect. Prior to committing the new state, it can set up initial configuration, such as maximizing or setting a window geometry. Even without attaching a buffer the compositor must respond to initial committed configuration, for instance sending a configure event with expected window geometry if the client maximized its surface during initialization. For a surface to be mapped by the compositor the client must have committed both an xdg_surface state and a buffer. Unmap and destroy the window. The window will be effectively hidden from the user's point of view, and all state like maximization, fullscreen, and so on, will be lost. Set the "parent" of this surface. This window should be stacked above a parent. The parent surface must be mapped as long as this surface is mapped. Parent windows should be set on dialogs, toolboxes, or other "auxiliary" surfaces, so that the parent is raised when the dialog is raised. Set a short title for the surface. This string may be used to identify the surface in a task bar, window list, or other user interface elements provided by the compositor. The string must be encoded in UTF-8. Set an application identifier for the surface. The app ID identifies the general class of applications to which the surface belongs. The compositor can use this to group multiple surfaces together, or to determine how to launch a new application. For D-Bus activatable applications, the app ID is used as the D-Bus service name. The compositor shell will try to group application surfaces together by their app ID. As a best practice, it is suggested to select app ID's that match the basename of the application's .desktop file. For example, "org.freedesktop.FooViewer" where the .desktop file is "org.freedesktop.FooViewer.desktop". See the desktop-entry specification [0] for more details on application identifiers and how they relate to well-known D-Bus names and .desktop files. [0] http://standards.freedesktop.org/desktop-entry-spec/ Clients implementing client-side decorations might want to show a context menu when right-clicking on the decorations, giving the user a menu that they can use to maximize or minimize the window. This request asks the compositor to pop up such a window menu at the given position, relative to the local surface coordinates of the parent surface. There are no guarantees as to what menu items the window menu contains. This request must be used in response to some sort of user action like a button press, key press, or touch down event. Start an interactive, user-driven move of the surface. This request must be used in response to some sort of user action like a button press, key press, or touch down event. The passed serial is used to determine the type of interactive move (touch, pointer, etc). The server may ignore move requests depending on the state of the surface (e.g. fullscreen or maximized), or if the passed serial is no longer valid. If triggered, the surface will lose the focus of the device (wl_pointer, wl_touch, etc) used for the move. It is up to the compositor to visually indicate that the move is taking place, such as updating a pointer cursor, during the move. There is no guarantee that the device focus will return when the move is completed. These values are used to indicate which edge of a surface is being dragged in a resize operation. Start a user-driven, interactive resize of the surface. This request must be used in response to some sort of user action like a button press, key press, or touch down event. The passed serial is used to determine the type of interactive resize (touch, pointer, etc). The server may ignore resize requests depending on the state of the surface (e.g. fullscreen or maximized). If triggered, the client will receive configure events with the "resize" state enum value and the expected sizes. See the "resize" enum value for more details about what is required. The client must also acknowledge configure events using "ack_configure". After the resize is completed, the client will receive another "configure" event without the resize state. If triggered, the surface also will lose the focus of the device (wl_pointer, wl_touch, etc) used for the resize. It is up to the compositor to visually indicate that the resize is taking place, such as updating a pointer cursor, during the resize. There is no guarantee that the device focus will return when the resize is completed. The edges parameter specifies how the surface should be resized, and is one of the values of the resize_edge enum. The compositor may use this information to update the surface position for example when dragging the top left corner. The compositor may also use this information to adapt its behavior, e.g. choose an appropriate cursor image. The different state values used on the surface. This is designed for state values like maximized, fullscreen. It is paired with the configure event to ensure that both the client and the compositor setting the state can be synchronized. States set in this way are double-buffered. They will get applied on the next commit. Desktop environments may extend this enum by taking up a range of values and documenting the range they chose in this description. They are not required to document the values for the range that they chose. Ideally, any good extensions from a desktop environment should make its way into standardization into this enum. The current reserved ranges are: 0x0000 - 0x0FFF: xdg-shell core values, documented below. 0x1000 - 0x1FFF: GNOME The surface is maximized. The window geometry specified in the configure event must be obeyed by the client. The surface is fullscreen. The window geometry specified in the configure event must be obeyed by the client. The surface is being resized. The window geometry specified in the configure event is a maximum; the client cannot resize beyond it. Clients that have aspect ratio or cell sizing configuration can use a smaller size, however. Client window decorations should be painted as if the window is active. Do not assume this means that the window actually has keyboard or pointer focus. The configure event asks the client to resize its surface or to change its state. The width and height arguments specify a hint to the window about how its surface should be resized in window geometry coordinates. See set_window_geometry. If the width or height arguments are zero, it means the client should decide its own window dimension. This may happen when the compositor need to configure the state of the surface but doesn't have any information about any previous or expected dimension. The states listed in the event specify how the width/height arguments should be interpreted, and possibly how it should be drawn. Clients should arrange their surface for the new size and states, and then send a ack_configure request with the serial sent in this configure event at some point before committing the new surface. If the client receives multiple configure events before it can respond to one, it is free to discard all but the last event it received. When a configure event is received, if a client commits the surface in response to the configure event, then the client must make a ack_configure request before the commit request, passing along the serial of the configure event. For instance, the compositor might use this information to move a surface to the top left only when the client has drawn itself for the maximized or fullscreen state. If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event. The window geometry of a window is its "visible bounds" from the user's perspective. Client-side decorations often have invisible portions like drop-shadows which should be ignored for the purposes of aligning, placing and constraining windows. The window geometry is double buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. Once the window geometry of the surface is set once, it is not possible to unset it, and it will remain the same until set_window_geometry is called again, even if a new subsurface or buffer is attached. If never set, the value is the full bounds of the surface, including any subsurfaces. This updates dynamically on every commit. This unset mode is meant for extremely simple clients. If responding to a configure event, the window geometry in here must respect the sizing negotiations specified by the states in the configure event. The arguments are given in the surface local coordinate space of the wl_surface associated with this xdg_surface. The width and height must be greater than zero. Maximize the surface. After requesting that the surface should be maximized, the compositor will respond by emitting a configure event with the "maximized" state and the required window geometry. The client should then update its content, drawing it in a maximized state, i.e. without shadow or other decoration outside of the window geometry. The client must also acknowledge the configure when committing the new content (see ack_configure). It is up to the compositor to decide how and where to maximize the surface, for example which output and what region of the screen should be used. If the surface was already maximized, the compositor will still emit a configure event with the "maximized" state. Unmaximize the surface. After requesting that the surface should be unmaximized, the compositor will respond by emitting a configure event without the "maximized" state. If available, the compositor will include the window geometry dimensions the window had prior to being maximized in the configure request. The client must then update its content, drawing it in a regular state, i.e. potentially with shadow, etc. The client must also acknowledge the configure when committing the new content (see ack_configure). It is up to the compositor to position the surface after it was unmaximized; usually the position the surface had before maximizing, if applicable. If the surface was already not maximized, the compositor will still emit a configure event without the "maximized" state. Make the surface fullscreen. You can specify an output that you would prefer to be fullscreen. If this value is NULL, it's up to the compositor to choose which display will be used to map this surface. If the surface doesn't cover the whole output, the compositor will position the surface in the center of the output and compensate with black borders filling the rest of the output. Request that the compositor minimize your surface. There is no way to know if the surface is currently minimized, nor is there any way to unset minimization on this surface. If you are looking to throttle redrawing when minimized, please instead use the wl_surface.frame event for this, as this will also work with live previews on windows in Alt-Tab, Expose or similar compositor features. The close event is sent by the compositor when the user wants the surface to be closed. This should be equivalent to the user clicking the close button in client-side decorations, if your application has any... This is only a request that the user intends to close your window. The client may choose to ignore this request, or show a dialog to ask the user to save their data... A popup surface is a short-lived, temporary surface that can be used to implement menus. It takes an explicit grab on the surface that will be dismissed when the user dismisses the popup. This can be done by the user clicking outside the surface, using the keyboard, or even locking the screen through closing the lid or a timeout. When the popup is dismissed, a popup_done event will be sent out, and at the same time the surface will be unmapped. The xdg_popup object is now inert and cannot be reactivated, so clients should destroy it. Explicitly destroying the xdg_popup object will also dismiss the popup and unmap the surface. Clients will receive events for all their surfaces during this grab (which is an "owner-events" grab in X11 parlance). This is done so that users can navigate through submenus and other "nested" popup windows without having to dismiss the topmost popup. Clients that want to dismiss the popup when another surface of their own is clicked should dismiss the popup using the destroy request. The parent surface must have either an xdg_surface or xdg_popup role. Specifying an xdg_popup for the parent means that the popups are nested, with this popup now being the topmost popup. Nested popups must be destroyed in the reverse order they were created in, e.g. the only popup you are allowed to destroy at all times is the topmost one. If there is an existing popup when creating a new popup, the parent must be the current topmost popup. A parent surface must be mapped before the new popup is mapped. When compositors choose to dismiss a popup, they will likely dismiss every nested popup as well. When a compositor dismisses popups, it will follow the same dismissing order as required from the client. The x and y arguments passed when creating the popup object specify where the top left of the popup should be placed, relative to the local surface coordinates of the parent surface. See xdg_shell.get_xdg_popup. The client must call wl_surface.commit on the corresponding wl_surface for the xdg_popup state to take effect. For a surface to be mapped by the compositor the client must have committed both the xdg_popup state and a buffer. This destroys the popup. Explicitly destroying the xdg_popup object will also dismiss the popup, and unmap the surface. If this xdg_popup is not the "topmost" popup, a protocol error will be sent. The popup_done event is sent out when a popup is dismissed by the compositor. The client should destroy the xdg_popup object at this point. weston-1.9.0/protocol/screenshooter.xml0000664000175000017500000000047112456345006015240 00000000000000 weston-1.9.0/protocol/ivi-hmi-controller.xml0000664000175000017500000000767512537627702016123 00000000000000 Copyright (C) 2013 DENSO CORPORATION Copyright (c) 2013 BMW Car IT GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Reference protocol to control a surface by server. To control a surface by server, it gives seat to the server to e.g. control Home screen. Home screen has several workspaces to group launchers of wayland application. These workspaces are drawn on a horizontally long surface to be controlled by motion of input device. E.g. A motion from right to left happens, the viewport of surface is controlled in the ivi-shell by using ivi-layout. client can recognizes the end of controlling by event "workspace_end_control". hmi-controller loaded to ivi-shall implements 4 types of layout as a reference; tiling, side by side, full_screen, and random. home screen is a reference implementation of launcher to launch wayland applications. The home screen has several workspaces to group wayland applications. By defining the following keys in weston.ini, user can add launcher icon to launch a wayland application to a workspace. [ivi-launcher] workspace-id=0 : id of workspace to add a launcher icon-id=4001 : ivi id of ivi_surface to draw a icon icon=/home/user/review/build-ivi-shell/data/icon_ivi_flower.png : path to icon image path=/home/user/review/build-ivi-shell/weston-dnd : path to wayland application weston-1.9.0/protocol/desktop-shell.xml0000664000175000017500000001120612551143353015126 00000000000000 Traditional user interfaces can rely on this interface to define the foundations of typical desktops. Currently it's possible to set up background, panels and locking surfaces. The surface set by this request will receive a fake pointer.enter event during grabs at position 0, 0 and is expected to set an appropriate cursor image as described by the grab_cursor event sent just before the enter event. Tell the client we want it to create and set the lock surface, which is a GUI asking the user to unlock the screen. The lock surface is announced with 'set_lock_surface'. Whether or not the client actually implements locking, it MUST send 'unlock' request to let the normal desktop resume. This event will be sent immediately before a fake enter event on the grab surface. Tell the server, that enough desktop elements have been drawn to make the desktop look ready for use. During start-up, the server can wait for this request with a black screen before starting to fade in the desktop, for instance. If the client parts of a desktop take a long time to initialize, we avoid showing temporary garbage. Tell the shell which side of the screen the panel is located. This is so that new windows do not overlap the panel and maximized windows maximize properly. Only one client can bind this interface at a time. A screensaver surface is normally hidden, and only visible after an idle timeout. weston-1.9.0/protocol/fullscreen-shell.xml0000664000175000017500000002325512516305154015626 00000000000000 Displays a single surface per output. This interface provides a mechanism for a single client to display simple full-screen surfaces. While there technically may be multiple clients bound to this interface, only one of those clients should be shown at a time. To present a surface, the client uses either the present_surface or present_surface_for_mode requests. Presenting a surface takes effect on the next wl_surface.commit. See the individual requests for details about scaling and mode switches. The client can have at most one surface per output at any time. Requesting a surface be presented on an output that already has a surface replaces the previously presented surface. Presenting a null surface removes its content and effectively disables the output. Exactly what happens when an output is "disabled" is compositor-specific. The same surface may be presented on multiple outputs simultaneously. Once a surface is presented on an output, it stays on that output until either the client removes it or the compositor destroys the output. This way, the client can update the output's contents by simply attaching a new buffer. Release the binding from the wl_fullscreen_shell interface This destroys the server-side object and frees this binding. If the client binds to wl_fullscreen_shell multiple times, it may wish to free some of those bindings. Various capabilities that can be advertised by the compositor. They are advertised one-at-a-time when the wl_fullscreen_shell interface is bound. See the wl_fullscreen_shell.capability event for more details. ARBITRARY_MODE: This is a hint to the client that indicates that the compositor is capable of setting practically any mode on its outputs. If this capability is provided, wl_fullscreen_shell.present_surface_for_mode will almost never fail and clients should feel free to set whatever mode they like. If the compositor does not advertise this, it may still support some modes that are not advertised through wl_global.mode but it is less likely. CURSOR_PLANE: This is a hint to the client that indicates that the compositor can handle a cursor surface from the client without actually compositing. This may be because of a hardware cursor plane or some other mechanism. If the compositor does not advertise this capability then setting wl_pointer.cursor may degrade performance or be ignored entirely. If CURSOR_PLANE is not advertised, it is recommended that the client draw its own cursor and set wl_pointer.cursor(NULL). Advertises a single capability of the compositor. When the wl_fullscreen_shell interface is bound, this event is emitted once for each capability advertised. Valid capabilities are given by the wl_fullscreen_shell.capability enum. If clients want to take advantage of any of these capabilities, they should use a wl_display.sync request immediately after binding to ensure that they receive all the capability events. Hints to indicate to the compositor how to deal with a conflict between the dimensions of the surface and the dimensions of the output. The compositor is free to ignore this parameter. Present a surface on the given output. If the output is null, the compositor will present the surface on whatever display (or displays) it thinks best. In particular, this may replace any or all surfaces currently presented so it should not be used in combination with placing surfaces on specific outputs. The method parameter is a hint to the compositor for how the surface is to be presented. In particular, it tells the compositor how to handle a size mismatch between the presented surface and the output. The compositor is free to ignore this parameter. The "zoom", "zoom_crop", and "stretch" methods imply a scaling operation on the surface. This will override any kind of output scaling, so the buffer_scale property of the surface is effectively ignored. Presents a surface on the given output for a particular mode. If the current size of the output differs from that of the surface, the compositor will attempt to change the size of the output to match the surface. The result of the mode-switch operation will be returned via the provided wl_fullscreen_shell_mode_feedback object. If the current output mode matches the one requested or if the compositor successfully switches the mode to match the surface, then the mode_successful event will be sent and the output will contain the contents of the given surface. If the compositor cannot match the output size to the surface size, the mode_failed will be sent and the output will contain the contents of the previously presented surface (if any). If another surface is presented on the given output before either of these has a chance to happen, the present_cancelled event will be sent. Due to race conditions and other issues unknown to the client, no mode-switch operation is guaranteed to succeed. However, if the mode is one advertised by wl_output.mode or if the compositor advertises the ARBITRARY_MODES capability, then the client should expect that the mode-switch operation will usually succeed. If the size of the presented surface changes, the resulting output is undefined. The compositor may attempt to change the output mode to compensate. However, there is no guarantee that a suitable mode will be found and the client has no way to be notified of success or failure. The framerate parameter specifies the desired framerate for the output in mHz. The compositor is free to ignore this parameter. A value of 0 indicates that the client has no preference. If the value of wl_output.scale differs from wl_surface.buffer_scale, then the compositor may choose a mode that matches either the buffer size or the surface size. In either case, the surface will fill the output. These errors can be emitted in response to wl_fullscreen_shell requests This event indicates that the attempted mode switch operation was successful. A surface of the size requested in the mode switch will fill the output without scaling. Upon receiving this event, the client should destroy the wl_fullscreen_shell_mode_feedback object. This event indicates that the attempted mode switch operation failed. This may be because the requested output mode is not possible or it may mean that the compositor does not want to allow it. Upon receiving this event, the client should destroy the wl_fullscreen_shell_mode_feedback object. This event indicates that the attempted mode switch operation was cancelled. Most likely this is because the client requested a second mode switch before the first one completed. Upon receiving this event, the client should destroy the wl_fullscreen_shell_mode_feedback object. weston-1.9.0/protocol/presentation_timing.xml0000664000175000017500000003037712537627702016455 00000000000000 Copyright © 2013-2014 Collabora, Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The main feature of this interface is accurate presentation timing feedback to ensure smooth video playback while maintaining audio/video synchronization. Some features use the concept of a presentation clock, which is defined in presentation.clock_id event. Request 'feedback' can be regarded as an additional wl_surface method. It is part of the double-buffered surface state update mechanism, where other requests first set up the state and then wl_surface.commit atomically applies the state into use. In other words, wl_surface.commit submits a content update. When the final realized presentation time is available, e.g. after a framebuffer flip completes, the requested presentation_feedback.presented events are sent. The final presentation time can differ from the compositor's predicted display update time and the update's target time, especially when the compositor misses its target vertical blanking period. These fatal protocol errors may be emitted in response to illegal presentation requests. Informs the server that the client will not be using this protocol object anymore. This does not affect any existing objects created by this interface. Request presentation feedback for the current content submission on the given surface. This creates a new presentation_feedback object, which will deliver the feedback information once. If multiple presentation_feedback objects are created for the same submission, they will all deliver the same information. For details on what information is returned, see presentation_feedback interface. This event tells the client in which clock domain the compositor interprets the timestamps used by the presentation extension. This clock is called the presentation clock. The compositor sends this event when the client binds to the presentation interface. The presentation clock does not change during the lifetime of the client connection. The clock identifier is platform dependent. Clients must be able to query the current clock value directly, not by asking the compositor. On Linux/glibc, the identifier value is one of the clockid_t values accepted by clock_gettime(). clock_gettime() is defined by POSIX.1-2001. Compositors should prefer a clock which does not jump and is not slewed e.g. by NTP. The absolute value of the clock is irrelevant. Precision of one millisecond or better is recommended. Timestamps in this clock domain are expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples, each component being an unsigned 32-bit value. Whole seconds are in tv_sec which is a 64-bit value combined from tv_sec_hi and tv_sec_lo, and the additional fractional part in tv_nsec as nanoseconds. Hence, for valid timestamps tv_nsec must be in [0, 999999999]. Note that clock_id applies only to the presentation clock, and implies nothing about e.g. the timestamps used in the Wayland core protocol input events. A presentation_feedback object returns an indication that a wl_surface content update has become visible to the user. One object corresponds to one content update submission (wl_surface.commit). There are two possible outcomes: the content update is presented to the user, and a presentation timestamp delivered; or, the user did not see the content update because it was superseded or its surface destroyed, and the content update is discarded. Once a presentation_feedback object has delivered an 'presented' or 'discarded' event it is automatically destroyed. As presentation can be synchronized to only one output at a time, this event tells which output it was. This event is only sent prior to the presented event. As clients may bind to the same global wl_output multiple times, this event is sent for each bound instance that matches the synchronized output. If a client has not bound to the right wl_output global at all, this event is not sent. These flags provide information about how the presentation of the related content update was done. The intent is to help clients assess the reliability of the feedback and the visual quality with respect to possible tearing and timings. The flags are: VSYNC: The presentation was synchronized to the "vertical retrace" by the display hardware such that tearing does not happen. Relying on user space scheduling is not acceptable for this flag. If presentation is done by a copy to the active frontbuffer, then it must guarantee that tearing cannot happen. HW_CLOCK: The display hardware provided measurements that the hardware driver converted into a presentation timestamp. Sampling a clock in user space is not acceptable for this flag. HW_COMPLETION: The display hardware signalled that it started using the new image content. The opposite of this is e.g. a timer being used to guess when the display hardware has switched to the new image content. ZERO_COPY: The presentation of this update was done zero-copy. This means the buffer from the client was given to display hardware as is, without copying it. Compositing with OpenGL counts as copying, even if textured directly from the client buffer. Possible zero-copy cases include direct scanout of a fullscreen surface and a surface on a hardware overlay. The associated content update was displayed to the user at the indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of the timestamp, see presentation.clock_id event. The timestamp corresponds to the time when the content update turned into light the first time on the surface's main output. Compositors may approximate this from the framebuffer flip completion events from the system, and the latency of the physical display path if known. This event is preceded by all related sync_output events telling which output's refresh cycle the feedback corresponds to, i.e. the main output for the surface. Compositors are recommended to choose the output containing the largest part of the wl_surface, or keeping the output they previously chose. Having a stable presentation output association helps clients predict future output refreshes (vblank). Argument 'refresh' gives the compositor's prediction of how many nanoseconds after tv_sec, tv_nsec the very next output refresh may occur. This is to further aid clients in predicting future refreshes, i.e., estimating the timestamps targeting the next few vblanks. If such prediction cannot usefully be done, the argument is zero. The 64-bit value combined from seq_hi and seq_lo is the value of the output's vertical retrace counter when the content update was first scanned out to the display. This value must be compatible with the definition of MSC in GLX_OML_sync_control specification. Note, that if the display path has a non-zero latency, the time instant specified by this counter may differ from the timestamp's. If the output does not have a constant refresh rate, explicit video mode switches excluded, then the refresh argument must be zero. If the output does not have a concept of vertical retrace or a refresh cycle, or the output device is self-refreshing without a way to query the refresh count, then the arguments seq_hi and seq_lo must be zero. The content update was never displayed to the user. weston-1.9.0/protocol/scaler.xml0000664000175000017500000002176512537627702013645 00000000000000 Copyright © 2013-2014 Collabora, Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The global interface exposing surface cropping and scaling capabilities is used to instantiate an interface extension for a wl_surface object. This extended interface will then allow cropping and scaling the surface contents, effectively disconnecting the direct relationship between the buffer and the surface size. Informs the server that the client will not be using this protocol object anymore. This does not affect any other objects, wl_viewport objects included. Instantiate an interface extension for the given wl_surface to crop and scale its content. If the given wl_surface already has a wl_viewport object associated, the viewport_exists protocol error is raised. An additional interface to a wl_surface object, which allows the client to specify the cropping and scaling of the surface contents. This interface allows to define the source rectangle (src_x, src_y, src_width, src_height) from where to take the wl_buffer contents, and scale that to destination size (dst_width, dst_height). This state is double-buffered, and is applied on the next wl_surface.commit. The two parts of crop and scale state are independent: the source rectangle, and the destination size. Initially both are unset, that is, no scaling is applied. The whole of the current wl_buffer is used as the source, and the surface size is as defined in wl_surface.attach. If the destination size is set, it causes the surface size to become dst_width, dst_height. The source (rectangle) is scaled to exactly this size. This overrides whatever the attached wl_buffer size is, unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface has no content and therefore no size. Otherwise, the size is always at least 1x1 in surface coordinates. If the source rectangle is set, it defines what area of the wl_buffer is taken as the source. If the source rectangle is set and the destination size is not set, the surface size becomes the source rectangle size rounded up to the nearest integer. If the source size is already exactly integers, this results in cropping without scaling. The coordinate transformations from buffer pixel coordinates up to the surface-local coordinates happen in the following order: 1. buffer_transform (wl_surface.set_buffer_transform) 2. buffer_scale (wl_surface.set_buffer_scale) 3. crop and scale (wl_viewport.set*) This means, that the source rectangle coordinates of crop and scale are given in the coordinates after the buffer transform and scale, i.e. in the coordinates that would be the surface-local coordinates if the crop and scale was not applied. If the source rectangle is partially or completely outside of the wl_buffer, then the surface contents are undefined (not void), and the surface size is still dst_width, dst_height. The x, y arguments of wl_surface.attach are applied as normal to the surface. They indicate how many pixels to remove from the surface size from the left and the top. In other words, they are still in the surface-local coordinate system, just like dst_width and dst_height are. If the wl_surface associated with the wl_viewport is destroyed, the wl_viewport object becomes inert. If the wl_viewport object is destroyed, the crop and scale state is removed from the wl_surface. The change will be applied on the next wl_surface.commit. The associated wl_surface's crop and scale state is removed. The change is applied on the next wl_surface.commit. Set both source rectangle and destination size of the associated wl_surface. See wl_viewport for the description, and relation to the wl_buffer size. The bad_value protocol error is raised if src_width or src_height is negative, or if dst_width or dst_height is not positive. The crop and scale state is double-buffered state, and will be applied on the next wl_surface.commit. Arguments dst_x and dst_y do not exist here, use the x and y arguments to wl_surface.attach. The x, y, dst_width, and dst_height define the surface-local coordinate system irrespective of the attached wl_buffer size. Set the source rectangle of the associated wl_surface. See wl_viewport for the description, and relation to the wl_buffer size. If width is -1.0 and height is -1.0, the source rectangle is unset instead. Any other pair of values for width and height that contains zero or negative values raises the bad_value protocol error. The crop and scale state is double-buffered state, and will be applied on the next wl_surface.commit. Set the destination size of the associated wl_surface. See wl_viewport for the description, and relation to the wl_buffer size. If width is -1 and height is -1, the destination size is unset instead. Any other pair of values for width and height that contains zero or negative values raises the bad_value protocol error. The crop and scale state is double-buffered state, and will be applied on the next wl_surface.commit. Arguments x and y do not exist here, use the x and y arguments to wl_surface.attach. The x, y, width, and height define the surface-local coordinate system irrespective of the attached wl_buffer size. weston-1.9.0/protocol/text.xml0000664000175000017500000003736112537647766013373 00000000000000 Copyright © 2012, 2013 Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. An object used for text input. Adds support for text input and input methods to applications. A text-input object is created from a wl_text_input_manager and corresponds typically to a text entry in an application. Requests are used to activate/deactivate the text-input object and set state information like surrounding and selected text or the content type. The information about entered text is sent to the text-input object via the pre-edit and commit events. Using this interface removes the need for applications to directly process hardware key events and compose text out of them. Text is generally UTF-8 encoded, indices and lengths are in bytes. Serials are used to synchronize the state between the text input and an input method. New serials are sent by the text input in the commit_state request and are used by the input method to indicate the known text input state in events like preedit_string, commit_string, and keysym. The text input can then ignore events from the input method which are based on an outdated state (for example after a reset). Requests the text-input object to be activated (typically when the text entry gets focus). The seat argument is a wl_seat which maintains the focus for this activation. The surface argument is a wl_surface assigned to the text-input object and tracked for focus lost. The enter event is emitted on successful activation. Requests the text-input object to be deactivated (typically when the text entry lost focus). The seat argument is a wl_seat which was used for activation. Requests input panels (virtual keyboard) to show. Requests input panels (virtual keyboard) to hide. Should be called by an editor widget when the input state should be reset, for example after the text was changed outside of the normal input method flow. Sets the plain surrounding text around the input position. Text is UTF-8 encoded. Cursor is the byte offset within the surrounding text. Anchor is the byte offset of the selection anchor within the surrounding text. If there is no selected text anchor is the same as cursor. Content hint is a bitmask to allow to modify the behavior of the text input. The content purpose allows to specify the primary purpose of a text input. This allows an input method to show special purpose input panels with extra characters or to disallow some characters. Sets the content purpose and content hint. While the purpose is the basic purpose of an input field, the hint flags allow to modify some of the behavior. When no content type is explicitly set, a normal content purpose with default hints (auto completion, auto correction, auto capitalization) should be assumed. Sets a specific language. This allows for example a virtual keyboard to show a language specific layout. The "language" argument is a RFC-3066 format language tag. It could be used for example in a word processor to indicate language of currently edited document or in an instant message application which tracks languages of contacts. Notify the text-input object when it received focus. Typically in response to an activate request. Notify the text-input object when it lost focus. Either in response to a deactivate request or when the assigned surface lost focus or was destroyed. Transfer an array of 0-terminated modifiers names. The position in the array is the index of the modifier as used in the modifiers bitmask in the keysym event. Notify when the visibility state of the input panel changed. Notify when a new composing text (pre-edit) should be set around the current cursor position. Any previously set composing text should be removed. The commit text can be used to replace the preedit text on reset (for example on unfocus). The text input should also handle all preedit_style and preedit_cursor events occurring directly before preedit_string. Sets styling information on composing text. The style is applied for length bytes from index relative to the beginning of the composing text (as byte offset). Multiple styles can be applied to a composing text by sending multiple preedit_styling events. This event is handled as part of a following preedit_string event. Sets the cursor position inside the composing text (as byte offset) relative to the start of the composing text. When index is a negative number no cursor is shown. This event is handled as part of a following preedit_string event. Notify when text should be inserted into the editor widget. The text to commit could be either just a single character after a key press or the result of some composing (pre-edit). It could be also an empty text when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position). Any previously set composing text should be removed. Notify when the cursor or anchor position should be modified. This event should be handled as part of a following commit_string event. Notify when the text around the current cursor position should be deleted. Index is relative to the current cursor (in bytes). Length is the length of deleted text (in bytes). This event should be handled as part of a following commit_string event. Notify when a key event was sent. Key events should not be used for normal text input operations, which should be done with commit_string, delete_surrounding_text, etc. The key event follows the wl_keyboard key event convention. Sym is a XKB keysym, state a wl_keyboard key_state. Modifiers are a mask for effective modifiers (where the modifier indices are set by the modifiers_map event) Sets the language of the input text. The "language" argument is a RFC-3066 format language tag. Sets the text direction of input text. It is mainly needed for showing input cursor on correct side of the editor when there is no input yet done and making sure neutral direction text is laid out properly. A factory for text-input objects. This object is a global singleton. Creates a new text-input object. weston-1.9.0/protocol/input-method.xml0000664000175000017500000003000312537627702014772 00000000000000 Copyright © 2012, 2013 Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Corresponds to a text input on input method side. An input method context is created on text input activation on the input method side. It allows to receive information about the text input from the application via events. Input method contexts do not keep state after deactivation and should be destroyed after deactivation is handled. Text is generally UTF-8 encoded, indices and lengths are in bytes. Serials are used to synchronize the state between the text input and an input method. New serials are sent by the text input in the commit_state request and are used by the input method to indicate the known text input state in events like preedit_string, commit_string, and keysym. The text input can then ignore events from the input method which are based on an outdated state (for example after a reset). Send the commit string text for insertion to the application. The text to commit could be either just a single character after a key press or the result of some composing (pre-edit). It could be also an empty text when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position). Any previously set composing text will be removed. Send the pre-edit string text to the application text input. The commit text can be used to replace the preedit text on reset (for example on unfocus). Also previously sent preedit_style and preedit_cursor requests are processed bt the text_input also. Sets styling information on composing text. The style is applied for length in bytes from index relative to the beginning of the composing text (as byte offset). Multiple styles can be applied to a composing text. This request should be sent before sending preedit_string request. Sets the cursor position inside the composing text (as byte offset) relative to the start of the composing text. When index is negative no cursor should be displayed. This request should be sent before sending preedit_string request. This request will be handled on text_input side as part of a directly following commit_string request. Sets the cursor and anchor to a new position. Index is the new cursor position in bytes (when >= 0 relative to the end of inserted text else relative to beginning of inserted text). Anchor is the new anchor position in bytes (when >= 0 relative to the end of inserted text, else relative to beginning of inserted text). When there should be no selected text anchor should be the same as index. This request will be handled on text_input side as part of a directly following commit_string request. Notify when a key event was sent. Key events should not be used for normal text input operations, which should be done with commit_string, delete_surrounfing_text, etc. The key event follows the wl_keyboard key event convention. Sym is a XKB keysym, state a wl_keyboard key_state. Allows an input method to receive hardware keyboard input and process key events to generate text events (with pre-edit) over the wire. This allows input methods which compose multiple key events for inputting text like it is done for CJK languages. Should be used when filtering key events with grab_keyboard. When the wl_keyboard::key event is not processed by the input method itself and should be sent to the client instead, forward it with this request. The arguments should be the ones from the wl_keyboard::key event. For generating custom key events use the keysym request instead. Should be used when filtering key events with grab_keyboard. When the wl_keyboard::modifiers event should be also send to the client, forward it with this request. The arguments should be the ones from the wl_keyboard::modifiers event. The plain surrounding text around the input position. Cursor is the position in bytes within the surrounding text relative to the beginning of the text. Anchor is the position in bytes of the selection anchor within the surrounding text relative to the beginning of the text. If there is no selected text anchor is the same as cursor. An input method object is responsible to compose text in response to input from hardware or virtual keyboards. There is one input method object per seat. On activate there is a new input method context object created which allows the input method to communicate with the text input. A text input was activated. Creates an input method context object which allows communication with the text input. The text input corresponding to the context argument was deactivated. The input method context should be destroyed after deactivation is handled. Only one client can bind this interface at a time. A keyboard surface is only shown when a text input is active. An overlay panel is shown near the input cursor above the application window when a text input is active. weston-1.9.0/protocol/ivi-application.xml0000664000175000017500000001072412537627702015455 00000000000000 Copyright (C) 2013 DENSO CORPORATION Copyright (c) 2013 BMW Car IT GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. This removes link from ivi_id to wl_surface and destroys ivi_surface. The ID, ivi_id, is free and can be used for surface_create again. The configure event asks the client to resize its surface. The size is a hint, in the sense that the client is free to ignore it if it doesn't resize, pick a smaller size (to satisfy aspect ratio or resize in steps of NxM pixels). The client is free to dismiss all but the last configure event it received. The width and height arguments specify the size of the window in surface local coordinates. This interface is exposed as a global singleton. This interface is implemented by servers that provide IVI-style user interfaces. It allows clients to associate a ivi_surface with wl_surface. This request gives the wl_surface the role of an IVI Surface. Creating more than one ivi_surface for a wl_surface is not allowed. Note, that this still allows the following example: 1. create a wl_surface 2. create ivi_surface for the wl_surface 3. destroy the ivi_surface 4. create ivi_surface for the wl_surface (with the same or another ivi_id as before) surface_create will create a interface:ivi_surface with numeric ID; ivi_id in ivi compositor. These ivi_ids are defined as unique in the system to identify it inside of ivi compositor. The ivi compositor implements business logic how to set properties of the surface with ivi_id according to status of the system. E.g. a unique ID for Car Navigation application is used for implementing special logic of the application about where it shall be located. The server regards following cases as protocol errors and disconnects the client. - wl_surface already has an nother role. - ivi_id is already assigned to an another wl_surface. If client destroys ivi_surface or wl_surface which is assigne to the ivi_surface, ivi_id which is assigned to the ivi_surface is free for reuse. weston-1.9.0/protocol/weston-test.xml0000664000175000017500000001162612537627702014663 00000000000000 Copyright © 2012 Intel Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Internal testing facilities for the weston compositor. It can't be stressed enough that these should never ever be used outside of running weston's tests. The weston-test.so module should never be installed. These requests may allow clients to do very bad things. Records an image of what is currently displayed on a given display output, returning the image as an event. The capture_screenshot_done signal is sent when a screenshot has been copied into the provided buffer. This is a global singleton interface for Weston internal tests. This interface allows a test client to trigger compositor-side test procedures. This is useful for cases, where the actual tests are in compositor plugins, but they also require the presence of a particular client. This interface is implemented by the compositor plugins containing the testing code. A test client starts a test with the "run" request. It must not send another "run" request until receiving the "finished" event. If the compositor-side test succeeds, the "finished" event is sent. If the compositor-side test fails, the compositor should send the protocol error "test_failed", but it may also exit with an error (e.g. SEGV). Unknown test name will raise "unknown_test" protocol error. weston-1.9.0/protocol/text-cursor-position.xml0000664000175000017500000000045412456345006016517 00000000000000 weston-1.9.0/protocol/workspaces.xml0000664000175000017500000000143112456345006014533 00000000000000 An interface for managing surfaces in workspaces. Move the given surface to the specified workspace. The current workspace state, such as current workspace and workspace count, has changed. weston-1.9.0/protocol/linux-dmabuf.xml0000664000175000017500000003050212563431500014740 00000000000000 Copyright © 2014, 2015 Collabora, Ltd. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Following the interfaces from: https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt and the Linux DRM sub-system's AddFb2 ioctl. This interface offers a way to create generic dmabuf-based wl_buffers. Immediately after a client binds to this interface, the set of supported formats is sent with 'format' events. The following are required from clients: - Clients must ensure that either all data in the dma-buf is coherent for all subsequent read access or that coherency is correctly handled by the underlying kernel-side dma-buf implementation. - Don't make any more attachments after sending the buffer to the compositor. Making more attachments later increases the risk of the compositor not being able to use (re-import) an existing dmabuf-based wl_buffer. The underlying graphics stack must ensure the following: - The dmabuf file descriptors relayed to the server will stay valid for the whole lifetime of the wl_buffer. This means the server may at any time use those fds to import the dmabuf into any kernel sub-system that might accept it. To create a wl_buffer from one or more dmabufs, a client creates a zlinux_dmabuf_params object with zlinux_dmabuf.create_params request. All planes required by the intended format are added with the 'add' request. Finally, 'create' request is issued. The server will reply with either 'created' event which provides the final wl_buffer or 'failed' event saying that it cannot use the dmabufs provided. Objects created through this interface, especially wl_buffers, will remain valid. This temporary object is used to collect multiple dmabuf handles into a single batch to create a wl_buffer. It can only be used once and should be destroyed after an 'created' or 'failed' event has been received. This event advertises one buffer format that the server supports. All the supported formats are advertised once when the client binds to this interface. A roundtrip after binding guarantees, that the client has received all supported formats. For the definition of the format codes, see create request. XXX: Can a compositor ever enumerate them? This temporary object is a collection of dmabufs and other parameters that together form a single logical buffer. The temporary object may eventually create one wl_buffer unless cancelled by destroying it before requesting 'create'. Single-planar formats only require one dmabuf, however multi-planar formats may require more than one dmabuf. For all formats, 'add' request must be called once per plane (even if the underlying dmabuf fd is identical). You must use consecutive plane indices ('plane_idx' argument for 'add') from zero to the number of planes used by the drm_fourcc format code. All planes required by the format must be given exactly once, but can be given in any order. Each plane index can be set only once. Cleans up the temporary data sent to the server for dmabuf-based wl_buffer creation. This request adds one dmabuf to the set in this zlinux_buffer_params. The 64-bit unsigned value combined from modifier_hi and modifier_lo is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the fb modifier, which is defined in drm_mode.h of Linux UAPI. This is an opaque token. Drivers use this token to express tiling, compression, etc. driver-specific modifications to the base format defined by the DRM fourcc code. This request raises the PLANE_IDX error if plane_idx is too large. The error PLANE_SET is raised if attempting to set a plane that was already set. This asks for creation of a wl_buffer from the added dmabuf buffers. The wl_buffer is not created immediately but returned via the 'created' event if the dmabuf sharing succeeds. The sharing may fail at runtime for reasons a client cannot predict, in which case the 'failed' event is triggered. The 'format' argument is a DRM_FORMAT code, as defined by the libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the authoritative source on how the format codes should work. The 'flags' is a bitfield of the flags defined in enum "flags". 'y_invert' means the that the image needs to be y-flipped. Flag 'interlaced' means that the frame in the buffer is not progressive as usual, but interlaced. An interlaced buffer as supported here must always contain both top and bottom fields. The top field always begins on the first pixel row. The temporal ordering between the two fields is top field first, unless 'bottom_first' is specified. It is undefined whether 'bottom_first' is ignored if 'interlaced' is not set. This protocol does not convey any information about field rate, duration, or timing, other than the relative ordering between the two fields in one buffer. A compositor may have to estimate the intended field rate from the incoming buffer rate. It is undefined whether the time of receiving wl_surface.commit with a new buffer attached, applying the wl_surface state, wl_surface.frame callback trigger, presentation, or any other point in the compositor cycle is used to measure the frame or field times. There is no support for detecting missed or late frames/fields/buffers either, and there is no support whatsoever for cooperating with interlaced compositor output. The composited image quality resulting from the use of interlaced buffers is explicitly undefined. A compositor may use elaborate hardware features or software to deinterlace and create progressive output frames from a sequence of interlaced input buffers, or it may produce substandard image quality. However, compositors that cannot guarantee reasonable image quality in all cases are recommended to just reject all interlaced buffers. Any argument errors, including non-positive width or height, mismatch between the number of planes and the format, bad format, bad offset or stride, may be indicated by fatal protocol errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS. Dmabuf import errors in the server that are not obvious client bugs are returned via the 'failed' event as non-fatal. This allows attempting dmabuf sharing and falling back in the client if it fails. This request can be sent only once in the object's lifetime, after which the only legal request is destroy. This object should be destroyed after issuing 'create' request. Attempting to use this object after issuing 'create' raises ALREADY_USED protocol error. It is not mandatory to issue 'create'. If a client wants to cancel the buffer creation, it can just destroy this object. This event indicates that the attempted buffer creation was successful. It provides the new wl_buffer referencing the dmabuf(s). Upon receiving this event, the client should destroy the zlinux_dmabuf_params object. This event indicates that the attempted buffer creation has failed. It usually means that one of the dmabuf constraints has not been fulfilled. Upon receiving this event, the client should destroy the zlinux_buffer_params object. weston-1.9.0/doc/0000775000175000017500000000000012600133270010602 500000000000000weston-1.9.0/doc/doxygen/0000775000175000017500000000000012600133270012257 500000000000000weston-1.9.0/doc/doxygen/tools.doxygen.in0000664000175000017500000000062012552265076015361 00000000000000PROJECT_NAME = "Tools" OUTPUT_DIRECTORY = @top_builddir@/docs/tools JAVADOC_AUTOBRIEF = YES OPTIMIZE_OUTPUT_FOR_C = YES INPUT = \ @top_srcdir@/doc/doxygen/tools.dox \ @top_srcdir@/tools/zunitc/doc/zunitc.dox \ @top_srcdir@/tools/zunitc/inc/zunitc/zunitc.h GENERATE_LATEX = NO DOTFILE_DIRS = @top_srcdir@/doc/doxygen weston-1.9.0/doc/doxygen/tooldev.doxygen.in0000664000175000017500000000062212552265076015677 00000000000000PROJECT_NAME = "Tool Internals" OUTPUT_DIRECTORY = @top_builddir@/docs/developer JAVADOC_AUTOBRIEF = YES OPTIMIZE_OUTPUT_FOR_C = YES EXTRACT_ALL = YES INPUT = \ @top_srcdir@/doc/doxygen/devtools.dox \ @top_srcdir@/tools/zunitc RECURSIVE = YES GENERATE_LATEX = NO DOTFILE_DIRS = @top_srcdir@/doc/doxygen weston-1.9.0/weston.ini.in0000664000175000017500000000274012543150037012413 00000000000000[core] #modules=xwayland.so,cms-colord.so #shell=desktop-shell.so #gbm-format=xrgb2101010 [shell] background-image=/usr/share/backgrounds/gnome/Aqua.jpg background-color=0xff002244 background-type=tile panel-color=0x90ff0000 locking=true animation=zoom startup-animation=fade #binding-modifier=ctrl #num-workspaces=6 #cursor-theme=whiteglass #cursor-size=24 #lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png #lockscreen=/usr/share/backgrounds/gnome/Garden.jpg #homescreen=/usr/share/backgrounds/gnome/Blinds.jpg #animation=fade [launcher] icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png path=/usr/bin/gnome-terminal [launcher] icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png path=@bindir@/weston-terminal [launcher] icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png path=/usr/bin/google-chrome [launcher] icon=/usr/share/icons/gnome/24x24/apps/arts.png path=@abs_top_builddir@/weston-flower [input-method] path=@libexecdir@/weston-keyboard #[output] #name=LVDS1 #mode=1680x1050 #transform=90 #icc_profile=/usr/share/color/icc/colord/Bluish.icc #[output] #name=VGA1 #mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync #transform=flipped #[output] #name=X1 #mode=1024x768 #transform=flipped-90 #[libinput] #enable_tap=true #[touchpad] #constant_accel_factor = 50 #min_accel_factor = 0.16 #max_accel_factor = 1.0 [screen-share] command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize weston-1.9.0/build-aux/0000775000175000017500000000000012600133270011727 500000000000000weston-1.9.0/build-aux/config.sub0000755000175000017500000010535412563437576013670 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-08-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: weston-1.9.0/build-aux/compile0000755000175000017500000001624512563437576013263 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: weston-1.9.0/build-aux/install-sh0000755000175000017500000003325512563437576013711 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: weston-1.9.0/build-aux/config.guess0000755000175000017500000013036112563437576014221 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: weston-1.9.0/build-aux/depcomp0000755000175000017500000005601612563437576013262 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: weston-1.9.0/build-aux/missing0000755000175000017500000001533012563437576013276 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: weston-1.9.0/build-aux/ltmain.sh0000644000175000017500000105204412563437574013521 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 weston-1.9.0/build-aux/test-driver0000755000175000017500000001027712563437576014102 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: weston-1.9.0/ivi-shell/0000775000175000017500000000000012600133270011731 500000000000000weston-1.9.0/ivi-shell/hmi-controller.c0000664000175000017500000014545312575610240014777 00000000000000/* * Copyright (C) 2014 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * A reference implementation how to use ivi-layout APIs in order to manage * layout of ivi_surfaces/ivi_layers. Layout change is triggered by * ivi-hmi-controller protocol, ivi-hmi-controller.xml. A reference how to * use the protocol, see hmi-controller-homescreen. * * In-Vehicle Infotainment system usually manage properties of * ivi_surfaces/ivi_layers by only a central component which decide where * ivi_surfaces/ivi_layers shall be. This reference show examples to * implement the central component as a module of weston. * * Default Scene graph of UI is defined in hmi_controller_create. It * consists of * - In the bottom, a base ivi_layer to group ivi_surfaces of background, * panel, and buttons * - Next, a application ivi_layer to show application ivi_surfaces. * - Workspace background ivi_layer to show a ivi_surface of background image. * - Workspace ivi_layer to show launcher to launch application with icons. * Paths to binary and icon are defined in weston.ini. The width of this * ivi_layer is longer than the size of ivi_screen because a workspace has * several pages and is controlled by motion of input. * * TODO: animation method shall be refined * TODO: support fade-in when UI is ready */ #include #include #include #include #include #include #include #include #include "ivi-layout-export.h" #include "ivi-hmi-controller-server-protocol.h" #include "shared/helpers.h" /***************************************************************************** * structure, globals ****************************************************************************/ struct hmi_controller_layer { struct ivi_layout_layer *ivilayer; uint32_t id_layer; int32_t x; int32_t y; int32_t width; int32_t height; }; struct link_layer { struct ivi_layout_layer *layout_layer; struct wl_list link; }; struct hmi_controller_fade { uint32_t is_fade_in; struct wl_list layer_list; }; struct hmi_server_setting { uint32_t base_layer_id; uint32_t application_layer_id; uint32_t workspace_background_layer_id; uint32_t workspace_layer_id; int32_t panel_height; uint32_t transition_duration; char *ivi_homescreen; }; struct ui_setting { uint32_t background_id; uint32_t panel_id; uint32_t tiling_id; uint32_t sidebyside_id; uint32_t fullscreen_id; uint32_t random_id; uint32_t home_id; uint32_t workspace_background_id; }; struct hmi_controller { struct hmi_server_setting *hmi_setting; struct hmi_controller_layer base_layer; struct hmi_controller_layer application_layer; struct hmi_controller_layer workspace_background_layer; struct hmi_controller_layer workspace_layer; enum ivi_hmi_controller_layout_mode layout_mode; struct hmi_controller_fade workspace_fade; int32_t workspace_count; struct wl_array ui_widgets; int32_t is_initialized; struct weston_compositor *compositor; struct wl_listener destroy_listener; struct wl_client *user_interface; struct ui_setting ui_setting; }; struct launcher_info { uint32_t surface_id; uint32_t workspace_id; int32_t index; }; const struct ivi_controller_interface *ivi_controller_interface; int controller_module_init(struct weston_compositor *ec, int *argc, char *argv[], const struct ivi_controller_interface *interface, size_t interface_version); /***************************************************************************** * local functions ****************************************************************************/ static void * fail_on_null(void *p, size_t size, char *file, int32_t line) { if (size && !p) { weston_log("%s(%d) %zd: out of memory\n", file, line, size); exit(EXIT_FAILURE); } return p; } static void * mem_alloc(size_t size, char *file, int32_t line) { return fail_on_null(calloc(1, size), size, file, line); } #define MEM_ALLOC(s) mem_alloc((s),__FILE__,__LINE__) static int32_t is_surf_in_ui_widget(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface *ivisurf) { uint32_t id = ivi_controller_interface->get_id_of_surface(ivisurf); uint32_t *ui_widget_id = NULL; wl_array_for_each(ui_widget_id, &hmi_ctrl->ui_widgets) { if (*ui_widget_id == id) return 1; } return 0; } static int compare_launcher_info(const void *lhs, const void *rhs) { const struct launcher_info *left = lhs; const struct launcher_info *right = rhs; if (left->workspace_id < right->workspace_id) return -1; if (left->workspace_id > right->workspace_id) return 1; if (left->index < right->index) return -1; if (left->index > right->index) return 1; return 0; } /** * Internal methods called by mainly ivi_hmi_controller_switch_mode * This reference shows 4 examples how to use ivi_layout APIs. */ static void mode_divided_into_tiling(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, struct hmi_controller_layer *layer) { const float surface_width = (float)layer->width * 0.25; const float surface_height = (float)layer->height * 0.5; int32_t surface_x = 0; int32_t surface_y = 0; struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface **surfaces; struct ivi_layout_surface **new_order; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; int32_t surf_num = 0; uint32_t num = 1; surfaces = MEM_ALLOC(sizeof(*surfaces) * surface_length); new_order = MEM_ALLOC(sizeof(*surfaces) * surface_length); for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; /* skip ui widgets */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; surfaces[surf_num++] = ivisurf; } for (i = 0; i < surf_num; i++) { ivisurf = surfaces[i]; new_order[i] = ivisurf; if (num <= 8) { if (num < 5) { surface_x = (int32_t)((num - 1) * (surface_width)); surface_y = 0; } else { surface_x = (int32_t)((num - 5) * (surface_width)); surface_y = (int32_t)surface_height; } ivi_controller_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_controller_interface->surface_set_visibility(ivisurf, true); ivi_controller_interface->surface_set_destination_rectangle(ivisurf, surface_x, surface_y, (int32_t)surface_width, (int32_t)surface_height); num++; continue; } ivi_controller_interface->surface_set_visibility(ivisurf, false); } if (surf_num > 0) { ivi_controller_interface->layer_set_transition(layer->ivilayer, IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, duration); } free(surfaces); free(new_order); } static void mode_divided_into_sidebyside(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, struct hmi_controller_layer *layer) { int32_t surface_width = layer->width / 2; int32_t surface_height = layer->height; struct ivi_layout_surface *ivisurf = NULL; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; int32_t num = 1; for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; /* skip ui widgets */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; if (num == 1) { ivi_controller_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_controller_interface->surface_set_visibility(ivisurf, true); ivi_controller_interface->surface_set_destination_rectangle(ivisurf, 0, 0, surface_width, surface_height); num++; continue; } else if (num == 2) { ivi_controller_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_controller_interface->surface_set_visibility(ivisurf, true); ivi_controller_interface->surface_set_destination_rectangle(ivisurf, surface_width, 0, surface_width, surface_height); num++; continue; } ivi_controller_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, duration); ivi_controller_interface->surface_set_visibility(ivisurf, false); } } static void mode_fullscreen_someone(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, struct hmi_controller_layer *layer) { const int32_t surface_width = layer->width; const int32_t surface_height = layer->height; struct ivi_layout_surface *ivisurf = NULL; int32_t i = 0; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; /* skip ui widgets */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; ivi_controller_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_controller_interface->surface_set_visibility(ivisurf, true); ivi_controller_interface->surface_set_destination_rectangle(ivisurf, 0, 0, surface_width, surface_height); } } static void mode_random_replace(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length, struct hmi_controller_layer *layer) { const int32_t surface_width = (int32_t)(layer->width * 0.25f); const int32_t surface_height = (int32_t)(layer->height * 0.25f); int32_t surface_x = 0; int32_t surface_y = 0; struct ivi_layout_surface *ivisurf = NULL; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; int32_t i = 0; for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; /* skip ui widgets */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; ivi_controller_interface->surface_set_transition(ivisurf, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, duration); ivi_controller_interface->surface_set_visibility(ivisurf, true); surface_x = rand() % (layer->width - surface_width); surface_y = rand() % (layer->height - surface_height); ivi_controller_interface->surface_set_destination_rectangle(ivisurf, surface_x, surface_y, surface_width, surface_height); } } static int32_t has_application_surface(struct hmi_controller *hmi_ctrl, struct ivi_layout_surface **pp_surface, int32_t surface_length) { struct ivi_layout_surface *ivisurf = NULL; int32_t i = 0; for (i = 0; i < surface_length; i++) { ivisurf = pp_surface[i]; /* skip ui widgets */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) continue; return 1; } return 0; } /** * Supports 4 example to layout of application ivi_surfaces; * tiling, side by side, fullscreen, and random. */ static void switch_mode(struct hmi_controller *hmi_ctrl, enum ivi_hmi_controller_layout_mode layout_mode) { struct hmi_controller_layer *layer = &hmi_ctrl->application_layer; struct ivi_layout_surface **pp_surface = NULL; int32_t surface_length = 0; int32_t ret = 0; if (!hmi_ctrl->is_initialized) return; hmi_ctrl->layout_mode = layout_mode; ret = ivi_controller_interface->get_surfaces(&surface_length, &pp_surface); assert(!ret); if (!has_application_surface(hmi_ctrl, pp_surface, surface_length)) { free(pp_surface); pp_surface = NULL; return; } switch (layout_mode) { case IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING: mode_divided_into_tiling(hmi_ctrl, pp_surface, surface_length, layer); break; case IVI_HMI_CONTROLLER_LAYOUT_MODE_SIDE_BY_SIDE: mode_divided_into_sidebyside(hmi_ctrl, pp_surface, surface_length, layer); break; case IVI_HMI_CONTROLLER_LAYOUT_MODE_FULL_SCREEN: mode_fullscreen_someone(hmi_ctrl, pp_surface, surface_length, layer); break; case IVI_HMI_CONTROLLER_LAYOUT_MODE_RANDOM: mode_random_replace(hmi_ctrl, pp_surface, surface_length, layer); break; } ivi_controller_interface->commit_changes(); free(pp_surface); } /** * Internal method for transition */ static void hmi_controller_fade_run(struct hmi_controller *hmi_ctrl, uint32_t is_fade_in, struct hmi_controller_fade *fade) { double tint = is_fade_in ? 1.0 : 0.0; struct link_layer *linklayer = NULL; const uint32_t duration = hmi_ctrl->hmi_setting->transition_duration; fade->is_fade_in = is_fade_in; wl_list_for_each(linklayer, &fade->layer_list, link) { ivi_controller_interface->layer_set_transition(linklayer->layout_layer, IVI_LAYOUT_TRANSITION_LAYER_FADE, duration); ivi_controller_interface->layer_set_fade_info(linklayer->layout_layer, is_fade_in, 1.0 - tint, tint); } } /** * Internal method to create ivi_layer with hmi_controller_layer and * add to a ivi_screen */ static void create_layer(struct ivi_layout_screen *iviscrn, struct hmi_controller_layer *layer) { int32_t ret = 0; layer->ivilayer = ivi_controller_interface->layer_create_with_dimension(layer->id_layer, layer->width, layer->height); assert(layer->ivilayer != NULL); ret = ivi_controller_interface->screen_add_layer(iviscrn, layer->ivilayer); assert(!ret); ret = ivi_controller_interface->layer_set_destination_rectangle(layer->ivilayer, layer->x, layer->y, layer->width, layer->height); assert(!ret); ret = ivi_controller_interface->layer_set_visibility(layer->ivilayer, true); assert(!ret); } /** * Internal set notification */ static void set_notification_create_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; struct ivi_layout_layer *application_layer = hmi_ctrl->application_layer.ivilayer; int32_t ret = 0; /* skip ui widgets */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) return; ret = ivi_controller_interface->layer_add_surface(application_layer, ivisurf); assert(!ret); } static void set_notification_remove_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; switch_mode(hmi_ctrl, hmi_ctrl->layout_mode); } static void set_notification_configure_surface(struct ivi_layout_surface *ivisurf, void *userdata) { struct hmi_controller *hmi_ctrl = userdata; struct ivi_layout_layer *application_layer = hmi_ctrl->application_layer.ivilayer; struct weston_surface *surface; struct ivi_layout_surface **ivisurfs; int32_t length = 0; int32_t i; /* return if the surface is not application content */ if (is_surf_in_ui_widget(hmi_ctrl, ivisurf)) { return; } /* * if application changes size of wl_buffer. The source rectangle shall be * fit to the size. */ surface = ivi_controller_interface->surface_get_weston_surface(ivisurf); if (surface) { ivi_controller_interface->surface_set_source_rectangle( ivisurf, 0, 0, surface->width, surface->height); } /* * search if the surface is already added to layer. * If not yet, it is newly invoded application to go to switch_mode. */ ivi_controller_interface->get_surfaces_on_layer(application_layer, &length, &ivisurfs); for (i = 0; i < length; i++) { if (ivisurf == ivisurfs[i]) { /* * if it is non new invoked application, just call * commit_changes to apply source_rectangle. */ ivi_controller_interface->commit_changes(); return; } } switch_mode(hmi_ctrl, hmi_ctrl->layout_mode); } /** * A hmi_controller used 4 ivi_layers to manage ivi_surfaces. The IDs of * corresponding ivi_layer are defined in weston.ini. Default scene graph * of ivi_layers are initialized in hmi_controller_create */ static struct hmi_server_setting * hmi_server_setting_create(struct weston_compositor *ec) { struct hmi_server_setting *setting = MEM_ALLOC(sizeof(*setting)); struct weston_config *config = ec->config; struct weston_config_section *shell_section = NULL; shell_section = weston_config_get_section(config, "ivi-shell", NULL, NULL); weston_config_section_get_uint(shell_section, "base-layer-id", &setting->base_layer_id, 1000); weston_config_section_get_uint(shell_section, "workspace-background-layer-id", &setting->workspace_background_layer_id, 2000); weston_config_section_get_uint(shell_section, "workspace-layer-id", &setting->workspace_layer_id, 3000); weston_config_section_get_uint(shell_section, "application-layer-id", &setting->application_layer_id, 4000); weston_config_section_get_uint(shell_section, "transition-duration", &setting->transition_duration, 300); setting->panel_height = 70; weston_config_section_get_string(shell_section, "ivi-shell-user-interface", &setting->ivi_homescreen, NULL); return setting; } static void hmi_controller_destroy(struct wl_listener *listener, void *data) { struct link_layer *link = NULL; struct link_layer *next = NULL; struct hmi_controller *hmi_ctrl = container_of(listener, struct hmi_controller, destroy_listener); wl_list_for_each_safe(link, next, &hmi_ctrl->workspace_fade.layer_list, link) { wl_list_remove(&link->link); free(link); } wl_array_release(&hmi_ctrl->ui_widgets); free(hmi_ctrl->hmi_setting); free(hmi_ctrl); } /** * This is a starting method called from module_init. * This sets up scene graph of ivi_layers; base, application, workspace * background, and workspace. These ivi_layers are created/added to * ivi_screen in create_layer * * base: to group ivi_surfaces of panel and background * application: to group ivi_surfaces of ivi_applications * workspace background: to group a ivi_surface of background in workspace * workspace: to group ivi_surfaces for launching ivi_applications * * ivi_layers of workspace background and workspace is set to invisible at * first. The properties of it is updated with animation when * ivi_hmi_controller_home is requested. */ static struct hmi_controller * hmi_controller_create(struct weston_compositor *ec) { struct ivi_layout_screen **pp_screen = NULL; struct ivi_layout_screen *iviscrn = NULL; int32_t screen_length = 0; int32_t screen_width = 0; int32_t screen_height = 0; struct link_layer *tmp_link_layer = NULL; int32_t panel_height = 0; struct hmi_controller *hmi_ctrl = MEM_ALLOC(sizeof(*hmi_ctrl)); wl_array_init(&hmi_ctrl->ui_widgets); hmi_ctrl->layout_mode = IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING; hmi_ctrl->hmi_setting = hmi_server_setting_create(ec); hmi_ctrl->compositor = ec; ivi_controller_interface->get_screens(&screen_length, &pp_screen); iviscrn = pp_screen[0]; ivi_controller_interface->get_screen_resolution(iviscrn, &screen_width, &screen_height); /* init base ivi_layer*/ hmi_ctrl->base_layer.x = 0; hmi_ctrl->base_layer.y = 0; hmi_ctrl->base_layer.width = screen_width; hmi_ctrl->base_layer.height = screen_height; hmi_ctrl->base_layer.id_layer = hmi_ctrl->hmi_setting->base_layer_id; create_layer(iviscrn, &hmi_ctrl->base_layer); panel_height = hmi_ctrl->hmi_setting->panel_height; /* init application ivi_layer */ hmi_ctrl->application_layer.x = 0; hmi_ctrl->application_layer.y = 0; hmi_ctrl->application_layer.width = screen_width; hmi_ctrl->application_layer.height = screen_height - panel_height; hmi_ctrl->application_layer.id_layer = hmi_ctrl->hmi_setting->application_layer_id; create_layer(iviscrn, &hmi_ctrl->application_layer); /* init workspace background ivi_layer */ hmi_ctrl->workspace_background_layer.x = 0; hmi_ctrl->workspace_background_layer.y = 0; hmi_ctrl->workspace_background_layer.width = screen_width; hmi_ctrl->workspace_background_layer.height = screen_height - panel_height; hmi_ctrl->workspace_background_layer.id_layer = hmi_ctrl->hmi_setting->workspace_background_layer_id; create_layer(iviscrn, &hmi_ctrl->workspace_background_layer); ivi_controller_interface->layer_set_opacity( hmi_ctrl->workspace_background_layer.ivilayer, 0); ivi_controller_interface->layer_set_visibility( hmi_ctrl->workspace_background_layer.ivilayer, false); wl_list_init(&hmi_ctrl->workspace_fade.layer_list); tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); tmp_link_layer->layout_layer = hmi_ctrl->workspace_background_layer.ivilayer; wl_list_insert(&hmi_ctrl->workspace_fade.layer_list, &tmp_link_layer->link); ivi_controller_interface->add_notification_create_surface( set_notification_create_surface, hmi_ctrl); ivi_controller_interface->add_notification_remove_surface( set_notification_remove_surface, hmi_ctrl); ivi_controller_interface->add_notification_configure_surface( set_notification_configure_surface, hmi_ctrl); hmi_ctrl->destroy_listener.notify = hmi_controller_destroy; wl_signal_add(&hmi_ctrl->compositor->destroy_signal, &hmi_ctrl->destroy_listener); free(pp_screen); pp_screen = NULL; return hmi_ctrl; } /** * Implementations of ivi-hmi-controller.xml */ /** * A ivi_surface drawing background is identified by id_surface. * Properties of the ivi_surface is set by using ivi_layout APIs according to * the scene graph of UI defined in hmi_controller_create. * * UI ivi_layer is used to add this ivi_surface. */ static void ivi_hmi_controller_set_background(struct hmi_controller *hmi_ctrl, uint32_t id_surface) { struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_layer *ivilayer = hmi_ctrl->base_layer.ivilayer; const int32_t dstx = hmi_ctrl->application_layer.x; const int32_t dsty = hmi_ctrl->application_layer.y; const int32_t width = hmi_ctrl->application_layer.width; const int32_t height = hmi_ctrl->application_layer.height; int32_t ret = 0; uint32_t *add_surface_id = wl_array_add(&hmi_ctrl->ui_widgets, sizeof(*add_surface_id)); *add_surface_id = id_surface; ivisurf = ivi_controller_interface->get_surface_from_id(id_surface); assert(ivisurf != NULL); ret = ivi_controller_interface->layer_add_surface(ivilayer, ivisurf); assert(!ret); ret = ivi_controller_interface->surface_set_destination_rectangle(ivisurf, dstx, dsty, width, height); assert(!ret); ret = ivi_controller_interface->surface_set_visibility(ivisurf, true); assert(!ret); } /** * A ivi_surface drawing panel is identified by id_surface. * Properties of the ivi_surface is set by using ivi_layout APIs according to * the scene graph of UI defined in hmi_controller_create. * * UI ivi_layer is used to add this ivi_surface. */ static void ivi_hmi_controller_set_panel(struct hmi_controller *hmi_ctrl, uint32_t id_surface) { struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_layer *ivilayer = hmi_ctrl->base_layer.ivilayer; const int32_t width = hmi_ctrl->base_layer.width; int32_t ret = 0; int32_t panel_height = 0; const int32_t dstx = 0; int32_t dsty = 0; uint32_t *add_surface_id = wl_array_add(&hmi_ctrl->ui_widgets, sizeof(*add_surface_id)); *add_surface_id = id_surface; ivisurf = ivi_controller_interface->get_surface_from_id(id_surface); assert(ivisurf != NULL); ret = ivi_controller_interface->layer_add_surface(ivilayer, ivisurf); assert(!ret); panel_height = hmi_ctrl->hmi_setting->panel_height; dsty = hmi_ctrl->base_layer.height - panel_height; ret = ivi_controller_interface->surface_set_destination_rectangle( ivisurf, dstx, dsty, width, panel_height); assert(!ret); ret = ivi_controller_interface->surface_set_visibility(ivisurf, true); assert(!ret); } /** * A ivi_surface drawing buttons in panel is identified by id_surface. * It can set several buttons. Properties of the ivi_surface is set by * using ivi_layout APIs according to the scene graph of UI defined in * hmi_controller_create. Additionally, the position of it is shifted to * right when new one is requested. * * UI ivi_layer is used to add these ivi_surfaces. */ static void ivi_hmi_controller_set_button(struct hmi_controller *hmi_ctrl, uint32_t id_surface, int32_t number) { struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_layer *ivilayer = hmi_ctrl->base_layer.ivilayer; const int32_t width = 48; const int32_t height = 48; int32_t ret = 0; int32_t panel_height = 0; int32_t dstx = 0; int32_t dsty = 0; uint32_t *add_surface_id = wl_array_add(&hmi_ctrl->ui_widgets, sizeof(*add_surface_id)); *add_surface_id = id_surface; ivisurf = ivi_controller_interface->get_surface_from_id(id_surface); assert(ivisurf != NULL); ret = ivi_controller_interface->layer_add_surface(ivilayer, ivisurf); assert(!ret); panel_height = hmi_ctrl->hmi_setting->panel_height; dstx = (60 * number) + 15; dsty = (hmi_ctrl->base_layer.height - panel_height) + 5; ret = ivi_controller_interface->surface_set_destination_rectangle( ivisurf,dstx, dsty, width, height); assert(!ret); ret = ivi_controller_interface->surface_set_visibility(ivisurf, true); assert(!ret); } /** * A ivi_surface drawing home button in panel is identified by id_surface. * Properties of the ivi_surface is set by using ivi_layout APIs according to * the scene graph of UI defined in hmi_controller_create. * * UI ivi_layer is used to add these ivi_surfaces. */ static void ivi_hmi_controller_set_home_button(struct hmi_controller *hmi_ctrl, uint32_t id_surface) { struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_layer *ivilayer = hmi_ctrl->base_layer.ivilayer; int32_t ret = 0; int32_t size = 48; int32_t panel_height = hmi_ctrl->hmi_setting->panel_height; const int32_t dstx = (hmi_ctrl->base_layer.width - size) / 2; const int32_t dsty = (hmi_ctrl->base_layer.height - panel_height) + 5; uint32_t *add_surface_id = wl_array_add(&hmi_ctrl->ui_widgets, sizeof(*add_surface_id)); *add_surface_id = id_surface; ivisurf = ivi_controller_interface->get_surface_from_id(id_surface); assert(ivisurf != NULL); ret = ivi_controller_interface->layer_add_surface(ivilayer, ivisurf); assert(!ret); ret = ivi_controller_interface->surface_set_destination_rectangle( ivisurf, dstx, dsty, size, size); assert(!ret); ret = ivi_controller_interface->surface_set_visibility(ivisurf, true); assert(!ret); } /** * A ivi_surface drawing background of workspace is identified by id_surface. * Properties of the ivi_surface is set by using ivi_layout APIs according to * the scene graph of UI defined in hmi_controller_create. * * A ivi_layer of workspace_background is used to add this ivi_surface. */ static void ivi_hmi_controller_set_workspacebackground(struct hmi_controller *hmi_ctrl, uint32_t id_surface) { struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_layer *ivilayer = NULL; const int32_t width = hmi_ctrl->workspace_background_layer.width; const int32_t height = hmi_ctrl->workspace_background_layer.height; int32_t ret = 0; uint32_t *add_surface_id = wl_array_add(&hmi_ctrl->ui_widgets, sizeof(*add_surface_id)); *add_surface_id = id_surface; ivilayer = hmi_ctrl->workspace_background_layer.ivilayer; ivisurf = ivi_controller_interface->get_surface_from_id(id_surface); assert(ivisurf != NULL); ret = ivi_controller_interface->layer_add_surface(ivilayer, ivisurf); assert(!ret); ret = ivi_controller_interface->surface_set_destination_rectangle(ivisurf, 0, 0, width, height); assert(!ret); ret = ivi_controller_interface->surface_set_visibility(ivisurf, true); assert(!ret); } /** * A list of ivi_surfaces drawing launchers in workspace is identified by * id_surfaces. Properties of the ivi_surface is set by using ivi_layout * APIs according to the scene graph of UI defined in hmi_controller_create. * * The workspace can have several pages to group ivi_surfaces of launcher. * Each call of this interface increments a number of page to add a group * of ivi_surfaces */ static void ivi_hmi_controller_add_launchers(struct hmi_controller *hmi_ctrl, int32_t icon_size) { int32_t minspace_x = 10; int32_t minspace_y = minspace_x; int32_t width = hmi_ctrl->workspace_background_layer.width; int32_t height = hmi_ctrl->workspace_background_layer.height; int32_t x_count = (width - minspace_x) / (minspace_x + icon_size); int32_t space_x = (int32_t)((width - x_count * icon_size) / (1.0 + x_count)); float fcell_size_x = icon_size + space_x; int32_t y_count = (height - minspace_y) / (minspace_y + icon_size); int32_t space_y = (int32_t)((height - y_count * icon_size) / (1.0 + y_count)); float fcell_size_y = icon_size + space_y; struct weston_config *config = NULL; struct weston_config_section *section = NULL; const char *name = NULL; int launcher_count = 0; struct wl_array launchers; int32_t nx = 0; int32_t ny = 0; int32_t prev = -1; struct launcher_info *data = NULL; uint32_t surfaceid = 0; uint32_t workspaceid = 0; struct launcher_info *info = NULL; int32_t x = 0; int32_t y = 0; int32_t ret = 0; struct ivi_layout_surface* layout_surface = NULL; uint32_t *add_surface_id = NULL; struct ivi_layout_screen *iviscrn = NULL; struct link_layer *tmp_link_layer = NULL; struct ivi_layout_screen **pp_screen = NULL; int32_t screen_length = 0; if (0 == x_count) x_count = 1; if (0 == y_count) y_count = 1; config = hmi_ctrl->compositor->config; if (!config) return; section = weston_config_get_section(config, "ivi-shell", NULL, NULL); if (!section) return; wl_array_init(&launchers); while (weston_config_next_section(config, §ion, &name)) { surfaceid = 0; workspaceid = 0; info = NULL; if (0 != strcmp(name, "ivi-launcher")) continue; if (0 != weston_config_section_get_uint(section, "icon-id", &surfaceid, 0)) continue; if (0 != weston_config_section_get_uint(section, "workspace-id", &workspaceid, 0)) continue; info = wl_array_add(&launchers, sizeof(*info)); if (info) { info->surface_id = surfaceid; info->workspace_id = workspaceid; info->index = launcher_count; ++launcher_count; } } qsort(launchers.data, launcher_count, sizeof(struct launcher_info), compare_launcher_info); wl_array_for_each(data, &launchers) { x = 0; y = 0; ret = 0; layout_surface = NULL; add_surface_id = wl_array_add(&hmi_ctrl->ui_widgets, sizeof(*add_surface_id)); *add_surface_id = data->surface_id; if (0 > prev || (uint32_t)prev != data->workspace_id) { nx = 0; ny = 0; prev = data->workspace_id; if (0 <= prev) hmi_ctrl->workspace_count++; } if (y_count == ny) { ny = 0; hmi_ctrl->workspace_count++; } x = nx * fcell_size_x + (hmi_ctrl->workspace_count - 1) * width + space_x; y = ny * fcell_size_y + space_y; layout_surface = ivi_controller_interface->get_surface_from_id(data->surface_id); assert(layout_surface); ret = ivi_controller_interface->surface_set_destination_rectangle( layout_surface, x, y, icon_size, icon_size); assert(!ret); nx++; if (x_count == nx) { ny++; nx = 0; } } /* init workspace ivi_layer */ hmi_ctrl->workspace_layer.x = hmi_ctrl->workspace_background_layer.x; hmi_ctrl->workspace_layer.y = hmi_ctrl->workspace_background_layer.y; hmi_ctrl->workspace_layer.width = hmi_ctrl->workspace_background_layer.width * hmi_ctrl->workspace_count; hmi_ctrl->workspace_layer.height = hmi_ctrl->workspace_background_layer.height; hmi_ctrl->workspace_layer.id_layer = hmi_ctrl->hmi_setting->workspace_layer_id; ivi_controller_interface->get_screens(&screen_length, &pp_screen); iviscrn = pp_screen[0]; free(pp_screen); create_layer(iviscrn, &hmi_ctrl->workspace_layer); ivi_controller_interface->layer_set_opacity(hmi_ctrl->workspace_layer.ivilayer, 0); ivi_controller_interface->layer_set_visibility(hmi_ctrl->workspace_layer.ivilayer, false); tmp_link_layer = MEM_ALLOC(sizeof(*tmp_link_layer)); tmp_link_layer->layout_layer = hmi_ctrl->workspace_layer.ivilayer; wl_list_insert(&hmi_ctrl->workspace_fade.layer_list, &tmp_link_layer->link); /* Add surface to layer */ wl_array_for_each(data, &launchers) { layout_surface = ivi_controller_interface->get_surface_from_id(data->surface_id); assert(layout_surface); ret = ivi_controller_interface->layer_add_surface(hmi_ctrl->workspace_layer.ivilayer, layout_surface); assert(!ret); ret = ivi_controller_interface->surface_set_visibility(layout_surface, true); assert(!ret); } wl_array_release(&launchers); ivi_controller_interface->commit_changes(); } static void ivi_hmi_controller_UI_ready(struct wl_client *client, struct wl_resource *resource) { struct hmi_controller *hmi_ctrl = wl_resource_get_user_data(resource); ivi_hmi_controller_set_background(hmi_ctrl, hmi_ctrl->ui_setting.background_id); ivi_hmi_controller_set_panel(hmi_ctrl, hmi_ctrl->ui_setting.panel_id); ivi_hmi_controller_set_button(hmi_ctrl, hmi_ctrl->ui_setting.tiling_id, 0); ivi_hmi_controller_set_button(hmi_ctrl, hmi_ctrl->ui_setting.sidebyside_id, 1); ivi_hmi_controller_set_button(hmi_ctrl, hmi_ctrl->ui_setting.fullscreen_id, 2); ivi_hmi_controller_set_button(hmi_ctrl, hmi_ctrl->ui_setting.random_id, 3); ivi_hmi_controller_set_home_button(hmi_ctrl, hmi_ctrl->ui_setting.home_id); ivi_hmi_controller_set_workspacebackground(hmi_ctrl, hmi_ctrl->ui_setting.workspace_background_id); ivi_controller_interface->commit_changes(); ivi_hmi_controller_add_launchers(hmi_ctrl, 256); hmi_ctrl->is_initialized = 1; } /** * Implementation of request and event of ivi_hmi_controller_workspace_control * and controlling workspace. * * When motion of input is detected in a ivi_surface of workspace background, * ivi_hmi_controller_workspace_control shall be invoked and to start * controlling of workspace. The workspace has several pages to show several * groups of applications. * The workspace is slid by using ivi-layout to select a a page in layer_set_pos * according to motion. When motion finished, e.g. touch up detected, control is * terminated and event:ivi_hmi_controller_workspace_control is notified. */ struct pointer_grab { struct weston_pointer_grab grab; struct ivi_layout_layer *layer; struct wl_resource *resource; }; struct touch_grab { struct weston_touch_grab grab; struct ivi_layout_layer *layer; struct wl_resource *resource; }; struct move_grab { wl_fixed_t dst[2]; wl_fixed_t rgn[2][2]; double v[2]; struct timespec start_time; struct timespec pre_time; wl_fixed_t start_pos[2]; wl_fixed_t pos[2]; int32_t is_moved; }; struct pointer_move_grab { struct pointer_grab base; struct move_grab move; }; struct touch_move_grab { struct touch_grab base; struct move_grab move; int32_t is_active; }; static void pointer_grab_start(struct pointer_grab *grab, struct ivi_layout_layer *layer, const struct weston_pointer_grab_interface *interface, struct weston_pointer *pointer) { grab->grab.interface = interface; grab->layer = layer; weston_pointer_start_grab(pointer, &grab->grab); } static void touch_grab_start(struct touch_grab *grab, struct ivi_layout_layer *layer, const struct weston_touch_grab_interface *interface, struct weston_touch* touch) { grab->grab.interface = interface; grab->layer = layer; weston_touch_start_grab(touch, &grab->grab); } static int32_t clamp(int32_t val, int32_t min, int32_t max) { if (val < min) return min; if (max < val) return max; return val; } static void move_workspace_grab_end(struct move_grab *move, struct wl_resource* resource, wl_fixed_t grab_x, struct ivi_layout_layer *layer) { struct hmi_controller *hmi_ctrl = wl_resource_get_user_data(resource); int32_t width = hmi_ctrl->workspace_background_layer.width; struct timespec time = {0}; double grab_time = 0.0; double from_motion_time = 0.0; double pointer_v = 0.0; int32_t is_flick = 0; int32_t pos_x = 0; int32_t pos_y = 0; int page_no = 0; double end_pos = 0.0; uint32_t duration = 0; clock_gettime(CLOCK_MONOTONIC, &time); grab_time = 1e+3 * (time.tv_sec - move->start_time.tv_sec) + 1e-6 * (time.tv_nsec - move->start_time.tv_nsec); from_motion_time = 1e+3 * (time.tv_sec - move->pre_time.tv_sec) + 1e-6 * (time.tv_nsec - move->pre_time.tv_nsec); pointer_v = move->v[0]; is_flick = grab_time < 400 && 0.4 < fabs(pointer_v); if (200 < from_motion_time) pointer_v = 0.0; ivi_controller_interface->layer_get_position(layer, &pos_x, &pos_y); if (is_flick) { int orgx = wl_fixed_to_int(move->dst[0] + grab_x); page_no = (-orgx + width / 2) / width; if (pointer_v < 0.0) page_no++; else page_no--; } else { page_no = (-pos_x + width / 2) / width; } page_no = clamp(page_no, 0, hmi_ctrl->workspace_count - 1); end_pos = -page_no * width; duration = hmi_ctrl->hmi_setting->transition_duration; ivi_hmi_controller_send_workspace_end_control(resource, move->is_moved); ivi_controller_interface->layer_set_transition(layer, IVI_LAYOUT_TRANSITION_LAYER_MOVE, duration); ivi_controller_interface->layer_set_destination_rectangle(layer, end_pos, pos_y, hmi_ctrl->workspace_layer.width, hmi_ctrl->workspace_layer.height); ivi_controller_interface->commit_changes(); } static void pointer_move_workspace_grab_end(struct pointer_grab *grab) { struct pointer_move_grab *pnt_move_grab = (struct pointer_move_grab *)grab; struct ivi_layout_layer *layer = pnt_move_grab->base.layer; move_workspace_grab_end(&pnt_move_grab->move, grab->resource, grab->grab.pointer->grab_x, layer); weston_pointer_end_grab(grab->grab.pointer); } static void touch_move_workspace_grab_end(struct touch_grab *grab) { struct touch_move_grab *tch_move_grab = (struct touch_move_grab *)grab; struct ivi_layout_layer *layer = tch_move_grab->base.layer; move_workspace_grab_end(&tch_move_grab->move, grab->resource, grab->grab.touch->grab_x, layer); weston_touch_end_grab(grab->grab.touch); } static void pointer_noop_grab_focus(struct weston_pointer_grab *grab) { } static void move_grab_update(struct move_grab *move, wl_fixed_t pointer[2]) { struct timespec timestamp = {0}; int32_t ii = 0; double dt = 0.0; clock_gettime(CLOCK_MONOTONIC, ×tamp); //FIXME dt = (1e+3 * (timestamp.tv_sec - move->pre_time.tv_sec) + 1e-6 * (timestamp.tv_nsec - move->pre_time.tv_nsec)); if (dt < 1e-6) dt = 1e-6; move->pre_time = timestamp; for (ii = 0; ii < 2; ii++) { wl_fixed_t prepos = move->pos[ii]; move->pos[ii] = pointer[ii] + move->dst[ii]; if (move->pos[ii] < move->rgn[0][ii]) { move->pos[ii] = move->rgn[0][ii]; move->dst[ii] = move->pos[ii] - pointer[ii]; } else if (move->rgn[1][ii] < move->pos[ii]) { move->pos[ii] = move->rgn[1][ii]; move->dst[ii] = move->pos[ii] - pointer[ii]; } move->v[ii] = wl_fixed_to_double(move->pos[ii] - prepos) / dt; if (!move->is_moved && 0 < wl_fixed_to_int(move->pos[ii] - move->start_pos[ii])) move->is_moved = 1; } } static void layer_set_pos(struct ivi_layout_layer *layer, wl_fixed_t pos_x, wl_fixed_t pos_y) { int32_t layout_pos_x = 0; int32_t layout_pos_y = 0; layout_pos_x = wl_fixed_to_int(pos_x); layout_pos_y = wl_fixed_to_int(pos_y); ivi_controller_interface->layer_set_position(layer, layout_pos_x, layout_pos_y); ivi_controller_interface->commit_changes(); } static void pointer_move_grab_motion(struct weston_pointer_grab *grab, uint32_t time, wl_fixed_t x, wl_fixed_t y) { struct pointer_move_grab *pnt_move_grab = (struct pointer_move_grab *)grab; wl_fixed_t pointer_pos[2] = {x, y}; move_grab_update(&pnt_move_grab->move, pointer_pos); layer_set_pos(pnt_move_grab->base.layer, pnt_move_grab->move.pos[0], pnt_move_grab->move.pos[1]); weston_pointer_move(pnt_move_grab->base.grab.pointer, x, y); } static void touch_move_grab_motion(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y) { struct touch_move_grab *tch_move_grab = (struct touch_move_grab *)grab; if (!tch_move_grab->is_active) return; wl_fixed_t pointer_pos[2] = { grab->touch->grab_x, grab->touch->grab_y }; move_grab_update(&tch_move_grab->move, pointer_pos); layer_set_pos(tch_move_grab->base.layer, tch_move_grab->move.pos[0], tch_move_grab->move.pos[1]); } static void pointer_move_workspace_grab_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button, uint32_t state_w) { if (BTN_LEFT == button && WL_POINTER_BUTTON_STATE_RELEASED == state_w) { struct pointer_grab *pg = (struct pointer_grab *)grab; pointer_move_workspace_grab_end(pg); free(grab); } } static void touch_nope_grab_down(struct weston_touch_grab *grab, uint32_t time, int touch_id, wl_fixed_t sx, wl_fixed_t sy) { } static void touch_move_workspace_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id) { struct touch_move_grab *tch_move_grab = (struct touch_move_grab *)grab; if (0 == touch_id) tch_move_grab->is_active = 0; if (0 == grab->touch->num_tp) { touch_move_workspace_grab_end(&tch_move_grab->base); free(grab); } } static void pointer_move_workspace_grab_cancel(struct weston_pointer_grab *grab) { struct pointer_grab *pg = (struct pointer_grab *)grab; pointer_move_workspace_grab_end(pg); free(grab); } static void touch_move_workspace_grab_frame(struct weston_touch_grab *grab) { } static void touch_move_workspace_grab_cancel(struct weston_touch_grab *grab) { struct touch_grab *tg = (struct touch_grab *)grab; touch_move_workspace_grab_end(tg); free(grab); } static const struct weston_pointer_grab_interface pointer_move_grab_workspace_interface = { pointer_noop_grab_focus, pointer_move_grab_motion, pointer_move_workspace_grab_button, pointer_move_workspace_grab_cancel }; static const struct weston_touch_grab_interface touch_move_grab_workspace_interface = { touch_nope_grab_down, touch_move_workspace_grab_up, touch_move_grab_motion, touch_move_workspace_grab_frame, touch_move_workspace_grab_cancel }; enum HMI_GRAB_DEVICE { HMI_GRAB_DEVICE_NONE, HMI_GRAB_DEVICE_POINTER, HMI_GRAB_DEVICE_TOUCH }; static enum HMI_GRAB_DEVICE get_hmi_grab_device(struct weston_seat *seat, uint32_t serial) { struct weston_pointer *pointer = weston_seat_get_pointer(seat); struct weston_touch *touch = weston_seat_get_touch(seat); if (pointer && pointer->focus && pointer->button_count && pointer->grab_serial == serial) return HMI_GRAB_DEVICE_POINTER; if (touch && touch->focus && touch->grab_serial == serial) return HMI_GRAB_DEVICE_TOUCH; return HMI_GRAB_DEVICE_NONE; } static void move_grab_init(struct move_grab* move, wl_fixed_t start_pos[2], wl_fixed_t grab_pos[2], wl_fixed_t rgn[2][2], struct wl_resource* resource) { clock_gettime(CLOCK_MONOTONIC, &move->start_time); //FIXME move->pre_time = move->start_time; move->pos[0] = start_pos[0]; move->pos[1] = start_pos[1]; move->start_pos[0] = start_pos[0]; move->start_pos[1] = start_pos[1]; move->dst[0] = start_pos[0] - grab_pos[0]; move->dst[1] = start_pos[1] - grab_pos[1]; memcpy(move->rgn, rgn, sizeof(move->rgn)); } static void move_grab_init_workspace(struct move_grab* move, wl_fixed_t grab_x, wl_fixed_t grab_y, struct wl_resource *resource) { struct hmi_controller *hmi_ctrl = wl_resource_get_user_data(resource); struct ivi_layout_layer *layer = hmi_ctrl->workspace_layer.ivilayer; int32_t workspace_count = hmi_ctrl->workspace_count; int32_t workspace_width = hmi_ctrl->workspace_background_layer.width; int32_t layer_pos_x = 0; int32_t layer_pos_y = 0; wl_fixed_t start_pos[2] = {0}; wl_fixed_t rgn[2][2] = {{0}}; wl_fixed_t grab_pos[2] = { grab_x, grab_y }; ivi_controller_interface->layer_get_position(layer, &layer_pos_x, &layer_pos_y); start_pos[0] = wl_fixed_from_int(layer_pos_x); start_pos[1] = wl_fixed_from_int(layer_pos_y); rgn[0][0] = wl_fixed_from_int(-workspace_width * (workspace_count - 1)); rgn[0][1] = wl_fixed_from_int(0); rgn[1][0] = wl_fixed_from_int(0); rgn[1][1] = wl_fixed_from_int(0); move_grab_init(move, start_pos, grab_pos, rgn, resource); } static struct pointer_move_grab * create_workspace_pointer_move(struct weston_pointer *pointer, struct wl_resource* resource) { struct pointer_move_grab *pnt_move_grab = MEM_ALLOC(sizeof(*pnt_move_grab)); pnt_move_grab->base.resource = resource; move_grab_init_workspace(&pnt_move_grab->move, pointer->grab_x, pointer->grab_y, resource); return pnt_move_grab; } static struct touch_move_grab * create_workspace_touch_move(struct weston_touch *touch, struct wl_resource* resource) { struct touch_move_grab *tch_move_grab = MEM_ALLOC(sizeof(*tch_move_grab)); tch_move_grab->base.resource = resource; tch_move_grab->is_active = 1; move_grab_init_workspace(&tch_move_grab->move, touch->grab_x, touch->grab_y, resource); return tch_move_grab; } static void ivi_hmi_controller_workspace_control(struct wl_client *client, struct wl_resource *resource, struct wl_resource *seat_resource, uint32_t serial) { struct hmi_controller *hmi_ctrl = wl_resource_get_user_data(resource); struct ivi_layout_layer *layer = NULL; struct pointer_move_grab *pnt_move_grab = NULL; struct touch_move_grab *tch_move_grab = NULL; struct weston_seat *seat = NULL; struct weston_pointer *pointer; struct weston_touch *touch; enum HMI_GRAB_DEVICE device; if (hmi_ctrl->workspace_count < 2) return; seat = wl_resource_get_user_data(seat_resource); device = get_hmi_grab_device(seat, serial); if (HMI_GRAB_DEVICE_POINTER != device && HMI_GRAB_DEVICE_TOUCH != device) return; layer = hmi_ctrl->workspace_layer.ivilayer; ivi_controller_interface->transition_move_layer_cancel(layer); switch (device) { case HMI_GRAB_DEVICE_POINTER: pointer = weston_seat_get_pointer(seat); pnt_move_grab = create_workspace_pointer_move(pointer, resource); pointer_grab_start(&pnt_move_grab->base, layer, &pointer_move_grab_workspace_interface, pointer); break; case HMI_GRAB_DEVICE_TOUCH: touch = weston_seat_get_touch(seat); tch_move_grab = create_workspace_touch_move(touch, resource); touch_grab_start(&tch_move_grab->base, layer, &touch_move_grab_workspace_interface, touch); break; default: break; } } /** * Implementation of switch_mode */ static void ivi_hmi_controller_switch_mode(struct wl_client *client, struct wl_resource *resource, uint32_t layout_mode) { struct hmi_controller *hmi_ctrl = wl_resource_get_user_data(resource); switch_mode(hmi_ctrl, layout_mode); } /** * Implementation of on/off displaying workspace and workspace background * ivi_layers. */ static void ivi_hmi_controller_home(struct wl_client *client, struct wl_resource *resource, uint32_t home) { struct hmi_controller *hmi_ctrl = wl_resource_get_user_data(resource); uint32_t is_fade_in; if ((IVI_HMI_CONTROLLER_HOME_ON == home && !hmi_ctrl->workspace_fade.is_fade_in) || (IVI_HMI_CONTROLLER_HOME_OFF == home && hmi_ctrl->workspace_fade.is_fade_in)) { is_fade_in = !hmi_ctrl->workspace_fade.is_fade_in; hmi_controller_fade_run(hmi_ctrl, is_fade_in, &hmi_ctrl->workspace_fade); } ivi_controller_interface->commit_changes(); } /** * binding ivi-hmi-controller implementation */ static const struct ivi_hmi_controller_interface ivi_hmi_controller_implementation = { ivi_hmi_controller_UI_ready, ivi_hmi_controller_workspace_control, ivi_hmi_controller_switch_mode, ivi_hmi_controller_home }; static void unbind_hmi_controller(struct wl_resource *resource) { } static void bind_hmi_controller(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct wl_resource *resource = NULL; struct hmi_controller *hmi_ctrl = data; if (hmi_ctrl->user_interface != client) { struct wl_resource *res = wl_client_get_object(client, 1); wl_resource_post_error(res, WL_DISPLAY_ERROR_INVALID_OBJECT, "hmi-controller failed: permission denied"); return; } resource = wl_resource_create( client, &ivi_hmi_controller_interface, 1, id); wl_resource_set_implementation( resource, &ivi_hmi_controller_implementation, hmi_ctrl, unbind_hmi_controller); } static int32_t initialize(struct hmi_controller *hmi_ctrl) { struct config_command { char *key; uint32_t *dest; }; struct weston_config *config = hmi_ctrl->compositor->config; struct weston_config_section *section = NULL; int result = 0; int i = 0; const struct config_command uint_commands[] = { { "background-id", &hmi_ctrl->ui_setting.background_id }, { "panel-id", &hmi_ctrl->ui_setting.panel_id }, { "tiling-id", &hmi_ctrl->ui_setting.tiling_id }, { "sidebyside-id", &hmi_ctrl->ui_setting.sidebyside_id }, { "fullscreen-id", &hmi_ctrl->ui_setting.fullscreen_id }, { "random-id", &hmi_ctrl->ui_setting.random_id }, { "home-id", &hmi_ctrl->ui_setting.home_id }, { "workspace-background-id", &hmi_ctrl->ui_setting.workspace_background_id }, { NULL, NULL } }; section = weston_config_get_section(config, "ivi-shell", NULL, NULL); for (i = 0; -1 != result; ++i) { const struct config_command *command = &uint_commands[i]; if (!command->key) break; if (weston_config_section_get_uint( section, command->key, command->dest, 0) != 0) result = -1; } if (-1 == result) { weston_log("Failed to initialize hmi-controller\n"); return 0; } return 1; } static void launch_hmi_client_process(void *data) { struct hmi_controller *hmi_ctrl = (struct hmi_controller *)data; hmi_ctrl->user_interface = weston_client_start(hmi_ctrl->compositor, hmi_ctrl->hmi_setting->ivi_homescreen); free(hmi_ctrl->hmi_setting->ivi_homescreen); } /***************************************************************************** * exported functions ****************************************************************************/ WL_EXPORT int controller_module_init(struct weston_compositor *ec, int *argc, char *argv[], const struct ivi_controller_interface *interface, size_t interface_version) { struct hmi_controller *hmi_ctrl = NULL; struct wl_event_loop *loop = NULL; if (interface_version < sizeof(struct ivi_controller_interface)) { weston_log("ivi-shell: version mismatch of controller interface"); return -1; } ivi_controller_interface = interface; hmi_ctrl = hmi_controller_create(ec); if (!initialize(hmi_ctrl)) { return -1; } if (wl_global_create(ec->wl_display, &ivi_hmi_controller_interface, 1, hmi_ctrl, bind_hmi_controller) == NULL) { return -1; } loop = wl_display_get_event_loop(ec->wl_display); wl_event_loop_add_idle(loop, launch_hmi_client_process, hmi_ctrl); return 0; } weston-1.9.0/ivi-shell/ivi-layout-private.h0000664000175000017500000001470012566724675015630 00000000000000/* * Copyright (C) 2014 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef _ivi_layout_PRIVATE_H_ #define _ivi_layout_PRIVATE_H_ #include "compositor.h" #include "ivi-layout-export.h" struct ivi_layout_surface { struct wl_list link; struct wl_signal property_changed; struct wl_list layer_list; int32_t update_count; uint32_t id_surface; struct ivi_layout *layout; struct weston_surface *surface; struct weston_transform transform; struct ivi_layout_surface_properties prop; uint32_t event_mask; struct { struct ivi_layout_surface_properties prop; struct wl_list link; } pending; struct { struct wl_list link; struct wl_list layer_list; } order; struct { ivi_controller_surface_content_callback callback; void *userdata; } content_observer; struct wl_signal configured; }; struct ivi_layout_layer { struct wl_list link; struct wl_signal property_changed; struct wl_list screen_list; struct wl_list link_to_surface; uint32_t id_layer; struct ivi_layout *layout; struct ivi_layout_layer_properties prop; uint32_t event_mask; struct { struct ivi_layout_layer_properties prop; struct wl_list surface_list; struct wl_list link; } pending; struct { int dirty; struct wl_list surface_list; struct wl_list link; } order; int32_t ref_count; }; struct ivi_layout { struct weston_compositor *compositor; struct wl_list surface_list; struct wl_list layer_list; struct wl_list screen_list; struct { struct wl_signal created; struct wl_signal removed; } layer_notification; struct { struct wl_signal created; struct wl_signal removed; struct wl_signal configure_changed; } surface_notification; struct weston_layer layout_layer; struct wl_signal warning_signal; struct ivi_layout_transition_set *transitions; struct wl_list pending_transition_list; }; struct ivi_layout *get_instance(void); struct ivi_layout_transition; struct ivi_layout_transition_set { struct wl_event_source *event_source; struct wl_list transition_list; }; typedef void (*ivi_layout_transition_destroy_user_func)(void *user_data); struct ivi_layout_transition_set * ivi_layout_transition_set_create(struct weston_compositor *ec); void ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface, int32_t dest_x, int32_t dest_y, int32_t dest_width, int32_t dest_height, uint32_t duration); void ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface, uint32_t duration); void ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface, uint32_t duration); void ivi_layout_transition_move_layer(struct ivi_layout_layer *layer, int32_t dest_x, int32_t dest_y, uint32_t duration); void ivi_layout_transition_fade_layer(struct ivi_layout_layer *layer, uint32_t is_fade_in, double start_alpha, double end_alpha, void *user_data, ivi_layout_transition_destroy_user_func destroy_func, uint32_t duration); int32_t is_surface_transition(struct ivi_layout_surface *surface); /** * methods of interaction between ivi-shell with ivi-layout */ struct weston_view * ivi_layout_get_weston_view(struct ivi_layout_surface *surface); void ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, int32_t width, int32_t height); struct ivi_layout_surface* ivi_layout_surface_create(struct weston_surface *wl_surface, uint32_t id_surface); void ivi_layout_init_with_compositor(struct weston_compositor *ec); int32_t ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf, int32_t *dest_width, int32_t *dest_height); void ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf, struct wl_listener* listener); /** * methods of interaction between transition animation with ivi-layout */ int32_t ivi_layout_commit_changes(void); uint32_t ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf); int32_t ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, int32_t x, int32_t y, int32_t width, int32_t height); int32_t ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, wl_fixed_t opacity); wl_fixed_t ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf); int32_t ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, bool newVisibility); bool ivi_layout_surface_get_visibility(struct ivi_layout_surface *ivisurf); struct ivi_layout_surface * ivi_layout_get_surface_from_id(uint32_t id_surface); int32_t ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, wl_fixed_t opacity); wl_fixed_t ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer); int32_t ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, bool newVisibility); int32_t ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer, int32_t dest_x, int32_t dest_y); int32_t ivi_layout_layer_get_position(struct ivi_layout_layer *ivilayer, int32_t *dest_x, int32_t *dest_y); int32_t ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface **pSurface, int32_t number); void ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer); int load_controller_modules(struct weston_compositor *compositor, const char *modules, int *argc, char *argv[]); void ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf); #endif weston-1.9.0/ivi-shell/ivi-shell.h0000664000175000017500000000372112544564625013744 00000000000000/* * Copyright (C) 2013 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include "compositor.h" struct ivi_shell { struct wl_listener destroy_listener; struct weston_compositor *compositor; struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */ struct text_backend *text_backend; struct wl_listener show_input_panel_listener; struct wl_listener hide_input_panel_listener; struct wl_listener update_input_panel_listener; struct weston_layer input_panel_layer; bool locked; bool showing_input_panels; struct { struct weston_surface *surface; pixman_box32_t cursor_rectangle; } text_input; struct { struct wl_resource *binding; struct wl_list surfaces; } input_panel; }; struct weston_view * get_default_view(struct weston_surface *surface); int input_panel_setup(struct ivi_shell *shell); void input_panel_destroy(struct ivi_shell *shell); weston-1.9.0/ivi-shell/ivi-layout-transition.c0000664000175000017500000005403512561200202016312 00000000000000/* * Copyright (C) 2014 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include #include #include #include #include "ivi-layout-export.h" #include "ivi-layout-private.h" struct ivi_layout_transition; typedef void (*ivi_layout_transition_frame_func)( struct ivi_layout_transition *transition); typedef void (*ivi_layout_transition_destroy_func)( struct ivi_layout_transition *transition); typedef int32_t (*ivi_layout_is_transition_func)(void *private_data, void *id); struct ivi_layout_transition { enum ivi_layout_transition_type type; void *private_data; void *user_data; uint32_t time_start; uint32_t time_duration; uint32_t time_elapsed; uint32_t is_done; ivi_layout_is_transition_func is_transition_func; ivi_layout_transition_frame_func frame_func; ivi_layout_transition_destroy_func destroy_func; }; struct transition_node { struct ivi_layout_transition *transition; struct wl_list link; }; static void layout_transition_destroy(struct ivi_layout_transition *transition); static struct ivi_layout_transition * get_transition_from_type_and_id(enum ivi_layout_transition_type type, void *id_data) { struct ivi_layout *layout = get_instance(); struct transition_node *node; struct ivi_layout_transition *tran; wl_list_for_each(node, &layout->transitions->transition_list, link) { tran = node->transition; if (tran->type == type && tran->is_transition_func(tran->private_data, id_data)) return tran; } return NULL; } int32_t is_surface_transition(struct ivi_layout_surface *surface) { struct ivi_layout *layout = get_instance(); struct transition_node *node; struct ivi_layout_transition *tran; wl_list_for_each(node, &layout->transitions->transition_list, link) { tran = node->transition; if ((tran->type == IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE || tran->type == IVI_LAYOUT_TRANSITION_VIEW_RESIZE) && tran->is_transition_func(tran->private_data, surface)) return 1; } return 0; } static void tick_transition(struct ivi_layout_transition *transition, uint32_t timestamp) { const double t = timestamp - transition->time_start; if (transition->time_duration <= t) { transition->time_elapsed = transition->time_duration; transition->is_done = 1; } else { transition->time_elapsed = t; } } static float time_to_nowpos(struct ivi_layout_transition *transition) { return sin((float)transition->time_elapsed / (float)transition->time_duration * M_PI_2); } static void do_transition_frame(struct ivi_layout_transition *transition, uint32_t timestamp) { if (0 == transition->time_start) transition->time_start = timestamp; tick_transition(transition, timestamp); transition->frame_func(transition); if (transition->is_done) layout_transition_destroy(transition); } static int32_t layout_transition_frame(void *data) { struct ivi_layout_transition_set *transitions = data; uint32_t fps = 30; struct timespec timestamp = {}; uint32_t msec = 0; struct transition_node *node = NULL; struct transition_node *next = NULL; if (wl_list_empty(&transitions->transition_list)) { wl_event_source_timer_update(transitions->event_source, 0); return 1; } wl_event_source_timer_update(transitions->event_source, 1000 / fps); clock_gettime(CLOCK_MONOTONIC, ×tamp);/* FIXME */ msec = (1e+3 * timestamp.tv_sec + 1e-6 * timestamp.tv_nsec); wl_list_for_each_safe(node, next, &transitions->transition_list, link) { do_transition_frame(node->transition, msec); } ivi_layout_commit_changes(); return 1; } struct ivi_layout_transition_set * ivi_layout_transition_set_create(struct weston_compositor *ec) { struct ivi_layout_transition_set *transitions; struct wl_event_loop *loop; transitions = malloc(sizeof(*transitions)); if (transitions == NULL) { weston_log("%s: memory allocation fails\n", __func__); return NULL; } wl_list_init(&transitions->transition_list); loop = wl_display_get_event_loop(ec->wl_display); transitions->event_source = wl_event_loop_add_timer(loop, layout_transition_frame, transitions); return transitions; } static void layout_transition_register(struct ivi_layout_transition *trans) { struct ivi_layout *layout = get_instance(); struct transition_node *node; node = malloc(sizeof(*node)); if (node == NULL) { weston_log("%s: memory allocation fails\n", __func__); return; } node->transition = trans; wl_list_insert(&layout->pending_transition_list, &node->link); } static void remove_transition(struct ivi_layout *layout, struct ivi_layout_transition *trans) { struct transition_node *node; struct transition_node *next; wl_list_for_each_safe(node, next, &layout->transitions->transition_list, link) { if (node->transition == trans) { wl_list_remove(&node->link); free(node); return; } } wl_list_for_each_safe(node, next, &layout->pending_transition_list, link) { if (node->transition == trans) { wl_list_remove(&node->link); free(node); return; } } } static void layout_transition_destroy(struct ivi_layout_transition *transition) { struct ivi_layout *layout = get_instance(); remove_transition(layout, transition); if (transition->destroy_func) transition->destroy_func(transition); free(transition); } static struct ivi_layout_transition * create_layout_transition(void) { struct ivi_layout_transition *transition = malloc(sizeof(*transition)); if (transition == NULL) { weston_log("%s: memory allocation fails\n", __func__); return NULL; } transition->type = IVI_LAYOUT_TRANSITION_MAX; transition->time_start = 0; transition->time_duration = 300; /* 300ms */ transition->time_elapsed = 0; transition->is_done = 0; transition->private_data = NULL; transition->user_data = NULL; transition->frame_func = NULL; transition->destroy_func = NULL; return transition; } /* move and resize view transition */ struct move_resize_view_data { struct ivi_layout_surface *surface; int32_t start_x; int32_t start_y; int32_t end_x; int32_t end_y; int32_t start_width; int32_t start_height; int32_t end_width; int32_t end_height; }; static void transition_move_resize_view_destroy(struct ivi_layout_transition *transition) { struct move_resize_view_data *data = (struct move_resize_view_data *)transition->private_data; struct ivi_layout_surface *layout_surface = data->surface; wl_signal_emit(&layout_surface->configured, layout_surface); if (transition->private_data) { free(transition->private_data); transition->private_data = NULL; } } static void transition_move_resize_view_user_frame(struct ivi_layout_transition *transition) { struct move_resize_view_data *mrv = transition->private_data; const double current = time_to_nowpos(transition); const int32_t destx = mrv->start_x + (mrv->end_x - mrv->start_x) * current; const int32_t desty = mrv->start_y + (mrv->end_y - mrv->start_y) * current; const int32_t dest_width = mrv->start_width + (mrv->end_width - mrv->start_width) * current; const int32_t dest_height = mrv->start_height + (mrv->end_height - mrv->start_height) * current; ivi_layout_surface_set_destination_rectangle(mrv->surface, destx, desty, dest_width, dest_height); } static int32_t is_transition_move_resize_view_func(struct move_resize_view_data *data, struct ivi_layout_surface *view) { return data->surface == view; } static struct ivi_layout_transition * create_move_resize_view_transition( struct ivi_layout_surface *surface, int32_t start_x, int32_t start_y, int32_t end_x, int32_t end_y, int32_t start_width, int32_t start_height, int32_t end_width, int32_t end_height, ivi_layout_transition_frame_func frame_func, ivi_layout_transition_destroy_func destroy_func, uint32_t duration) { struct ivi_layout_transition *transition; struct move_resize_view_data *data; transition = create_layout_transition(); if (transition == NULL) return NULL; data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); return NULL; } transition->type = IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE; transition->is_transition_func = (ivi_layout_is_transition_func)is_transition_move_resize_view_func; transition->frame_func = frame_func; transition->destroy_func = destroy_func; transition->private_data = data; if (duration != 0) transition->time_duration = duration; data->surface = surface; data->start_x = start_x; data->start_y = start_y; data->end_x = end_x; data->end_y = end_y; data->start_width = start_width; data->start_height = start_height; data->end_width = end_width; data->end_height = end_height; return transition; } void ivi_layout_transition_move_resize_view(struct ivi_layout_surface *surface, int32_t dest_x, int32_t dest_y, int32_t dest_width, int32_t dest_height, uint32_t duration) { struct ivi_layout_transition *transition; int32_t start_pos[2] = { surface->pending.prop.start_x, surface->pending.prop.start_y }; int32_t start_size[2] = { surface->pending.prop.start_width, surface->pending.prop.start_height }; transition = get_transition_from_type_and_id( IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE, surface); if (transition) { struct move_resize_view_data *data = transition->private_data; transition->time_start = 0; transition->time_duration = duration; data->start_x = start_pos[0]; data->start_y = start_pos[1]; data->end_x = dest_x; data->end_y = dest_y; data->start_width = start_size[0]; data->start_height = start_size[1]; data->end_width = dest_width; data->end_height = dest_height; return; } transition = create_move_resize_view_transition( surface, start_pos[0], start_pos[1], dest_x, dest_y, start_size[0], start_size[1], dest_width, dest_height, transition_move_resize_view_user_frame, transition_move_resize_view_destroy, duration); layout_transition_register(transition); } /* fade transition */ struct fade_view_data { struct ivi_layout_surface *surface; double start_alpha; double end_alpha; }; struct store_alpha{ double alpha; }; static void fade_view_user_frame(struct ivi_layout_transition *transition) { struct fade_view_data *fade = transition->private_data; struct ivi_layout_surface *surface = fade->surface; const double current = time_to_nowpos(transition); const double alpha = fade->start_alpha + (fade->end_alpha - fade->start_alpha) * current; ivi_layout_surface_set_opacity(surface, wl_fixed_from_double(alpha)); ivi_layout_surface_set_visibility(surface, true); } static int32_t is_transition_fade_view_func(struct fade_view_data *data, struct ivi_layout_surface *view) { return data->surface == view; } static struct ivi_layout_transition * create_fade_view_transition( struct ivi_layout_surface *surface, double start_alpha, double end_alpha, ivi_layout_transition_frame_func frame_func, void *user_data, ivi_layout_transition_destroy_func destroy_func, uint32_t duration) { struct ivi_layout_transition *transition; struct fade_view_data *data; transition = create_layout_transition(); if (transition == NULL) return NULL; data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); return NULL; } transition->type = IVI_LAYOUT_TRANSITION_VIEW_FADE; transition->is_transition_func = (ivi_layout_is_transition_func)is_transition_fade_view_func; transition->user_data = user_data; transition->private_data = data; transition->frame_func = frame_func; transition->destroy_func = destroy_func; if (duration != 0) transition->time_duration = duration; data->surface = surface; data->start_alpha = start_alpha; data->end_alpha = end_alpha; return transition; } static void create_visibility_transition(struct ivi_layout_surface *surface, double start_alpha, double dest_alpha, void *user_data, ivi_layout_transition_destroy_func destroy_func, uint32_t duration) { struct ivi_layout_transition *transition = NULL; transition = create_fade_view_transition( surface, start_alpha, dest_alpha, fade_view_user_frame, user_data, destroy_func, duration); layout_transition_register(transition); } static void visibility_on_transition_destroy(struct ivi_layout_transition *transition) { struct fade_view_data *data = transition->private_data; struct store_alpha *user_data = transition->user_data; ivi_layout_surface_set_visibility(data->surface, true); free(data); transition->private_data = NULL; free(user_data); transition->user_data = NULL; } void ivi_layout_transition_visibility_on(struct ivi_layout_surface *surface, uint32_t duration) { struct ivi_layout_transition *transition; bool is_visible = ivi_layout_surface_get_visibility(surface); wl_fixed_t dest_alpha = ivi_layout_surface_get_opacity(surface); struct store_alpha *user_data = NULL; wl_fixed_t start_alpha = 0.0; struct fade_view_data *data = NULL; transition = get_transition_from_type_and_id( IVI_LAYOUT_TRANSITION_VIEW_FADE, surface); if (transition) { start_alpha = ivi_layout_surface_get_opacity(surface); user_data = transition->user_data; data = transition->private_data; transition->time_start = 0; transition->time_duration = duration; transition->destroy_func = visibility_on_transition_destroy; data->start_alpha = wl_fixed_to_double(start_alpha); data->end_alpha = user_data->alpha; return; } if (is_visible) return; user_data = malloc(sizeof(*user_data)); if (user_data == NULL) { weston_log("%s: memory allocation fails\n", __func__); return; } user_data->alpha = wl_fixed_to_double(dest_alpha); create_visibility_transition(surface, 0.0, // start_alpha wl_fixed_to_double(dest_alpha), user_data, visibility_on_transition_destroy, duration); } static void visibility_off_transition_destroy(struct ivi_layout_transition *transition) { struct fade_view_data *data = transition->private_data; struct store_alpha *user_data = transition->user_data; ivi_layout_surface_set_visibility(data->surface, false); ivi_layout_surface_set_opacity(data->surface, wl_fixed_from_double(user_data->alpha)); free(data); transition->private_data = NULL; free(user_data); transition->user_data= NULL; } void ivi_layout_transition_visibility_off(struct ivi_layout_surface *surface, uint32_t duration) { struct ivi_layout_transition *transition; wl_fixed_t start_alpha = ivi_layout_surface_get_opacity(surface); struct store_alpha* user_data = NULL; struct fade_view_data* data = NULL; transition = get_transition_from_type_and_id(IVI_LAYOUT_TRANSITION_VIEW_FADE, surface); if (transition) { data = transition->private_data; transition->time_start = 0; transition->time_duration = duration; transition->destroy_func = visibility_off_transition_destroy; data->start_alpha = wl_fixed_to_double(start_alpha); data->end_alpha = 0; return; } user_data = malloc(sizeof(*user_data)); if (user_data == NULL) { weston_log("%s: memory allocation fails\n", __func__); return; } user_data->alpha = wl_fixed_to_double(start_alpha); create_visibility_transition(surface, wl_fixed_to_double(start_alpha), 0.0, // dest_alpha user_data, visibility_off_transition_destroy, duration); } /* move layer transition */ struct move_layer_data { struct ivi_layout_layer *layer; int32_t start_x; int32_t start_y; int32_t end_x; int32_t end_y; ivi_layout_transition_destroy_user_func destroy_func; }; static void transition_move_layer_user_frame(struct ivi_layout_transition *transition) { struct move_layer_data *data = transition->private_data; struct ivi_layout_layer *layer = data->layer; const float current = time_to_nowpos(transition); const int32_t dest_x = data->start_x + (data->end_x - data->start_x) * current; const int32_t dest_y = data->start_y + (data->end_y - data->start_y) * current; ivi_layout_layer_set_position(layer, dest_x, dest_y); } static void transition_move_layer_destroy(struct ivi_layout_transition *transition) { struct move_layer_data *data = transition->private_data; if (data->destroy_func) data->destroy_func(transition->user_data); free(data); transition->private_data = NULL; } static int32_t is_transition_move_layer_func(struct move_layer_data *data, struct ivi_layout_layer *layer) { return data->layer == layer; } static struct ivi_layout_transition * create_move_layer_transition( struct ivi_layout_layer *layer, int32_t start_x, int32_t start_y, int32_t end_x, int32_t end_y, void *user_data, ivi_layout_transition_destroy_user_func destroy_user_func, uint32_t duration) { struct ivi_layout_transition *transition; struct move_layer_data *data; transition = create_layout_transition(); if (transition == NULL) return NULL; data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); return NULL; } transition->type = IVI_LAYOUT_TRANSITION_LAYER_MOVE; transition->is_transition_func = (ivi_layout_is_transition_func)is_transition_move_layer_func; transition->frame_func = transition_move_layer_user_frame; transition->destroy_func = transition_move_layer_destroy; transition->private_data = data; transition->user_data = user_data; if (duration != 0) transition->time_duration = duration; data->layer = layer; data->start_x = start_x; data->start_y = start_y; data->end_x = end_x; data->end_y = end_y; data->destroy_func = destroy_user_func; return transition; } void ivi_layout_transition_move_layer(struct ivi_layout_layer *layer, int32_t dest_x, int32_t dest_y, uint32_t duration) { int32_t start_pos_x = 0; int32_t start_pos_y = 0; struct ivi_layout_transition *transition = NULL; ivi_layout_layer_get_position(layer, &start_pos_x, &start_pos_y); transition = create_move_layer_transition( layer, start_pos_x, start_pos_y, dest_x, dest_y, NULL, NULL, duration); layout_transition_register(transition); return; } void ivi_layout_transition_move_layer_cancel(struct ivi_layout_layer *layer) { struct ivi_layout_transition *transition = get_transition_from_type_and_id( IVI_LAYOUT_TRANSITION_LAYER_MOVE, layer); if (transition) { layout_transition_destroy(transition); } } /* fade layer transition */ struct fade_layer_data { struct ivi_layout_layer *layer; uint32_t is_fade_in; double start_alpha; double end_alpha; ivi_layout_transition_destroy_user_func destroy_func; }; static void transition_fade_layer_destroy(struct ivi_layout_transition *transition) { struct fade_layer_data *data = transition->private_data; transition->private_data = NULL; free(data); } static void transition_fade_layer_user_frame(struct ivi_layout_transition *transition) { double current = time_to_nowpos(transition); struct fade_layer_data *data = transition->private_data; double alpha = data->start_alpha + (data->end_alpha - data->start_alpha) * current; wl_fixed_t fixed_alpha = wl_fixed_from_double(alpha); int32_t is_done = transition->is_done; bool is_visible = !is_done || data->is_fade_in; ivi_layout_layer_set_opacity(data->layer, fixed_alpha); ivi_layout_layer_set_visibility(data->layer, is_visible); } static int32_t is_transition_fade_layer_func(struct fade_layer_data *data, struct ivi_layout_layer *layer) { return data->layer == layer; } void ivi_layout_transition_fade_layer( struct ivi_layout_layer *layer, uint32_t is_fade_in, double start_alpha, double end_alpha, void* user_data, ivi_layout_transition_destroy_user_func destroy_func, uint32_t duration) { struct ivi_layout_transition *transition; struct fade_layer_data *data = NULL; wl_fixed_t fixed_opacity = 0.0; double now_opacity = 0.0; double remain = 0.0; transition = get_transition_from_type_and_id( IVI_LAYOUT_TRANSITION_LAYER_FADE, layer); if (transition) { /* transition update */ data = transition->private_data; /* FIXME */ fixed_opacity = ivi_layout_layer_get_opacity(layer); now_opacity = wl_fixed_to_double(fixed_opacity); remain = 0.0; data->is_fade_in = is_fade_in; data->start_alpha = now_opacity; data->end_alpha = end_alpha; remain = is_fade_in? 1.0 - now_opacity : now_opacity; transition->time_start = 0; transition->time_elapsed = 0; transition->time_duration = duration * remain; return; } transition = create_layout_transition(); if (transition == NULL) return; data = malloc(sizeof(*data)); if (data == NULL) { weston_log("%s: memory allocation fails\n", __func__); return; } transition->type = IVI_LAYOUT_TRANSITION_LAYER_FADE; transition->is_transition_func = (ivi_layout_is_transition_func)is_transition_fade_layer_func; transition->private_data = data; transition->user_data = user_data; transition->frame_func = transition_fade_layer_user_frame; transition->destroy_func = transition_fade_layer_destroy; if (duration != 0) transition->time_duration = duration; data->layer = layer; data->is_fade_in = is_fade_in; data->start_alpha = start_alpha; data->end_alpha = end_alpha; data->destroy_func = destroy_func; layout_transition_register(transition); return; } weston-1.9.0/ivi-shell/input-panel-ivi.c0000664000175000017500000002616612556771651015076 00000000000000/* * Copyright © 2010-2012 Intel Corporation * Copyright © 2011-2012 Collabora, Ltd. * Copyright © 2013 Raspberry Pi Foundation * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "config.h" #include #include #include #include "ivi-shell.h" #include "input-method-server-protocol.h" #include "ivi-layout-private.h" #include "shared/helpers.h" struct input_panel_surface { struct wl_resource *resource; struct wl_signal destroy_signal; struct ivi_shell *shell; struct wl_list link; struct weston_surface *surface; struct weston_view *view; struct wl_listener surface_destroy_listener; struct weston_view_animation *anim; struct weston_output *output; uint32_t panel; }; static void input_panel_slide_done(struct weston_view_animation *animation, void *data) { struct input_panel_surface *ipsurf = data; ipsurf->anim = NULL; } static void show_input_panel_surface(struct input_panel_surface *ipsurf) { struct ivi_shell *shell = ipsurf->shell; struct weston_seat *seat; struct weston_surface *focus; float x, y; wl_list_for_each(seat, &shell->compositor->seat_list, link) { struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat); if (!keyboard || !keyboard->focus) continue; focus = weston_surface_get_main_surface(keyboard->focus); ipsurf->output = focus->output; x = ipsurf->output->x + (ipsurf->output->width - ipsurf->surface->width) / 2; y = ipsurf->output->y + ipsurf->output->height - ipsurf->surface->height; weston_view_set_position(ipsurf->view, x, y); } weston_layer_entry_insert(&shell->input_panel_layer.view_list, &ipsurf->view->layer_link); weston_view_geometry_dirty(ipsurf->view); weston_view_update_transform(ipsurf->view); weston_surface_damage(ipsurf->surface); if (ipsurf->anim) weston_view_animation_destroy(ipsurf->anim); ipsurf->anim = weston_slide_run(ipsurf->view, ipsurf->surface->height * 0.9, 0, input_panel_slide_done, ipsurf); } static void show_input_panels(struct wl_listener *listener, void *data) { struct ivi_shell *shell = container_of(listener, struct ivi_shell, show_input_panel_listener); struct input_panel_surface *ipsurf, *next; shell->text_input.surface = (struct weston_surface*)data; if (shell->showing_input_panels) return; shell->showing_input_panels = true; if (!shell->locked) wl_list_insert(&shell->compositor->cursor_layer.link, &shell->input_panel_layer.link); wl_list_for_each_safe(ipsurf, next, &shell->input_panel.surfaces, link) { if (ipsurf->surface->width == 0) continue; show_input_panel_surface(ipsurf); } } static void hide_input_panels(struct wl_listener *listener, void *data) { struct ivi_shell *shell = container_of(listener, struct ivi_shell, hide_input_panel_listener); struct weston_view *view, *next; if (!shell->showing_input_panels) return; shell->showing_input_panels = false; if (!shell->locked) wl_list_remove(&shell->input_panel_layer.link); wl_list_for_each_safe(view, next, &shell->input_panel_layer.view_list.link, layer_link.link) weston_view_unmap(view); } static void update_input_panels(struct wl_listener *listener, void *data) { struct ivi_shell *shell = container_of(listener, struct ivi_shell, update_input_panel_listener); memcpy(&shell->text_input.cursor_rectangle, data, sizeof(pixman_box32_t)); } static void input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct input_panel_surface *ip_surface = surface->configure_private; struct ivi_shell *shell = ip_surface->shell; struct weston_view *view; float x, y; if (surface->width == 0) return; if (ip_surface->panel) { view = get_default_view(shell->text_input.surface); if (view == NULL) return; x = view->geometry.x + shell->text_input.cursor_rectangle.x2; y = view->geometry.y + shell->text_input.cursor_rectangle.y2; } else { x = ip_surface->output->x + (ip_surface->output->width - surface->width) / 2; y = ip_surface->output->y + ip_surface->output->height - surface->height; } weston_view_set_position(ip_surface->view, x, y); if (!weston_surface_is_mapped(surface) && shell->showing_input_panels) show_input_panel_surface(ip_surface); } static void destroy_input_panel_surface(struct input_panel_surface *input_panel_surface) { wl_signal_emit(&input_panel_surface->destroy_signal, input_panel_surface); wl_list_remove(&input_panel_surface->surface_destroy_listener.link); wl_list_remove(&input_panel_surface->link); input_panel_surface->surface->configure = NULL; weston_view_destroy(input_panel_surface->view); free(input_panel_surface); } static struct input_panel_surface * get_input_panel_surface(struct weston_surface *surface) { if (surface->configure == input_panel_configure) { return surface->configure_private; } else { return NULL; } } static void input_panel_handle_surface_destroy(struct wl_listener *listener, void *data) { struct input_panel_surface *ipsurface = container_of(listener, struct input_panel_surface, surface_destroy_listener); if (ipsurface->resource) { wl_resource_destroy(ipsurface->resource); } else { destroy_input_panel_surface(ipsurface); } } static struct input_panel_surface * create_input_panel_surface(struct ivi_shell *shell, struct weston_surface *surface) { struct input_panel_surface *input_panel_surface; input_panel_surface = calloc(1, sizeof *input_panel_surface); if (!input_panel_surface) return NULL; surface->configure = input_panel_configure; surface->configure_private = input_panel_surface; input_panel_surface->shell = shell; input_panel_surface->surface = surface; input_panel_surface->view = weston_view_create(surface); wl_signal_init(&input_panel_surface->destroy_signal); input_panel_surface->surface_destroy_listener.notify = input_panel_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &input_panel_surface->surface_destroy_listener); wl_list_init(&input_panel_surface->link); return input_panel_surface; } static void input_panel_surface_set_toplevel(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output_resource, uint32_t position) { struct input_panel_surface *input_panel_surface = wl_resource_get_user_data(resource); struct ivi_shell *shell = input_panel_surface->shell; wl_list_insert(&shell->input_panel.surfaces, &input_panel_surface->link); input_panel_surface->output = wl_resource_get_user_data(output_resource); input_panel_surface->panel = 0; } static void input_panel_surface_set_overlay_panel(struct wl_client *client, struct wl_resource *resource) { struct input_panel_surface *input_panel_surface = wl_resource_get_user_data(resource); struct ivi_shell *shell = input_panel_surface->shell; wl_list_insert(&shell->input_panel.surfaces, &input_panel_surface->link); input_panel_surface->panel = 1; } static const struct wl_input_panel_surface_interface input_panel_surface_implementation = { input_panel_surface_set_toplevel, input_panel_surface_set_overlay_panel }; static void destroy_input_panel_surface_resource(struct wl_resource *resource) { struct input_panel_surface *ipsurf = wl_resource_get_user_data(resource); destroy_input_panel_surface(ipsurf); } static void input_panel_get_input_panel_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface_resource) { struct weston_surface *surface = wl_resource_get_user_data(surface_resource); struct ivi_shell *shell = wl_resource_get_user_data(resource); struct input_panel_surface *ipsurf; if (get_input_panel_surface(surface)) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "wl_input_panel::get_input_panel_surface already requested"); return; } ipsurf = create_input_panel_surface(shell, surface); if (!ipsurf) { wl_resource_post_error(surface_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "surface->configure already set"); return; } ipsurf->resource = wl_resource_create(client, &wl_input_panel_surface_interface, 1, id); wl_resource_set_implementation(ipsurf->resource, &input_panel_surface_implementation, ipsurf, destroy_input_panel_surface_resource); } static const struct wl_input_panel_interface input_panel_implementation = { input_panel_get_input_panel_surface }; static void unbind_input_panel(struct wl_resource *resource) { struct ivi_shell *shell = wl_resource_get_user_data(resource); shell->input_panel.binding = NULL; } static void bind_input_panel(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct ivi_shell *shell = data; struct wl_resource *resource; resource = wl_resource_create(client, &wl_input_panel_interface, 1, id); if (shell->input_panel.binding == NULL) { wl_resource_set_implementation(resource, &input_panel_implementation, shell, unbind_input_panel); shell->input_panel.binding = resource; return; } wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "interface object already bound"); } void input_panel_destroy(struct ivi_shell *shell) { wl_list_remove(&shell->show_input_panel_listener.link); wl_list_remove(&shell->hide_input_panel_listener.link); } int input_panel_setup(struct ivi_shell *shell) { struct weston_compositor *ec = shell->compositor; shell->show_input_panel_listener.notify = show_input_panels; wl_signal_add(&ec->show_input_panel_signal, &shell->show_input_panel_listener); shell->hide_input_panel_listener.notify = hide_input_panels; wl_signal_add(&ec->hide_input_panel_signal, &shell->hide_input_panel_listener); shell->update_input_panel_listener.notify = update_input_panels; wl_signal_add(&ec->update_input_panel_signal, &shell->update_input_panel_listener); wl_list_init(&shell->input_panel.surfaces); if (wl_global_create(shell->compositor->wl_display, &wl_input_panel_interface, 1, shell, bind_input_panel) == NULL) return -1; return 0; } weston-1.9.0/ivi-shell/ivi-shell.c0000664000175000017500000003041312561200202013706 00000000000000/* * Copyright (C) 2013 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /* * ivi-shell supports a type of shell for In-Vehicle Infotainment system. * In-Vehicle Infotainment system traditionally manages surfaces with global * identification. A protocol, ivi_application, supports such a feature * by implementing a request, ivi_application::surface_creation defined in * ivi_application.xml. * * The ivi-shell explicitly loads a module to add business logic like how to * layout surfaces by using internal ivi-layout APIs. */ #include "config.h" #include #include #include #include #include #include "ivi-shell.h" #include "ivi-application-server-protocol.h" #include "ivi-layout-export.h" #include "ivi-layout-private.h" #include "shared/helpers.h" /* Representation of ivi_surface protocol object. */ struct ivi_shell_surface { struct wl_resource* resource; struct ivi_shell *shell; struct ivi_layout_surface *layout_surface; struct weston_surface *surface; struct wl_listener surface_destroy_listener; uint32_t id_surface; int32_t width; int32_t height; struct wl_list link; struct wl_listener configured_listener; }; struct ivi_shell_setting { char *ivi_module; int developermode; }; /* * Implementation of ivi_surface */ static void surface_configure_notify(struct wl_listener *listener, void *data) { struct ivi_layout_surface *layout_surf = (struct ivi_layout_surface *)data; struct ivi_shell_surface *shell_surf = container_of(listener, struct ivi_shell_surface, configured_listener); int32_t dest_width = 0; int32_t dest_height = 0; ivi_layout_surface_get_dimension(layout_surf, &dest_width, &dest_height); if (shell_surf->resource) ivi_surface_send_configure(shell_surf->resource, dest_width, dest_height); } static void ivi_shell_surface_configure(struct weston_surface *, int32_t, int32_t); static struct ivi_shell_surface * get_ivi_shell_surface(struct weston_surface *surface) { if (surface->configure == ivi_shell_surface_configure) return surface->configure_private; return NULL; } static void ivi_shell_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct ivi_shell_surface *ivisurf = get_ivi_shell_surface(surface); if (surface->width == 0 || surface->height == 0 || ivisurf == NULL) return; if (ivisurf->width != surface->width || ivisurf->height != surface->height) { ivisurf->width = surface->width; ivisurf->height = surface->height; ivi_layout_surface_configure(ivisurf->layout_surface, surface->width, surface->height); } } static void layout_surface_cleanup(struct ivi_shell_surface *ivisurf) { assert(ivisurf->layout_surface != NULL); ivi_layout_surface_destroy(ivisurf->layout_surface); ivisurf->layout_surface = NULL; ivisurf->surface->configure = NULL; ivisurf->surface->configure_private = NULL; ivisurf->surface = NULL; // destroy weston_surface destroy signal. wl_list_remove(&ivisurf->surface_destroy_listener.link); } /* * The ivi_surface wl_resource destructor. * * Gets called via ivi_surface.destroy request or automatic wl_client clean-up. */ static void shell_destroy_shell_surface(struct wl_resource *resource) { struct ivi_shell_surface *ivisurf = wl_resource_get_user_data(resource); if (ivisurf == NULL) return; assert(ivisurf->resource == resource); if (ivisurf->layout_surface != NULL) layout_surface_cleanup(ivisurf); wl_list_remove(&ivisurf->link); free(ivisurf); } /* Gets called through the weston_surface destroy signal. */ static void shell_handle_surface_destroy(struct wl_listener *listener, void *data) { struct ivi_shell_surface *ivisurf = container_of(listener, struct ivi_shell_surface, surface_destroy_listener); assert(ivisurf != NULL); if (ivisurf->layout_surface != NULL) layout_surface_cleanup(ivisurf); } /* Gets called, when a client sends ivi_surface.destroy request. */ static void surface_destroy(struct wl_client *client, struct wl_resource *resource) { /* * Fires the wl_resource destroy signal, and then calls * ivi_surface wl_resource destructor: shell_destroy_shell_surface() */ wl_resource_destroy(resource); } static const struct ivi_surface_interface surface_implementation = { surface_destroy, }; /** * Request handler for ivi_application.surface_create. * * Creates an ivi_surface protocol object associated with the given wl_surface. * ivi_surface protocol object is represented by struct ivi_shell_surface. * * \param client The client. * \param resource The ivi_application protocol object. * \param id_surface The IVI surface ID. * \param surface_resource The wl_surface protocol object. * \param id The protocol object id for the new ivi_surface protocol object. * * The wl_surface is given the ivi_surface role and associated with a unique * IVI ID which is used to identify the surface in a controller * (window manager). */ static void application_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id_surface, struct wl_resource *surface_resource, uint32_t id) { struct ivi_shell *shell = wl_resource_get_user_data(resource); struct ivi_shell_surface *ivisurf; struct ivi_layout_surface *layout_surface; struct weston_surface *weston_surface = wl_resource_get_user_data(surface_resource); struct wl_resource *res; if (weston_surface_set_role(weston_surface, "ivi_surface", resource, IVI_APPLICATION_ERROR_ROLE) < 0) return; layout_surface = ivi_layout_surface_create(weston_surface, id_surface); /* check if id_ivi is already used for wl_surface*/ if (layout_surface == NULL) { wl_resource_post_error(resource, IVI_APPLICATION_ERROR_IVI_ID, "surface_id is already assigned " "by another app"); return; } ivisurf = zalloc(sizeof *ivisurf); if (ivisurf == NULL) { wl_resource_post_no_memory(resource); return; } wl_list_init(&ivisurf->link); wl_list_insert(&shell->ivi_surface_list, &ivisurf->link); ivisurf->shell = shell; ivisurf->id_surface = id_surface; ivisurf->width = 0; ivisurf->height = 0; ivisurf->layout_surface = layout_surface; ivisurf->configured_listener.notify = surface_configure_notify; ivi_layout_surface_add_configured_listener(layout_surface, &ivisurf->configured_listener); /* * The following code relies on wl_surface destruction triggering * immediateweston_surface destruction */ ivisurf->surface_destroy_listener.notify = shell_handle_surface_destroy; wl_signal_add(&weston_surface->destroy_signal, &ivisurf->surface_destroy_listener); ivisurf->surface = weston_surface; weston_surface->configure = ivi_shell_surface_configure; weston_surface->configure_private = ivisurf; res = wl_resource_create(client, &ivi_surface_interface, 1, id); if (res == NULL) { wl_client_post_no_memory(client); return; } ivisurf->resource = res; wl_resource_set_implementation(res, &surface_implementation, ivisurf, shell_destroy_shell_surface); } static const struct ivi_application_interface application_implementation = { application_surface_create }; /* * Handle wl_registry.bind of ivi_application global singleton. */ static void bind_ivi_application(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct ivi_shell *shell = data; struct wl_resource *resource; resource = wl_resource_create(client, &ivi_application_interface, 1, id); wl_resource_set_implementation(resource, &application_implementation, shell, NULL); } struct weston_view * get_default_view(struct weston_surface *surface) { struct ivi_shell_surface *shsurf; struct weston_view *view; if (!surface || wl_list_empty(&surface->views)) return NULL; shsurf = get_ivi_shell_surface(surface); if (shsurf && shsurf->layout_surface) { view = ivi_layout_get_weston_view(shsurf->layout_surface); if (view) return view; } wl_list_for_each(view, &surface->views, surface_link) { if (weston_view_is_mapped(view)) return view; } return container_of(surface->views.next, struct weston_view, surface_link); } /* * Called through the compositor's destroy signal. */ static void shell_destroy(struct wl_listener *listener, void *data) { struct ivi_shell *shell = container_of(listener, struct ivi_shell, destroy_listener); struct ivi_shell_surface *ivisurf, *next; text_backend_destroy(shell->text_backend); input_panel_destroy(shell); wl_list_for_each_safe(ivisurf, next, &shell->ivi_surface_list, link) { wl_list_remove(&ivisurf->link); free(ivisurf); } free(shell); } static void terminate_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key, void *data) { struct weston_compositor *compositor = data; wl_display_terminate(compositor->wl_display); } static void init_ivi_shell(struct weston_compositor *compositor, struct ivi_shell *shell, const struct ivi_shell_setting *setting) { shell->compositor = compositor; wl_list_init(&shell->ivi_surface_list); weston_layer_init(&shell->input_panel_layer, NULL); if (setting->developermode) { weston_install_debug_key_binding(compositor, MODIFIER_SUPER); weston_compositor_add_key_binding(compositor, KEY_BACKSPACE, MODIFIER_CTRL | MODIFIER_ALT, terminate_binding, compositor); } } static int ivi_shell_setting_create(struct ivi_shell_setting *dest, struct weston_compositor *compositor, int *argc, char *argv[]) { int result = 0; struct weston_config *config = compositor->config; struct weston_config_section *section; const struct weston_option ivi_shell_options[] = { { WESTON_OPTION_STRING, "ivi-module", 0, &dest->ivi_module }, }; parse_options(ivi_shell_options, ARRAY_LENGTH(ivi_shell_options), argc, argv); section = weston_config_get_section(config, "ivi-shell", NULL, NULL); if (!dest->ivi_module && weston_config_section_get_string(section, "ivi-module", &dest->ivi_module, NULL) < 0) { weston_log("Error: ivi-shell: No ivi-module set\n"); result = -1; } weston_config_section_get_bool(section, "developermode", &dest->developermode, 0); return result; } /* * Initialization of ivi-shell. */ WL_EXPORT int module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct ivi_shell *shell; struct ivi_shell_setting setting = { }; int retval = -1; shell = zalloc(sizeof *shell); if (shell == NULL) return -1; if (ivi_shell_setting_create(&setting, compositor, argc, argv) != 0) return -1; init_ivi_shell(compositor, shell, &setting); shell->destroy_listener.notify = shell_destroy; wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); if (input_panel_setup(shell) < 0) goto out_settings; shell->text_backend = text_backend_init(compositor); if (!shell->text_backend) goto out_settings; if (wl_global_create(compositor->wl_display, &ivi_application_interface, 1, shell, bind_ivi_application) == NULL) goto out_settings; ivi_layout_init_with_compositor(compositor); /* Call module_init of ivi-modules which are defined in weston.ini */ if (load_controller_modules(compositor, setting.ivi_module, argc, argv) < 0) goto out_settings; retval = 0; out_settings: free(setting.ivi_module); return retval; } weston-1.9.0/ivi-shell/ivi-layout-export.h0000664000175000017500000006110412543150037015453 00000000000000/* * Copyright (C) 2013 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * The ivi-layout library supports API set of controlling properties of * surface and layer which groups surfaces. An unique ID whose type is integer * is required to create surface and layer. With the unique ID, surface and * layer are identified to control them. The API set consists of APIs to control * properties of surface and layers about followings, * - visibility. * - opacity. * - clipping (x,y,width,height). * - position and size of it to be displayed. * - orientation per 90 degree. * - add or remove surfaces to a layer. * - order of surfaces/layers in layer/screen to be displayed. * - commit to apply property changes. * - notifications of property change. * * Management of surfaces and layers grouping these surfaces are common * way in In-Vehicle Infotainment system, which integrate several domains * in one system. A layer is allocated to a domain in order to control * application surfaces grouped to the layer all together. * * This API and ABI follow following specifications. * http://projects.genivi.org/wayland-ivi-extension/layer-manager-apis */ #ifndef _IVI_LAYOUT_EXPORT_H_ #define _IVI_LAYOUT_EXPORT_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "stdbool.h" #include "compositor.h" #define IVI_SUCCEEDED (0) #define IVI_FAILED (-1) struct ivi_layout_layer; struct ivi_layout_screen; struct ivi_layout_surface; struct ivi_layout_surface_properties { wl_fixed_t opacity; int32_t source_x; int32_t source_y; int32_t source_width; int32_t source_height; int32_t start_x; int32_t start_y; int32_t start_width; int32_t start_height; int32_t dest_x; int32_t dest_y; int32_t dest_width; int32_t dest_height; enum wl_output_transform orientation; bool visibility; int32_t transition_type; uint32_t transition_duration; }; struct ivi_layout_layer_properties { wl_fixed_t opacity; int32_t source_x; int32_t source_y; int32_t source_width; int32_t source_height; int32_t dest_x; int32_t dest_y; int32_t dest_width; int32_t dest_height; enum wl_output_transform orientation; uint32_t visibility; int32_t transition_type; uint32_t transition_duration; double start_alpha; double end_alpha; uint32_t is_fade_in; }; enum ivi_layout_notification_mask { IVI_NOTIFICATION_NONE = 0, IVI_NOTIFICATION_OPACITY = (1 << 1), IVI_NOTIFICATION_SOURCE_RECT = (1 << 2), IVI_NOTIFICATION_DEST_RECT = (1 << 3), IVI_NOTIFICATION_DIMENSION = (1 << 4), IVI_NOTIFICATION_POSITION = (1 << 5), IVI_NOTIFICATION_ORIENTATION = (1 << 6), IVI_NOTIFICATION_VISIBILITY = (1 << 7), IVI_NOTIFICATION_PIXELFORMAT = (1 << 8), IVI_NOTIFICATION_ADD = (1 << 9), IVI_NOTIFICATION_REMOVE = (1 << 10), IVI_NOTIFICATION_CONFIGURE = (1 << 11), IVI_NOTIFICATION_ALL = 0xFFFF }; enum ivi_layout_transition_type{ IVI_LAYOUT_TRANSITION_NONE, IVI_LAYOUT_TRANSITION_VIEW_DEFAULT, IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY, IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY, IVI_LAYOUT_TRANSITION_LAYER_FADE, IVI_LAYOUT_TRANSITION_LAYER_MOVE, IVI_LAYOUT_TRANSITION_LAYER_VIEW_ORDER, IVI_LAYOUT_TRANSITION_VIEW_MOVE_RESIZE, IVI_LAYOUT_TRANSITION_VIEW_RESIZE, IVI_LAYOUT_TRANSITION_VIEW_FADE, IVI_LAYOUT_TRANSITION_MAX, }; typedef void (*layer_property_notification_func)( struct ivi_layout_layer *ivilayer, const struct ivi_layout_layer_properties *, enum ivi_layout_notification_mask mask, void *userdata); typedef void (*surface_property_notification_func)( struct ivi_layout_surface *ivisurf, const struct ivi_layout_surface_properties *, enum ivi_layout_notification_mask mask, void *userdata); typedef void (*layer_create_notification_func)( struct ivi_layout_layer *ivilayer, void *userdata); typedef void (*layer_remove_notification_func)( struct ivi_layout_layer *ivilayer, void *userdata); typedef void (*surface_create_notification_func)( struct ivi_layout_surface *ivisurf, void *userdata); typedef void (*surface_remove_notification_func)( struct ivi_layout_surface *ivisurf, void *userdata); typedef void (*surface_configure_notification_func)( struct ivi_layout_surface *ivisurf, void *userdata); typedef void (*ivi_controller_surface_content_callback)( struct ivi_layout_surface *ivisurf, int32_t content, void *userdata); struct ivi_controller_interface { /** * \brief Commit all changes and execute all enqueued commands since * last commit. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*commit_changes)(void); /** * surface controller interface */ /** * \brief register/unregister for notification when ivi_surface is created */ int32_t (*add_notification_create_surface)( surface_create_notification_func callback, void *userdata); void (*remove_notification_create_surface)( surface_create_notification_func callback, void *userdata); /** * \brief register/unregister for notification when ivi_surface is removed */ int32_t (*add_notification_remove_surface)( surface_remove_notification_func callback, void *userdata); void (*remove_notification_remove_surface)( surface_remove_notification_func callback, void *userdata); /** * \brief register/unregister for notification when ivi_surface is configured */ int32_t (*add_notification_configure_surface)( surface_configure_notification_func callback, void *userdata); void (*remove_notification_configure_surface)( surface_configure_notification_func callback, void *userdata); /** * \brief Get all ivi_surfaces which are currently registered and managed * by the services * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_surfaces)(int32_t *pLength, struct ivi_layout_surface ***ppArray); /** * \brief get id of ivi_surface from ivi_layout_surface * * \return id of ivi_surface */ uint32_t (*get_id_of_surface)(struct ivi_layout_surface *ivisurf); /** * \brief get ivi_layout_surface from id of ivi_surface * * \return (struct ivi_layout_surface *) * if the method call was successful * \return NULL if the method call was failed */ struct ivi_layout_surface * (*get_surface_from_id)(uint32_t id_surface); /** * \brief get ivi_layout_surface_properties from ivisurf * * \return (struct ivi_layout_surface_properties *) * if the method call was successful * \return NULL if the method call was failed */ const struct ivi_layout_surface_properties * (*get_properties_of_surface)(struct ivi_layout_surface *ivisurf); /** * \brief Get all Surfaces which are currently registered to a given * layer and are managed by the services * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_surfaces_on_layer)(struct ivi_layout_layer *ivilayer, int32_t *pLength, struct ivi_layout_surface ***ppArray); /** * \brief Set the visibility of a ivi_surface. * * If a surface is not visible it will not be rendered. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_visibility)(struct ivi_layout_surface *ivisurf, bool newVisibility); /** * \brief Get the visibility of a surface. * * If a surface is not visible it will not be rendered. * * \return true if surface is visible * \return false if surface is invisible or the method call was failed */ bool (*surface_get_visibility)(struct ivi_layout_surface *ivisurf); /** * \brief Set the opacity of a surface. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_opacity)(struct ivi_layout_surface *ivisurf, wl_fixed_t opacity); /** * \brief Get the opacity of a ivi_surface. * * \return opacity if the method call was successful * \return wl_fixed_from_double(0.0) if the method call was failed */ wl_fixed_t (*surface_get_opacity)(struct ivi_layout_surface *ivisurf); /** * \brief Set the area of a ivi_surface which should be used for the rendering. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_source_rectangle)(struct ivi_layout_surface *ivisurf, int32_t x, int32_t y, int32_t width, int32_t height); /** * \brief Set the destination area of a ivi_surface within a ivi_layer * for rendering. * * The surface will be scaled to this rectangle for rendering. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_destination_rectangle)(struct ivi_layout_surface *ivisurf, int32_t x, int32_t y, int32_t width, int32_t height); /** * \brief Sets the horizontal and vertical position of the surface. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_position)(struct ivi_layout_surface *ivisurf, int32_t dest_x, int32_t dest_y); /** * \brief Get the horizontal and vertical position of the surface. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_get_position)(struct ivi_layout_surface *ivisurf, int32_t *dest_x, int32_t *dest_y); /** * \brief Set the horizontal and vertical dimension of the surface. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_dimension)(struct ivi_layout_surface *ivisurf, int32_t dest_width, int32_t dest_height); /** * \brief Get the horizontal and vertical dimension of the surface. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_get_dimension)(struct ivi_layout_surface *ivisurf, int32_t *dest_width, int32_t *dest_height); /** * \brief Sets the orientation of a ivi_surface. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_orientation)(struct ivi_layout_surface *ivisurf, enum wl_output_transform orientation); /** * \brief Gets the orientation of a surface. * * \return (enum wl_output_transform) * if the method call was successful * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed */ enum wl_output_transform (*surface_get_orientation)(struct ivi_layout_surface *ivisurf); /** * \brief Set an observer callback for ivi_surface content status change. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_set_content_observer)( struct ivi_layout_surface *ivisurf, ivi_controller_surface_content_callback callback, void* userdata); /** * \brief register for notification on property changes of ivi_surface * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*surface_add_notification)(struct ivi_layout_surface *ivisurf, surface_property_notification_func callback, void *userdata); /** * \brief remove notification on property changes of ivi_surface */ void (*surface_remove_notification)(struct ivi_layout_surface *ivisurf); /** * \brief get weston_surface of ivi_surface */ struct weston_surface * (*surface_get_weston_surface)(struct ivi_layout_surface *ivisurf); /** * \brief set type of transition animation */ int32_t (*surface_set_transition)(struct ivi_layout_surface *ivisurf, enum ivi_layout_transition_type type, uint32_t duration); /** * \brief set duration of transition animation */ int32_t (*surface_set_transition_duration)( struct ivi_layout_surface *ivisurf, uint32_t duration); /** * layer controller interface */ /** * \brief register/unregister for notification when ivi_layer is created */ int32_t (*add_notification_create_layer)( layer_create_notification_func callback, void *userdata); void (*remove_notification_create_layer)( layer_create_notification_func callback, void *userdata); /** * \brief register/unregister for notification when ivi_layer is removed */ int32_t (*add_notification_remove_layer)( layer_remove_notification_func callback, void *userdata); void (*remove_notification_remove_layer)( layer_remove_notification_func callback, void *userdata); /** * \brief Create a ivi_layer which should be managed by the service * * \return (struct ivi_layout_layer *) * if the method call was successful * \return NULL if the method call was failed */ struct ivi_layout_layer * (*layer_create_with_dimension)(uint32_t id_layer, int32_t width, int32_t height); /** * \brief Removes a ivi_layer which is currently managed by the service */ void (*layer_destroy)(struct ivi_layout_layer *ivilayer); /** * \brief Get all ivi_layers which are currently registered and managed * by the services * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_layers)(int32_t *pLength, struct ivi_layout_layer ***ppArray); /** * \brief get id of ivi_layer from ivi_layout_layer * * * \return id of ivi_layer */ uint32_t (*get_id_of_layer)(struct ivi_layout_layer *ivilayer); /** * \brief get ivi_layout_layer from id of layer * * \return (struct ivi_layout_layer *) * if the method call was successful * \return NULL if the method call was failed */ struct ivi_layout_layer * (*get_layer_from_id)(uint32_t id_layer); /** * \brief Get the ivi_layer properties * * \return (const struct ivi_layout_layer_properties *) * if the method call was successful * \return NULL if the method call was failed */ const struct ivi_layout_layer_properties * (*get_properties_of_layer)(struct ivi_layout_layer *ivilayer); /** * \brief Get all ivi_ayers under the given ivi_surface * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_layers_under_surface)(struct ivi_layout_surface *ivisurf, int32_t *pLength, struct ivi_layout_layer ***ppArray); /** * \brief Get all Layers of the given screen * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_layers_on_screen)(struct ivi_layout_screen *iviscrn, int32_t *pLength, struct ivi_layout_layer ***ppArray); /** * \brief Set the visibility of a ivi_layer. If a ivi_layer is not visible, * the ivi_layer and its ivi_surfaces will not be rendered. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_visibility)(struct ivi_layout_layer *ivilayer, bool newVisibility); /** * \brief Get the visibility of a layer. If a layer is not visible, * the layer and its surfaces will not be rendered. * * \return true if layer is visible * \return false if layer is invisible or the method call was failed */ bool (*layer_get_visibility)(struct ivi_layout_layer *ivilayer); /** * \brief Set the opacity of a ivi_layer. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_opacity)(struct ivi_layout_layer *ivilayer, wl_fixed_t opacity); /** * \brief Get the opacity of a ivi_layer. * * \return opacity if the method call was successful * \return wl_fixed_from_double(0.0) if the method call was failed */ wl_fixed_t (*layer_get_opacity)(struct ivi_layout_layer *ivilayer); /** * \brief Set the area of a ivi_layer which should be used for the rendering. * * Only this part will be visible. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_source_rectangle)(struct ivi_layout_layer *ivilayer, int32_t x, int32_t y, int32_t width, int32_t height); /** * \brief Set the destination area on the display for a ivi_layer. * * The ivi_layer will be scaled and positioned to this rectangle * for rendering * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_destination_rectangle)(struct ivi_layout_layer *ivilayer, int32_t x, int32_t y, int32_t width, int32_t height); /** * \brief Sets the horizontal and vertical position of the ivi_layer. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_position)(struct ivi_layout_layer *ivilayer, int32_t dest_x, int32_t dest_y); /** * \brief Get the horizontal and vertical position of the ivi_layer. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_get_position)(struct ivi_layout_layer *ivilayer, int32_t *dest_x, int32_t *dest_y); /** * \brief Set the horizontal and vertical dimension of the layer. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_dimension)(struct ivi_layout_layer *ivilayer, int32_t dest_width, int32_t dest_height); /** * \brief Get the horizontal and vertical dimension of the layer. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_get_dimension)(struct ivi_layout_layer *ivilayer, int32_t *dest_width, int32_t *dest_height); /** * \brief Sets the orientation of a ivi_layer. * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_orientation)(struct ivi_layout_layer *ivilayer, enum wl_output_transform orientation); /** * \brief Gets the orientation of a layer. * * \return (enum wl_output_transform) * if the method call was successful * \return WL_OUTPUT_TRANSFORM_NORMAL if the method call was failed */ enum wl_output_transform (*layer_get_orientation)(struct ivi_layout_layer *ivilayer); /** * \brief Add a ivi_surface to a ivi_layer which is currently managed by the service * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_add_surface)(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *addsurf); /** * \brief Removes a surface from a layer which is currently managed by the service */ void (*layer_remove_surface)(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *remsurf); /** * \brief Sets render order of ivi_surfaces within a ivi_layer * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_set_render_order)(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface **pSurface, int32_t number); /** * \brief register for notification on property changes of ivi_layer * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*layer_add_notification)(struct ivi_layout_layer *ivilayer, layer_property_notification_func callback, void *userdata); /** * \brief remove notification on property changes of ivi_layer */ void (*layer_remove_notification)(struct ivi_layout_layer *ivilayer); /** * \brief set type of transition animation */ int32_t (*layer_set_transition)(struct ivi_layout_layer *ivilayer, enum ivi_layout_transition_type type, uint32_t duration); /** * screen controller interface */ /** * \brief get ivi_layout_screen from id of ivi_screen * * \return (struct ivi_layout_screen *) * if the method call was successful * \return NULL if the method call was failed */ struct ivi_layout_screen * (*get_screen_from_id)(uint32_t id_screen); /** * \brief Get the screen resolution of a specific ivi_screen * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_screen_resolution)(struct ivi_layout_screen *iviscrn, int32_t *pWidth, int32_t *pHeight); /** * \brief Get the ivi_screens * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_screens)(int32_t *pLength, struct ivi_layout_screen ***ppArray); /** * \brief Get the ivi_screens under the given ivi_layer * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*get_screens_under_layer)(struct ivi_layout_layer *ivilayer, int32_t *pLength, struct ivi_layout_screen ***ppArray); /** * \brief Add a ivi_layer to a ivi_screen which is currently managed * by the service * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*screen_add_layer)(struct ivi_layout_screen *iviscrn, struct ivi_layout_layer *addlayer); /** * \brief Sets render order of ivi_layers on a ivi_screen * * \return IVI_SUCCEEDED if the method call was successful * \return IVI_FAILED if the method call was failed */ int32_t (*screen_set_render_order)(struct ivi_layout_screen *iviscrn, struct ivi_layout_layer **pLayer, const int32_t number); /** * \brief get weston_output from ivi_layout_screen. * * \return (struct weston_output *) * if the method call was successful * \return NULL if the method call was failed */ struct weston_output *(*screen_get_output)(struct ivi_layout_screen *); /** * transision animation for layer */ void (*transition_move_layer_cancel)(struct ivi_layout_layer *layer); int32_t (*layer_set_fade_info)(struct ivi_layout_layer* ivilayer, uint32_t is_fade_in, double start_alpha, double end_alpha); /** * surface content dumping for debugging */ int32_t (*surface_get_size)(struct ivi_layout_surface *ivisurf, int32_t *width, int32_t *height, int32_t *stride); int32_t (*surface_dump)(struct weston_surface *surface, void *target, size_t size, int32_t x, int32_t y, int32_t width, int32_t height); /** * remove notification by callback on property changes of ivi_surface */ void (*surface_remove_notification_by_callback)(struct ivi_layout_surface *ivisurf, surface_property_notification_func callback, void *userdata); /** * \brief remove notification by callback on property changes of ivi_layer */ void (*layer_remove_notification_by_callback)(struct ivi_layout_layer *ivilayer, layer_property_notification_func callback, void *userdata); /** * \brief get id of ivi_screen from ivi_layout_screen * * * \return id of ivi_screen */ uint32_t (*get_id_of_screen)(struct ivi_layout_screen *iviscrn); }; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _IVI_LAYOUT_EXPORT_H_ */ weston-1.9.0/ivi-shell/ivi-layout.c0000664000175000017500000024107212575610240014135 00000000000000/* * Copyright (C) 2013 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Implementation of ivi-layout library. The actual view on ivi_screen is * not updated till calling ivi_layout_commit_changes. A overview from * calling API for updating properties of ivi_surface/ivi_layer to asking * compositor to compose them by using weston_compositor_schedule_repaint, * 0/ initialize this library by ivi_layout_init_with_compositor * with (struct weston_compositor *ec) from ivi-shell. * 1/ When a API for updating properties of ivi_surface/ivi_layer, it updates * pending prop of ivi_surface/ivi_layer/ivi_screen which are structure to * store properties. * 2/ Before calling commitChanges, in case of calling a API to get a property, * return current property, not pending property. * 3/ At the timing of calling ivi_layout_commitChanges, pending properties * are applied to properties. * * *) ivi_layout_commitChanges is also called by transition animation * per each frame. See ivi-layout-transition.c in details. Transition * animation interpolates frames between previous properties of ivi_surface * and new ones. * For example, when a property of ivi_surface is changed from invisibility * to visibility, it behaves like fade-in. When ivi_layout_commitChange is * called during transition animation, it cancels the transition and * re-start transition to new properties from current properties of final * frame just before the the cancellation. * * 4/ According properties, set transformation by using weston_matrix and * weston_view per ivi_surfaces and ivi_layers in while loop. * 5/ Set damage and trigger transform by using weston_view_geometry_dirty. * 6/ Notify update of properties. * 7/ Trigger composition by weston_compositor_schedule_repaint. * */ #include "config.h" #include #include #include "compositor.h" #include "ivi-layout-export.h" #include "ivi-layout-private.h" #include "shared/helpers.h" #include "shared/os-compatibility.h" #define max(a, b) ((a) > (b) ? (a) : (b)) struct link_layer { struct ivi_layout_layer *ivilayer; struct wl_list link; struct wl_list link_to_layer; }; struct link_screen { struct ivi_layout_screen *iviscrn; struct wl_list link; struct wl_list link_to_screen; }; struct listener_layout_notification { void *userdata; struct wl_listener listener; }; struct ivi_layout; struct ivi_layout_screen { struct wl_list link; struct wl_list link_to_layer; uint32_t id_screen; struct ivi_layout *layout; struct weston_output *output; struct { struct wl_list layer_list; struct wl_list link; } pending; struct { int dirty; struct wl_list layer_list; struct wl_list link; } order; }; struct ivi_layout_notification_callback { void *callback; void *data; }; struct ivi_rectangle { int32_t x; int32_t y; int32_t width; int32_t height; }; static void remove_notification(struct wl_list *listener_list, void *callback, void *userdata); static struct ivi_layout ivilayout = {0}; struct ivi_layout * get_instance(void) { return &ivilayout; } /** * Internal API to add/remove a link to ivi_surface from ivi_layer. */ static void add_link_to_surface(struct ivi_layout_layer *ivilayer, struct link_layer *link_layer) { struct link_layer *link = NULL; wl_list_for_each(link, &ivilayer->link_to_surface, link_to_layer) { if (link == link_layer) return; } wl_list_insert(&ivilayer->link_to_surface, &link_layer->link_to_layer); } static void remove_link_to_surface(struct ivi_layout_layer *ivilayer) { struct link_layer *link = NULL; struct link_layer *next = NULL; wl_list_for_each_safe(link, next, &ivilayer->link_to_surface, link_to_layer) { wl_list_remove(&link->link_to_layer); wl_list_remove(&link->link); free(link); } wl_list_init(&ivilayer->link_to_surface); } /** * Internal API to add a link to ivi_layer from ivi_screen. */ static void add_link_to_layer(struct ivi_layout_screen *iviscrn, struct link_screen *link_screen) { wl_list_insert(&iviscrn->link_to_layer, &link_screen->link_to_screen); } /** * Internal API to add/remove a ivi_surface from ivi_layer. */ static void add_ordersurface_to_layer(struct ivi_layout_surface *ivisurf, struct ivi_layout_layer *ivilayer) { struct link_layer *link_layer = NULL; link_layer = malloc(sizeof *link_layer); if (link_layer == NULL) { weston_log("fails to allocate memory\n"); return; } link_layer->ivilayer = ivilayer; wl_list_insert(&ivisurf->layer_list, &link_layer->link); add_link_to_surface(ivilayer, link_layer); } static void remove_ordersurface_from_layer(struct ivi_layout_surface *ivisurf) { struct link_layer *link_layer = NULL; struct link_layer *next = NULL; wl_list_for_each_safe(link_layer, next, &ivisurf->layer_list, link) { wl_list_remove(&link_layer->link); wl_list_remove(&link_layer->link_to_layer); free(link_layer); } wl_list_init(&ivisurf->layer_list); } /** * Internal API to add/remove a ivi_layer to/from ivi_screen. */ static void add_orderlayer_to_screen(struct ivi_layout_layer *ivilayer, struct ivi_layout_screen *iviscrn) { struct link_screen *link_scrn = NULL; link_scrn = malloc(sizeof *link_scrn); if (link_scrn == NULL) { weston_log("fails to allocate memory\n"); return; } link_scrn->iviscrn = iviscrn; wl_list_insert(&ivilayer->screen_list, &link_scrn->link); add_link_to_layer(iviscrn, link_scrn); } static void remove_orderlayer_from_screen(struct ivi_layout_layer *ivilayer) { struct link_screen *link_scrn = NULL; struct link_screen *next = NULL; wl_list_for_each_safe(link_scrn, next, &ivilayer->screen_list, link) { wl_list_remove(&link_scrn->link); wl_list_remove(&link_scrn->link_to_screen); free(link_scrn); } wl_list_init(&ivilayer->screen_list); } /** * Internal API to add/remove a ivi_layer to/from ivi_screen. */ static struct ivi_layout_surface * get_surface(struct wl_list *surf_list, uint32_t id_surface) { struct ivi_layout_surface *ivisurf; wl_list_for_each(ivisurf, surf_list, link) { if (ivisurf->id_surface == id_surface) { return ivisurf; } } return NULL; } static struct ivi_layout_layer * get_layer(struct wl_list *layer_list, uint32_t id_layer) { struct ivi_layout_layer *ivilayer; wl_list_for_each(ivilayer, layer_list, link) { if (ivilayer->id_layer == id_layer) { return ivilayer; } } return NULL; } static void remove_configured_listener(struct ivi_layout_surface *ivisurf) { struct wl_listener *link = NULL; struct wl_listener *next = NULL; wl_list_for_each_safe(link, next, &ivisurf->configured.listener_list, link) { wl_list_remove(&link->link); } } static void remove_all_notification(struct wl_list *listener_list) { struct wl_listener *listener = NULL; struct wl_listener *next = NULL; wl_list_for_each_safe(listener, next, listener_list, link) { struct listener_layout_notification *notification = NULL; wl_list_remove(&listener->link); notification = container_of(listener, struct listener_layout_notification, listener); free(notification->userdata); free(notification); } } static void ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf) { if (ivisurf == NULL) { weston_log("ivi_layout_surface_remove_notification: invalid argument\n"); return; } remove_all_notification(&ivisurf->property_changed.listener_list); } static void ivi_layout_surface_remove_notification_by_callback(struct ivi_layout_surface *ivisurf, surface_property_notification_func callback, void *userdata) { if (ivisurf == NULL) { weston_log("ivi_layout_surface_remove_notification_by_callback: invalid argument\n"); return; } remove_notification(&ivisurf->property_changed.listener_list, callback, userdata); } /** * Called at destruction of wl_surface/ivi_surface */ void ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) { struct ivi_layout *layout = get_instance(); if (ivisurf == NULL) { weston_log("%s: invalid argument\n", __func__); return; } wl_list_remove(&ivisurf->transform.link); wl_list_remove(&ivisurf->pending.link); wl_list_remove(&ivisurf->order.link); wl_list_remove(&ivisurf->link); remove_ordersurface_from_layer(ivisurf); wl_signal_emit(&layout->surface_notification.removed, ivisurf); remove_configured_listener(ivisurf); ivi_layout_surface_remove_notification(ivisurf); free(ivisurf); } /** * Internal API to check ivi_layer/ivi_surface already added in ivi_layer/ivi_screen. * Called by ivi_layout_layer_add_surface/ivi_layout_screenAddLayer */ static int is_surface_in_layer(struct ivi_layout_surface *ivisurf, struct ivi_layout_layer *ivilayer) { struct ivi_layout_surface *surf = NULL; wl_list_for_each(surf, &ivilayer->pending.surface_list, pending.link) { if (surf->id_surface == ivisurf->id_surface) { return 1; } } return 0; } static int is_layer_in_screen(struct ivi_layout_layer *ivilayer, struct ivi_layout_screen *iviscrn) { struct ivi_layout_layer *layer = NULL; wl_list_for_each(layer, &iviscrn->pending.layer_list, pending.link) { if (layer->id_layer == ivilayer->id_layer) { return 1; } } return 0; } /** * Internal API to initialize ivi_screens found from output_list of weston_compositor. * Called by ivi_layout_init_with_compositor. */ static void create_screen(struct weston_compositor *ec) { struct ivi_layout *layout = get_instance(); struct ivi_layout_screen *iviscrn = NULL; struct weston_output *output = NULL; int32_t count = 0; wl_list_for_each(output, &ec->output_list, link) { iviscrn = calloc(1, sizeof *iviscrn); if (iviscrn == NULL) { weston_log("fails to allocate memory\n"); continue; } iviscrn->layout = layout; iviscrn->id_screen = count; count++; iviscrn->output = output; wl_list_init(&iviscrn->pending.layer_list); wl_list_init(&iviscrn->pending.link); wl_list_init(&iviscrn->order.layer_list); wl_list_init(&iviscrn->order.link); wl_list_init(&iviscrn->link_to_layer); wl_list_insert(&layout->screen_list, &iviscrn->link); } } /** * Internal APIs to initialize properties of ivi_surface/ivi_layer when they are created. */ static void init_layer_properties(struct ivi_layout_layer_properties *prop, int32_t width, int32_t height) { memset(prop, 0, sizeof *prop); prop->opacity = wl_fixed_from_double(1.0); prop->source_width = width; prop->source_height = height; prop->dest_width = width; prop->dest_height = height; } static void init_surface_properties(struct ivi_layout_surface_properties *prop) { memset(prop, 0, sizeof *prop); prop->opacity = wl_fixed_from_double(1.0); /* * FIXME: this shall be finxed by ivi-layout-transition. */ prop->dest_width = 1; prop->dest_height = 1; } /** * Internal APIs to be called from ivi_layout_commit_changes. */ static void update_opacity(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf) { double layer_alpha = wl_fixed_to_double(ivilayer->prop.opacity); double surf_alpha = wl_fixed_to_double(ivisurf->prop.opacity); if ((ivilayer->event_mask & IVI_NOTIFICATION_OPACITY) || (ivisurf->event_mask & IVI_NOTIFICATION_OPACITY)) { struct weston_view *tmpview = NULL; wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) { if (tmpview == NULL) { continue; } tmpview->alpha = layer_alpha * surf_alpha; } } } static void get_rotate_values(enum wl_output_transform orientation, float *v_sin, float *v_cos) { switch (orientation) { case WL_OUTPUT_TRANSFORM_90: *v_sin = 1.0f; *v_cos = 0.0f; break; case WL_OUTPUT_TRANSFORM_180: *v_sin = 0.0f; *v_cos = -1.0f; break; case WL_OUTPUT_TRANSFORM_270: *v_sin = -1.0f; *v_cos = 0.0f; break; case WL_OUTPUT_TRANSFORM_NORMAL: default: *v_sin = 0.0f; *v_cos = 1.0f; break; } } static void get_scale(enum wl_output_transform orientation, float dest_width, float dest_height, float source_width, float source_height, float *scale_x, float *scale_y) { switch (orientation) { case WL_OUTPUT_TRANSFORM_90: *scale_x = dest_width / source_height; *scale_y = dest_height / source_width; break; case WL_OUTPUT_TRANSFORM_180: *scale_x = dest_width / source_width; *scale_y = dest_height / source_height; break; case WL_OUTPUT_TRANSFORM_270: *scale_x = dest_width / source_height; *scale_y = dest_height / source_width; break; case WL_OUTPUT_TRANSFORM_NORMAL: default: *scale_x = dest_width / source_width; *scale_y = dest_height / source_height; break; } } static void calc_transformation_matrix(struct ivi_rectangle *source_rect, struct ivi_rectangle *dest_rect, enum wl_output_transform orientation, struct weston_matrix *m) { float source_center_x; float source_center_y; float vsin; float vcos; float scale_x; float scale_y; float translate_x; float translate_y; source_center_x = source_rect->x + source_rect->width * 0.5f; source_center_y = source_rect->y + source_rect->height * 0.5f; weston_matrix_translate(m, -source_center_x, -source_center_y, 0.0f); get_rotate_values(orientation, &vsin, &vcos); weston_matrix_rotate_xy(m, vcos, vsin); get_scale(orientation, dest_rect->width, dest_rect->height, source_rect->width, source_rect->height, &scale_x, &scale_y); weston_matrix_scale(m, scale_x, scale_y, 1.0f); translate_x = dest_rect->width * 0.5f + dest_rect->x; translate_y = dest_rect->height * 0.5f + dest_rect->y; weston_matrix_translate(m, translate_x, translate_y, 0.0f); } /* * This computes intersected rect_output from two ivi_rectangles */ static void ivi_rectangle_intersect(const struct ivi_rectangle *rect1, const struct ivi_rectangle *rect2, struct ivi_rectangle *rect_output) { int32_t rect1_right = rect1->x + rect1->width; int32_t rect1_bottom = rect1->y + rect1->height; int32_t rect2_right = rect2->x + rect2->width; int32_t rect2_bottom = rect2->y + rect2->height; rect_output->x = max(rect1->x, rect2->x); rect_output->y = max(rect1->y, rect2->y); rect_output->width = rect1_right < rect2_right ? rect1_right - rect_output->x : rect2_right - rect_output->x; rect_output->height = rect1_bottom < rect2_bottom ? rect1_bottom - rect_output->y : rect2_bottom - rect_output->y; if (rect_output->width < 0 || rect_output->height < 0) { rect_output->width = 0; rect_output->height = 0; } } /* * Transform rect_input by the inverse of matrix, intersect with boundingbox, * and store the result in rect_output. * The boundingbox must be given in the same coordinate space as rect_output. * Additionally, there are the following restrictions on the matrix: * - no projective transformations * - no skew * - only multiples of 90-degree rotations supported * * In failure case of weston_matrix_invert, rect_output is set to boundingbox * as a fail-safe with log. */ static void calc_inverse_matrix_transform(const struct weston_matrix *matrix, const struct ivi_rectangle *rect_input, const struct ivi_rectangle *boundingbox, struct ivi_rectangle *rect_output) { struct weston_matrix m; struct weston_vector top_left; struct weston_vector bottom_right; assert(boundingbox != rect_output); if (weston_matrix_invert(&m, matrix) < 0) { weston_log("ivi-shell: calc_inverse_matrix_transform fails to invert a matrix.\n"); weston_log("ivi-shell: boundingbox is set to the rect_output.\n"); rect_output->x = boundingbox->x; rect_output->y = boundingbox->y; rect_output->width = boundingbox->width; rect_output->height = boundingbox->height; } /* The vectors and matrices involved will always produce f[3] == 1.0. */ top_left.f[0] = rect_input->x; top_left.f[1] = rect_input->y; top_left.f[2] = 0.0f; top_left.f[3] = 1.0f; bottom_right.f[0] = rect_input->x + rect_input->width; bottom_right.f[1] = rect_input->y + rect_input->height; bottom_right.f[2] = 0.0f; bottom_right.f[3] = 1.0f; weston_matrix_transform(&m, &top_left); weston_matrix_transform(&m, &bottom_right); if (top_left.f[0] < bottom_right.f[0]) { rect_output->x = top_left.f[0]; rect_output->width = bottom_right.f[0] - rect_output->x; } else { rect_output->x = bottom_right.f[0]; rect_output->width = top_left.f[0] - rect_output->x; } if (top_left.f[1] < bottom_right.f[1]) { rect_output->y = top_left.f[1]; rect_output->height = bottom_right.f[1] - rect_output->y; } else { rect_output->y = bottom_right.f[1]; rect_output->height = top_left.f[1] - rect_output->y; } ivi_rectangle_intersect(rect_output, boundingbox, rect_output); } /** * This computes the whole transformation matrix:m from surface-local * coordinates to global coordinates. It is assumed that * weston_view::geometry.{x,y} are zero. * * Additionally, this computes the mask on surface-local coordinates as a * ivi_rectangle. This can be set to weston_view_set_mask. * * The mask is computed by following steps * - destination rectangle of layer is inversed to surface-local cooodinates * by inversed matrix:m. * - the area is intersected by intersected area between weston_surface and * source rectangle of ivi_surface. */ static void calc_surface_to_global_matrix_and_mask_to_weston_surface( struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf, struct weston_matrix *m, struct ivi_rectangle *result) { const struct ivi_layout_surface_properties *sp = &ivisurf->prop; const struct ivi_layout_layer_properties *lp = &ivilayer->prop; struct ivi_rectangle weston_surface_rect = { 0, 0, ivisurf->surface->width, ivisurf->surface->height }; struct ivi_rectangle surface_source_rect = { sp->source_x, sp->source_y, sp->source_width, sp->source_height }; struct ivi_rectangle surface_dest_rect = { sp->dest_x, sp->dest_y, sp->dest_width, sp->dest_height }; struct ivi_rectangle layer_source_rect = { lp->source_x, lp->source_y, lp->source_width, lp->source_height }; struct ivi_rectangle layer_dest_rect = { lp->dest_x, lp->dest_y, lp->dest_width, lp->dest_height }; struct ivi_rectangle surface_result; /* * the whole transformation matrix:m from surface-local * coordinates to global coordinates, which is computed by * two steps, * - surface-local coordinates to layer-local coordinates * - layer-local coordinates to global coordinates */ calc_transformation_matrix(&surface_source_rect, &surface_dest_rect, sp->orientation, m); calc_transformation_matrix(&layer_source_rect, &layer_dest_rect, lp->orientation, m); /* this intersected ivi_rectangle would be used for masking * weston_surface */ ivi_rectangle_intersect(&surface_source_rect, &weston_surface_rect, &surface_result); /* calc masking area of weston_surface from m */ calc_inverse_matrix_transform(m, &layer_dest_rect, &surface_result, result); } static void update_prop(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *ivisurf) { struct weston_view *tmpview; struct ivi_rectangle r; bool can_calc = true; if (!ivilayer->event_mask && !ivisurf->event_mask) { return; } update_opacity(ivilayer, ivisurf); wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) { if (tmpview != NULL) { break; } } if (ivisurf->prop.source_width == 0 || ivisurf->prop.source_height == 0) { weston_log("ivi-shell: source rectangle is not yet set by ivi_layout_surface_set_source_rectangle\n"); can_calc = false; } if (ivisurf->prop.dest_width == 0 || ivisurf->prop.dest_height == 0) { weston_log("ivi-shell: destination rectangle is not yet set by ivi_layout_surface_set_destination_rectangle\n"); can_calc = false; } if (can_calc) { wl_list_remove(&ivisurf->transform.link); weston_matrix_init(&ivisurf->transform.matrix); calc_surface_to_global_matrix_and_mask_to_weston_surface( ivilayer, ivisurf, &ivisurf->transform.matrix, &r); if (tmpview != NULL) { weston_view_set_mask(tmpview, r.x, r.y, r.width, r.height); wl_list_insert(&tmpview->geometry.transformation_list, &ivisurf->transform.link); weston_view_set_transform_parent(tmpview, NULL); } } ivisurf->update_count++; if (tmpview != NULL) { weston_view_geometry_dirty(tmpview); } if (ivisurf->surface != NULL) { weston_surface_damage(ivisurf->surface); } } static void commit_changes(struct ivi_layout *layout) { struct ivi_layout_screen *iviscrn = NULL; struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_surface *ivisurf = NULL; wl_list_for_each(iviscrn, &layout->screen_list, link) { wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) { wl_list_for_each(ivisurf, &ivilayer->order.surface_list, order.link) { update_prop(ivilayer, ivisurf); } } } } static void commit_surface_list(struct ivi_layout *layout) { struct ivi_layout_surface *ivisurf = NULL; int32_t dest_x = 0; int32_t dest_y = 0; int32_t dest_width = 0; int32_t dest_height = 0; int32_t configured = 0; wl_list_for_each(ivisurf, &layout->surface_list, link) { if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEFAULT) { dest_x = ivisurf->prop.dest_x; dest_y = ivisurf->prop.dest_y; dest_width = ivisurf->prop.dest_width; dest_height = ivisurf->prop.dest_height; ivi_layout_transition_move_resize_view(ivisurf, ivisurf->pending.prop.dest_x, ivisurf->pending.prop.dest_y, ivisurf->pending.prop.dest_width, ivisurf->pending.prop.dest_height, ivisurf->pending.prop.transition_duration); if (ivisurf->pending.prop.visibility) { ivi_layout_transition_visibility_on(ivisurf, ivisurf->pending.prop.transition_duration); } else { ivi_layout_transition_visibility_off(ivisurf, ivisurf->pending.prop.transition_duration); } ivisurf->prop = ivisurf->pending.prop; ivisurf->prop.dest_x = dest_x; ivisurf->prop.dest_y = dest_y; ivisurf->prop.dest_width = dest_width; ivisurf->prop.dest_height = dest_height; ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; } else if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY) { dest_x = ivisurf->prop.dest_x; dest_y = ivisurf->prop.dest_y; dest_width = ivisurf->prop.dest_width; dest_height = ivisurf->prop.dest_height; ivi_layout_transition_move_resize_view(ivisurf, ivisurf->pending.prop.dest_x, ivisurf->pending.prop.dest_y, ivisurf->pending.prop.dest_width, ivisurf->pending.prop.dest_height, ivisurf->pending.prop.transition_duration); ivisurf->prop = ivisurf->pending.prop; ivisurf->prop.dest_x = dest_x; ivisurf->prop.dest_y = dest_y; ivisurf->prop.dest_width = dest_width; ivisurf->prop.dest_height = dest_height; ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; } else if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY) { configured = 0; if (ivisurf->pending.prop.visibility) { ivi_layout_transition_visibility_on(ivisurf, ivisurf->pending.prop.transition_duration); } else { ivi_layout_transition_visibility_off(ivisurf, ivisurf->pending.prop.transition_duration); } if (ivisurf->prop.dest_width != ivisurf->pending.prop.dest_width || ivisurf->prop.dest_height != ivisurf->pending.prop.dest_height) { configured = 1; } ivisurf->prop = ivisurf->pending.prop; ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; if (configured && !is_surface_transition(ivisurf)) wl_signal_emit(&ivisurf->configured, ivisurf); } else { configured = 0; if (ivisurf->prop.dest_width != ivisurf->pending.prop.dest_width || ivisurf->prop.dest_height != ivisurf->pending.prop.dest_height) { configured = 1; } ivisurf->prop = ivisurf->pending.prop; ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; if (configured && !is_surface_transition(ivisurf)) wl_signal_emit(&ivisurf->configured, ivisurf); } } } static void commit_layer_list(struct ivi_layout *layout) { struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface *next = NULL; wl_list_for_each(ivilayer, &layout->layer_list, link) { if (ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_MOVE) { ivi_layout_transition_move_layer(ivilayer, ivilayer->pending.prop.dest_x, ivilayer->pending.prop.dest_y, ivilayer->pending.prop.transition_duration); } else if (ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_FADE) { ivi_layout_transition_fade_layer(ivilayer,ivilayer->pending.prop.is_fade_in, ivilayer->pending.prop.start_alpha,ivilayer->pending.prop.end_alpha, NULL, NULL, ivilayer->pending.prop.transition_duration); } ivilayer->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE; ivilayer->prop = ivilayer->pending.prop; if (!ivilayer->order.dirty) { continue; } wl_list_for_each_safe(ivisurf, next, &ivilayer->order.surface_list, order.link) { remove_ordersurface_from_layer(ivisurf); wl_list_remove(&ivisurf->order.link); wl_list_init(&ivisurf->order.link); ivisurf->event_mask |= IVI_NOTIFICATION_REMOVE; } assert(wl_list_empty(&ivilayer->order.surface_list)); wl_list_for_each(ivisurf, &ivilayer->pending.surface_list, pending.link) { wl_list_remove(&ivisurf->order.link); wl_list_insert(&ivilayer->order.surface_list, &ivisurf->order.link); add_ordersurface_to_layer(ivisurf, ivilayer); ivisurf->event_mask |= IVI_NOTIFICATION_ADD; } ivilayer->order.dirty = 0; } } static void commit_screen_list(struct ivi_layout *layout) { struct ivi_layout_screen *iviscrn = NULL; struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_layer *next = NULL; struct ivi_layout_surface *ivisurf = NULL; wl_list_for_each(iviscrn, &layout->screen_list, link) { if (iviscrn->order.dirty) { wl_list_for_each_safe(ivilayer, next, &iviscrn->order.layer_list, order.link) { remove_orderlayer_from_screen(ivilayer); wl_list_remove(&ivilayer->order.link); wl_list_init(&ivilayer->order.link); ivilayer->event_mask |= IVI_NOTIFICATION_REMOVE; } assert(wl_list_empty(&iviscrn->order.layer_list)); wl_list_for_each(ivilayer, &iviscrn->pending.layer_list, pending.link) { wl_list_insert(&iviscrn->order.layer_list, &ivilayer->order.link); add_orderlayer_to_screen(ivilayer, iviscrn); ivilayer->event_mask |= IVI_NOTIFICATION_ADD; } iviscrn->order.dirty = 0; } /* Clear view list of layout ivi_layer */ wl_list_init(&layout->layout_layer.view_list.link); wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) { if (ivilayer->prop.visibility == false) continue; wl_list_for_each(ivisurf, &ivilayer->order.surface_list, order.link) { struct weston_view *tmpview = NULL; wl_list_for_each(tmpview, &ivisurf->surface->views, surface_link) { if (tmpview != NULL) { break; } } if (ivisurf->prop.visibility == false) continue; if (ivisurf->surface == NULL || tmpview == NULL) continue; weston_layer_entry_insert(&layout->layout_layer.view_list, &tmpview->layer_link); ivisurf->surface->output = iviscrn->output; } } break; } } static void commit_transition(struct ivi_layout* layout) { if (wl_list_empty(&layout->pending_transition_list)) { return; } wl_list_insert_list(&layout->transitions->transition_list, &layout->pending_transition_list); wl_list_init(&layout->pending_transition_list); wl_event_source_timer_update(layout->transitions->event_source, 1); } static void send_surface_prop(struct ivi_layout_surface *ivisurf) { wl_signal_emit(&ivisurf->property_changed, ivisurf); ivisurf->event_mask = 0; } static void send_layer_prop(struct ivi_layout_layer *ivilayer) { wl_signal_emit(&ivilayer->property_changed, ivilayer); ivilayer->event_mask = 0; } static void send_prop(struct ivi_layout *layout) { struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_surface *ivisurf = NULL; wl_list_for_each_reverse(ivilayer, &layout->layer_list, link) { if (ivilayer->event_mask) send_layer_prop(ivilayer); } wl_list_for_each_reverse(ivisurf, &layout->surface_list, link) { if (ivisurf->event_mask) send_surface_prop(ivisurf); } } static void clear_surface_pending_list(struct ivi_layout_layer *ivilayer) { struct ivi_layout_surface *surface_link = NULL; struct ivi_layout_surface *surface_next = NULL; wl_list_for_each_safe(surface_link, surface_next, &ivilayer->pending.surface_list, pending.link) { wl_list_remove(&surface_link->pending.link); wl_list_init(&surface_link->pending.link); } } static void clear_surface_order_list(struct ivi_layout_layer *ivilayer) { struct ivi_layout_surface *surface_link = NULL; struct ivi_layout_surface *surface_next = NULL; wl_list_for_each_safe(surface_link, surface_next, &ivilayer->order.surface_list, order.link) { wl_list_remove(&surface_link->order.link); wl_list_init(&surface_link->order.link); } } static void layer_created(struct wl_listener *listener, void *data) { struct ivi_layout_layer *ivilayer = data; struct listener_layout_notification *notification = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *created_callback = notification->userdata; ((layer_create_notification_func)created_callback->callback) (ivilayer, created_callback->data); } static void layer_removed(struct wl_listener *listener, void *data) { struct ivi_layout_layer *ivilayer = data; struct listener_layout_notification *notification = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *removed_callback = notification->userdata; ((layer_remove_notification_func)removed_callback->callback) (ivilayer, removed_callback->data); } static void layer_prop_changed(struct wl_listener *listener, void *data) { struct ivi_layout_layer *ivilayer = data; struct listener_layout_notification *layout_listener = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *prop_callback = layout_listener->userdata; ((layer_property_notification_func)prop_callback->callback) (ivilayer, &ivilayer->prop, ivilayer->event_mask, prop_callback->data); } static void surface_created(struct wl_listener *listener, void *data) { struct ivi_layout_surface *ivisurface = data; struct listener_layout_notification *notification = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *created_callback = notification->userdata; ((surface_create_notification_func)created_callback->callback) (ivisurface, created_callback->data); } static void surface_removed(struct wl_listener *listener, void *data) { struct ivi_layout_surface *ivisurface = data; struct listener_layout_notification *notification = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *removed_callback = notification->userdata; ((surface_remove_notification_func)removed_callback->callback) (ivisurface, removed_callback->data); } static void surface_prop_changed(struct wl_listener *listener, void *data) { struct ivi_layout_surface *ivisurf = data; struct listener_layout_notification *layout_listener = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *prop_callback = layout_listener->userdata; ((surface_property_notification_func)prop_callback->callback) (ivisurf, &ivisurf->prop, ivisurf->event_mask, prop_callback->data); ivisurf->event_mask = 0; } static void surface_configure_changed(struct wl_listener *listener, void *data) { struct ivi_layout_surface *ivisurface = data; struct listener_layout_notification *notification = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *configure_changed_callback = notification->userdata; ((surface_configure_notification_func)configure_changed_callback->callback) (ivisurface, configure_changed_callback->data); } static int32_t add_notification(struct wl_signal *signal, wl_notify_func_t callback, void *userdata) { struct listener_layout_notification *notification = NULL; notification = malloc(sizeof *notification); if (notification == NULL) { weston_log("fails to allocate memory\n"); free(userdata); return IVI_FAILED; } notification->listener.notify = callback; notification->userdata = userdata; wl_signal_add(signal, ¬ification->listener); return IVI_SUCCEEDED; } static void remove_notification(struct wl_list *listener_list, void *callback, void *userdata) { struct wl_listener *listener = NULL; struct wl_listener *next = NULL; wl_list_for_each_safe(listener, next, listener_list, link) { struct listener_layout_notification *notification = container_of(listener, struct listener_layout_notification, listener); struct ivi_layout_notification_callback *notification_callback = notification->userdata; if ((notification_callback->callback != callback) || (notification_callback->data != userdata)) { continue; } wl_list_remove(&listener->link); free(notification->userdata); free(notification); } } /** * Exported APIs of ivi-layout library are implemented from here. * Brief of APIs is described in ivi-layout-export.h. */ static int32_t ivi_layout_add_notification_create_layer(layer_create_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); struct ivi_layout_notification_callback *created_callback = NULL; if (callback == NULL) { weston_log("ivi_layout_add_notification_create_layer: invalid argument\n"); return IVI_FAILED; } created_callback = malloc(sizeof *created_callback); if (created_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } created_callback->callback = callback; created_callback->data = userdata; return add_notification(&layout->layer_notification.created, layer_created, created_callback); } static void ivi_layout_remove_notification_create_layer(layer_create_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); remove_notification(&layout->layer_notification.created.listener_list, callback, userdata); } static int32_t ivi_layout_add_notification_remove_layer(layer_remove_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); struct ivi_layout_notification_callback *removed_callback = NULL; if (callback == NULL) { weston_log("ivi_layout_add_notification_remove_layer: invalid argument\n"); return IVI_FAILED; } removed_callback = malloc(sizeof *removed_callback); if (removed_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } removed_callback->callback = callback; removed_callback->data = userdata; return add_notification(&layout->layer_notification.removed, layer_removed, removed_callback); } static void ivi_layout_remove_notification_remove_layer(layer_remove_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); remove_notification(&layout->layer_notification.removed.listener_list, callback, userdata); } static int32_t ivi_layout_add_notification_create_surface(surface_create_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); struct ivi_layout_notification_callback *created_callback = NULL; if (callback == NULL) { weston_log("ivi_layout_add_notification_create_surface: invalid argument\n"); return IVI_FAILED; } created_callback = malloc(sizeof *created_callback); if (created_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } created_callback->callback = callback; created_callback->data = userdata; return add_notification(&layout->surface_notification.created, surface_created, created_callback); } static void ivi_layout_remove_notification_create_surface(surface_create_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); remove_notification(&layout->surface_notification.created.listener_list, callback, userdata); } static int32_t ivi_layout_add_notification_remove_surface(surface_remove_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); struct ivi_layout_notification_callback *removed_callback = NULL; if (callback == NULL) { weston_log("ivi_layout_add_notification_remove_surface: invalid argument\n"); return IVI_FAILED; } removed_callback = malloc(sizeof *removed_callback); if (removed_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } removed_callback->callback = callback; removed_callback->data = userdata; return add_notification(&layout->surface_notification.removed, surface_removed, removed_callback); } static void ivi_layout_remove_notification_remove_surface(surface_remove_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); remove_notification(&layout->surface_notification.removed.listener_list, callback, userdata); } static int32_t ivi_layout_add_notification_configure_surface(surface_configure_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); struct ivi_layout_notification_callback *configure_changed_callback = NULL; if (callback == NULL) { weston_log("ivi_layout_add_notification_configure_surface: invalid argument\n"); return IVI_FAILED; } configure_changed_callback = malloc(sizeof *configure_changed_callback); if (configure_changed_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } configure_changed_callback->callback = callback; configure_changed_callback->data = userdata; return add_notification(&layout->surface_notification.configure_changed, surface_configure_changed, configure_changed_callback); } static void ivi_layout_remove_notification_configure_surface(surface_configure_notification_func callback, void *userdata) { struct ivi_layout *layout = get_instance(); remove_notification(&layout->surface_notification.configure_changed.listener_list, callback, userdata); } uint32_t ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf) { return ivisurf->id_surface; } static uint32_t ivi_layout_get_id_of_layer(struct ivi_layout_layer *ivilayer) { return ivilayer->id_layer; } static uint32_t ivi_layout_get_id_of_screen(struct ivi_layout_screen *iviscrn) { return iviscrn->id_screen; } static struct ivi_layout_layer * ivi_layout_get_layer_from_id(uint32_t id_layer) { struct ivi_layout *layout = get_instance(); struct ivi_layout_layer *ivilayer = NULL; wl_list_for_each(ivilayer, &layout->layer_list, link) { if (ivilayer->id_layer == id_layer) { return ivilayer; } } return NULL; } struct ivi_layout_surface * ivi_layout_get_surface_from_id(uint32_t id_surface) { struct ivi_layout *layout = get_instance(); struct ivi_layout_surface *ivisurf = NULL; wl_list_for_each(ivisurf, &layout->surface_list, link) { if (ivisurf->id_surface == id_surface) { return ivisurf; } } return NULL; } static struct ivi_layout_screen * ivi_layout_get_screen_from_id(uint32_t id_screen) { struct ivi_layout *layout = get_instance(); struct ivi_layout_screen *iviscrn = NULL; wl_list_for_each(iviscrn, &layout->screen_list, link) { /* FIXME : select iviscrn from screen_list by id_screen */ return iviscrn; break; } return NULL; } static int32_t ivi_layout_get_screen_resolution(struct ivi_layout_screen *iviscrn, int32_t *pWidth, int32_t *pHeight) { struct weston_output *output = NULL; if (iviscrn == NULL || pWidth == NULL || pHeight == NULL) { weston_log("ivi_layout_get_screen_resolution: invalid argument\n"); return IVI_FAILED; } output = iviscrn->output; *pWidth = output->current_mode->width; *pHeight = output->current_mode->height; return IVI_SUCCEEDED; } static int32_t ivi_layout_surface_add_notification(struct ivi_layout_surface *ivisurf, surface_property_notification_func callback, void *userdata) { struct listener_layout_notification* notification = NULL; struct ivi_layout_notification_callback *prop_callback = NULL; if (ivisurf == NULL || callback == NULL) { weston_log("ivi_layout_surface_add_notification: invalid argument\n"); return IVI_FAILED; } notification = malloc(sizeof *notification); if (notification == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } prop_callback = malloc(sizeof *prop_callback); if (prop_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } prop_callback->callback = callback; prop_callback->data = userdata; notification->listener.notify = surface_prop_changed; notification->userdata = prop_callback; wl_signal_add(&ivisurf->property_changed, ¬ification->listener); return IVI_SUCCEEDED; } static const struct ivi_layout_layer_properties * ivi_layout_get_properties_of_layer(struct ivi_layout_layer *ivilayer) { if (ivilayer == NULL) { weston_log("ivi_layout_get_properties_of_layer: invalid argument\n"); return NULL; } return &ivilayer->prop; } static int32_t ivi_layout_get_screens(int32_t *pLength, struct ivi_layout_screen ***ppArray) { struct ivi_layout *layout = get_instance(); struct ivi_layout_screen *iviscrn = NULL; int32_t length = 0; int32_t n = 0; if (pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_get_screens: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&layout->screen_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_screen *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(iviscrn, &layout->screen_list, link) { (*ppArray)[n++] = iviscrn; } } *pLength = length; return IVI_SUCCEEDED; } static int32_t ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer, int32_t *pLength, struct ivi_layout_screen ***ppArray) { struct link_screen *link_scrn = NULL; int32_t length = 0; int32_t n = 0; if (ivilayer == NULL || pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_get_screens_under_layer: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&ivilayer->screen_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_screen *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(link_scrn, &ivilayer->screen_list, link) { (*ppArray)[n++] = link_scrn->iviscrn; } } *pLength = length; return IVI_SUCCEEDED; } static int32_t ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray) { struct ivi_layout *layout = get_instance(); struct ivi_layout_layer *ivilayer = NULL; int32_t length = 0; int32_t n = 0; if (pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_get_layers: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&layout->layer_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_layer *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(ivilayer, &layout->layer_list, link) { (*ppArray)[n++] = ivilayer; } } *pLength = length; return IVI_SUCCEEDED; } static int32_t ivi_layout_get_layers_on_screen(struct ivi_layout_screen *iviscrn, int32_t *pLength, struct ivi_layout_layer ***ppArray) { struct ivi_layout_layer *ivilayer = NULL; int32_t length = 0; int32_t n = 0; if (iviscrn == NULL || pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_get_layers_on_screen: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&iviscrn->order.layer_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_layer *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(ivilayer, &iviscrn->order.layer_list, order.link) { (*ppArray)[n++] = ivilayer; } } *pLength = length; return IVI_SUCCEEDED; } static int32_t ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf, int32_t *pLength, struct ivi_layout_layer ***ppArray) { struct link_layer *link_layer = NULL; int32_t length = 0; int32_t n = 0; if (ivisurf == NULL || pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_getLayers: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&ivisurf->layer_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_layer *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(link_layer, &ivisurf->layer_list, link) { (*ppArray)[n++] = link_layer->ivilayer; } } *pLength = length; return IVI_SUCCEEDED; } static int32_t ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray) { struct ivi_layout *layout = get_instance(); struct ivi_layout_surface *ivisurf = NULL; int32_t length = 0; int32_t n = 0; if (pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_get_surfaces: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&layout->surface_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_surface *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(ivisurf, &layout->surface_list, link) { (*ppArray)[n++] = ivisurf; } } *pLength = length; return IVI_SUCCEEDED; } static int32_t ivi_layout_get_surfaces_on_layer(struct ivi_layout_layer *ivilayer, int32_t *pLength, struct ivi_layout_surface ***ppArray) { struct ivi_layout_surface *ivisurf = NULL; int32_t length = 0; int32_t n = 0; if (ivilayer == NULL || pLength == NULL || ppArray == NULL) { weston_log("ivi_layout_getSurfaceIDsOnLayer: invalid argument\n"); return IVI_FAILED; } length = wl_list_length(&ivilayer->order.surface_list); if (length != 0) { /* the Array must be free by module which called this function */ *ppArray = calloc(length, sizeof(struct ivi_layout_surface *)); if (*ppArray == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } wl_list_for_each(ivisurf, &ivilayer->order.surface_list, order.link) { (*ppArray)[n++] = ivisurf; } } *pLength = length; return IVI_SUCCEEDED; } static struct ivi_layout_layer * ivi_layout_layer_create_with_dimension(uint32_t id_layer, int32_t width, int32_t height) { struct ivi_layout *layout = get_instance(); struct ivi_layout_layer *ivilayer = NULL; ivilayer = get_layer(&layout->layer_list, id_layer); if (ivilayer != NULL) { weston_log("id_layer is already created\n"); ++ivilayer->ref_count; return ivilayer; } ivilayer = calloc(1, sizeof *ivilayer); if (ivilayer == NULL) { weston_log("fails to allocate memory\n"); return NULL; } ivilayer->ref_count = 1; wl_signal_init(&ivilayer->property_changed); wl_list_init(&ivilayer->screen_list); wl_list_init(&ivilayer->link_to_surface); ivilayer->layout = layout; ivilayer->id_layer = id_layer; init_layer_properties(&ivilayer->prop, width, height); ivilayer->event_mask = 0; wl_list_init(&ivilayer->pending.surface_list); wl_list_init(&ivilayer->pending.link); ivilayer->pending.prop = ivilayer->prop; wl_list_init(&ivilayer->order.surface_list); wl_list_init(&ivilayer->order.link); wl_list_insert(&layout->layer_list, &ivilayer->link); wl_signal_emit(&layout->layer_notification.created, ivilayer); return ivilayer; } static void ivi_layout_layer_remove_notification(struct ivi_layout_layer *ivilayer) { if (ivilayer == NULL) { weston_log("ivi_layout_layer_remove_notification: invalid argument\n"); return; } remove_all_notification(&ivilayer->property_changed.listener_list); } static void ivi_layout_layer_remove_notification_by_callback(struct ivi_layout_layer *ivilayer, layer_property_notification_func callback, void *userdata) { if (ivilayer == NULL) { weston_log("ivi_layout_layer_remove_notification_by_callback: invalid argument\n"); return; } remove_notification(&ivilayer->property_changed.listener_list, callback, userdata); } static void ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer) { struct ivi_layout *layout = get_instance(); if (ivilayer == NULL) { weston_log("ivi_layout_layer_remove: invalid argument\n"); return; } if (--ivilayer->ref_count > 0) return; wl_signal_emit(&layout->layer_notification.removed, ivilayer); clear_surface_pending_list(ivilayer); clear_surface_order_list(ivilayer); wl_list_remove(&ivilayer->pending.link); wl_list_remove(&ivilayer->order.link); wl_list_remove(&ivilayer->link); remove_orderlayer_from_screen(ivilayer); remove_link_to_surface(ivilayer); ivi_layout_layer_remove_notification(ivilayer); free(ivilayer); } int32_t ivi_layout_layer_set_visibility(struct ivi_layout_layer *ivilayer, bool newVisibility) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_visibility: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->visibility = newVisibility; if (ivilayer->prop.visibility != newVisibility) ivilayer->event_mask |= IVI_NOTIFICATION_VISIBILITY; else ivilayer->event_mask &= ~IVI_NOTIFICATION_VISIBILITY; return IVI_SUCCEEDED; } static bool ivi_layout_layer_get_visibility(struct ivi_layout_layer *ivilayer) { if (ivilayer == NULL) { weston_log("ivi_layout_layer_get_visibility: invalid argument\n"); return false; } return ivilayer->prop.visibility; } int32_t ivi_layout_layer_set_opacity(struct ivi_layout_layer *ivilayer, wl_fixed_t opacity) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL || opacity < wl_fixed_from_double(0.0) || wl_fixed_from_double(1.0) < opacity) { weston_log("ivi_layout_layer_set_opacity: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->opacity = opacity; if (ivilayer->prop.opacity != opacity) ivilayer->event_mask |= IVI_NOTIFICATION_OPACITY; else ivilayer->event_mask &= ~IVI_NOTIFICATION_OPACITY; return IVI_SUCCEEDED; } wl_fixed_t ivi_layout_layer_get_opacity(struct ivi_layout_layer *ivilayer) { if (ivilayer == NULL) { weston_log("ivi_layout_layer_get_opacity: invalid argument\n"); return wl_fixed_from_double(0.0); } return ivilayer->prop.opacity; } static int32_t ivi_layout_layer_set_source_rectangle(struct ivi_layout_layer *ivilayer, int32_t x, int32_t y, int32_t width, int32_t height) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_source_rectangle: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->source_x = x; prop->source_y = y; prop->source_width = width; prop->source_height = height; if (ivilayer->prop.source_x != x || ivilayer->prop.source_y != y || ivilayer->prop.source_width != width || ivilayer->prop.source_height != height) ivilayer->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; else ivilayer->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT; return IVI_SUCCEEDED; } static int32_t ivi_layout_layer_set_destination_rectangle(struct ivi_layout_layer *ivilayer, int32_t x, int32_t y, int32_t width, int32_t height) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_destination_rectangle: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->dest_x = x; prop->dest_y = y; prop->dest_width = width; prop->dest_height = height; if (ivilayer->prop.dest_x != x || ivilayer->prop.dest_y != y || ivilayer->prop.dest_width != width || ivilayer->prop.dest_height != height) ivilayer->event_mask |= IVI_NOTIFICATION_DEST_RECT; else ivilayer->event_mask &= ~IVI_NOTIFICATION_DEST_RECT; return IVI_SUCCEEDED; } static int32_t ivi_layout_layer_get_dimension(struct ivi_layout_layer *ivilayer, int32_t *dest_width, int32_t *dest_height) { if (ivilayer == NULL || dest_width == NULL || dest_height == NULL) { weston_log("ivi_layout_layer_get_dimension: invalid argument\n"); return IVI_FAILED; } *dest_width = ivilayer->prop.dest_width; *dest_height = ivilayer->prop.dest_height; return IVI_SUCCEEDED; } static int32_t ivi_layout_layer_set_dimension(struct ivi_layout_layer *ivilayer, int32_t dest_width, int32_t dest_height) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_dimension: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->dest_width = dest_width; prop->dest_height = dest_height; if (ivilayer->prop.dest_width != dest_width || ivilayer->prop.dest_height != dest_height) ivilayer->event_mask |= IVI_NOTIFICATION_DIMENSION; else ivilayer->event_mask &= ~IVI_NOTIFICATION_DIMENSION; return IVI_SUCCEEDED; } int32_t ivi_layout_layer_get_position(struct ivi_layout_layer *ivilayer, int32_t *dest_x, int32_t *dest_y) { if (ivilayer == NULL || dest_x == NULL || dest_y == NULL) { weston_log("ivi_layout_layer_get_position: invalid argument\n"); return IVI_FAILED; } *dest_x = ivilayer->prop.dest_x; *dest_y = ivilayer->prop.dest_y; return IVI_SUCCEEDED; } int32_t ivi_layout_layer_set_position(struct ivi_layout_layer *ivilayer, int32_t dest_x, int32_t dest_y) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_position: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->dest_x = dest_x; prop->dest_y = dest_y; if (ivilayer->prop.dest_x != dest_x || ivilayer->prop.dest_y != dest_y) ivilayer->event_mask |= IVI_NOTIFICATION_POSITION; else ivilayer->event_mask &= ~IVI_NOTIFICATION_POSITION; return IVI_SUCCEEDED; } static int32_t ivi_layout_layer_set_orientation(struct ivi_layout_layer *ivilayer, enum wl_output_transform orientation) { struct ivi_layout_layer_properties *prop = NULL; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_orientation: invalid argument\n"); return IVI_FAILED; } prop = &ivilayer->pending.prop; prop->orientation = orientation; if (ivilayer->prop.orientation != orientation) ivilayer->event_mask |= IVI_NOTIFICATION_ORIENTATION; else ivilayer->event_mask &= ~IVI_NOTIFICATION_ORIENTATION; return IVI_SUCCEEDED; } static enum wl_output_transform ivi_layout_layer_get_orientation(struct ivi_layout_layer *ivilayer) { if (ivilayer == NULL) { weston_log("ivi_layout_layer_get_orientation: invalid argument\n"); return 0; } return ivilayer->prop.orientation; } int32_t ivi_layout_layer_set_render_order(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface **pSurface, int32_t number) { struct ivi_layout *layout = get_instance(); struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface *next = NULL; uint32_t *id_surface = NULL; int32_t i = 0; if (ivilayer == NULL) { weston_log("ivi_layout_layer_set_render_order: invalid argument\n"); return IVI_FAILED; } clear_surface_pending_list(ivilayer); for (i = 0; i < number; i++) { id_surface = &pSurface[i]->id_surface; wl_list_for_each_safe(ivisurf, next, &layout->surface_list, link) { if (*id_surface != ivisurf->id_surface) { continue; } wl_list_remove(&ivisurf->pending.link); wl_list_insert(&ivilayer->pending.surface_list, &ivisurf->pending.link); break; } } ivilayer->order.dirty = 1; return IVI_SUCCEEDED; } int32_t ivi_layout_surface_set_visibility(struct ivi_layout_surface *ivisurf, bool newVisibility) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL) { weston_log("ivi_layout_surface_set_visibility: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->visibility = newVisibility; if (ivisurf->prop.visibility != newVisibility) ivisurf->event_mask |= IVI_NOTIFICATION_VISIBILITY; else ivisurf->event_mask &= ~IVI_NOTIFICATION_VISIBILITY; return IVI_SUCCEEDED; } bool ivi_layout_surface_get_visibility(struct ivi_layout_surface *ivisurf) { if (ivisurf == NULL) { weston_log("ivi_layout_surface_get_visibility: invalid argument\n"); return false; } return ivisurf->prop.visibility; } int32_t ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf, wl_fixed_t opacity) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL || opacity < wl_fixed_from_double(0.0) || wl_fixed_from_double(1.0) < opacity) { weston_log("ivi_layout_surface_set_opacity: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->opacity = opacity; if (ivisurf->prop.opacity != opacity) ivisurf->event_mask |= IVI_NOTIFICATION_OPACITY; else ivisurf->event_mask &= ~IVI_NOTIFICATION_OPACITY; return IVI_SUCCEEDED; } wl_fixed_t ivi_layout_surface_get_opacity(struct ivi_layout_surface *ivisurf) { if (ivisurf == NULL) { weston_log("ivi_layout_surface_get_opacity: invalid argument\n"); return wl_fixed_from_double(0.0); } return ivisurf->prop.opacity; } int32_t ivi_layout_surface_set_destination_rectangle(struct ivi_layout_surface *ivisurf, int32_t x, int32_t y, int32_t width, int32_t height) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL) { weston_log("ivi_layout_surface_set_destination_rectangle: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->start_x = prop->dest_x; prop->start_y = prop->dest_y; prop->dest_x = x; prop->dest_y = y; prop->start_width = prop->dest_width; prop->start_height = prop->dest_height; prop->dest_width = width; prop->dest_height = height; if (ivisurf->prop.dest_x != x || ivisurf->prop.dest_y != y || ivisurf->prop.dest_width != width || ivisurf->prop.dest_height != height) ivisurf->event_mask |= IVI_NOTIFICATION_DEST_RECT; else ivisurf->event_mask &= ~IVI_NOTIFICATION_DEST_RECT; return IVI_SUCCEEDED; } static int32_t ivi_layout_surface_set_dimension(struct ivi_layout_surface *ivisurf, int32_t dest_width, int32_t dest_height) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL) { weston_log("ivi_layout_surface_set_dimension: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->dest_width = dest_width; prop->dest_height = dest_height; if (ivisurf->prop.dest_width != dest_width || ivisurf->prop.dest_height != dest_height) ivisurf->event_mask |= IVI_NOTIFICATION_DIMENSION; else ivisurf->event_mask &= ~IVI_NOTIFICATION_DIMENSION; return IVI_SUCCEEDED; } int32_t ivi_layout_surface_get_dimension(struct ivi_layout_surface *ivisurf, int32_t *dest_width, int32_t *dest_height) { if (ivisurf == NULL || dest_width == NULL || dest_height == NULL) { weston_log("ivi_layout_surface_get_dimension: invalid argument\n"); return IVI_FAILED; } *dest_width = ivisurf->prop.dest_width; *dest_height = ivisurf->prop.dest_height; return IVI_SUCCEEDED; } static int32_t ivi_layout_surface_set_position(struct ivi_layout_surface *ivisurf, int32_t dest_x, int32_t dest_y) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL) { weston_log("ivi_layout_surface_set_position: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->dest_x = dest_x; prop->dest_y = dest_y; if (ivisurf->prop.dest_x != dest_x || ivisurf->prop.dest_y != dest_y) ivisurf->event_mask |= IVI_NOTIFICATION_POSITION; else ivisurf->event_mask &= ~IVI_NOTIFICATION_POSITION; return IVI_SUCCEEDED; } static int32_t ivi_layout_surface_get_position(struct ivi_layout_surface *ivisurf, int32_t *dest_x, int32_t *dest_y) { if (ivisurf == NULL || dest_x == NULL || dest_y == NULL) { weston_log("ivi_layout_surface_get_position: invalid argument\n"); return IVI_FAILED; } *dest_x = ivisurf->prop.dest_x; *dest_y = ivisurf->prop.dest_y; return IVI_SUCCEEDED; } static int32_t ivi_layout_surface_set_orientation(struct ivi_layout_surface *ivisurf, enum wl_output_transform orientation) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL) { weston_log("ivi_layout_surface_set_orientation: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->orientation = orientation; if (ivisurf->prop.orientation != orientation) ivisurf->event_mask |= IVI_NOTIFICATION_ORIENTATION; else ivisurf->event_mask &= ~IVI_NOTIFICATION_ORIENTATION; return IVI_SUCCEEDED; } static enum wl_output_transform ivi_layout_surface_get_orientation(struct ivi_layout_surface *ivisurf) { if (ivisurf == NULL) { weston_log("ivi_layout_surface_get_orientation: invalid argument\n"); return 0; } return ivisurf->prop.orientation; } static int32_t ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn, struct ivi_layout_layer *addlayer) { struct ivi_layout *layout = get_instance(); struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_layer *next = NULL; int is_layer_in_scrn = 0; if (iviscrn == NULL || addlayer == NULL) { weston_log("ivi_layout_screen_add_layer: invalid argument\n"); return IVI_FAILED; } is_layer_in_scrn = is_layer_in_screen(addlayer, iviscrn); if (is_layer_in_scrn == 1) { weston_log("ivi_layout_screen_add_layer: addlayer is already available\n"); return IVI_SUCCEEDED; } wl_list_for_each_safe(ivilayer, next, &layout->layer_list, link) { if (ivilayer->id_layer == addlayer->id_layer) { wl_list_remove(&ivilayer->pending.link); wl_list_insert(&iviscrn->pending.layer_list, &ivilayer->pending.link); break; } } iviscrn->order.dirty = 1; return IVI_SUCCEEDED; } static int32_t ivi_layout_screen_set_render_order(struct ivi_layout_screen *iviscrn, struct ivi_layout_layer **pLayer, const int32_t number) { struct ivi_layout *layout = get_instance(); struct ivi_layout_layer *ivilayer = NULL; struct ivi_layout_layer *next = NULL; uint32_t *id_layer = NULL; int32_t i = 0; if (iviscrn == NULL) { weston_log("ivi_layout_screen_set_render_order: invalid argument\n"); return IVI_FAILED; } wl_list_for_each_safe(ivilayer, next, &iviscrn->pending.layer_list, pending.link) { wl_list_remove(&ivilayer->pending.link); wl_list_init(&ivilayer->pending.link); } assert(wl_list_empty(&iviscrn->pending.layer_list)); for (i = 0; i < number; i++) { id_layer = &pLayer[i]->id_layer; wl_list_for_each(ivilayer, &layout->layer_list, link) { if (*id_layer != ivilayer->id_layer) { continue; } wl_list_remove(&ivilayer->pending.link); wl_list_insert(&iviscrn->pending.layer_list, &ivilayer->pending.link); break; } } iviscrn->order.dirty = 1; return IVI_SUCCEEDED; } static struct weston_output * ivi_layout_screen_get_output(struct ivi_layout_screen *iviscrn) { return iviscrn->output; } /** * This function is used by the additional ivi-module because of dumping ivi_surface sceenshot. * The ivi-module, e.g. ivi-controller.so, is in wayland-ivi-extension of Genivi's Layer Management. * This function is used to get the result of drawing by clients. */ static struct weston_surface * ivi_layout_surface_get_weston_surface(struct ivi_layout_surface *ivisurf) { return ivisurf != NULL ? ivisurf->surface : NULL; } static int32_t ivi_layout_surface_get_size(struct ivi_layout_surface *ivisurf, int32_t *width, int32_t *height, int32_t *stride) { int32_t w; int32_t h; const size_t bytespp = 4; /* PIXMAN_a8b8g8r8 */ if (ivisurf == NULL || ivisurf->surface == NULL) { weston_log("%s: invalid argument\n", __func__); return IVI_FAILED; } weston_surface_get_content_size(ivisurf->surface, &w, &h); if (width != NULL) *width = w; if (height != NULL) *height = h; if (stride != NULL) *stride = w * bytespp; return IVI_SUCCEEDED; } static int32_t ivi_layout_layer_add_notification(struct ivi_layout_layer *ivilayer, layer_property_notification_func callback, void *userdata) { struct ivi_layout_notification_callback *prop_callback = NULL; if (ivilayer == NULL || callback == NULL) { weston_log("ivi_layout_layer_add_notification: invalid argument\n"); return IVI_FAILED; } prop_callback = malloc(sizeof *prop_callback); if (prop_callback == NULL) { weston_log("fails to allocate memory\n"); return IVI_FAILED; } prop_callback->callback = callback; prop_callback->data = userdata; return add_notification(&ivilayer->property_changed, layer_prop_changed, prop_callback); } static const struct ivi_layout_surface_properties * ivi_layout_get_properties_of_surface(struct ivi_layout_surface *ivisurf) { if (ivisurf == NULL) { weston_log("ivi_layout_get_properties_of_surface: invalid argument\n"); return NULL; } return &ivisurf->prop; } static int32_t ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *addsurf) { struct ivi_layout *layout = get_instance(); struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface *next = NULL; int is_surf_in_layer = 0; if (ivilayer == NULL || addsurf == NULL) { weston_log("ivi_layout_layer_add_surface: invalid argument\n"); return IVI_FAILED; } is_surf_in_layer = is_surface_in_layer(addsurf, ivilayer); if (is_surf_in_layer == 1) { weston_log("ivi_layout_layer_add_surface: addsurf is already available\n"); return IVI_SUCCEEDED; } wl_list_for_each_safe(ivisurf, next, &layout->surface_list, link) { if (ivisurf->id_surface == addsurf->id_surface) { wl_list_remove(&ivisurf->pending.link); wl_list_insert(&ivilayer->pending.surface_list, &ivisurf->pending.link); break; } } ivilayer->order.dirty = 1; return IVI_SUCCEEDED; } static void ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer, struct ivi_layout_surface *remsurf) { struct ivi_layout_surface *ivisurf = NULL; struct ivi_layout_surface *next = NULL; if (ivilayer == NULL || remsurf == NULL) { weston_log("ivi_layout_layer_remove_surface: invalid argument\n"); return; } wl_list_for_each_safe(ivisurf, next, &ivilayer->pending.surface_list, pending.link) { if (ivisurf->id_surface == remsurf->id_surface) { wl_list_remove(&ivisurf->pending.link); wl_list_init(&ivisurf->pending.link); break; } } ivilayer->order.dirty = 1; } static int32_t ivi_layout_surface_set_source_rectangle(struct ivi_layout_surface *ivisurf, int32_t x, int32_t y, int32_t width, int32_t height) { struct ivi_layout_surface_properties *prop = NULL; if (ivisurf == NULL) { weston_log("ivi_layout_surface_set_source_rectangle: invalid argument\n"); return IVI_FAILED; } prop = &ivisurf->pending.prop; prop->source_x = x; prop->source_y = y; prop->source_width = width; prop->source_height = height; if (ivisurf->prop.source_x != x || ivisurf->prop.source_y != y || ivisurf->prop.source_width != width || ivisurf->prop.source_height != height) ivisurf->event_mask |= IVI_NOTIFICATION_SOURCE_RECT; else ivisurf->event_mask &= ~IVI_NOTIFICATION_SOURCE_RECT; return IVI_SUCCEEDED; } int32_t ivi_layout_commit_changes(void) { struct ivi_layout *layout = get_instance(); commit_surface_list(layout); commit_layer_list(layout); commit_screen_list(layout); commit_transition(layout); commit_changes(layout); send_prop(layout); weston_compositor_schedule_repaint(layout->compositor); return IVI_SUCCEEDED; } static int32_t ivi_layout_layer_set_transition(struct ivi_layout_layer *ivilayer, enum ivi_layout_transition_type type, uint32_t duration) { if (ivilayer == NULL) { weston_log("%s: invalid argument\n", __func__); return -1; } ivilayer->pending.prop.transition_type = type; ivilayer->pending.prop.transition_duration = duration; return 0; } static int32_t ivi_layout_layer_set_fade_info(struct ivi_layout_layer* ivilayer, uint32_t is_fade_in, double start_alpha, double end_alpha) { if (ivilayer == NULL) { weston_log("%s: invalid argument\n", __func__); return -1; } ivilayer->pending.prop.is_fade_in = is_fade_in; ivilayer->pending.prop.start_alpha = start_alpha; ivilayer->pending.prop.end_alpha = end_alpha; return 0; } static int32_t ivi_layout_surface_set_transition_duration(struct ivi_layout_surface *ivisurf, uint32_t duration) { struct ivi_layout_surface_properties *prop; if (ivisurf == NULL) { weston_log("%s: invalid argument\n", __func__); return -1; } prop = &ivisurf->pending.prop; prop->transition_duration = duration*10; return 0; } static int32_t ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf, enum ivi_layout_transition_type type, uint32_t duration) { struct ivi_layout_surface_properties *prop; if (ivisurf == NULL) { weston_log("%s: invalid argument\n", __func__); return -1; } prop = &ivisurf->pending.prop; prop->transition_type = type; prop->transition_duration = duration; return 0; } static int32_t ivi_layout_surface_dump(struct weston_surface *surface, void *target, size_t size,int32_t x, int32_t y, int32_t width, int32_t height) { int result = 0; if (surface == NULL) { weston_log("%s: invalid argument\n", __func__); return IVI_FAILED; } result = weston_surface_copy_content( surface, target, size, x, y, width, height); return result == 0 ? IVI_SUCCEEDED : IVI_FAILED; } /** * methods of interaction between ivi-shell with ivi-layout */ struct weston_view * ivi_layout_get_weston_view(struct ivi_layout_surface *surface) { struct weston_view *tmpview = NULL; if (surface == NULL) return NULL; wl_list_for_each(tmpview, &surface->surface->views, surface_link) { if (tmpview != NULL) { break; } } return tmpview; } void ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, int32_t width, int32_t height) { struct ivi_layout *layout = get_instance(); /* emit callback which is set by ivi-layout api user */ wl_signal_emit(&layout->surface_notification.configure_changed, ivisurf); } static int32_t ivi_layout_surface_set_content_observer(struct ivi_layout_surface *ivisurf, ivi_controller_surface_content_callback callback, void* userdata) { int32_t ret = IVI_FAILED; if (ivisurf != NULL) { ivisurf->content_observer.callback = callback; ivisurf->content_observer.userdata = userdata; ret = IVI_SUCCEEDED; } return ret; } struct ivi_layout_surface* ivi_layout_surface_create(struct weston_surface *wl_surface, uint32_t id_surface) { struct ivi_layout *layout = get_instance(); struct ivi_layout_surface *ivisurf = NULL; struct weston_view *tmpview = NULL; if (wl_surface == NULL) { weston_log("ivi_layout_surface_create: invalid argument\n"); return NULL; } ivisurf = get_surface(&layout->surface_list, id_surface); if (ivisurf != NULL) { if (ivisurf->surface != NULL) { weston_log("id_surface(%d) is already created\n", id_surface); return NULL; } } ivisurf = calloc(1, sizeof *ivisurf); if (ivisurf == NULL) { weston_log("fails to allocate memory\n"); return NULL; } wl_signal_init(&ivisurf->property_changed); wl_signal_init(&ivisurf->configured); wl_list_init(&ivisurf->layer_list); ivisurf->id_surface = id_surface; ivisurf->layout = layout; ivisurf->surface = wl_surface; tmpview = weston_view_create(wl_surface); if (tmpview == NULL) { weston_log("fails to allocate memory\n"); } ivisurf->surface->width_from_buffer = 0; ivisurf->surface->height_from_buffer = 0; weston_matrix_init(&ivisurf->transform.matrix); wl_list_init(&ivisurf->transform.link); init_surface_properties(&ivisurf->prop); ivisurf->event_mask = 0; ivisurf->pending.prop = ivisurf->prop; wl_list_init(&ivisurf->pending.link); wl_list_init(&ivisurf->order.link); wl_list_init(&ivisurf->order.layer_list); wl_list_insert(&layout->surface_list, &ivisurf->link); wl_signal_emit(&layout->surface_notification.created, ivisurf); return ivisurf; } void ivi_layout_init_with_compositor(struct weston_compositor *ec) { struct ivi_layout *layout = get_instance(); layout->compositor = ec; wl_list_init(&layout->surface_list); wl_list_init(&layout->layer_list); wl_list_init(&layout->screen_list); wl_signal_init(&layout->layer_notification.created); wl_signal_init(&layout->layer_notification.removed); wl_signal_init(&layout->surface_notification.created); wl_signal_init(&layout->surface_notification.removed); wl_signal_init(&layout->surface_notification.configure_changed); /* Add layout_layer at the last of weston_compositor.layer_list */ weston_layer_init(&layout->layout_layer, ec->layer_list.prev); create_screen(ec); layout->transitions = ivi_layout_transition_set_create(ec); wl_list_init(&layout->pending_transition_list); } void ivi_layout_surface_add_configured_listener(struct ivi_layout_surface* ivisurf, struct wl_listener* listener) { wl_signal_add(&ivisurf->configured, listener); } static struct ivi_controller_interface ivi_controller_interface = { /** * commit all changes */ .commit_changes = ivi_layout_commit_changes, /** * surface controller interfaces */ .add_notification_create_surface = ivi_layout_add_notification_create_surface, .remove_notification_create_surface = ivi_layout_remove_notification_create_surface, .add_notification_remove_surface = ivi_layout_add_notification_remove_surface, .remove_notification_remove_surface = ivi_layout_remove_notification_remove_surface, .add_notification_configure_surface = ivi_layout_add_notification_configure_surface, .remove_notification_configure_surface = ivi_layout_remove_notification_configure_surface, .get_surfaces = ivi_layout_get_surfaces, .get_id_of_surface = ivi_layout_get_id_of_surface, .get_surface_from_id = ivi_layout_get_surface_from_id, .get_properties_of_surface = ivi_layout_get_properties_of_surface, .get_surfaces_on_layer = ivi_layout_get_surfaces_on_layer, .surface_set_visibility = ivi_layout_surface_set_visibility, .surface_get_visibility = ivi_layout_surface_get_visibility, .surface_set_opacity = ivi_layout_surface_set_opacity, .surface_get_opacity = ivi_layout_surface_get_opacity, .surface_set_source_rectangle = ivi_layout_surface_set_source_rectangle, .surface_set_destination_rectangle = ivi_layout_surface_set_destination_rectangle, .surface_set_position = ivi_layout_surface_set_position, .surface_get_position = ivi_layout_surface_get_position, .surface_set_dimension = ivi_layout_surface_set_dimension, .surface_get_dimension = ivi_layout_surface_get_dimension, .surface_set_orientation = ivi_layout_surface_set_orientation, .surface_get_orientation = ivi_layout_surface_get_orientation, .surface_set_content_observer = ivi_layout_surface_set_content_observer, .surface_add_notification = ivi_layout_surface_add_notification, .surface_remove_notification = ivi_layout_surface_remove_notification, .surface_get_weston_surface = ivi_layout_surface_get_weston_surface, .surface_set_transition = ivi_layout_surface_set_transition, .surface_set_transition_duration = ivi_layout_surface_set_transition_duration, /** * layer controller interfaces */ .add_notification_create_layer = ivi_layout_add_notification_create_layer, .remove_notification_create_layer = ivi_layout_remove_notification_create_layer, .add_notification_remove_layer = ivi_layout_add_notification_remove_layer, .remove_notification_remove_layer = ivi_layout_remove_notification_remove_layer, .layer_create_with_dimension = ivi_layout_layer_create_with_dimension, .layer_destroy = ivi_layout_layer_destroy, .get_layers = ivi_layout_get_layers, .get_id_of_layer = ivi_layout_get_id_of_layer, .get_layer_from_id = ivi_layout_get_layer_from_id, .get_properties_of_layer = ivi_layout_get_properties_of_layer, .get_layers_under_surface = ivi_layout_get_layers_under_surface, .get_layers_on_screen = ivi_layout_get_layers_on_screen, .layer_set_visibility = ivi_layout_layer_set_visibility, .layer_get_visibility = ivi_layout_layer_get_visibility, .layer_set_opacity = ivi_layout_layer_set_opacity, .layer_get_opacity = ivi_layout_layer_get_opacity, .layer_set_source_rectangle = ivi_layout_layer_set_source_rectangle, .layer_set_destination_rectangle = ivi_layout_layer_set_destination_rectangle, .layer_set_position = ivi_layout_layer_set_position, .layer_get_position = ivi_layout_layer_get_position, .layer_set_dimension = ivi_layout_layer_set_dimension, .layer_get_dimension = ivi_layout_layer_get_dimension, .layer_set_orientation = ivi_layout_layer_set_orientation, .layer_get_orientation = ivi_layout_layer_get_orientation, .layer_add_surface = ivi_layout_layer_add_surface, .layer_remove_surface = ivi_layout_layer_remove_surface, .layer_set_render_order = ivi_layout_layer_set_render_order, .layer_add_notification = ivi_layout_layer_add_notification, .layer_remove_notification = ivi_layout_layer_remove_notification, .layer_set_transition = ivi_layout_layer_set_transition, /** * screen controller interfaces part1 */ .get_screen_from_id = ivi_layout_get_screen_from_id, .get_screen_resolution = ivi_layout_get_screen_resolution, .get_screens = ivi_layout_get_screens, .get_screens_under_layer = ivi_layout_get_screens_under_layer, .screen_add_layer = ivi_layout_screen_add_layer, .screen_set_render_order = ivi_layout_screen_set_render_order, .screen_get_output = ivi_layout_screen_get_output, /** * animation */ .transition_move_layer_cancel = ivi_layout_transition_move_layer_cancel, .layer_set_fade_info = ivi_layout_layer_set_fade_info, /** * surface content dumping for debugging */ .surface_get_size = ivi_layout_surface_get_size, .surface_dump = ivi_layout_surface_dump, /** * remove notification by callback on property changes of ivi_surface/layer */ .surface_remove_notification_by_callback = ivi_layout_surface_remove_notification_by_callback, .layer_remove_notification_by_callback = ivi_layout_layer_remove_notification_by_callback, /** * screen controller interfaces part2 */ .get_id_of_screen = ivi_layout_get_id_of_screen }; int load_controller_modules(struct weston_compositor *compositor, const char *modules, int *argc, char *argv[]) { const char *p, *end; char buffer[256]; int (*controller_module_init)(struct weston_compositor *compositor, int *argc, char *argv[], const struct ivi_controller_interface *interface, size_t interface_version); if (modules == NULL) return 0; p = modules; while (*p) { end = strchrnul(p, ','); snprintf(buffer, sizeof buffer, "%.*s", (int)(end - p), p); controller_module_init = weston_load_module(buffer, "controller_module_init"); if (!controller_module_init) return -1; if (controller_module_init(compositor, argc, argv, &ivi_controller_interface, sizeof(struct ivi_controller_interface)) != 0) { weston_log("ivi-shell: Initialization of controller module fails"); return -1; } p = end; while (*p == ',') p++; } return 0; } weston-1.9.0/ivi-shell/weston.ini.in0000664000175000017500000000432412516305422014307 00000000000000[core] shell=@plugin_prefix@ivi-shell.so [ivi-shell] ivi-module=@plugin_prefix@hmi-controller.so ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface #developermode=true cursor-theme=default cursor-size=32 base-layer-id=1000 workspace-background-layer-id=2000 workspace-layer-id=3000 application-layer-id=4000 transition-duration=300 background-image=@abs_top_srcdir@/data/background.png background-id=1001 panel-image=@abs_top_srcdir@/data/panel.png panel-id=1002 tiling-image=@abs_top_srcdir@/data/tiling.png tiling-id=1003 sidebyside-image=@abs_top_srcdir@/data/sidebyside.png sidebyside-id=1004 fullscreen-image=@abs_top_srcdir@/data/fullscreen.png fullscreen-id=1005 random-image=@abs_top_srcdir@/data/random.png random-id=1006 home-image=@abs_top_srcdir@/data/home.png home-id=1007 workspace-background-color=0x99000000 workspace-background-id=2001 [input-method] path=@libexecdir@/weston-keyboard [ivi-launcher] workspace-id=0 icon-id=4001 icon=@abs_top_srcdir@/data/icon_ivi_flower.png path=@abs_top_builddir@/weston-flower [ivi-launcher] workspace-id=0 icon-id=4002 icon=@abs_top_srcdir@/data/icon_ivi_clickdot.png path=@abs_top_builddir@/weston-clickdot [ivi-launcher] workspace-id=1 icon-id=4003 icon=@abs_top_srcdir@/data/icon_ivi_simple-egl.png path=@abs_top_builddir@/weston-simple-egl [ivi-launcher] workspace-id=1 icon-id=4004 icon=@abs_top_srcdir@/data/icon_ivi_simple-shm.png path=@abs_top_builddir@/weston-simple-shm [ivi-launcher] workspace-id=2 icon-id=4005 icon=@abs_top_srcdir@/data/icon_ivi_smoke.png path=@abs_top_builddir@/weston-smoke [ivi-launcher] workspace-id=3 icon-id=4006 icon=@abs_top_srcdir@/data/icon_ivi_flower.png path=@abs_top_builddir@/weston-flower [ivi-launcher] workspace-id=3 icon-id=4007 icon=@abs_top_srcdir@/data/icon_ivi_clickdot.png path=@abs_top_builddir@/weston-clickdot [ivi-launcher] workspace-id=3 icon-id=4008 icon=@abs_top_srcdir@/data/icon_ivi_simple-egl.png path=@abs_top_builddir@/weston-simple-egl [ivi-launcher] workspace-id=3 icon-id=4009 icon=@abs_top_srcdir@/data/icon_ivi_simple-shm.png path=@abs_top_builddir@/weston-simple-shm [ivi-launcher] workspace-id=3 icon-id=4010 icon=@abs_top_srcdir@/data/icon_ivi_smoke.png path=@abs_top_builddir@/weston-smoke weston-1.9.0/clients/0000775000175000017500000000000012600133270011476 500000000000000weston-1.9.0/clients/desktop-shell.c0000664000175000017500000010110112537664716014361 00000000000000/* * Copyright © 2011 Kristian Høgsberg * Copyright © 2011 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "shared/cairo-util.h" #include "shared/config-parser.h" #include "shared/helpers.h" #include "desktop-shell-client-protocol.h" extern char **environ; /* defined by libc */ struct desktop { struct display *display; struct desktop_shell *shell; uint32_t interface_version; struct unlock_dialog *unlock_dialog; struct task unlock_task; struct wl_list outputs; struct window *grab_window; struct widget *grab_widget; struct weston_config *config; int locking; enum cursor_type grab_cursor; int painted; }; struct surface { void (*configure)(void *data, struct desktop_shell *desktop_shell, uint32_t edges, struct window *window, int32_t width, int32_t height); }; struct panel { struct surface base; struct window *window; struct widget *widget; struct wl_list launcher_list; struct panel_clock *clock; int painted; uint32_t color; }; struct background { struct surface base; struct window *window; struct widget *widget; int painted; char *image; int type; uint32_t color; }; struct output { struct wl_output *output; uint32_t server_output_id; struct wl_list link; struct panel *panel; struct background *background; }; struct panel_launcher { struct widget *widget; struct panel *panel; cairo_surface_t *icon; int focused, pressed; char *path; struct wl_list link; struct wl_array envp; struct wl_array argv; }; struct panel_clock { struct widget *widget; struct panel *panel; struct task clock_task; int clock_fd; }; struct unlock_dialog { struct window *window; struct widget *widget; struct widget *button; int button_focused; int closing; struct desktop *desktop; }; static void panel_add_launchers(struct panel *panel, struct desktop *desktop); static void sigchild_handler(int s) { int status; pid_t pid; while (pid = waitpid(-1, &status, WNOHANG), pid > 0) fprintf(stderr, "child %d exited\n", pid); } static int is_desktop_painted(struct desktop *desktop) { struct output *output; wl_list_for_each(output, &desktop->outputs, link) { if (output->panel && !output->panel->painted) return 0; if (output->background && !output->background->painted) return 0; } return 1; } static void check_desktop_ready(struct window *window) { struct display *display; struct desktop *desktop; display = window_get_display(window); desktop = display_get_user_data(display); if (!desktop->painted && is_desktop_painted(desktop)) { desktop->painted = 1; if (desktop->interface_version >= 2) desktop_shell_desktop_ready(desktop->shell); } } static void panel_launcher_activate(struct panel_launcher *widget) { char **argv; pid_t pid; pid = fork(); if (pid < 0) { fprintf(stderr, "fork failed: %m\n"); return; } if (pid) return; argv = widget->argv.data; if (execve(argv[0], argv, widget->envp.data) < 0) { fprintf(stderr, "execl '%s' failed: %m\n", argv[0]); exit(1); } } static void panel_launcher_redraw_handler(struct widget *widget, void *data) { struct panel_launcher *launcher = data; struct rectangle allocation; cairo_t *cr; cr = widget_cairo_create(launcher->panel->widget); widget_get_allocation(widget, &allocation); if (launcher->pressed) { allocation.x++; allocation.y++; } cairo_set_source_surface(cr, launcher->icon, allocation.x, allocation.y); cairo_paint(cr); if (launcher->focused) { cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.4); cairo_mask_surface(cr, launcher->icon, allocation.x, allocation.y); } cairo_destroy(cr); } static int panel_launcher_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct panel_launcher *launcher = data; widget_set_tooltip(widget, basename((char *)launcher->path), x, y); return CURSOR_LEFT_PTR; } static void set_hex_color(cairo_t *cr, uint32_t color) { cairo_set_source_rgba(cr, ((color >> 16) & 0xff) / 255.0, ((color >> 8) & 0xff) / 255.0, ((color >> 0) & 0xff) / 255.0, ((color >> 24) & 0xff) / 255.0); } static void panel_redraw_handler(struct widget *widget, void *data) { cairo_surface_t *surface; cairo_t *cr; struct panel *panel = data; cr = widget_cairo_create(panel->widget); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); set_hex_color(cr, panel->color); cairo_paint(cr); cairo_destroy(cr); surface = window_get_surface(panel->window); cairo_surface_destroy(surface); panel->painted = 1; check_desktop_ready(panel->window); } static int panel_launcher_enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct panel_launcher *launcher = data; launcher->focused = 1; widget_schedule_redraw(widget); return CURSOR_LEFT_PTR; } static void panel_launcher_leave_handler(struct widget *widget, struct input *input, void *data) { struct panel_launcher *launcher = data; launcher->focused = 0; widget_destroy_tooltip(widget); widget_schedule_redraw(widget); } static void panel_launcher_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct panel_launcher *launcher; launcher = widget_get_user_data(widget); widget_schedule_redraw(widget); if (state == WL_POINTER_BUTTON_STATE_RELEASED) panel_launcher_activate(launcher); } static void panel_launcher_touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct panel_launcher *launcher; launcher = widget_get_user_data(widget); launcher->focused = 1; widget_schedule_redraw(widget); } static void panel_launcher_touch_up_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data) { struct panel_launcher *launcher; launcher = widget_get_user_data(widget); launcher->focused = 0; widget_schedule_redraw(widget); panel_launcher_activate(launcher); } static void clock_func(struct task *task, uint32_t events) { struct panel_clock *clock = container_of(task, struct panel_clock, clock_task); uint64_t exp; if (read(clock->clock_fd, &exp, sizeof exp) != sizeof exp) abort(); widget_schedule_redraw(clock->widget); } static void panel_clock_redraw_handler(struct widget *widget, void *data) { struct panel_clock *clock = data; cairo_t *cr; struct rectangle allocation; cairo_text_extents_t extents; cairo_font_extents_t font_extents; time_t rawtime; struct tm * timeinfo; char string[128]; time(&rawtime); timeinfo = localtime(&rawtime); strftime(string, sizeof string, "%a %b %d, %I:%M %p", timeinfo); widget_get_allocation(widget, &allocation); if (allocation.width == 0) return; cr = widget_cairo_create(clock->panel->widget); cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 14); cairo_text_extents(cr, string, &extents); cairo_font_extents (cr, &font_extents); cairo_move_to(cr, allocation.x + 5, allocation.y + 3 * (allocation.height >> 2) + 1); cairo_set_source_rgb(cr, 0, 0, 0); cairo_show_text(cr, string); cairo_move_to(cr, allocation.x + 4, allocation.y + 3 * (allocation.height >> 2)); cairo_set_source_rgb(cr, 1, 1, 1); cairo_show_text(cr, string); cairo_destroy(cr); } static int clock_timer_reset(struct panel_clock *clock) { struct itimerspec its; its.it_interval.tv_sec = 60; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = 60; its.it_value.tv_nsec = 0; if (timerfd_settime(clock->clock_fd, 0, &its, NULL) < 0) { fprintf(stderr, "could not set timerfd\n: %m"); return -1; } return 0; } static void panel_destroy_clock(struct panel_clock *clock) { widget_destroy(clock->widget); close(clock->clock_fd); free(clock); } static void panel_add_clock(struct panel *panel) { struct panel_clock *clock; int timerfd; timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); if (timerfd < 0) { fprintf(stderr, "could not create timerfd\n: %m"); return; } clock = xzalloc(sizeof *clock); clock->panel = panel; panel->clock = clock; clock->clock_fd = timerfd; clock->clock_task.run = clock_func; display_watch_fd(window_get_display(panel->window), clock->clock_fd, EPOLLIN, &clock->clock_task); clock_timer_reset(clock); clock->widget = widget_add_widget(panel->widget, clock); widget_set_redraw_handler(clock->widget, panel_clock_redraw_handler); } static void panel_resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct panel_launcher *launcher; struct panel *panel = data; int x, y, w, h; x = 10; y = 16; wl_list_for_each(launcher, &panel->launcher_list, link) { w = cairo_image_surface_get_width(launcher->icon); h = cairo_image_surface_get_height(launcher->icon); widget_set_allocation(launcher->widget, x, y - h / 2, w + 1, h + 1); x += w + 10; } h=20; w=170; if (panel->clock) widget_set_allocation(panel->clock->widget, width - w - 8, y - h / 2, w + 1, h + 1); } static void panel_configure(void *data, struct desktop_shell *desktop_shell, uint32_t edges, struct window *window, int32_t width, int32_t height) { struct surface *surface = window_get_user_data(window); struct panel *panel = container_of(surface, struct panel, base); window_schedule_resize(panel->window, width, 32); } static void panel_destroy_launcher(struct panel_launcher *launcher) { wl_array_release(&launcher->argv); wl_array_release(&launcher->envp); free(launcher->path); cairo_surface_destroy(launcher->icon); widget_destroy(launcher->widget); wl_list_remove(&launcher->link); free(launcher); } static void panel_destroy(struct panel *panel) { struct panel_launcher *tmp; struct panel_launcher *launcher; panel_destroy_clock(panel->clock); wl_list_for_each_safe(launcher, tmp, &panel->launcher_list, link) panel_destroy_launcher(launcher); widget_destroy(panel->widget); window_destroy(panel->window); free(panel); } static struct panel * panel_create(struct desktop *desktop) { struct panel *panel; struct weston_config_section *s; panel = xzalloc(sizeof *panel); panel->base.configure = panel_configure; panel->window = window_create_custom(desktop->display); panel->widget = window_add_widget(panel->window, panel); wl_list_init(&panel->launcher_list); window_set_title(panel->window, "panel"); window_set_user_data(panel->window, panel); widget_set_redraw_handler(panel->widget, panel_redraw_handler); widget_set_resize_handler(panel->widget, panel_resize_handler); panel_add_clock(panel); s = weston_config_get_section(desktop->config, "shell", NULL, NULL); weston_config_section_get_uint(s, "panel-color", &panel->color, 0xaa000000); panel_add_launchers(panel, desktop); return panel; } static cairo_surface_t * load_icon_or_fallback(const char *icon) { cairo_surface_t *surface = cairo_image_surface_create_from_png(icon); cairo_status_t status; cairo_t *cr; status = cairo_surface_status(surface); if (status == CAIRO_STATUS_SUCCESS) return surface; cairo_surface_destroy(surface); fprintf(stderr, "ERROR loading icon from file '%s', error: '%s'\n", icon, cairo_status_to_string(status)); /* draw fallback icon */ surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 20, 20); cr = cairo_create(surface); cairo_set_source_rgba(cr, 0.8, 0.8, 0.8, 1); cairo_paint(cr); cairo_set_source_rgba(cr, 0, 0, 0, 1); cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND); cairo_rectangle(cr, 0, 0, 20, 20); cairo_move_to(cr, 4, 4); cairo_line_to(cr, 16, 16); cairo_move_to(cr, 4, 16); cairo_line_to(cr, 16, 4); cairo_stroke(cr); cairo_destroy(cr); return surface; } static void panel_add_launcher(struct panel *panel, const char *icon, const char *path) { struct panel_launcher *launcher; char *start, *p, *eq, **ps; int i, j, k; launcher = xzalloc(sizeof *launcher); launcher->icon = load_icon_or_fallback(icon); launcher->path = xstrdup(path); wl_array_init(&launcher->envp); wl_array_init(&launcher->argv); for (i = 0; environ[i]; i++) { ps = wl_array_add(&launcher->envp, sizeof *ps); *ps = environ[i]; } j = 0; start = launcher->path; while (*start) { for (p = start, eq = NULL; *p && !isspace(*p); p++) if (*p == '=') eq = p; if (eq && j == 0) { ps = launcher->envp.data; for (k = 0; k < i; k++) if (strncmp(ps[k], start, eq - start) == 0) { ps[k] = start; break; } if (k == i) { ps = wl_array_add(&launcher->envp, sizeof *ps); *ps = start; i++; } } else { ps = wl_array_add(&launcher->argv, sizeof *ps); *ps = start; j++; } while (*p && isspace(*p)) *p++ = '\0'; start = p; } ps = wl_array_add(&launcher->envp, sizeof *ps); *ps = NULL; ps = wl_array_add(&launcher->argv, sizeof *ps); *ps = NULL; launcher->panel = panel; wl_list_insert(panel->launcher_list.prev, &launcher->link); launcher->widget = widget_add_widget(panel->widget, launcher); widget_set_enter_handler(launcher->widget, panel_launcher_enter_handler); widget_set_leave_handler(launcher->widget, panel_launcher_leave_handler); widget_set_button_handler(launcher->widget, panel_launcher_button_handler); widget_set_touch_down_handler(launcher->widget, panel_launcher_touch_down_handler); widget_set_touch_up_handler(launcher->widget, panel_launcher_touch_up_handler); widget_set_redraw_handler(launcher->widget, panel_launcher_redraw_handler); widget_set_motion_handler(launcher->widget, panel_launcher_motion_handler); } enum { BACKGROUND_SCALE, BACKGROUND_SCALE_CROP, BACKGROUND_TILE }; static void background_draw(struct widget *widget, void *data) { struct background *background = data; cairo_surface_t *surface, *image; cairo_pattern_t *pattern; cairo_matrix_t matrix; cairo_t *cr; double im_w, im_h; double sx, sy, s; double tx, ty; struct rectangle allocation; surface = window_get_surface(background->window); cr = widget_cairo_create(background->widget); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0.0, 0.0, 0.2, 1.0); cairo_paint(cr); widget_get_allocation(widget, &allocation); image = NULL; if (background->image) image = load_cairo_surface(background->image); else if (background->color == 0) image = load_cairo_surface(DATADIR "/weston/pattern.png"); if (image && background->type != -1) { im_w = cairo_image_surface_get_width(image); im_h = cairo_image_surface_get_height(image); sx = im_w / allocation.width; sy = im_h / allocation.height; pattern = cairo_pattern_create_for_surface(image); switch (background->type) { case BACKGROUND_SCALE: cairo_matrix_init_scale(&matrix, sx, sy); cairo_pattern_set_matrix(pattern, &matrix); cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD); break; case BACKGROUND_SCALE_CROP: s = (sx < sy) ? sx : sy; /* align center */ tx = (im_w - s * allocation.width) * 0.5; ty = (im_h - s * allocation.height) * 0.5; cairo_matrix_init_translate(&matrix, tx, ty); cairo_matrix_scale(&matrix, s, s); cairo_pattern_set_matrix(pattern, &matrix); cairo_pattern_set_extend(pattern, CAIRO_EXTEND_PAD); break; case BACKGROUND_TILE: cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); break; } cairo_set_source(cr, pattern); cairo_pattern_destroy (pattern); cairo_surface_destroy(image); } else { set_hex_color(cr, background->color); } cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(surface); background->painted = 1; check_desktop_ready(background->window); } static void background_configure(void *data, struct desktop_shell *desktop_shell, uint32_t edges, struct window *window, int32_t width, int32_t height) { struct background *background = (struct background *) window_get_user_data(window); widget_schedule_resize(background->widget, width, height); } static void unlock_dialog_redraw_handler(struct widget *widget, void *data) { struct unlock_dialog *dialog = data; struct rectangle allocation; cairo_surface_t *surface; cairo_t *cr; cairo_pattern_t *pat; double cx, cy, r, f; cr = widget_cairo_create(widget); widget_get_allocation(dialog->widget, &allocation); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0.6); cairo_fill(cr); cairo_translate(cr, allocation.x, allocation.y); if (dialog->button_focused) f = 1.0; else f = 0.7; cx = allocation.width / 2.0; cy = allocation.height / 2.0; r = (cx < cy ? cx : cy) * 0.4; pat = cairo_pattern_create_radial(cx, cy, r * 0.7, cx, cy, r); cairo_pattern_add_color_stop_rgb(pat, 0.0, 0, 0.86 * f, 0); cairo_pattern_add_color_stop_rgb(pat, 0.85, 0.2 * f, f, 0.2 * f); cairo_pattern_add_color_stop_rgb(pat, 1.0, 0, 0.86 * f, 0); cairo_set_source(cr, pat); cairo_pattern_destroy(pat); cairo_arc(cr, cx, cy, r, 0.0, 2.0 * M_PI); cairo_fill(cr); widget_set_allocation(dialog->button, allocation.x + cx - r, allocation.y + cy - r, 2 * r, 2 * r); cairo_destroy(cr); surface = window_get_surface(dialog->window); cairo_surface_destroy(surface); } static void unlock_dialog_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct unlock_dialog *dialog = data; struct desktop *desktop = dialog->desktop; if (button == BTN_LEFT) { if (state == WL_POINTER_BUTTON_STATE_RELEASED && !dialog->closing) { display_defer(desktop->display, &desktop->unlock_task); dialog->closing = 1; } } } static void unlock_dialog_touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct unlock_dialog *dialog = data; dialog->button_focused = 1; widget_schedule_redraw(widget); } static void unlock_dialog_touch_up_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data) { struct unlock_dialog *dialog = data; struct desktop *desktop = dialog->desktop; dialog->button_focused = 0; widget_schedule_redraw(widget); display_defer(desktop->display, &desktop->unlock_task); dialog->closing = 1; } static void unlock_dialog_keyboard_focus_handler(struct window *window, struct input *device, void *data) { window_schedule_redraw(window); } static int unlock_dialog_widget_enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct unlock_dialog *dialog = data; dialog->button_focused = 1; widget_schedule_redraw(widget); return CURSOR_LEFT_PTR; } static void unlock_dialog_widget_leave_handler(struct widget *widget, struct input *input, void *data) { struct unlock_dialog *dialog = data; dialog->button_focused = 0; widget_schedule_redraw(widget); } static struct unlock_dialog * unlock_dialog_create(struct desktop *desktop) { struct display *display = desktop->display; struct unlock_dialog *dialog; dialog = xzalloc(sizeof *dialog); dialog->window = window_create_custom(display); dialog->widget = window_frame_create(dialog->window, dialog); window_set_title(dialog->window, "Unlock your desktop"); window_set_user_data(dialog->window, dialog); window_set_keyboard_focus_handler(dialog->window, unlock_dialog_keyboard_focus_handler); dialog->button = widget_add_widget(dialog->widget, dialog); widget_set_redraw_handler(dialog->widget, unlock_dialog_redraw_handler); widget_set_enter_handler(dialog->button, unlock_dialog_widget_enter_handler); widget_set_leave_handler(dialog->button, unlock_dialog_widget_leave_handler); widget_set_button_handler(dialog->button, unlock_dialog_button_handler); widget_set_touch_down_handler(dialog->button, unlock_dialog_touch_down_handler); widget_set_touch_up_handler(dialog->button, unlock_dialog_touch_up_handler); desktop_shell_set_lock_surface(desktop->shell, window_get_wl_surface(dialog->window)); window_schedule_resize(dialog->window, 260, 230); return dialog; } static void unlock_dialog_destroy(struct unlock_dialog *dialog) { window_destroy(dialog->window); free(dialog); } static void unlock_dialog_finish(struct task *task, uint32_t events) { struct desktop *desktop = container_of(task, struct desktop, unlock_task); desktop_shell_unlock(desktop->shell); unlock_dialog_destroy(desktop->unlock_dialog); desktop->unlock_dialog = NULL; } static void desktop_shell_configure(void *data, struct desktop_shell *desktop_shell, uint32_t edges, struct wl_surface *surface, int32_t width, int32_t height) { struct window *window = wl_surface_get_user_data(surface); struct surface *s = window_get_user_data(window); s->configure(data, desktop_shell, edges, window, width, height); } static void desktop_shell_prepare_lock_surface(void *data, struct desktop_shell *desktop_shell) { struct desktop *desktop = data; if (!desktop->locking) { desktop_shell_unlock(desktop->shell); return; } if (!desktop->unlock_dialog) { desktop->unlock_dialog = unlock_dialog_create(desktop); desktop->unlock_dialog->desktop = desktop; } } static void desktop_shell_grab_cursor(void *data, struct desktop_shell *desktop_shell, uint32_t cursor) { struct desktop *desktop = data; switch (cursor) { case DESKTOP_SHELL_CURSOR_NONE: desktop->grab_cursor = CURSOR_BLANK; break; case DESKTOP_SHELL_CURSOR_BUSY: desktop->grab_cursor = CURSOR_WATCH; break; case DESKTOP_SHELL_CURSOR_MOVE: desktop->grab_cursor = CURSOR_DRAGGING; break; case DESKTOP_SHELL_CURSOR_RESIZE_TOP: desktop->grab_cursor = CURSOR_TOP; break; case DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM: desktop->grab_cursor = CURSOR_BOTTOM; break; case DESKTOP_SHELL_CURSOR_RESIZE_LEFT: desktop->grab_cursor = CURSOR_LEFT; break; case DESKTOP_SHELL_CURSOR_RESIZE_RIGHT: desktop->grab_cursor = CURSOR_RIGHT; break; case DESKTOP_SHELL_CURSOR_RESIZE_TOP_LEFT: desktop->grab_cursor = CURSOR_TOP_LEFT; break; case DESKTOP_SHELL_CURSOR_RESIZE_TOP_RIGHT: desktop->grab_cursor = CURSOR_TOP_RIGHT; break; case DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_LEFT: desktop->grab_cursor = CURSOR_BOTTOM_LEFT; break; case DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_RIGHT: desktop->grab_cursor = CURSOR_BOTTOM_RIGHT; break; case DESKTOP_SHELL_CURSOR_ARROW: default: desktop->grab_cursor = CURSOR_LEFT_PTR; } } static const struct desktop_shell_listener listener = { desktop_shell_configure, desktop_shell_prepare_lock_surface, desktop_shell_grab_cursor }; static void background_destroy(struct background *background) { widget_destroy(background->widget); window_destroy(background->window); free(background->image); free(background); } static struct background * background_create(struct desktop *desktop) { struct background *background; struct weston_config_section *s; char *type; background = xzalloc(sizeof *background); background->base.configure = background_configure; background->window = window_create_custom(desktop->display); background->widget = window_add_widget(background->window, background); window_set_user_data(background->window, background); widget_set_redraw_handler(background->widget, background_draw); widget_set_transparent(background->widget, 0); window_set_preferred_format(background->window, WINDOW_PREFERRED_FORMAT_RGB565); s = weston_config_get_section(desktop->config, "shell", NULL, NULL); weston_config_section_get_string(s, "background-image", &background->image, NULL); weston_config_section_get_uint(s, "background-color", &background->color, 0); weston_config_section_get_string(s, "background-type", &type, "tile"); if (type == NULL) { fprintf(stderr, "%s: out of memory\n", program_invocation_short_name); exit(EXIT_FAILURE); } if (strcmp(type, "scale") == 0) { background->type = BACKGROUND_SCALE; } else if (strcmp(type, "scale-crop") == 0) { background->type = BACKGROUND_SCALE_CROP; } else if (strcmp(type, "tile") == 0) { background->type = BACKGROUND_TILE; } else { background->type = -1; fprintf(stderr, "invalid background-type: %s\n", type); } free(type); return background; } static int grab_surface_enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct desktop *desktop = data; return desktop->grab_cursor; } static void grab_surface_destroy(struct desktop *desktop) { widget_destroy(desktop->grab_widget); window_destroy(desktop->grab_window); } static void grab_surface_create(struct desktop *desktop) { struct wl_surface *s; desktop->grab_window = window_create_custom(desktop->display); window_set_user_data(desktop->grab_window, desktop); s = window_get_wl_surface(desktop->grab_window); desktop_shell_set_grab_surface(desktop->shell, s); desktop->grab_widget = window_add_widget(desktop->grab_window, desktop); /* We set the allocation to 1x1 at 0,0 so the fake enter event * at 0,0 will go to this widget. */ widget_set_allocation(desktop->grab_widget, 0, 0, 1, 1); widget_set_enter_handler(desktop->grab_widget, grab_surface_enter_handler); } static void output_destroy(struct output *output) { background_destroy(output->background); if (output->panel) panel_destroy(output->panel); wl_output_destroy(output->output); wl_list_remove(&output->link); free(output); } static void desktop_destroy_outputs(struct desktop *desktop) { struct output *tmp; struct output *output; wl_list_for_each_safe(output, tmp, &desktop->outputs, link) output_destroy(output); } static void output_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, int physical_width, int physical_height, int subpixel, const char *make, const char *model, int transform) { struct output *output = data; if (output->panel) window_set_buffer_transform(output->panel->window, transform); window_set_buffer_transform(output->background->window, transform); } static void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh) { } static void output_handle_done(void *data, struct wl_output *wl_output) { } static void output_handle_scale(void *data, struct wl_output *wl_output, int32_t scale) { struct output *output = data; if (output->panel) window_set_buffer_scale(output->panel->window, scale); window_set_buffer_scale(output->background->window, scale); } static const struct wl_output_listener output_listener = { output_handle_geometry, output_handle_mode, output_handle_done, output_handle_scale }; static int want_panel(struct desktop *desktop) { struct weston_config_section *s; char *location = NULL; int ret = 1; s = weston_config_get_section(desktop->config, "shell", NULL, NULL); weston_config_section_get_string(s, "panel-location", &location, "top"); if (strcmp(location, "top") != 0) ret = 0; free(location); return ret; } static void output_init(struct output *output, struct desktop *desktop) { struct wl_surface *surface; if (want_panel(desktop)) { output->panel = panel_create(desktop); surface = window_get_wl_surface(output->panel->window); desktop_shell_set_panel(desktop->shell, output->output, surface); } output->background = background_create(desktop); surface = window_get_wl_surface(output->background->window); desktop_shell_set_background(desktop->shell, output->output, surface); } static void create_output(struct desktop *desktop, uint32_t id) { struct output *output; output = calloc(1, sizeof *output); if (!output) return; output->output = display_bind(desktop->display, id, &wl_output_interface, 2); output->server_output_id = id; wl_output_add_listener(output->output, &output_listener, output); wl_list_insert(&desktop->outputs, &output->link); /* On start up we may process an output global before the shell global * in which case we can't create the panel and background just yet */ if (desktop->shell) output_init(output, desktop); } static void global_handler(struct display *display, uint32_t id, const char *interface, uint32_t version, void *data) { struct desktop *desktop = data; if (!strcmp(interface, "desktop_shell")) { desktop->interface_version = (version < 2) ? version : 2; desktop->shell = display_bind(desktop->display, id, &desktop_shell_interface, desktop->interface_version); desktop_shell_add_listener(desktop->shell, &listener, desktop); } else if (!strcmp(interface, "wl_output")) { create_output(desktop, id); } } static void global_handler_remove(struct display *display, uint32_t id, const char *interface, uint32_t version, void *data) { struct desktop *desktop = data; struct output *output; if (!strcmp(interface, "wl_output")) { wl_list_for_each(output, &desktop->outputs, link) { if (output->server_output_id == id) { output_destroy(output); break; } } } } static void panel_add_launchers(struct panel *panel, struct desktop *desktop) { struct weston_config_section *s; char *icon, *path; const char *name; int count; count = 0; s = NULL; while (weston_config_next_section(desktop->config, &s, &name)) { if (strcmp(name, "launcher") != 0) continue; weston_config_section_get_string(s, "icon", &icon, NULL); weston_config_section_get_string(s, "path", &path, NULL); if (icon != NULL && path != NULL) { panel_add_launcher(panel, icon, path); count++; } else { fprintf(stderr, "invalid launcher section\n"); } free(icon); free(path); } if (count == 0) { /* add default launcher */ panel_add_launcher(panel, DATADIR "/weston/terminal.png", BINDIR "/weston-terminal"); } } int main(int argc, char *argv[]) { struct desktop desktop = { 0 }; struct output *output; struct weston_config_section *s; const char *config_file; desktop.unlock_task.run = unlock_dialog_finish; wl_list_init(&desktop.outputs); config_file = weston_config_get_name_from_env(); desktop.config = weston_config_parse(config_file); s = weston_config_get_section(desktop.config, "shell", NULL, NULL); weston_config_section_get_bool(s, "locking", &desktop.locking, 1); desktop.display = display_create(&argc, argv); if (desktop.display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } display_set_user_data(desktop.display, &desktop); display_set_global_handler(desktop.display, global_handler); display_set_global_handler_remove(desktop.display, global_handler_remove); /* Create panel and background for outputs processed before the shell * global interface was processed */ wl_list_for_each(output, &desktop.outputs, link) if (!output->panel) output_init(output, &desktop); grab_surface_create(&desktop); signal(SIGCHLD, sigchild_handler); display_run(desktop.display); /* Cleanup */ grab_surface_destroy(&desktop); desktop_destroy_outputs(&desktop); if (desktop.unlock_dialog) unlock_dialog_destroy(desktop.unlock_dialog); desktop_shell_destroy(desktop.shell); display_destroy(desktop.display); return 0; } weston-1.9.0/clients/simple-shm.c0000664000175000017500000003350412537664635013674 00000000000000/* * Copyright © 2011 Benjamin Franzke * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include "shared/os-compatibility.h" #include "xdg-shell-client-protocol.h" #include "fullscreen-shell-client-protocol.h" #include #include "ivi-application-client-protocol.h" #define IVI_SURFACE_ID 9000 struct display { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct xdg_shell *shell; struct _wl_fullscreen_shell *fshell; struct wl_shm *shm; uint32_t formats; struct ivi_application *ivi_application; }; struct buffer { struct wl_buffer *buffer; void *shm_data; int busy; }; struct window { struct display *display; int width, height; struct wl_surface *surface; struct xdg_surface *xdg_surface; struct ivi_surface *ivi_surface; struct buffer buffers[2]; struct buffer *prev_buffer; struct wl_callback *callback; }; static int running = 1; static void buffer_release(void *data, struct wl_buffer *buffer) { struct buffer *mybuf = data; mybuf->busy = 0; } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static int create_shm_buffer(struct display *display, struct buffer *buffer, int width, int height, uint32_t format) { struct wl_shm_pool *pool; int fd, size, stride; void *data; stride = width * 4; size = stride * height; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return -1; } data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { fprintf(stderr, "mmap failed: %m\n"); close(fd); return -1; } pool = wl_shm_create_pool(display->shm, fd, size); buffer->buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, format); wl_buffer_add_listener(buffer->buffer, &buffer_listener, buffer); wl_shm_pool_destroy(pool); close(fd); buffer->shm_data = data; return 0; } static void handle_configure(void *data, struct xdg_surface *surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) { xdg_surface_ack_configure(surface, serial); } static void handle_delete(void *data, struct xdg_surface *xdg_surface) { running = 0; } static const struct xdg_surface_listener xdg_surface_listener = { handle_configure, handle_delete, }; static void handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, int32_t width, int32_t height) { /* Simple-shm is resizable */ } static const struct ivi_surface_listener ivi_surface_listener = { handle_ivi_surface_configure, }; static struct window * create_window(struct display *display, int width, int height) { struct window *window; window = calloc(1, sizeof *window); if (!window) return NULL; window->callback = NULL; window->display = display; window->width = width; window->height = height; window->surface = wl_compositor_create_surface(display->compositor); if (display->shell) { window->xdg_surface = xdg_shell_get_xdg_surface(display->shell, window->surface); assert(window->xdg_surface); xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); xdg_surface_set_title(window->xdg_surface, "simple-shm"); } else if (display->fshell) { _wl_fullscreen_shell_present_surface(display->fshell, window->surface, _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT, NULL); } else if (display->ivi_application ) { uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); window->ivi_surface = ivi_application_surface_create(display->ivi_application, id_ivisurf, window->surface); if (window->ivi_surface == NULL) { fprintf(stderr, "Failed to create ivi_client_surface\n"); abort(); } ivi_surface_add_listener(window->ivi_surface, &ivi_surface_listener, window); } else { assert(0); } return window; } static void destroy_window(struct window *window) { if (window->callback) wl_callback_destroy(window->callback); if (window->buffers[0].buffer) wl_buffer_destroy(window->buffers[0].buffer); if (window->buffers[1].buffer) wl_buffer_destroy(window->buffers[1].buffer); if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface); wl_surface_destroy(window->surface); free(window); } static struct buffer * window_next_buffer(struct window *window) { struct buffer *buffer; int ret = 0; if (!window->buffers[0].busy) buffer = &window->buffers[0]; else if (!window->buffers[1].busy) buffer = &window->buffers[1]; else return NULL; if (!buffer->buffer) { ret = create_shm_buffer(window->display, buffer, window->width, window->height, WL_SHM_FORMAT_XRGB8888); if (ret < 0) return NULL; /* paint the padding */ memset(buffer->shm_data, 0xff, window->width * window->height * 4); } return buffer; } static void paint_pixels(void *image, int padding, int width, int height, uint32_t time) { const int halfh = padding + (height - padding * 2) / 2; const int halfw = padding + (width - padding * 2) / 2; int ir, or; uint32_t *pixel = image; int y; /* squared radii thresholds */ or = (halfw < halfh ? halfw : halfh) - 8; ir = or - 32; or *= or; ir *= ir; pixel += padding * width; for (y = padding; y < height - padding; y++) { int x; int y2 = (y - halfh) * (y - halfh); pixel += padding; for (x = padding; x < width - padding; x++) { uint32_t v; /* squared distance from center */ int r2 = (x - halfw) * (x - halfw) + y2; if (r2 < ir) v = (r2 / 32 + time / 64) * 0x0080401; else if (r2 < or) v = (y + time / 32) * 0x0080401; else v = (x + time / 16) * 0x0080401; v &= 0x00ffffff; /* cross if compositor uses X from XRGB as alpha */ if (abs(x - y) > 6 && abs(x + y - height) > 6) v |= 0xff000000; *pixel++ = v; } pixel += padding; } } static const struct wl_callback_listener frame_listener; static void redraw(void *data, struct wl_callback *callback, uint32_t time) { struct window *window = data; struct buffer *buffer; buffer = window_next_buffer(window); if (!buffer) { fprintf(stderr, !callback ? "Failed to create the first buffer.\n" : "Both buffers busy at redraw(). Server bug?\n"); abort(); } paint_pixels(buffer->shm_data, 20, window->width, window->height, time); wl_surface_attach(window->surface, buffer->buffer, 0, 0); wl_surface_damage(window->surface, 20, 20, window->width - 40, window->height - 40); if (callback) wl_callback_destroy(callback); window->callback = wl_surface_frame(window->surface); wl_callback_add_listener(window->callback, &frame_listener, window); wl_surface_commit(window->surface); buffer->busy = 1; } static const struct wl_callback_listener frame_listener = { redraw }; static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct display *d = data; d->formats |= (1 << format); } struct wl_shm_listener shm_listener = { shm_format }; static void xdg_shell_ping(void *data, struct xdg_shell *shell, uint32_t serial) { xdg_shell_pong(shell, serial); } static const struct xdg_shell_listener xdg_shell_listener = { xdg_shell_ping, }; #define XDG_VERSION 5 /* The version of xdg-shell that we implement */ #ifdef static_assert static_assert(XDG_VERSION == XDG_SHELL_VERSION_CURRENT, "Interface version doesn't match implementation version"); #endif static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "xdg_shell") == 0) { d->shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1); xdg_shell_use_unstable_version(d->shell, XDG_VERSION); xdg_shell_add_listener(d->shell, &xdg_shell_listener, d); } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) { d->fshell = wl_registry_bind(registry, id, &_wl_fullscreen_shell_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(d->shm, &shm_listener, d); } else if (strcmp(interface, "ivi_application") == 0) { d->ivi_application = wl_registry_bind(registry, id, &ivi_application_interface, 1); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static struct display * create_display(void) { struct display *display; display = malloc(sizeof *display); if (display == NULL) { fprintf(stderr, "out of memory\n"); exit(1); } display->display = wl_display_connect(NULL); assert(display->display); display->formats = 0; display->registry = wl_display_get_registry(display->display); wl_registry_add_listener(display->registry, ®istry_listener, display); wl_display_roundtrip(display->display); if (display->shm == NULL) { fprintf(stderr, "No wl_shm global\n"); exit(1); } wl_display_roundtrip(display->display); /* * Why do we need two roundtrips here? * * wl_display_get_registry() sends a request to the server, to which * the server replies by emitting the wl_registry.global events. * The first wl_display_roundtrip() sends wl_display.sync. The server * first processes the wl_display.get_registry which includes sending * the global events, and then processes the sync. Therefore when the * sync (roundtrip) returns, we are guaranteed to have received and * processed all the global events. * * While we are inside the first wl_display_roundtrip(), incoming * events are dispatched, which causes registry_handle_global() to * be called for each global. One of these globals is wl_shm. * registry_handle_global() sends wl_registry.bind request for the * wl_shm global. However, wl_registry.bind request is sent after * the first wl_display.sync, so the reply to the sync comes before * the initial events of the wl_shm object. * * The initial events that get sent as a reply to binding to wl_shm * include wl_shm.format. These tell us which pixel formats are * supported, and we need them before we can create buffers. They * don't change at runtime, so we receive them as part of init. * * When the reply to the first sync comes, the server may or may not * have sent the initial wl_shm events. Therefore we need the second * wl_display_roundtrip() call here. * * The server processes the wl_registry.bind for wl_shm first, and * the second wl_display.sync next. During our second call to * wl_display_roundtrip() the initial wl_shm events are received and * processed. Finally, when the reply to the second wl_display.sync * arrives, it guarantees we have processed all wl_shm initial events. * * This sequence contains two examples on how wl_display_roundtrip() * can be used to guarantee, that all reply events to a request * have been received and processed. This is a general Wayland * technique. */ if (!(display->formats & (1 << WL_SHM_FORMAT_XRGB8888))) { fprintf(stderr, "WL_SHM_FORMAT_XRGB32 not available\n"); exit(1); } return display; } static void destroy_display(struct display *display) { if (display->shm) wl_shm_destroy(display->shm); if (display->shell) xdg_shell_destroy(display->shell); if (display->fshell) _wl_fullscreen_shell_release(display->fshell); if (display->compositor) wl_compositor_destroy(display->compositor); wl_registry_destroy(display->registry); wl_display_flush(display->display); wl_display_disconnect(display->display); free(display); } static void signal_int(int signum) { running = 0; } int main(int argc, char **argv) { struct sigaction sigint; struct display *display; struct window *window; int ret = 0; display = create_display(); window = create_window(display, 250, 250); if (!window) return 1; sigint.sa_handler = signal_int; sigemptyset(&sigint.sa_mask); sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); /* Initialise damage to full surface, so the padding gets painted */ wl_surface_damage(window->surface, 0, 0, window->width, window->height); redraw(window, NULL, 0); while (running && ret != -1) ret = wl_display_dispatch(display->display); fprintf(stderr, "simple-shm exiting\n"); if (window->display->ivi_application) { ivi_surface_destroy(window->ivi_surface); ivi_application_destroy(window->display->ivi_application); } destroy_window(window); destroy_display(display); return 0; } weston-1.9.0/clients/window.h0000664000175000017500000004031512552301651013107 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #ifndef _WINDOW_H_ #define _WINDOW_H_ #include "config.h" #include #include #include #include "shared/config-parser.h" #include "shared/zalloc.h" #include "shared/platform.h" struct window; struct widget; struct display; struct input; struct output; struct task { void (*run)(struct task *task, uint32_t events); struct wl_list link; }; struct rectangle { int32_t x; int32_t y; int32_t width; int32_t height; }; void * fail_on_null(void *p); void * xmalloc(size_t s); void * xzalloc(size_t s); char * xstrdup(const char *s); void * xrealloc(char *p, size_t s); struct display * display_create(int *argc, char *argv[]); void display_destroy(struct display *display); void display_set_user_data(struct display *display, void *data); void * display_get_user_data(struct display *display); struct wl_display * display_get_display(struct display *display); int display_has_subcompositor(struct display *display); cairo_device_t * display_get_cairo_device(struct display *display); struct wl_compositor * display_get_compositor(struct display *display); struct output * display_get_output(struct display *display); uint32_t display_get_serial(struct display *display); typedef void (*display_global_handler_t)(struct display *display, uint32_t name, const char *interface, uint32_t version, void *data); void display_set_global_handler(struct display *display, display_global_handler_t handler); void display_set_global_handler_remove(struct display *display, display_global_handler_t remove_handler); void * display_bind(struct display *display, uint32_t name, const struct wl_interface *interface, uint32_t version); typedef void (*display_output_handler_t)(struct output *output, void *data); /* * The output configure handler is called, when a new output is connected * and we know its current mode, or when the current mode changes. * Test and set the output user data in your handler to know, if the * output is new. Note: 'data' in the configure handler is the display * user data. */ void display_set_output_configure_handler(struct display *display, display_output_handler_t handler); struct wl_data_source * display_create_data_source(struct display *display); #ifdef EGL_NO_DISPLAY EGLDisplay display_get_egl_display(struct display *d); EGLConfig display_get_argb_egl_config(struct display *d); int display_acquire_window_surface(struct display *display, struct window *window, EGLContext ctx); void display_release_window_surface(struct display *display, struct window *window); #endif #define SURFACE_OPAQUE 0x01 #define SURFACE_SHM 0x02 #define SURFACE_HINT_RESIZE 0x10 #define SURFACE_HINT_RGB565 0x100 cairo_surface_t * display_create_surface(struct display *display, struct wl_surface *surface, struct rectangle *rectangle, uint32_t flags); struct wl_buffer * display_get_buffer_for_surface(struct display *display, cairo_surface_t *surface); struct wl_cursor_image * display_get_pointer_image(struct display *display, int pointer); void display_defer(struct display *display, struct task *task); void display_watch_fd(struct display *display, int fd, uint32_t events, struct task *task); void display_unwatch_fd(struct display *display, int fd); void display_run(struct display *d); void display_exit(struct display *d); enum cursor_type { CURSOR_BOTTOM_LEFT, CURSOR_BOTTOM_RIGHT, CURSOR_BOTTOM, CURSOR_DRAGGING, CURSOR_LEFT_PTR, CURSOR_LEFT, CURSOR_RIGHT, CURSOR_TOP_LEFT, CURSOR_TOP_RIGHT, CURSOR_TOP, CURSOR_IBEAM, CURSOR_HAND1, CURSOR_WATCH, CURSOR_BLANK }; typedef void (*window_key_handler_t)(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t unicode, enum wl_keyboard_key_state state, void *data); typedef void (*window_keyboard_focus_handler_t)(struct window *window, struct input *device, void *data); typedef void (*window_data_handler_t)(struct window *window, struct input *input, float x, float y, const char **types, void *data); typedef void (*window_drop_handler_t)(struct window *window, struct input *input, int32_t x, int32_t y, void *data); typedef void (*window_close_handler_t)(void *data); typedef void (*window_fullscreen_handler_t)(struct window *window, void *data); typedef void (*window_output_handler_t)(struct window *window, struct output *output, int enter, void *data); typedef void (*window_state_changed_handler_t)(struct window *window, void *data); typedef void (*widget_resize_handler_t)(struct widget *widget, int32_t width, int32_t height, void *data); typedef void (*widget_redraw_handler_t)(struct widget *widget, void *data); typedef int (*widget_enter_handler_t)(struct widget *widget, struct input *input, float x, float y, void *data); typedef void (*widget_leave_handler_t)(struct widget *widget, struct input *input, void *data); typedef int (*widget_motion_handler_t)(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data); typedef void (*widget_button_handler_t)(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data); typedef void (*widget_touch_down_handler_t)(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data); typedef void (*widget_touch_up_handler_t)(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data); typedef void (*widget_touch_motion_handler_t)(struct widget *widget, struct input *input, uint32_t time, int32_t id, float x, float y, void *data); typedef void (*widget_touch_frame_handler_t)(struct widget *widget, struct input *input, void *data); typedef void (*widget_touch_cancel_handler_t)(struct widget *widget, struct input *input, void *data); typedef void (*widget_axis_handler_t)(struct widget *widget, struct input *input, uint32_t time, uint32_t axis, wl_fixed_t value, void *data); struct window * window_create(struct display *display); struct window * window_create_custom(struct display *display); void window_set_parent(struct window *window, struct window *parent_window); struct window * window_get_parent(struct window *window); int window_has_focus(struct window *window); typedef void (*menu_func_t)(void *data, struct input *input, int index); struct window * window_create_menu(struct display *display, struct input *input, uint32_t time, menu_func_t func, const char **entries, int count, void *user_data); void window_show_menu(struct display *display, struct input *input, uint32_t time, struct window *parent, int32_t x, int32_t y, menu_func_t func, const char **entries, int count); void window_show_frame_menu(struct window *window, struct input *input, uint32_t time); int window_get_buffer_transform(struct window *window); void window_set_buffer_transform(struct window *window, enum wl_output_transform transform); uint32_t window_get_buffer_scale(struct window *window); void window_set_buffer_scale(struct window *window, int32_t scale); uint32_t window_get_output_scale(struct window *window); void window_destroy(struct window *window); struct widget * window_add_widget(struct window *window, void *data); enum subsurface_mode { SUBSURFACE_SYNCHRONIZED, SUBSURFACE_DESYNCHRONIZED }; struct widget * window_add_subsurface(struct window *window, void *data, enum subsurface_mode default_mode); typedef void (*data_func_t)(void *data, size_t len, int32_t x, int32_t y, void *user_data); struct display * window_get_display(struct window *window); void window_move(struct window *window, struct input *input, uint32_t time); void window_get_allocation(struct window *window, struct rectangle *allocation); void window_schedule_redraw(struct window *window); void window_schedule_resize(struct window *window, int width, int height); void window_damage(struct window *window, int32_t x, int32_t y, int32_t width, int32_t height); cairo_surface_t * window_get_surface(struct window *window); struct wl_surface * window_get_wl_surface(struct window *window); struct wl_subsurface * widget_get_wl_subsurface(struct widget *widget); enum window_buffer_type { WINDOW_BUFFER_TYPE_EGL_WINDOW, WINDOW_BUFFER_TYPE_SHM, }; void display_surface_damage(struct display *display, cairo_surface_t *cairo_surface, int32_t x, int32_t y, int32_t width, int32_t height); void window_set_buffer_type(struct window *window, enum window_buffer_type type); enum window_buffer_type window_get_buffer_type(struct window *window); int window_is_fullscreen(struct window *window); void window_set_fullscreen(struct window *window, int fullscreen); int window_is_maximized(struct window *window); void window_set_maximized(struct window *window, int maximized); int window_is_resizing(struct window *window); void window_set_minimized(struct window *window); void window_set_user_data(struct window *window, void *data); void * window_get_user_data(struct window *window); void window_set_key_handler(struct window *window, window_key_handler_t handler); void window_set_keyboard_focus_handler(struct window *window, window_keyboard_focus_handler_t handler); void window_set_data_handler(struct window *window, window_data_handler_t handler); void window_set_drop_handler(struct window *window, window_drop_handler_t handler); void window_set_close_handler(struct window *window, window_close_handler_t handler); void window_set_fullscreen_handler(struct window *window, window_fullscreen_handler_t handler); void window_set_output_handler(struct window *window, window_output_handler_t handler); void window_set_state_changed_handler(struct window *window, window_state_changed_handler_t handler); void window_set_title(struct window *window, const char *title); const char * window_get_title(struct window *window); void window_set_text_cursor_position(struct window *window, int32_t x, int32_t y); enum preferred_format { WINDOW_PREFERRED_FORMAT_NONE, WINDOW_PREFERRED_FORMAT_RGB565 }; void window_set_preferred_format(struct window *window, enum preferred_format format); int widget_set_tooltip(struct widget *parent, char *entry, float x, float y); void widget_destroy_tooltip(struct widget *parent); struct widget * widget_add_widget(struct widget *parent, void *data); void widget_destroy(struct widget *widget); void widget_set_default_cursor(struct widget *widget, int cursor); void widget_get_allocation(struct widget *widget, struct rectangle *allocation); void widget_set_allocation(struct widget *widget, int32_t x, int32_t y, int32_t width, int32_t height); void widget_set_size(struct widget *widget, int32_t width, int32_t height); void widget_set_transparent(struct widget *widget, int transparent); void widget_schedule_resize(struct widget *widget, int32_t width, int32_t height); void * widget_get_user_data(struct widget *widget); cairo_t * widget_cairo_create(struct widget *widget); struct wl_surface * widget_get_wl_surface(struct widget *widget); uint32_t widget_get_last_time(struct widget *widget); void widget_input_region_add(struct widget *widget, const struct rectangle *rect); void widget_set_redraw_handler(struct widget *widget, widget_redraw_handler_t handler); void widget_set_resize_handler(struct widget *widget, widget_resize_handler_t handler); void widget_set_enter_handler(struct widget *widget, widget_enter_handler_t handler); void widget_set_leave_handler(struct widget *widget, widget_leave_handler_t handler); void widget_set_motion_handler(struct widget *widget, widget_motion_handler_t handler); void widget_set_button_handler(struct widget *widget, widget_button_handler_t handler); void widget_set_touch_down_handler(struct widget *widget, widget_touch_down_handler_t handler); void widget_set_touch_up_handler(struct widget *widget, widget_touch_up_handler_t handler); void widget_set_touch_motion_handler(struct widget *widget, widget_touch_motion_handler_t handler); void widget_set_touch_frame_handler(struct widget *widget, widget_touch_frame_handler_t handler); void widget_set_touch_cancel_handler(struct widget *widget, widget_touch_cancel_handler_t handler); void widget_set_axis_handler(struct widget *widget, widget_axis_handler_t handler); void widget_schedule_redraw(struct widget *widget); void widget_set_use_cairo(struct widget *widget, int use_cairo); struct widget * window_frame_create(struct window *window, void *data); void window_frame_set_child_size(struct widget *widget, int child_width, int child_height); void input_set_pointer_image(struct input *input, int pointer); void input_get_position(struct input *input, int32_t *x, int32_t *y); int input_get_touch(struct input *input, int32_t id, float *x, float *y); #define MOD_SHIFT_MASK 0x01 #define MOD_ALT_MASK 0x02 #define MOD_CONTROL_MASK 0x04 uint32_t input_get_modifiers(struct input *input); void touch_grab(struct input *input, int32_t touch_id); void touch_ungrab(struct input *input); void input_grab(struct input *input, struct widget *widget, uint32_t button); void input_ungrab(struct input *input); struct widget * input_get_focus_widget(struct input *input); struct display * input_get_display(struct input *input); struct wl_seat * input_get_seat(struct input *input); struct wl_data_device * input_get_data_device(struct input *input); void input_set_selection(struct input *input, struct wl_data_source *source, uint32_t time); void input_accept(struct input *input, const char *type); void input_receive_drag_data(struct input *input, const char *mime_type, data_func_t func, void *user_data); int input_receive_drag_data_to_fd(struct input *input, const char *mime_type, int fd); int input_receive_selection_data(struct input *input, const char *mime_type, data_func_t func, void *data); int input_receive_selection_data_to_fd(struct input *input, const char *mime_type, int fd); void output_set_user_data(struct output *output, void *data); void * output_get_user_data(struct output *output); void output_set_destroy_handler(struct output *output, display_output_handler_t handler); void output_get_allocation(struct output *output, struct rectangle *allocation); struct wl_output * output_get_wl_output(struct output *output); enum wl_output_transform output_get_transform(struct output *output); uint32_t output_get_scale(struct output *output); const char * output_get_make(struct output *output); const char * output_get_model(struct output *output); void keysym_modifiers_add(struct wl_array *modifiers_map, const char *name); xkb_mod_mask_t keysym_modifiers_get_mask(struct wl_array *modifiers_map, const char *name); #endif weston-1.9.0/clients/dnd.c0000664000175000017500000004357412552301651012352 00000000000000/* * Copyright © 2010 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "shared/cairo-util.h" #include "shared/helpers.h" struct dnd_drag; struct pointer { struct input *input; bool dragging; struct wl_list link; }; struct dnd { struct window *window; struct widget *widget; struct display *display; uint32_t key; struct item *items[16]; int self_only; struct dnd_drag *current_drag; struct wl_list pointers; }; struct dnd_drag { cairo_surface_t *translucent; cairo_surface_t *opaque; int hotspot_x, hotspot_y; struct dnd *dnd; struct input *input; uint32_t time; struct item *item; int x_offset, y_offset; int width, height; const char *mime_type; struct wl_surface *drag_surface; struct wl_data_source *data_source; }; struct item { cairo_surface_t *surface; int seed; int x, y; }; struct dnd_flower_message { int seed, x_offset, y_offset; }; static const int item_width = 64; static const int item_height = 64; static const int item_padding = 16; static const char flower_mime_type[] = "application/x-wayland-dnd-flower"; static const char text_mime_type[] = "text/plain;charset=utf-8"; static struct item * item_create(struct display *display, int x, int y, int seed) { struct item *item; struct timeval tv; item = malloc(sizeof *item); if (item == NULL) return NULL; gettimeofday(&tv, NULL); item->seed = seed ? seed : tv.tv_usec; srandom(item->seed); const int petal_count = 3 + random() % 5; const double r1 = 20 + random() % 10; const double r2 = 5 + random() % 12; const double u = (10 + random() % 90) / 100.0; const double v = (random() % 90) / 100.0; cairo_t *cr; int i; double t, dt = 2 * M_PI / (petal_count * 2); double x1, y1, x2, y2, x3, y3; struct rectangle rect; rect.width = item_width; rect.height = item_height; item->surface = display_create_surface(display, NULL, &rect, SURFACE_SHM); item->x = x; item->y = y; cr = cairo_create(item->surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0); cairo_paint(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_translate(cr, item_width / 2, item_height / 2); t = random(); cairo_move_to(cr, cos(t) * r1, sin(t) * r1); for (i = 0; i < petal_count; i++, t += dt * 2) { x1 = cos(t) * r1; y1 = sin(t) * r1; x2 = cos(t + dt) * r2; y2 = sin(t + dt) * r2; x3 = cos(t + 2 * dt) * r1; y3 = sin(t + 2 * dt) * r1; cairo_curve_to(cr, x1 - y1 * u, y1 + x1 * u, x2 + y2 * v, y2 - x2 * v, x2, y2); cairo_curve_to(cr, x2 - y2 * v, y2 + x2 * v, x3 + y3 * u, y3 - x3 * u, x3, y3); } cairo_close_path(cr); cairo_set_source_rgba(cr, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 100) / 99.0); cairo_fill_preserve(cr); cairo_set_line_width(cr, 1); cairo_set_source_rgba(cr, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 100) / 99.0); cairo_stroke(cr); cairo_destroy(cr); return item; } static void dnd_redraw_handler(struct widget *widget, void *data) { struct dnd *dnd = data; struct rectangle allocation; cairo_t *cr; cairo_surface_t *surface; unsigned int i; surface = window_get_surface(dnd->window); cr = cairo_create(surface); widget_get_allocation(dnd->widget, &allocation); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0.8); cairo_fill(cr); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) { if (!dnd->items[i]) continue; cairo_set_source_surface(cr, dnd->items[i]->surface, dnd->items[i]->x + allocation.x, dnd->items[i]->y + allocation.y); cairo_paint(cr); } cairo_destroy(cr); cairo_surface_destroy(surface); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct dnd *dnd = data; window_schedule_redraw(dnd->window); } static int dnd_add_item(struct dnd *dnd, struct item *item) { unsigned int i; for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) { if (dnd->items[i] == 0) { dnd->items[i] = item; return i; } } return -1; } static struct item * dnd_get_item(struct dnd *dnd, int32_t x, int32_t y) { struct item *item; struct rectangle allocation; unsigned int i; widget_get_allocation(dnd->widget, &allocation); x -= allocation.x; y -= allocation.y; for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) { item = dnd->items[i]; if (item && item->x <= x && x < item->x + item_width && item->y <= y && y < item->y + item_height) return item; } return NULL; } static void data_source_target(void *data, struct wl_data_source *source, const char *mime_type) { struct dnd_drag *dnd_drag = data; struct dnd *dnd = dnd_drag->dnd; cairo_surface_t *surface; struct wl_buffer *buffer; dnd_drag->mime_type = mime_type; if (mime_type) surface = dnd_drag->opaque; else surface = dnd_drag->translucent; buffer = display_get_buffer_for_surface(dnd->display, surface); wl_surface_attach(dnd_drag->drag_surface, buffer, 0, 0); wl_surface_damage(dnd_drag->drag_surface, 0, 0, dnd_drag->width, dnd_drag->height); wl_surface_commit(dnd_drag->drag_surface); } static void data_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd) { struct dnd_flower_message dnd_flower_message; struct dnd_drag *dnd_drag = data; char buffer[128]; int n; if (strcmp(mime_type, flower_mime_type) == 0) { dnd_flower_message.seed = dnd_drag->item->seed; dnd_flower_message.x_offset = dnd_drag->x_offset; dnd_flower_message.y_offset = dnd_drag->y_offset; if (write(fd, &dnd_flower_message, sizeof dnd_flower_message) < 0) abort(); } else if (strcmp(mime_type, text_mime_type) == 0) { n = snprintf(buffer, sizeof buffer, "seed=%d x=%d y=%d\n", dnd_drag->item->seed, dnd_drag->x_offset, dnd_drag->y_offset); if (write(fd, buffer, n) < 0) abort(); } close(fd); } static void data_source_cancelled(void *data, struct wl_data_source *source) { struct dnd_drag *dnd_drag = data; /* The 'cancelled' event means that the source is no longer in * use by the drag (or current selection). We need to clean * up the drag object created and the local state. */ wl_data_source_destroy(dnd_drag->data_source); /* Destroy the item that has been dragged out */ cairo_surface_destroy(dnd_drag->item->surface); free(dnd_drag->item); wl_surface_destroy(dnd_drag->drag_surface); cairo_surface_destroy(dnd_drag->translucent); cairo_surface_destroy(dnd_drag->opaque); free(dnd_drag); } static const struct wl_data_source_listener data_source_listener = { data_source_target, data_source_send, data_source_cancelled }; static cairo_surface_t * create_drag_icon(struct dnd_drag *dnd_drag, struct item *item, int32_t x, int32_t y, double opacity) { struct dnd *dnd = dnd_drag->dnd; cairo_surface_t *surface; struct rectangle rectangle; cairo_pattern_t *pattern; cairo_t *cr; rectangle.width = item_width; rectangle.height = item_height; surface = display_create_surface(dnd->display, NULL, &rectangle, SURFACE_SHM); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_surface(cr, item->surface, 0, 0); pattern = cairo_pattern_create_rgba(0, 0, 0, opacity); cairo_mask(cr, pattern); cairo_pattern_destroy(pattern); cairo_destroy(cr); dnd_drag->hotspot_x = x - item->x; dnd_drag->hotspot_y = y - item->y; dnd_drag->width = rectangle.width; dnd_drag->height = rectangle.height; return surface; } static int create_drag_source(struct dnd *dnd, struct input *input, uint32_t time, int32_t x, int32_t y) { struct item *item; struct rectangle allocation; struct dnd_drag *dnd_drag; struct display *display; struct wl_compositor *compositor; struct wl_buffer *buffer; unsigned int i; uint32_t serial; cairo_surface_t *icon; widget_get_allocation(dnd->widget, &allocation); item = dnd_get_item(dnd, x, y); x -= allocation.x; y -= allocation.y; if (item) { dnd_drag = xmalloc(sizeof *dnd_drag); dnd_drag->dnd = dnd; dnd_drag->input = input; dnd_drag->time = time; dnd_drag->item = item; dnd_drag->x_offset = x - item->x; dnd_drag->y_offset = y - item->y; for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) { if (item == dnd->items[i]){ dnd->items[i] = 0; break; } } display = window_get_display(dnd->window); compositor = display_get_compositor(display); serial = display_get_serial(display); dnd_drag->drag_surface = wl_compositor_create_surface(compositor); if (dnd->self_only) { dnd_drag->data_source = NULL; } else { dnd_drag->data_source = display_create_data_source(dnd->display); wl_data_source_add_listener(dnd_drag->data_source, &data_source_listener, dnd_drag); wl_data_source_offer(dnd_drag->data_source, flower_mime_type); wl_data_source_offer(dnd_drag->data_source, text_mime_type); } wl_data_device_start_drag(input_get_data_device(input), dnd_drag->data_source, window_get_wl_surface(dnd->window), dnd_drag->drag_surface, serial); dnd_drag->opaque = create_drag_icon(dnd_drag, item, x, y, 1); dnd_drag->translucent = create_drag_icon(dnd_drag, item, x, y, 0.2); if (dnd->self_only) icon = dnd_drag->opaque; else icon = dnd_drag->translucent; buffer = display_get_buffer_for_surface(dnd->display, icon); wl_surface_attach(dnd_drag->drag_surface, buffer, -dnd_drag->hotspot_x, -dnd_drag->hotspot_y); wl_surface_damage(dnd_drag->drag_surface, 0, 0, dnd_drag->width, dnd_drag->height); wl_surface_commit(dnd_drag->drag_surface); dnd->current_drag = dnd_drag; window_schedule_redraw(dnd->window); return 0; } else return -1; } static int lookup_cursor(struct dnd *dnd, int x, int y) { struct item *item; item = dnd_get_item(dnd, x, y); if (item) return CURSOR_HAND1; else return CURSOR_LEFT_PTR; } /* Update all the mouse pointers in the window appropriately. * Optionally, skip one (which will be the current pointer just * about to start a drag). This is done here to save a scan * through the pointer list. */ static void update_pointer_images_except(struct dnd *dnd, struct input *except) { struct pointer *pointer; int32_t x, y; wl_list_for_each(pointer, &dnd->pointers, link) { if (pointer->input == except) { pointer->dragging = true; continue; } input_get_position(pointer->input, &x, &y); input_set_pointer_image(pointer->input, lookup_cursor(dnd, x, y)); } } static void dnd_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct dnd *dnd = data; int32_t x, y; input_get_position(input, &x, &y); if (state == WL_POINTER_BUTTON_STATE_PRESSED) { input_ungrab(input); if (create_drag_source(dnd, input, time, x, y) == 0) { input_set_pointer_image(input, CURSOR_DRAGGING); update_pointer_images_except(dnd, input); } } } static void dnd_touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct dnd *dnd = data; int32_t int_x, int_y; if (id > 0) return; int_x = (int32_t)x; int_y = (int32_t)y; if (create_drag_source(dnd, input, time, int_x, int_y) == 0) touch_grab(input, 0); } static int dnd_enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct dnd *dnd = data; struct pointer *new_pointer = malloc(sizeof *new_pointer); dnd->current_drag = NULL; if (new_pointer) { new_pointer->input = input; new_pointer->dragging = false; wl_list_insert(dnd->pointers.prev, &new_pointer->link); } return lookup_cursor(dnd, x, y); } static void dnd_leave_handler(struct widget *widget, struct input *input, void *data) { struct dnd *dnd = data; struct pointer *pointer, *tmp; wl_list_for_each_safe(pointer, tmp, &dnd->pointers, link) if (pointer->input == input) { wl_list_remove(&pointer->link); free(pointer); } } static int dnd_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct dnd *dnd = data; struct pointer *pointer; wl_list_for_each(pointer, &dnd->pointers, link) if (pointer->input == input) { if (pointer->dragging) return CURSOR_DRAGGING; break; } return lookup_cursor(data, x, y); } static void dnd_data_handler(struct window *window, struct input *input, float x, float y, const char **types, void *data) { struct dnd *dnd = data; int i, has_flower = 0; if (!types) return; for (i = 0; types[i]; i++) if (strcmp(types[i], flower_mime_type) == 0) has_flower = 1; if (dnd_get_item(dnd, x, y) || dnd->self_only || !has_flower) { input_accept(input, NULL); } else { input_accept(input, flower_mime_type); } } static void dnd_receive_func(void *data, size_t len, int32_t x, int32_t y, void *user_data) { struct dnd *dnd = user_data; struct dnd_flower_message *message = data; struct item *item; struct rectangle allocation; if (len == 0) { return; } else if (len != sizeof *message) { fprintf(stderr, "odd message length %zu, expected %zu\n", len, sizeof *message); return; } widget_get_allocation(dnd->widget, &allocation); item = item_create(dnd->display, x - message->x_offset - allocation.x, y - message->y_offset - allocation.y, message->seed); dnd_add_item(dnd, item); update_pointer_images_except(dnd, NULL); window_schedule_redraw(dnd->window); } static void dnd_drop_handler(struct window *window, struct input *input, int32_t x, int32_t y, void *data) { struct dnd *dnd = data; struct dnd_flower_message message; if (dnd_get_item(dnd, x, y)) { fprintf(stderr, "got 'drop', but no target\n"); return; } if (!dnd->self_only) { input_receive_drag_data(input, flower_mime_type, dnd_receive_func, dnd); } else if (dnd->current_drag) { message.seed = dnd->current_drag->item->seed; message.x_offset = dnd->current_drag->x_offset; message.y_offset = dnd->current_drag->y_offset; dnd_receive_func(&message, sizeof message, x, y, dnd); dnd->current_drag = NULL; } else { fprintf(stderr, "ignoring drop from another client\n"); } } static struct dnd * dnd_create(struct display *display) { struct dnd *dnd; int x, y; int32_t width, height; unsigned int i; dnd = xzalloc(sizeof *dnd); dnd->window = window_create(display); dnd->widget = window_frame_create(dnd->window, dnd); window_set_title(dnd->window, "Wayland Drag and Drop Demo"); dnd->display = display; dnd->key = 100; wl_list_init(&dnd->pointers); for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) { x = (i % 4) * (item_width + item_padding) + item_padding; y = (i / 4) * (item_height + item_padding) + item_padding; if ((i ^ (i >> 2)) & 1) dnd->items[i] = item_create(display, x, y, 0); else dnd->items[i] = NULL; } window_set_user_data(dnd->window, dnd); window_set_keyboard_focus_handler(dnd->window, keyboard_focus_handler); window_set_data_handler(dnd->window, dnd_data_handler); window_set_drop_handler(dnd->window, dnd_drop_handler); widget_set_redraw_handler(dnd->widget, dnd_redraw_handler); widget_set_enter_handler(dnd->widget, dnd_enter_handler); widget_set_leave_handler(dnd->widget, dnd_leave_handler); widget_set_motion_handler(dnd->widget, dnd_motion_handler); widget_set_button_handler(dnd->widget, dnd_button_handler); widget_set_touch_down_handler(dnd->widget, dnd_touch_down_handler); width = 4 * (item_width + item_padding) + item_padding; height = 4 * (item_height + item_padding) + item_padding; window_frame_set_child_size(dnd->widget, width, height); return dnd; } static void dnd_destroy(struct dnd *dnd) { widget_destroy(dnd->widget); window_destroy(dnd->window); free(dnd); } int main(int argc, char *argv[]) { struct display *d; struct dnd *dnd; int self_only = 0; if (argc == 2 && !strcmp(argv[1], "--self-only")) self_only = 1; else if (argc > 1) { printf("Usage: %s [OPTIONS]\n --self-only\n", argv[0]); return 1; } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } dnd = dnd_create(d); if (self_only) dnd->self_only = 1; display_run(d); dnd_destroy(dnd); display_destroy(d); return 0; } weston-1.9.0/clients/screenshot.c0000664000175000017500000001716312537664635013776 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "screenshooter-client-protocol.h" #include "shared/os-compatibility.h" /* The screenshooter is a good example of a custom object exposed by * the compositor and serves as a test bed for implementing client * side marshalling outside libwayland.so */ static struct wl_shm *shm; static struct screenshooter *screenshooter; static struct wl_list output_list; int min_x, min_y, max_x, max_y; int buffer_copy_done; struct screenshooter_output { struct wl_output *output; struct wl_buffer *buffer; int width, height, offset_x, offset_y; void *data; struct wl_list link; }; static void display_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, int physical_width, int physical_height, int subpixel, const char *make, const char *model, int transform) { struct screenshooter_output *output; output = wl_output_get_user_data(wl_output); if (wl_output == output->output) { output->offset_x = x; output->offset_y = y; } } static void * xmalloc(size_t size) { void *p; p = malloc(size); if (p == NULL) { fprintf(stderr, "%s: out of memory\n", program_invocation_short_name); exit(EXIT_FAILURE); } return p; } static void display_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh) { struct screenshooter_output *output; output = wl_output_get_user_data(wl_output); if (wl_output == output->output && (flags & WL_OUTPUT_MODE_CURRENT)) { output->width = width; output->height = height; } } static const struct wl_output_listener output_listener = { display_handle_geometry, display_handle_mode }; static void screenshot_done(void *data, struct screenshooter *screenshooter) { buffer_copy_done = 1; } static const struct screenshooter_listener screenshooter_listener = { screenshot_done }; static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { static struct screenshooter_output *output; if (strcmp(interface, "wl_output") == 0) { output = xmalloc(sizeof *output); output->output = wl_registry_bind(registry, name, &wl_output_interface, 1); wl_list_insert(&output_list, &output->link); wl_output_add_listener(output->output, &output_listener, output); } else if (strcmp(interface, "wl_shm") == 0) { shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); } else if (strcmp(interface, "screenshooter") == 0) { screenshooter = wl_registry_bind(registry, name, &screenshooter_interface, 1); } } static void handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { /* XXX: unimplemented */ } static const struct wl_registry_listener registry_listener = { handle_global, handle_global_remove }; static struct wl_buffer * create_shm_buffer(int width, int height, void **data_out) { struct wl_shm_pool *pool; struct wl_buffer *buffer; int fd, size, stride; void *data; stride = width * 4; size = stride * height; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return NULL; } data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { fprintf(stderr, "mmap failed: %m\n"); close(fd); return NULL; } pool = wl_shm_create_pool(shm, fd, size); close(fd); buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_XRGB8888); wl_shm_pool_destroy(pool); *data_out = data; return buffer; } static void write_png(int width, int height) { int output_stride, buffer_stride, i; cairo_surface_t *surface; void *data, *d, *s; struct screenshooter_output *output, *next; buffer_stride = width * 4; data = xmalloc(buffer_stride * height); if (!data) return; wl_list_for_each_safe(output, next, &output_list, link) { output_stride = output->width * 4; s = output->data; d = data + (output->offset_y - min_y) * buffer_stride + (output->offset_x - min_x) * 4; for (i = 0; i < output->height; i++) { memcpy(d, s, output_stride); d += buffer_stride; s += output_stride; } free(output); } surface = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, width, height, buffer_stride); cairo_surface_write_to_png(surface, "wayland-screenshot.png"); cairo_surface_destroy(surface); free(data); } static int set_buffer_size(int *width, int *height) { struct screenshooter_output *output; min_x = min_y = INT_MAX; max_x = max_y = INT_MIN; int position = 0; wl_list_for_each_reverse(output, &output_list, link) { output->offset_x = position; position += output->width; } wl_list_for_each(output, &output_list, link) { min_x = MIN(min_x, output->offset_x); min_y = MIN(min_y, output->offset_y); max_x = MAX(max_x, output->offset_x + output->width); max_y = MAX(max_y, output->offset_y + output->height); } if (max_x <= min_x || max_y <= min_y) return -1; *width = max_x - min_x; *height = max_y - min_y; return 0; } int main(int argc, char *argv[]) { struct wl_display *display; struct wl_registry *registry; struct screenshooter_output *output; int width, height; if (getenv("WAYLAND_SOCKET") == NULL) { fprintf(stderr, "%s must be launched by weston.\n" "Use the MOD+S shortcut to take a screenshot.\n", program_invocation_short_name); return -1; } display = wl_display_connect(NULL); if (display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } wl_list_init(&output_list); registry = wl_display_get_registry(display); wl_registry_add_listener(registry, ®istry_listener, NULL); wl_display_dispatch(display); wl_display_roundtrip(display); if (screenshooter == NULL) { fprintf(stderr, "display doesn't support screenshooter\n"); return -1; } screenshooter_add_listener(screenshooter, &screenshooter_listener, screenshooter); if (set_buffer_size(&width, &height)) return -1; wl_list_for_each(output, &output_list, link) { output->buffer = create_shm_buffer(output->width, output->height, &output->data); screenshooter_shoot(screenshooter, output->output, output->buffer); buffer_copy_done = 0; while (!buffer_copy_done) wl_display_roundtrip(display); } write_png(width, height); return 0; } weston-1.9.0/clients/editor.c0000664000175000017500000011474312561177776013113 00000000000000/* * Copyright © 2012 Openismus GmbH * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "window.h" #include "text-client-protocol.h" struct text_entry { struct widget *widget; struct window *window; char *text; int active; uint32_t cursor; uint32_t anchor; struct { char *text; int32_t cursor; char *commit; PangoAttrList *attr_list; } preedit; struct { PangoAttrList *attr_list; int32_t cursor; } preedit_info; struct { int32_t cursor; int32_t anchor; uint32_t delete_index; uint32_t delete_length; bool invalid_delete; } pending_commit; struct wl_text_input *text_input; PangoLayout *layout; struct { xkb_mod_mask_t shift_mask; } keysym; uint32_t serial; uint32_t reset_serial; uint32_t content_purpose; uint32_t click_to_show; char *preferred_language; bool button_pressed; }; struct editor { struct wl_text_input_manager *text_input_manager; struct wl_data_source *selection; char *selected_text; struct display *display; struct window *window; struct widget *widget; struct text_entry *entry; struct text_entry *editor; struct text_entry *active_entry; }; static const char * utf8_end_char(const char *p) { while ((*p & 0xc0) == 0x80) p++; return p; } static const char * utf8_prev_char(const char *s, const char *p) { for (--p; p >= s; --p) { if ((*p & 0xc0) != 0x80) return p; } return NULL; } static const char * utf8_next_char(const char *p) { if (*p != 0) return utf8_end_char(++p); return NULL; } static void move_up(const char *p, uint32_t *cursor) { const char *posr, *posr_i; char text[16]; xkb_keysym_to_utf8(XKB_KEY_Return, text, sizeof(text)); posr = strstr(p, text); while (posr) { if (*cursor > (unsigned)(posr-p)) { posr_i = strstr(posr+1, text); if (!posr_i || !(*cursor > (unsigned)(posr_i-p))) { *cursor = posr-p; break; } posr = posr_i; } else { break; } } } static void move_down(const char *p, uint32_t *cursor) { const char *posr; char text[16]; xkb_keysym_to_utf8(XKB_KEY_Return, text, sizeof(text)); posr = strstr(p, text); while (posr) { if (*cursor <= (unsigned)(posr-p)) { *cursor = posr-p + 1; break; } posr = strstr(posr+1, text); } } static void text_entry_redraw_handler(struct widget *widget, void *data); static void text_entry_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data); static void text_entry_touch_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float tx, float ty, void *data); static int text_entry_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data); static void text_entry_insert_at_cursor(struct text_entry *entry, const char *text, int32_t cursor, int32_t anchor); static void text_entry_set_preedit(struct text_entry *entry, const char *preedit_text, int preedit_cursor); static void text_entry_delete_text(struct text_entry *entry, uint32_t index, uint32_t length); static void text_entry_delete_selected_text(struct text_entry *entry); static void text_entry_reset_preedit(struct text_entry *entry); static void text_entry_commit_and_reset(struct text_entry *entry); static void text_entry_get_cursor_rectangle(struct text_entry *entry, struct rectangle *rectangle); static void text_entry_update(struct text_entry *entry); static void text_input_commit_string(void *data, struct wl_text_input *text_input, uint32_t serial, const char *text) { struct text_entry *entry = data; if ((entry->serial - serial) > (entry->serial - entry->reset_serial)) { fprintf(stderr, "Ignore commit. Serial: %u, Current: %u, Reset: %u\n", serial, entry->serial, entry->reset_serial); return; } if (entry->pending_commit.invalid_delete) { fprintf(stderr, "Ignore commit. Invalid previous delete_surrounding event.\n"); memset(&entry->pending_commit, 0, sizeof entry->pending_commit); return; } text_entry_reset_preedit(entry); if (entry->pending_commit.delete_length) { text_entry_delete_text(entry, entry->pending_commit.delete_index, entry->pending_commit.delete_length); } else { text_entry_delete_selected_text(entry); } text_entry_insert_at_cursor(entry, text, entry->pending_commit.cursor, entry->pending_commit.anchor); memset(&entry->pending_commit, 0, sizeof entry->pending_commit); widget_schedule_redraw(entry->widget); } static void clear_pending_preedit(struct text_entry *entry) { memset(&entry->pending_commit, 0, sizeof entry->pending_commit); pango_attr_list_unref(entry->preedit_info.attr_list); entry->preedit_info.cursor = 0; entry->preedit_info.attr_list = NULL; memset(&entry->preedit_info, 0, sizeof entry->preedit_info); } static void text_input_preedit_string(void *data, struct wl_text_input *text_input, uint32_t serial, const char *text, const char *commit) { struct text_entry *entry = data; if ((entry->serial - serial) > (entry->serial - entry->reset_serial)) { fprintf(stderr, "Ignore preedit_string. Serial: %u, Current: %u, Reset: %u\n", serial, entry->serial, entry->reset_serial); clear_pending_preedit(entry); return; } if (entry->pending_commit.invalid_delete) { fprintf(stderr, "Ignore preedit_string. Invalid previous delete_surrounding event.\n"); clear_pending_preedit(entry); return; } if (entry->pending_commit.delete_length) { text_entry_delete_text(entry, entry->pending_commit.delete_index, entry->pending_commit.delete_length); } else { text_entry_delete_selected_text(entry); } text_entry_set_preedit(entry, text, entry->preedit_info.cursor); entry->preedit.commit = strdup(commit); entry->preedit.attr_list = pango_attr_list_ref(entry->preedit_info.attr_list); clear_pending_preedit(entry); text_entry_update(entry); widget_schedule_redraw(entry->widget); } static void text_input_delete_surrounding_text(void *data, struct wl_text_input *text_input, int32_t index, uint32_t length) { struct text_entry *entry = data; uint32_t text_length; entry->pending_commit.delete_index = entry->cursor + index; entry->pending_commit.delete_length = length; entry->pending_commit.invalid_delete = false; text_length = strlen(entry->text); if (entry->pending_commit.delete_index > text_length || length > text_length || entry->pending_commit.delete_index + length > text_length) { fprintf(stderr, "delete_surrounding_text: Invalid index: %d," \ "length %u'; cursor: %u text length: %u\n", index, length, entry->cursor, text_length); entry->pending_commit.invalid_delete = true; return; } } static void text_input_cursor_position(void *data, struct wl_text_input *text_input, int32_t index, int32_t anchor) { struct text_entry *entry = data; entry->pending_commit.cursor = index; entry->pending_commit.anchor = anchor; } static void text_input_preedit_styling(void *data, struct wl_text_input *text_input, uint32_t index, uint32_t length, uint32_t style) { struct text_entry *entry = data; PangoAttribute *attr1 = NULL; PangoAttribute *attr2 = NULL; if (!entry->preedit_info.attr_list) entry->preedit_info.attr_list = pango_attr_list_new(); switch (style) { case WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT: case WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE: attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); break; case WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT: attr1 = pango_attr_underline_new(PANGO_UNDERLINE_ERROR); attr2 = pango_attr_underline_color_new(65535, 0, 0); break; case WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION: attr1 = pango_attr_background_new(0.3 * 65535, 0.3 * 65535, 65535); attr2 = pango_attr_foreground_new(65535, 65535, 65535); break; case WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT: case WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE: attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); attr2 = pango_attr_weight_new(PANGO_WEIGHT_BOLD); break; case WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE: attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); attr2 = pango_attr_foreground_new(0.3 * 65535, 0.3 * 65535, 0.3 * 65535); break; } if (attr1) { attr1->start_index = entry->cursor + index; attr1->end_index = entry->cursor + index + length; pango_attr_list_insert(entry->preedit_info.attr_list, attr1); } if (attr2) { attr2->start_index = entry->cursor + index; attr2->end_index = entry->cursor + index + length; pango_attr_list_insert(entry->preedit_info.attr_list, attr2); } } static void text_input_preedit_cursor(void *data, struct wl_text_input *text_input, int32_t index) { struct text_entry *entry = data; entry->preedit_info.cursor = index; } static void text_input_modifiers_map(void *data, struct wl_text_input *text_input, struct wl_array *map) { struct text_entry *entry = data; entry->keysym.shift_mask = keysym_modifiers_get_mask(map, "Shift"); } static void text_input_keysym(void *data, struct wl_text_input *text_input, uint32_t serial, uint32_t time, uint32_t key, uint32_t state, uint32_t modifiers) { struct text_entry *entry = data; const char *new_char; if (key == XKB_KEY_Left || key == XKB_KEY_Right) { if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; if (key == XKB_KEY_Left) new_char = utf8_prev_char(entry->text, entry->text + entry->cursor); else new_char = utf8_next_char(entry->text + entry->cursor); if (new_char != NULL) { entry->cursor = new_char - entry->text; } if (!(modifiers & entry->keysym.shift_mask)) entry->anchor = entry->cursor; widget_schedule_redraw(entry->widget); return; } if (key == XKB_KEY_Up || key == XKB_KEY_Down) { if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; if (key == XKB_KEY_Up) move_up(entry->text, &entry->cursor); else move_down(entry->text, &entry->cursor); if (!(modifiers & entry->keysym.shift_mask)) entry->anchor = entry->cursor; widget_schedule_redraw(entry->widget); return; } if (key == XKB_KEY_BackSpace) { const char *start, *end; if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; text_entry_commit_and_reset(entry); start = utf8_prev_char(entry->text, entry->text + entry->cursor); if (start == NULL) return; end = utf8_next_char(start); text_entry_delete_text(entry, start - entry->text, end - start); return; } if (key == XKB_KEY_Tab || key == XKB_KEY_KP_Enter || key == XKB_KEY_Return) { char text[16]; if (state != WL_KEYBOARD_KEY_STATE_RELEASED) return; xkb_keysym_to_utf8(key, text, sizeof(text)); text_entry_insert_at_cursor(entry, text, 0, 0); return; } } static void text_input_enter(void *data, struct wl_text_input *text_input, struct wl_surface *surface) { struct text_entry *entry = data; if (surface != window_get_wl_surface(entry->window)) return; entry->active++; text_entry_update(entry); entry->reset_serial = entry->serial; widget_schedule_redraw(entry->widget); } static void text_input_leave(void *data, struct wl_text_input *text_input) { struct text_entry *entry = data; text_entry_commit_and_reset(entry); entry->active--; if (!entry->active) wl_text_input_hide_input_panel(text_input); widget_schedule_redraw(entry->widget); } static void text_input_input_panel_state(void *data, struct wl_text_input *text_input, uint32_t state) { } static void text_input_language(void *data, struct wl_text_input *text_input, uint32_t serial, const char *language) { fprintf(stderr, "input language is %s \n", language); } static void text_input_text_direction(void *data, struct wl_text_input *text_input, uint32_t serial, uint32_t direction) { struct text_entry *entry = data; PangoContext *context = pango_layout_get_context(entry->layout); PangoDirection pango_direction; switch (direction) { case WL_TEXT_INPUT_TEXT_DIRECTION_LTR: pango_direction = PANGO_DIRECTION_LTR; break; case WL_TEXT_INPUT_TEXT_DIRECTION_RTL: pango_direction = PANGO_DIRECTION_RTL; break; case WL_TEXT_INPUT_TEXT_DIRECTION_AUTO: default: pango_direction = PANGO_DIRECTION_NEUTRAL; } pango_context_set_base_dir(context, pango_direction); } static const struct wl_text_input_listener text_input_listener = { text_input_enter, text_input_leave, text_input_modifiers_map, text_input_input_panel_state, text_input_preedit_string, text_input_preedit_styling, text_input_preedit_cursor, text_input_commit_string, text_input_cursor_position, text_input_delete_surrounding_text, text_input_keysym, text_input_language, text_input_text_direction }; static void data_source_target(void *data, struct wl_data_source *source, const char *mime_type) { } static void data_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd) { struct editor *editor = data; if (write(fd, editor->selected_text, strlen(editor->selected_text) + 1) < 0) fprintf(stderr, "write failed: %m\n"); } static void data_source_cancelled(void *data, struct wl_data_source *source) { wl_data_source_destroy(source); } static const struct wl_data_source_listener data_source_listener = { data_source_target, data_source_send, data_source_cancelled }; static void paste_func(void *buffer, size_t len, int32_t x, int32_t y, void *data) { struct editor *editor = data; struct text_entry *entry = editor->active_entry; char *pasted_text; if (!entry) return; pasted_text = malloc(len + 1); strncpy(pasted_text, buffer, len); pasted_text[len] = '\0'; text_entry_insert_at_cursor(entry, pasted_text, 0, 0); free(pasted_text); } static void editor_copy_cut(struct editor *editor, struct input *input, bool cut) { struct text_entry *entry = editor->active_entry; if (!entry) return; if (entry->cursor != entry->anchor) { int start_index = MIN(entry->cursor, entry->anchor); int end_index = MAX(entry->cursor, entry->anchor); int len = end_index - start_index; editor->selected_text = realloc(editor->selected_text, len + 1); strncpy(editor->selected_text, &entry->text[start_index], len); editor->selected_text[len] = '\0'; if (cut) text_entry_delete_text(entry, start_index, len); editor->selection = display_create_data_source(editor->display); wl_data_source_offer(editor->selection, "text/plain;charset=utf-8"); wl_data_source_add_listener(editor->selection, &data_source_listener, editor); input_set_selection(input, editor->selection, display_get_serial(editor->display)); } } static void editor_paste(struct editor *editor, struct input *input) { input_receive_selection_data(input, "text/plain;charset=utf-8", paste_func, editor); } static void menu_func(void *data, struct input *input, int index) { struct window *window = data; struct editor *editor = window_get_user_data(window); fprintf(stderr, "picked entry %d\n", index); switch (index) { case 0: editor_copy_cut(editor, input, true); break; case 1: editor_copy_cut(editor, input, false); break; case 2: editor_paste(editor, input); break; } } static void show_menu(struct editor *editor, struct input *input, uint32_t time) { int32_t x, y; static const char *entries[] = { "Cut", "Copy", "Paste" }; input_get_position(input, &x, &y); window_show_menu(editor->display, input, time, editor->window, x + 10, y + 20, menu_func, entries, ARRAY_LENGTH(entries)); } static struct text_entry* text_entry_create(struct editor *editor, const char *text) { struct text_entry *entry; entry = xzalloc(sizeof *entry); entry->widget = widget_add_widget(editor->widget, entry); entry->window = editor->window; entry->text = strdup(text); entry->active = 0; entry->cursor = strlen(text); entry->anchor = entry->cursor; entry->text_input = wl_text_input_manager_create_text_input(editor->text_input_manager); wl_text_input_add_listener(entry->text_input, &text_input_listener, entry); widget_set_redraw_handler(entry->widget, text_entry_redraw_handler); widget_set_button_handler(entry->widget, text_entry_button_handler); widget_set_motion_handler(entry->widget, text_entry_motion_handler); widget_set_touch_down_handler(entry->widget, text_entry_touch_handler); return entry; } static void text_entry_destroy(struct text_entry *entry) { widget_destroy(entry->widget); wl_text_input_destroy(entry->text_input); g_clear_object(&entry->layout); free(entry->text); free(entry); } static void redraw_handler(struct widget *widget, void *data) { struct editor *editor = data; cairo_surface_t *surface; struct rectangle allocation; cairo_t *cr; surface = window_get_surface(editor->window); widget_get_allocation(editor->widget, &allocation); cr = cairo_create(surface); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_translate(cr, allocation.x, allocation.y); /* Draw background */ cairo_push_group(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 1, 1, 1, 1); cairo_rectangle(cr, 0, 0, allocation.width, allocation.height); cairo_fill(cr); cairo_pop_group_to_source(cr); cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static void text_entry_allocate(struct text_entry *entry, int32_t x, int32_t y, int32_t width, int32_t height) { widget_set_allocation(entry->widget, x, y, width, height); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct editor *editor = data; struct rectangle allocation; widget_get_allocation(editor->widget, &allocation); text_entry_allocate(editor->entry, allocation.x + 20, allocation.y + 20, width - 40, height / 2 - 40); text_entry_allocate(editor->editor, allocation.x + 20, allocation.y + height / 2 + 20, width - 40, height / 2 - 40); } static void text_entry_activate(struct text_entry *entry, struct wl_seat *seat) { struct wl_surface *surface = window_get_wl_surface(entry->window); if (entry->click_to_show && entry->active) { wl_text_input_show_input_panel(entry->text_input); return; } if (!entry->click_to_show) wl_text_input_show_input_panel(entry->text_input); wl_text_input_activate(entry->text_input, seat, surface); } static void text_entry_deactivate(struct text_entry *entry, struct wl_seat *seat) { wl_text_input_deactivate(entry->text_input, seat); } static void text_entry_update_layout(struct text_entry *entry) { char *text; PangoAttrList *attr_list; assert(entry->cursor <= (strlen(entry->text) + (entry->preedit.text ? strlen(entry->preedit.text) : 0))); if (entry->preedit.text) { text = xmalloc(strlen(entry->text) + strlen(entry->preedit.text) + 1); strncpy(text, entry->text, entry->cursor); strcpy(text + entry->cursor, entry->preedit.text); strcpy(text + entry->cursor + strlen(entry->preedit.text), entry->text + entry->cursor); } else { text = strdup(entry->text); } if (entry->cursor != entry->anchor) { int start_index = MIN(entry->cursor, entry->anchor); int end_index = MAX(entry->cursor, entry->anchor); PangoAttribute *attr; attr_list = pango_attr_list_copy(entry->preedit.attr_list); if (!attr_list) attr_list = pango_attr_list_new(); attr = pango_attr_background_new(0.3 * 65535, 0.3 * 65535, 65535); attr->start_index = start_index; attr->end_index = end_index; pango_attr_list_insert(attr_list, attr); attr = pango_attr_foreground_new(65535, 65535, 65535); attr->start_index = start_index; attr->end_index = end_index; pango_attr_list_insert(attr_list, attr); } else { attr_list = pango_attr_list_ref(entry->preedit.attr_list); } if (entry->preedit.text && !entry->preedit.attr_list) { PangoAttribute *attr; if (!attr_list) attr_list = pango_attr_list_new(); attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); attr->start_index = entry->cursor; attr->end_index = entry->cursor + strlen(entry->preedit.text); pango_attr_list_insert(attr_list, attr); } if (entry->layout) { pango_layout_set_text(entry->layout, text, -1); pango_layout_set_attributes(entry->layout, attr_list); } free(text); pango_attr_list_unref(attr_list); } static void text_entry_update(struct text_entry *entry) { struct rectangle cursor_rectangle; wl_text_input_set_content_type(entry->text_input, WL_TEXT_INPUT_CONTENT_HINT_NONE, entry->content_purpose); wl_text_input_set_surrounding_text(entry->text_input, entry->text, entry->cursor, entry->anchor); if (entry->preferred_language) wl_text_input_set_preferred_language(entry->text_input, entry->preferred_language); text_entry_get_cursor_rectangle(entry, &cursor_rectangle); wl_text_input_set_cursor_rectangle(entry->text_input, cursor_rectangle.x, cursor_rectangle.y, cursor_rectangle.width, cursor_rectangle.height); wl_text_input_commit_state(entry->text_input, ++entry->serial); } static void text_entry_insert_at_cursor(struct text_entry *entry, const char *text, int32_t cursor, int32_t anchor) { char *new_text = xmalloc(strlen(entry->text) + strlen(text) + 1); strncpy(new_text, entry->text, entry->cursor); strcpy(new_text + entry->cursor, text); strcpy(new_text + entry->cursor + strlen(text), entry->text + entry->cursor); free(entry->text); entry->text = new_text; if (anchor >= 0) entry->anchor = entry->cursor + strlen(text) + anchor; else entry->anchor = entry->cursor + 1 + anchor; if (cursor >= 0) entry->cursor += strlen(text) + cursor; else entry->cursor += 1 + cursor; text_entry_update_layout(entry); widget_schedule_redraw(entry->widget); text_entry_update(entry); } static void text_entry_reset_preedit(struct text_entry *entry) { entry->preedit.cursor = 0; free(entry->preedit.text); entry->preedit.text = NULL; free(entry->preedit.commit); entry->preedit.commit = NULL; pango_attr_list_unref(entry->preedit.attr_list); entry->preedit.attr_list = NULL; } static void text_entry_commit_and_reset(struct text_entry *entry) { char *commit = NULL; if (entry->preedit.commit) commit = strdup(entry->preedit.commit); text_entry_reset_preedit(entry); if (commit) { text_entry_insert_at_cursor(entry, commit, 0, 0); free(commit); } wl_text_input_reset(entry->text_input); text_entry_update(entry); entry->reset_serial = entry->serial; } static void text_entry_set_preedit(struct text_entry *entry, const char *preedit_text, int preedit_cursor) { text_entry_reset_preedit(entry); if (!preedit_text) return; entry->preedit.text = strdup(preedit_text); entry->preedit.cursor = preedit_cursor; text_entry_update_layout(entry); widget_schedule_redraw(entry->widget); } static uint32_t text_entry_try_invoke_preedit_action(struct text_entry *entry, int32_t x, int32_t y, uint32_t button, enum wl_pointer_button_state state) { int index, trailing; uint32_t cursor; const char *text; if (!entry->preedit.text) return 0; pango_layout_xy_to_index(entry->layout, x * PANGO_SCALE, y * PANGO_SCALE, &index, &trailing); text = pango_layout_get_text(entry->layout); cursor = g_utf8_offset_to_pointer(text + index, trailing) - text; if (cursor < entry->cursor || cursor > entry->cursor + strlen(entry->preedit.text)) { return 0; } if (state == WL_POINTER_BUTTON_STATE_RELEASED) wl_text_input_invoke_action(entry->text_input, button, cursor - entry->cursor); return 1; } static bool text_entry_has_preedit(struct text_entry *entry) { return entry->preedit.text && (strlen(entry->preedit.text) > 0); } static void text_entry_set_cursor_position(struct text_entry *entry, int32_t x, int32_t y, bool move_anchor) { int index, trailing; const char *text; uint32_t cursor; pango_layout_xy_to_index(entry->layout, x * PANGO_SCALE, y * PANGO_SCALE, &index, &trailing); text = pango_layout_get_text(entry->layout); cursor = g_utf8_offset_to_pointer(text + index, trailing) - text; if (move_anchor) entry->anchor = cursor; if (text_entry_has_preedit(entry)) { text_entry_commit_and_reset(entry); assert(!text_entry_has_preedit(entry)); } if (entry->cursor == cursor) return; entry->cursor = cursor; text_entry_update_layout(entry); widget_schedule_redraw(entry->widget); text_entry_update(entry); } static void text_entry_delete_text(struct text_entry *entry, uint32_t index, uint32_t length) { uint32_t l; assert(index <= strlen(entry->text)); assert(index + length <= strlen(entry->text)); assert(index + length >= length); l = strlen(entry->text + index + length); memmove(entry->text + index, entry->text + index + length, l + 1); if (entry->cursor > (index + length)) entry->cursor -= length; else if (entry->cursor > index) entry->cursor = index; entry->anchor = entry->cursor; text_entry_update_layout(entry); widget_schedule_redraw(entry->widget); text_entry_update(entry); } static void text_entry_delete_selected_text(struct text_entry *entry) { uint32_t start_index = entry->anchor < entry->cursor ? entry->anchor : entry->cursor; uint32_t end_index = entry->anchor < entry->cursor ? entry->cursor : entry->anchor; if (entry->anchor == entry->cursor) return; text_entry_delete_text(entry, start_index, end_index - start_index); entry->anchor = entry->cursor; } static void text_entry_get_cursor_rectangle(struct text_entry *entry, struct rectangle *rectangle) { struct rectangle allocation; PangoRectangle extents; PangoRectangle cursor_pos; widget_get_allocation(entry->widget, &allocation); if (entry->preedit.text && entry->preedit.cursor < 0) { rectangle->x = 0; rectangle->y = 0; rectangle->width = 0; rectangle->height = 0; return; } pango_layout_get_extents(entry->layout, &extents, NULL); pango_layout_get_cursor_pos(entry->layout, entry->cursor + entry->preedit.cursor, &cursor_pos, NULL); rectangle->x = allocation.x + (allocation.height / 2) + PANGO_PIXELS(cursor_pos.x); rectangle->y = allocation.y + 10 + PANGO_PIXELS(cursor_pos.y); rectangle->width = PANGO_PIXELS(cursor_pos.width); rectangle->height = PANGO_PIXELS(cursor_pos.height); } static void text_entry_draw_cursor(struct text_entry *entry, cairo_t *cr) { PangoRectangle extents; PangoRectangle cursor_pos; if (entry->preedit.text && entry->preedit.cursor < 0) return; pango_layout_get_extents(entry->layout, &extents, NULL); pango_layout_get_cursor_pos(entry->layout, entry->cursor + entry->preedit.cursor, &cursor_pos, NULL); cairo_set_line_width(cr, 1.0); cairo_move_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y)); cairo_line_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y) + PANGO_PIXELS(cursor_pos.height)); cairo_stroke(cr); } static int text_offset_left(struct rectangle *allocation) { return 10; } static int text_offset_top(struct rectangle *allocation) { return allocation->height / 2; } static void text_entry_redraw_handler(struct widget *widget, void *data) { struct text_entry *entry = data; cairo_surface_t *surface; struct rectangle allocation; cairo_t *cr; surface = window_get_surface(entry->window); widget_get_allocation(entry->widget, &allocation); cr = cairo_create(surface); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_push_group(cr); cairo_translate(cr, allocation.x, allocation.y); cairo_set_source_rgba(cr, 1, 1, 1, 1); cairo_rectangle(cr, 0, 0, allocation.width, allocation.height); cairo_fill(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); if (entry->active) { cairo_rectangle(cr, 0, 0, allocation.width, allocation.height); cairo_set_line_width (cr, 3); cairo_set_source_rgba(cr, 0, 0, 1, 1.0); cairo_stroke(cr); } cairo_set_source_rgba(cr, 0, 0, 0, 1); cairo_translate(cr, text_offset_left(&allocation), text_offset_top(&allocation)); if (!entry->layout) entry->layout = pango_cairo_create_layout(cr); else pango_cairo_update_layout(cr, entry->layout); text_entry_update_layout(entry); pango_cairo_show_layout(cr, entry->layout); text_entry_draw_cursor(entry, cr); cairo_pop_group_to_source(cr); cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static int text_entry_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct text_entry *entry = data; struct rectangle allocation; int tx, ty; if (!entry->button_pressed) { return CURSOR_IBEAM; } widget_get_allocation(entry->widget, &allocation); tx = x - allocation.x - text_offset_left(&allocation); ty = y - allocation.y - text_offset_top(&allocation); text_entry_set_cursor_position(entry, tx, ty, false); return CURSOR_IBEAM; } static void text_entry_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct text_entry *entry = data; struct rectangle allocation; struct editor *editor; int32_t x, y; uint32_t result; widget_get_allocation(entry->widget, &allocation); input_get_position(input, &x, &y); x -= allocation.x + text_offset_left(&allocation); y -= allocation.y + text_offset_top(&allocation); editor = window_get_user_data(entry->window); switch (button) { case BTN_LEFT: entry->button_pressed = (state == WL_POINTER_BUTTON_STATE_PRESSED); if (state == WL_POINTER_BUTTON_STATE_PRESSED) input_grab(input, entry->widget, button); else input_ungrab(input); break; case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) show_menu(editor, input, time); break; } if (text_entry_has_preedit(entry)) { result = text_entry_try_invoke_preedit_action(entry, x, y, button, state); if (result) return; } if (state == WL_POINTER_BUTTON_STATE_PRESSED && button == BTN_LEFT) { struct wl_seat *seat = input_get_seat(input); text_entry_activate(entry, seat); editor->active_entry = entry; text_entry_set_cursor_position(entry, x, y, true); } } static void text_entry_touch_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float tx, float ty, void *data) { struct text_entry *entry = data; struct wl_seat *seat = input_get_seat(input); struct rectangle allocation; struct editor *editor; int32_t x, y; widget_get_allocation(entry->widget, &allocation); x = tx - (allocation.x + text_offset_left(&allocation)); y = ty - (allocation.y + text_offset_top(&allocation)); editor = window_get_user_data(entry->window); text_entry_activate(entry, seat); editor->active_entry = entry; text_entry_set_cursor_position(entry, x, y, true); } static void editor_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct editor *editor = data; if (button != BTN_LEFT) { return; } if (state == WL_POINTER_BUTTON_STATE_PRESSED) { struct wl_seat *seat = input_get_seat(input); text_entry_deactivate(editor->entry, seat); text_entry_deactivate(editor->editor, seat); editor->active_entry = NULL; } } static void editor_touch_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float tx, float ty, void *data) { struct editor *editor = data; struct wl_seat *seat = input_get_seat(input); text_entry_deactivate(editor->entry, seat); text_entry_deactivate(editor->editor, seat); editor->active_entry = NULL; } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct editor *editor = data; window_schedule_redraw(editor->window); } static int handle_bound_key(struct editor *editor, struct input *input, uint32_t sym, uint32_t time) { switch (sym) { case XKB_KEY_X: editor_copy_cut(editor, input, true); return 1; case XKB_KEY_C: editor_copy_cut(editor, input, false); return 1; case XKB_KEY_V: editor_paste(editor, input); return 1; default: return 0; } } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct editor *editor = data; struct text_entry *entry; const char *new_char; char text[16]; uint32_t modifiers; if (!editor->active_entry) return; entry = editor->active_entry; if (state != WL_KEYBOARD_KEY_STATE_PRESSED) return; modifiers = input_get_modifiers(input); if ((modifiers & MOD_CONTROL_MASK) && (modifiers & MOD_SHIFT_MASK) && handle_bound_key(editor, input, sym, time)) return; switch (sym) { case XKB_KEY_BackSpace: text_entry_commit_and_reset(entry); new_char = utf8_prev_char(entry->text, entry->text + entry->cursor); if (new_char != NULL) text_entry_delete_text(entry, new_char - entry->text, (entry->text + entry->cursor) - new_char); break; case XKB_KEY_Delete: text_entry_commit_and_reset(entry); new_char = utf8_next_char(entry->text + entry->cursor); if (new_char != NULL) text_entry_delete_text(entry, entry->cursor, new_char - (entry->text + entry->cursor)); break; case XKB_KEY_Left: text_entry_commit_and_reset(entry); new_char = utf8_prev_char(entry->text, entry->text + entry->cursor); if (new_char != NULL) { entry->cursor = new_char - entry->text; if (!(input_get_modifiers(input) & MOD_SHIFT_MASK)) entry->anchor = entry->cursor; widget_schedule_redraw(entry->widget); } break; case XKB_KEY_Right: text_entry_commit_and_reset(entry); new_char = utf8_next_char(entry->text + entry->cursor); if (new_char != NULL) { entry->cursor = new_char - entry->text; if (!(input_get_modifiers(input) & MOD_SHIFT_MASK)) entry->anchor = entry->cursor; widget_schedule_redraw(entry->widget); } break; case XKB_KEY_Up: text_entry_commit_and_reset(entry); move_up(entry->text, &entry->cursor); if (!(input_get_modifiers(input) & MOD_SHIFT_MASK)) entry->anchor = entry->cursor; widget_schedule_redraw(entry->widget); break; case XKB_KEY_Down: text_entry_commit_and_reset(entry); move_down(entry->text, &entry->cursor); if (!(input_get_modifiers(input) & MOD_SHIFT_MASK)) entry->anchor = entry->cursor; widget_schedule_redraw(entry->widget); break; case XKB_KEY_Escape: break; default: if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0) break; text_entry_commit_and_reset(entry); text_entry_insert_at_cursor(entry, text, 0, 0); break; } widget_schedule_redraw(entry->widget); } static void global_handler(struct display *display, uint32_t name, const char *interface, uint32_t version, void *data) { struct editor *editor = data; if (!strcmp(interface, "wl_text_input_manager")) { editor->text_input_manager = display_bind(display, name, &wl_text_input_manager_interface, 1); } } int main(int argc, char *argv[]) { struct editor editor; int i; uint32_t click_to_show = 0; const char *preferred_language = NULL; for (i = 1; i < argc; i++) { if (strcmp("--click-to-show", argv[i]) == 0) click_to_show = 1; else if (strcmp("--preferred-language", argv[i]) == 0 && i + 1 < argc) { preferred_language = argv[i + 1]; i++; } else { printf("Usage: %s [OPTIONS]\n" " --click-to-show\n" " --preferred-language LANGUAGE\n", argv[0]); return 1; } } memset(&editor, 0, sizeof editor); #ifdef HAVE_PANGO g_type_init(); #endif editor.display = display_create(&argc, argv); if (editor.display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } display_set_user_data(editor.display, &editor); display_set_global_handler(editor.display, global_handler); if (editor.text_input_manager == NULL) { fprintf(stderr, "No text input manager global\n"); return -1; } editor.window = window_create(editor.display); editor.widget = window_frame_create(editor.window, &editor); editor.entry = text_entry_create(&editor, "Entry"); editor.entry->click_to_show = click_to_show; if (preferred_language) editor.entry->preferred_language = strdup(preferred_language); editor.editor = text_entry_create(&editor, "Numeric"); editor.editor->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER; editor.editor->click_to_show = click_to_show; editor.selection = NULL; editor.selected_text = NULL; window_set_title(editor.window, "Text Editor"); window_set_key_handler(editor.window, key_handler); window_set_keyboard_focus_handler(editor.window, keyboard_focus_handler); window_set_user_data(editor.window, &editor); widget_set_redraw_handler(editor.widget, redraw_handler); widget_set_resize_handler(editor.widget, resize_handler); widget_set_button_handler(editor.widget, editor_button_handler); widget_set_touch_down_handler(editor.widget, editor_touch_handler); window_schedule_resize(editor.window, 500, 400); display_run(editor.display); if (editor.selected_text) free(editor.selected_text); if (editor.selection) wl_data_source_destroy(editor.selection); text_entry_destroy(editor.entry); text_entry_destroy(editor.editor); widget_destroy(editor.widget); window_destroy(editor.window); display_destroy(editor.display); return 0; } weston-1.9.0/clients/eventdemo.c0000664000175000017500000002761012561200202013552 00000000000000/* * Copyright © 2011 Tim Wiederhake * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /** * \file eventdemo.c * \brief Demonstrate the use of Wayland's toytoolkit. * * Heavily commented demo program that can report all events that are * dispatched to the window. For other functionality, eg. opengl/egl, * drag and drop, etc. have a look at the other demos. * \author Tim Wiederhake */ #include "config.h" #include #include #include #include "shared/helpers.h" #include "window.h" /** window title */ static char *title = "EventDemo"; /** window width */ static int width = 500; /** window height */ static int height = 400; /** set if window has no borders */ static int noborder = 0; /** if non-zero, maximum window width */ static int width_max = 0; /** if non-zero, maximum window height */ static int height_max = 0; /** set to log redrawing */ static int log_redraw = 0; /** set to log resizing */ static int log_resize = 0; /** set to log keyboard focus */ static int log_focus = 0; /** set to log key events */ static int log_key = 0; /** set to log button events */ static int log_button = 0; /** set to log axis events */ static int log_axis = 0; /** set to log motion events */ static int log_motion = 0; /** * \struct eventdemo * \brief Holds all data the program needs per window * * In this demo the struct holds the position of a * red rectangle that is drawn in the window's area. */ struct eventdemo { struct window *window; struct widget *widget; struct display *display; int x, y, w, h; }; /** * \brief CALLBACK function, Wayland requests the window to redraw. * \param widget widget to be redrawn * \param data user data associated to the window * * Draws a red rectangle as demonstration of per-window data. */ static void redraw_handler(struct widget *widget, void *data) { struct eventdemo *e = data; cairo_surface_t *surface; cairo_t *cr; struct rectangle rect; if (log_redraw) printf("redraw\n"); widget_get_allocation(e->widget, &rect); surface = window_get_surface(e->window); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_rectangle(cr, rect.x, rect.y, rect.width, rect.height); cairo_set_source_rgba(cr, 0, 0, 0, 0.8); cairo_fill(cr); cairo_rectangle(cr, e->x, e->y, e->w, e->h); cairo_set_source_rgba(cr, 1.0, 0, 0, 1); cairo_fill(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } /** * \brief CALLBACK function, Wayland requests the window to resize. * \param widget widget to be resized * \param width desired width * \param height desired height * \param data user data associated to the window */ static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct eventdemo *e = data; if (log_resize) printf("resize width: %d, height: %d\n", width, height); /* if a maximum width is set, constrain to it */ if (width_max && width_max < width) width = width_max; /* if a maximum height is set, constrain to it */ if (height_max && height_max < height) height = height_max; /* set the new window dimensions */ widget_set_size(e->widget, width, height); } /** * \brief CALLBACK function, Wayland informs about keyboard focus change * \param window window * \param device device that caused the focus change * \param data user data associated to the window */ static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { int32_t x, y; struct eventdemo *e = data; if (log_focus) { if (device) { input_get_position(device, &x, &y); printf("focus x: %d, y: %d\n", x, y); } else { printf("focus lost\n"); } } window_schedule_redraw(e->window); } /** * \brief CALLBACK function, Wayland informs about key event * \param window window * \param key keycode * \param unicode associated character * \param state pressed or released * \param modifiers modifiers: ctrl, alt, meta etc. * \param data user data associated to the window */ static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t unicode, enum wl_keyboard_key_state state, void *data) { uint32_t modifiers = input_get_modifiers(input); if (!log_key) return; printf("key key: %d, unicode: %d, state: %s, modifiers: 0x%x\n", key, unicode, (state == WL_KEYBOARD_KEY_STATE_PRESSED) ? "pressed" : "released", modifiers); } /** * \brief CALLBACK function, Wayland informs about button event * \param widget widget * \param input input device that caused the button event * \param time time the event happened * \param button button * \param state pressed or released * \param data user data associated to the window */ static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { int32_t x, y; if (!log_button) return; input_get_position(input, &x, &y); printf("button time: %d, button: %d, state: %s, x: %d, y: %d\n", time, button, (state == WL_POINTER_BUTTON_STATE_PRESSED) ? "pressed" : "released", x, y); } /** * \brief CALLBACK function, Wayland informs about axis event * \param widget widget * \param input input device that caused the axis event * \param time time the event happened * \param axis vertical or horizontal * \param value amount of scrolling * \param data user data associated to the widget */ static void axis_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t axis, wl_fixed_t value, void *data) { if (!log_axis) return; printf("axis time: %d, axis: %s, value: %f\n", time, axis == WL_POINTER_AXIS_VERTICAL_SCROLL ? "vertical" : "horizontal", wl_fixed_to_double(value)); } /** * \brief CALLBACK function, Waylands informs about pointer motion * \param widget widget * \param input input device that caused the motion event * \param time time the event happened * \param x absolute x position * \param y absolute y position * \param sx x position relative to the window * \param sy y position relative to the window * \param data user data associated to the window * * Demonstrates the use of different cursors */ static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct eventdemo *e = data; if (log_motion) { printf("motion time: %d, x: %f, y: %f\n", time, x, y); } if (x > e->x && x < e->x + e->w) if (y > e->y && y < e->y + e->h) return CURSOR_HAND1; return CURSOR_LEFT_PTR; } /** * \brief Create and initialise a new eventdemo window. * The returned eventdemo instance should be destroyed using \c eventdemo_destroy(). * \param d associated display */ static struct eventdemo * eventdemo_create(struct display *d) { struct eventdemo *e; e = malloc(sizeof (struct eventdemo)); if (e == NULL) return NULL; e->window = window_create(d); if (noborder) { /* Demonstrate how to create a borderless window. * Move windows with META + left mouse button. */ e->widget = window_add_widget(e->window, e); } else { e->widget = window_frame_create(e->window, e); window_set_title(e->window, title); } e->display = d; /* The eventdemo window draws a red rectangle as a demonstration * of per-window data. The dimensions of that rectangle are set * here. */ e->x = width * 1.0 / 4.0; e->w = width * 2.0 / 4.0; e->y = height * 1.0 / 4.0; e->h = height * 2.0 / 4.0; /* Connect the user data to the window */ window_set_user_data(e->window, e); /* Set the callback redraw handler for the window */ widget_set_redraw_handler(e->widget, redraw_handler); /* Set the callback resize handler for the window */ widget_set_resize_handler(e->widget, resize_handler); /* Set the callback focus handler for the window */ window_set_keyboard_focus_handler(e->window, keyboard_focus_handler); /* Set the callback key handler for the window */ window_set_key_handler(e->window, key_handler); /* Set the callback button handler for the window */ widget_set_button_handler(e->widget, button_handler); /* Set the callback motion handler for the window */ widget_set_motion_handler(e->widget, motion_handler); /* Set the callback axis handler for the window */ widget_set_axis_handler(e->widget, axis_handler); /* Initial drawing of the window */ window_schedule_resize(e->window, width, height); return e; } /** * \brief Destroy eventdemo instance previously created by \c eventdemo_create(). * \param eventdemo eventdemo instance to destroy */ static void eventdemo_destroy(struct eventdemo * eventdemo) { widget_destroy(eventdemo->widget); window_destroy(eventdemo->window); free(eventdemo); } /** * \brief command line options for eventdemo */ static const struct weston_option eventdemo_options[] = { { WESTON_OPTION_STRING, "title", 0, &title }, { WESTON_OPTION_INTEGER, "width", 'w', &width }, { WESTON_OPTION_INTEGER, "height", 'h', &height }, { WESTON_OPTION_INTEGER, "max-width", 0, &width_max }, { WESTON_OPTION_INTEGER, "max-height", 0, &height_max }, { WESTON_OPTION_BOOLEAN, "no-border", 'b', &noborder }, { WESTON_OPTION_BOOLEAN, "log-redraw", 0, &log_redraw }, { WESTON_OPTION_BOOLEAN, "log-resize", 0, &log_resize }, { WESTON_OPTION_BOOLEAN, "log-focus", 0, &log_focus }, { WESTON_OPTION_BOOLEAN, "log-key", 0, &log_key }, { WESTON_OPTION_BOOLEAN, "log-button", 0, &log_button }, { WESTON_OPTION_BOOLEAN, "log-axis", 0, &log_axis }, { WESTON_OPTION_BOOLEAN, "log-motion", 0, &log_motion }, }; /** * \brief Connects to the display, creates the window and hands over * to the main loop. */ int main(int argc, char *argv[]) { struct display *d; struct eventdemo *e; if (parse_options(eventdemo_options, ARRAY_LENGTH(eventdemo_options), &argc, argv) > 1) { unsigned k; printf("Usage: %s [OPTIONS]\n\n", argv[0]); for (k = 0; k < ARRAY_LENGTH(eventdemo_options); k++) { const struct weston_option* p = &eventdemo_options[k]; if (p->name) { printf(" --%s", p->name); if (p->type != WESTON_OPTION_BOOLEAN) printf("=VALUE"); putchar('\n'); } if (p->short_name) { printf(" -%c", p->short_name); if (p->type != WESTON_OPTION_BOOLEAN) printf("VALUE"); putchar('\n'); } } return 1; } if (!log_redraw && !log_resize && !log_focus && !log_key && !log_button && !log_axis && !log_motion) log_redraw = log_resize = log_focus = log_key = log_button = log_axis = log_motion = 1; /* Connect to the display and have the arguments parsed */ d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } /* Create new eventdemo window */ e = eventdemo_create(d); if (e == NULL) { fprintf(stderr, "failed to create eventdemo: %m\n"); return -1; } display_run(d); /* Release resources */ eventdemo_destroy(e); display_destroy(d); return 0; } weston-1.9.0/clients/window.c0000664000175000017500000042074112571434220013107 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2012-2013 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CAIRO_EGL #include #ifdef USE_CAIRO_GLESV2 #include #include #else #include #endif #include #include #include #else /* HAVE_CAIRO_EGL */ typedef void *EGLDisplay; typedef void *EGLConfig; typedef void *EGLContext; #define EGL_NO_DISPLAY ((EGLDisplay)0) #endif /* no HAVE_CAIRO_EGL */ #include #include #include #include #include "shared/cairo-util.h" #include "shared/helpers.h" #include "xdg-shell-client-protocol.h" #include "text-cursor-position-client-protocol.h" #include "workspaces-client-protocol.h" #include "shared/os-compatibility.h" #include "window.h" #include #include "ivi-application-client-protocol.h" #define IVI_SURFACE_ID 9000 struct shm_pool; struct global { uint32_t name; char *interface; uint32_t version; struct wl_list link; }; struct display { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_subcompositor *subcompositor; struct wl_shm *shm; struct wl_data_device_manager *data_device_manager; struct text_cursor_position *text_cursor_position; struct workspace_manager *workspace_manager; struct xdg_shell *xdg_shell; struct ivi_application *ivi_application; /* ivi style shell */ EGLDisplay dpy; EGLConfig argb_config; EGLContext argb_ctx; cairo_device_t *argb_device; uint32_t serial; int display_fd; uint32_t display_fd_events; struct task display_task; int epoll_fd; struct wl_list deferred_list; int running; struct wl_list global_list; struct wl_list window_list; struct wl_list input_list; struct wl_list output_list; struct theme *theme; struct wl_cursor_theme *cursor_theme; struct wl_cursor **cursors; display_output_handler_t output_configure_handler; display_global_handler_t global_handler; display_global_handler_t global_handler_remove; void *user_data; struct xkb_context *xkb_context; uint32_t workspace; uint32_t workspace_count; /* A hack to get text extents for tooltips */ cairo_surface_t *dummy_surface; void *dummy_surface_data; int has_rgb565; int seat_version; int data_device_manager_version; }; struct window_output { struct output *output; struct wl_list link; }; struct toysurface { /* * Prepare the surface for drawing. Makes sure there is a surface * of the right size available for rendering, and returns it. * dx,dy are the x,y of wl_surface.attach. * width,height are the new buffer size. * If flags has SURFACE_HINT_RESIZE set, the user is * doing continuous resizing. * Returns the Cairo surface to draw to. */ cairo_surface_t *(*prepare)(struct toysurface *base, int dx, int dy, int32_t width, int32_t height, uint32_t flags, enum wl_output_transform buffer_transform, int32_t buffer_scale); /* * Post the surface to the server, returning the server allocation * rectangle. The Cairo surface from prepare() must be destroyed * after calling this. */ void (*swap)(struct toysurface *base, enum wl_output_transform buffer_transform, int32_t buffer_scale, struct rectangle *server_allocation); /* * Make the toysurface current with the given EGL context. * Returns 0 on success, and negative of failure. */ int (*acquire)(struct toysurface *base, EGLContext ctx); /* * Release the toysurface from the EGL context, returning control * to Cairo. */ void (*release)(struct toysurface *base); /* * Destroy the toysurface, including the Cairo surface, any * backing storage, and the Wayland protocol objects. */ void (*destroy)(struct toysurface *base); }; struct surface { struct window *window; struct wl_surface *surface; struct wl_subsurface *subsurface; int synchronized; int synchronized_default; struct toysurface *toysurface; struct widget *widget; int redraw_needed; struct wl_callback *frame_cb; uint32_t last_time; struct rectangle allocation; struct rectangle server_allocation; struct wl_region *input_region; struct wl_region *opaque_region; enum window_buffer_type buffer_type; enum wl_output_transform buffer_transform; int32_t buffer_scale; cairo_surface_t *cairo_surface; struct wl_list link; }; struct window { struct display *display; struct wl_list window_output_list; char *title; struct rectangle saved_allocation; struct rectangle min_allocation; struct rectangle pending_allocation; struct rectangle last_geometry; int x, y; int redraw_needed; int redraw_task_scheduled; struct task redraw_task; int resize_needed; int custom; int focused; int resizing; int fullscreen; int maximized; enum preferred_format preferred_format; window_key_handler_t key_handler; window_keyboard_focus_handler_t keyboard_focus_handler; window_data_handler_t data_handler; window_drop_handler_t drop_handler; window_close_handler_t close_handler; window_fullscreen_handler_t fullscreen_handler; window_output_handler_t output_handler; window_state_changed_handler_t state_changed_handler; struct surface *main_surface; struct xdg_surface *xdg_surface; struct xdg_popup *xdg_popup; struct window *parent; struct window *last_parent; struct ivi_surface *ivi_surface; struct window_frame *frame; /* struct surface::link, contains also main_surface */ struct wl_list subsurface_list; void *user_data; struct wl_list link; }; struct widget { struct window *window; struct surface *surface; struct tooltip *tooltip; struct wl_list child_list; struct wl_list link; struct rectangle allocation; widget_resize_handler_t resize_handler; widget_redraw_handler_t redraw_handler; widget_enter_handler_t enter_handler; widget_leave_handler_t leave_handler; widget_motion_handler_t motion_handler; widget_button_handler_t button_handler; widget_touch_down_handler_t touch_down_handler; widget_touch_up_handler_t touch_up_handler; widget_touch_motion_handler_t touch_motion_handler; widget_touch_frame_handler_t touch_frame_handler; widget_touch_cancel_handler_t touch_cancel_handler; widget_axis_handler_t axis_handler; void *user_data; int opaque; int tooltip_count; int default_cursor; /* If this is set to false then no cairo surface will be * created before redrawing the surface. This is useful if the * redraw handler is going to do completely custom rendering * such as using EGL directly */ int use_cairo; }; struct touch_point { int32_t id; float x, y; struct widget *widget; struct wl_list link; }; struct input { struct display *display; struct wl_seat *seat; struct wl_pointer *pointer; struct wl_keyboard *keyboard; struct wl_touch *touch; struct wl_list touch_point_list; struct window *pointer_focus; struct window *keyboard_focus; struct window *touch_focus; int current_cursor; uint32_t cursor_anim_start; struct wl_callback *cursor_frame_cb; uint32_t cursor_timer_start; uint32_t cursor_anim_current; int cursor_delay_fd; bool cursor_timer_running; struct task cursor_task; struct wl_surface *pointer_surface; uint32_t modifiers; uint32_t pointer_enter_serial; uint32_t cursor_serial; float sx, sy; struct wl_list link; struct widget *focus_widget; struct widget *grab; uint32_t grab_button; struct wl_data_device *data_device; struct data_offer *drag_offer; struct data_offer *selection_offer; uint32_t touch_grab; int32_t touch_grab_id; float drag_x, drag_y; struct window *drag_focus; uint32_t drag_enter_serial; struct { struct xkb_keymap *keymap; struct xkb_state *state; xkb_mod_mask_t control_mask; xkb_mod_mask_t alt_mask; xkb_mod_mask_t shift_mask; } xkb; int32_t repeat_rate_sec; int32_t repeat_rate_nsec; int32_t repeat_delay_sec; int32_t repeat_delay_nsec; struct task repeat_task; int repeat_timer_fd; uint32_t repeat_sym; uint32_t repeat_key; uint32_t repeat_time; }; struct output { struct display *display; struct wl_output *output; uint32_t server_output_id; struct rectangle allocation; struct wl_list link; int transform; int scale; char *make; char *model; display_output_handler_t destroy_handler; void *user_data; }; struct window_frame { struct widget *widget; struct widget *child; struct frame *frame; uint32_t last_time; uint32_t did_double, double_click; int32_t last_id, double_id; }; struct menu { void *user_data; struct window *window; struct widget *widget; struct input *input; struct frame *frame; const char **entries; uint32_t time; int current; int count; int release_count; menu_func_t func; }; struct tooltip { struct widget *parent; struct widget *widget; char *entry; struct task tooltip_task; int tooltip_fd; float x, y; }; struct shm_pool { struct wl_shm_pool *pool; size_t size; size_t used; void *data; }; enum { CURSOR_DEFAULT = 100, CURSOR_UNSET }; static const cairo_user_data_key_t shm_surface_data_key; /* #define DEBUG */ #ifdef DEBUG static void debug_print(void *proxy, int line, const char *func, const char *fmt, ...) __attribute__ ((format (printf, 4, 5))); static void debug_print(void *proxy, int line, const char *func, const char *fmt, ...) { va_list ap; struct timeval tv; gettimeofday(&tv, NULL); fprintf(stderr, "%8ld.%03ld ", (long)tv.tv_sec & 0xffff, (long)tv.tv_usec / 1000); if (proxy) fprintf(stderr, "%s@%d ", wl_proxy_get_class(proxy), wl_proxy_get_id(proxy)); /*fprintf(stderr, __FILE__ ":%d:%s ", line, func);*/ fprintf(stderr, "%s ", func); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); } #define DBG(fmt, ...) \ debug_print(NULL, __LINE__, __func__, fmt, ##__VA_ARGS__) #define DBG_OBJ(obj, fmt, ...) \ debug_print(obj, __LINE__, __func__, fmt, ##__VA_ARGS__) #else #define DBG(...) do {} while (0) #define DBG_OBJ(...) do {} while (0) #endif static void surface_to_buffer_size (enum wl_output_transform buffer_transform, int32_t buffer_scale, int32_t *width, int32_t *height) { int32_t tmp; switch (buffer_transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: tmp = *width; *width = *height; *height = tmp; break; default: break; } *width *= buffer_scale; *height *= buffer_scale; } static void buffer_to_surface_size (enum wl_output_transform buffer_transform, int32_t buffer_scale, int32_t *width, int32_t *height) { int32_t tmp; switch (buffer_transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: tmp = *width; *width = *height; *height = tmp; break; default: break; } *width /= buffer_scale; *height /= buffer_scale; } #ifdef HAVE_CAIRO_EGL struct egl_window_surface { struct toysurface base; cairo_surface_t *cairo_surface; struct display *display; struct wl_surface *surface; struct wl_egl_window *egl_window; EGLSurface egl_surface; }; static struct egl_window_surface * to_egl_window_surface(struct toysurface *base) { return container_of(base, struct egl_window_surface, base); } static cairo_surface_t * egl_window_surface_prepare(struct toysurface *base, int dx, int dy, int32_t width, int32_t height, uint32_t flags, enum wl_output_transform buffer_transform, int32_t buffer_scale) { struct egl_window_surface *surface = to_egl_window_surface(base); surface_to_buffer_size (buffer_transform, buffer_scale, &width, &height); wl_egl_window_resize(surface->egl_window, width, height, dx, dy); cairo_gl_surface_set_size(surface->cairo_surface, width, height); return cairo_surface_reference(surface->cairo_surface); } static void egl_window_surface_swap(struct toysurface *base, enum wl_output_transform buffer_transform, int32_t buffer_scale, struct rectangle *server_allocation) { struct egl_window_surface *surface = to_egl_window_surface(base); cairo_gl_surface_swapbuffers(surface->cairo_surface); wl_egl_window_get_attached_size(surface->egl_window, &server_allocation->width, &server_allocation->height); buffer_to_surface_size (buffer_transform, buffer_scale, &server_allocation->width, &server_allocation->height); } static int egl_window_surface_acquire(struct toysurface *base, EGLContext ctx) { struct egl_window_surface *surface = to_egl_window_surface(base); cairo_device_t *device; device = cairo_surface_get_device(surface->cairo_surface); if (!device) return -1; if (!ctx) { if (device == surface->display->argb_device) ctx = surface->display->argb_ctx; else assert(0); } cairo_device_flush(device); cairo_device_acquire(device); if (!eglMakeCurrent(surface->display->dpy, surface->egl_surface, surface->egl_surface, ctx)) fprintf(stderr, "failed to make surface current\n"); return 0; } static void egl_window_surface_release(struct toysurface *base) { struct egl_window_surface *surface = to_egl_window_surface(base); cairo_device_t *device; device = cairo_surface_get_device(surface->cairo_surface); if (!device) return; if (!eglMakeCurrent(surface->display->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) fprintf(stderr, "failed to make context current\n"); cairo_device_release(device); } static void egl_window_surface_destroy(struct toysurface *base) { struct egl_window_surface *surface = to_egl_window_surface(base); struct display *d = surface->display; cairo_surface_destroy(surface->cairo_surface); eglDestroySurface(d->dpy, surface->egl_surface); wl_egl_window_destroy(surface->egl_window); surface->surface = NULL; free(surface); } static struct toysurface * egl_window_surface_create(struct display *display, struct wl_surface *wl_surface, uint32_t flags, struct rectangle *rectangle) { struct egl_window_surface *surface; if (display->dpy == EGL_NO_DISPLAY) return NULL; surface = calloc(1, sizeof *surface); if (!surface) return NULL; surface->base.prepare = egl_window_surface_prepare; surface->base.swap = egl_window_surface_swap; surface->base.acquire = egl_window_surface_acquire; surface->base.release = egl_window_surface_release; surface->base.destroy = egl_window_surface_destroy; surface->display = display; surface->surface = wl_surface; surface->egl_window = wl_egl_window_create(surface->surface, rectangle->width, rectangle->height); surface->egl_surface = weston_platform_create_egl_surface(display->dpy, display->argb_config, surface->egl_window, NULL); surface->cairo_surface = cairo_gl_surface_create_for_egl(display->argb_device, surface->egl_surface, rectangle->width, rectangle->height); return &surface->base; } #else static struct toysurface * egl_window_surface_create(struct display *display, struct wl_surface *wl_surface, uint32_t flags, struct rectangle *rectangle) { return NULL; } #endif struct shm_surface_data { struct wl_buffer *buffer; struct shm_pool *pool; }; struct wl_buffer * display_get_buffer_for_surface(struct display *display, cairo_surface_t *surface) { struct shm_surface_data *data; data = cairo_surface_get_user_data(surface, &shm_surface_data_key); return data->buffer; } static void shm_pool_destroy(struct shm_pool *pool); static void shm_surface_data_destroy(void *p) { struct shm_surface_data *data = p; wl_buffer_destroy(data->buffer); if (data->pool) shm_pool_destroy(data->pool); free(data); } static struct wl_shm_pool * make_shm_pool(struct display *display, int size, void **data) { struct wl_shm_pool *pool; int fd; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return NULL; } *data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (*data == MAP_FAILED) { fprintf(stderr, "mmap failed: %m\n"); close(fd); return NULL; } pool = wl_shm_create_pool(display->shm, fd, size); close(fd); return pool; } static struct shm_pool * shm_pool_create(struct display *display, size_t size) { struct shm_pool *pool = malloc(sizeof *pool); if (!pool) return NULL; pool->pool = make_shm_pool(display, size, &pool->data); if (!pool->pool) { free(pool); return NULL; } pool->size = size; pool->used = 0; return pool; } static void * shm_pool_allocate(struct shm_pool *pool, size_t size, int *offset) { if (pool->used + size > pool->size) return NULL; *offset = pool->used; pool->used += size; return (char *) pool->data + *offset; } /* destroy the pool. this does not unmap the memory though */ static void shm_pool_destroy(struct shm_pool *pool) { munmap(pool->data, pool->size); wl_shm_pool_destroy(pool->pool); free(pool); } /* Start allocating from the beginning of the pool again */ static void shm_pool_reset(struct shm_pool *pool) { pool->used = 0; } static int data_length_for_shm_surface(struct rectangle *rect) { int stride; stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, rect->width); return stride * rect->height; } static cairo_surface_t * display_create_shm_surface_from_pool(struct display *display, struct rectangle *rectangle, uint32_t flags, struct shm_pool *pool) { struct shm_surface_data *data; uint32_t format; cairo_surface_t *surface; cairo_format_t cairo_format; int stride, length, offset; void *map; data = malloc(sizeof *data); if (data == NULL) return NULL; if (flags & SURFACE_HINT_RGB565 && display->has_rgb565) cairo_format = CAIRO_FORMAT_RGB16_565; else cairo_format = CAIRO_FORMAT_ARGB32; stride = cairo_format_stride_for_width (cairo_format, rectangle->width); length = stride * rectangle->height; data->pool = NULL; map = shm_pool_allocate(pool, length, &offset); if (!map) { free(data); return NULL; } surface = cairo_image_surface_create_for_data (map, cairo_format, rectangle->width, rectangle->height, stride); cairo_surface_set_user_data(surface, &shm_surface_data_key, data, shm_surface_data_destroy); if (flags & SURFACE_HINT_RGB565 && display->has_rgb565) format = WL_SHM_FORMAT_RGB565; else { if (flags & SURFACE_OPAQUE) format = WL_SHM_FORMAT_XRGB8888; else format = WL_SHM_FORMAT_ARGB8888; } data->buffer = wl_shm_pool_create_buffer(pool->pool, offset, rectangle->width, rectangle->height, stride, format); return surface; } static cairo_surface_t * display_create_shm_surface(struct display *display, struct rectangle *rectangle, uint32_t flags, struct shm_pool *alternate_pool, struct shm_surface_data **data_ret) { struct shm_surface_data *data; struct shm_pool *pool; cairo_surface_t *surface; if (alternate_pool) { shm_pool_reset(alternate_pool); surface = display_create_shm_surface_from_pool(display, rectangle, flags, alternate_pool); if (surface) { data = cairo_surface_get_user_data(surface, &shm_surface_data_key); goto out; } } pool = shm_pool_create(display, data_length_for_shm_surface(rectangle)); if (!pool) return NULL; surface = display_create_shm_surface_from_pool(display, rectangle, flags, pool); if (!surface) { shm_pool_destroy(pool); return NULL; } /* make sure we destroy the pool when the surface is destroyed */ data = cairo_surface_get_user_data(surface, &shm_surface_data_key); data->pool = pool; out: if (data_ret) *data_ret = data; return surface; } static int check_size(struct rectangle *rect) { if (rect->width && rect->height) return 0; fprintf(stderr, "tried to create surface of " "width: %d, height: %d\n", rect->width, rect->height); return -1; } cairo_surface_t * display_create_surface(struct display *display, struct wl_surface *surface, struct rectangle *rectangle, uint32_t flags) { if (check_size(rectangle) < 0) return NULL; assert(flags & SURFACE_SHM); return display_create_shm_surface(display, rectangle, flags, NULL, NULL); } struct shm_surface_leaf { cairo_surface_t *cairo_surface; /* 'data' is automatically destroyed, when 'cairo_surface' is */ struct shm_surface_data *data; struct shm_pool *resize_pool; int busy; }; static void shm_surface_leaf_release(struct shm_surface_leaf *leaf) { if (leaf->cairo_surface) cairo_surface_destroy(leaf->cairo_surface); /* leaf->data already destroyed via cairo private */ if (leaf->resize_pool) shm_pool_destroy(leaf->resize_pool); memset(leaf, 0, sizeof *leaf); } #define MAX_LEAVES 3 struct shm_surface { struct toysurface base; struct display *display; struct wl_surface *surface; uint32_t flags; int dx, dy; struct shm_surface_leaf leaf[MAX_LEAVES]; struct shm_surface_leaf *current; }; static struct shm_surface * to_shm_surface(struct toysurface *base) { return container_of(base, struct shm_surface, base); } static void shm_surface_buffer_state_debug(struct shm_surface *surface, const char *msg) { #ifdef DEBUG struct shm_surface_leaf *leaf; char bufs[MAX_LEAVES + 1]; int i; for (i = 0; i < MAX_LEAVES; i++) { leaf = &surface->leaf[i]; if (leaf->busy) bufs[i] = 'b'; else if (leaf->cairo_surface) bufs[i] = 'a'; else bufs[i] = ' '; } bufs[MAX_LEAVES] = '\0'; DBG_OBJ(surface->surface, "%s, leaves [%s]\n", msg, bufs); #endif } static void shm_surface_buffer_release(void *data, struct wl_buffer *buffer) { struct shm_surface *surface = data; struct shm_surface_leaf *leaf; int i; int free_found; shm_surface_buffer_state_debug(surface, "buffer_release before"); for (i = 0; i < MAX_LEAVES; i++) { leaf = &surface->leaf[i]; if (leaf->data && leaf->data->buffer == buffer) { leaf->busy = 0; break; } } assert(i < MAX_LEAVES && "unknown buffer released"); /* Leave one free leaf with storage, release others */ free_found = 0; for (i = 0; i < MAX_LEAVES; i++) { leaf = &surface->leaf[i]; if (!leaf->cairo_surface || leaf->busy) continue; if (!free_found) free_found = 1; else shm_surface_leaf_release(leaf); } shm_surface_buffer_state_debug(surface, "buffer_release after"); } static const struct wl_buffer_listener shm_surface_buffer_listener = { shm_surface_buffer_release }; static cairo_surface_t * shm_surface_prepare(struct toysurface *base, int dx, int dy, int32_t width, int32_t height, uint32_t flags, enum wl_output_transform buffer_transform, int32_t buffer_scale) { int resize_hint = !!(flags & SURFACE_HINT_RESIZE); struct shm_surface *surface = to_shm_surface(base); struct rectangle rect = { 0}; struct shm_surface_leaf *leaf = NULL; int i; surface->dx = dx; surface->dy = dy; /* pick a free buffer, preferably one that already has storage */ for (i = 0; i < MAX_LEAVES; i++) { if (surface->leaf[i].busy) continue; if (!leaf || surface->leaf[i].cairo_surface) leaf = &surface->leaf[i]; } DBG_OBJ(surface->surface, "pick leaf %d\n", (int)(leaf - &surface->leaf[0])); if (!leaf) { fprintf(stderr, "%s: all buffers are held by the server.\n", __func__); exit(1); return NULL; } if (!resize_hint && leaf->resize_pool) { cairo_surface_destroy(leaf->cairo_surface); leaf->cairo_surface = NULL; shm_pool_destroy(leaf->resize_pool); leaf->resize_pool = NULL; } surface_to_buffer_size (buffer_transform, buffer_scale, &width, &height); if (leaf->cairo_surface && cairo_image_surface_get_width(leaf->cairo_surface) == width && cairo_image_surface_get_height(leaf->cairo_surface) == height) goto out; if (leaf->cairo_surface) cairo_surface_destroy(leaf->cairo_surface); #ifdef USE_RESIZE_POOL if (resize_hint && !leaf->resize_pool) { /* Create a big pool to allocate from, while continuously * resizing. Mmapping a new pool in the server * is relatively expensive, so reusing a pool performs * better, but may temporarily reserve unneeded memory. */ /* We should probably base this number on the output size. */ leaf->resize_pool = shm_pool_create(surface->display, 6 * 1024 * 1024); } #endif rect.width = width; rect.height = height; leaf->cairo_surface = display_create_shm_surface(surface->display, &rect, surface->flags, leaf->resize_pool, &leaf->data); if (!leaf->cairo_surface) return NULL; wl_buffer_add_listener(leaf->data->buffer, &shm_surface_buffer_listener, surface); out: surface->current = leaf; return cairo_surface_reference(leaf->cairo_surface); } static void shm_surface_swap(struct toysurface *base, enum wl_output_transform buffer_transform, int32_t buffer_scale, struct rectangle *server_allocation) { struct shm_surface *surface = to_shm_surface(base); struct shm_surface_leaf *leaf = surface->current; server_allocation->width = cairo_image_surface_get_width(leaf->cairo_surface); server_allocation->height = cairo_image_surface_get_height(leaf->cairo_surface); buffer_to_surface_size (buffer_transform, buffer_scale, &server_allocation->width, &server_allocation->height); wl_surface_attach(surface->surface, leaf->data->buffer, surface->dx, surface->dy); wl_surface_damage(surface->surface, 0, 0, server_allocation->width, server_allocation->height); wl_surface_commit(surface->surface); DBG_OBJ(surface->surface, "leaf %d busy\n", (int)(leaf - &surface->leaf[0])); leaf->busy = 1; surface->current = NULL; } static int shm_surface_acquire(struct toysurface *base, EGLContext ctx) { return -1; } static void shm_surface_release(struct toysurface *base) { } static void shm_surface_destroy(struct toysurface *base) { struct shm_surface *surface = to_shm_surface(base); int i; for (i = 0; i < MAX_LEAVES; i++) shm_surface_leaf_release(&surface->leaf[i]); free(surface); } static struct toysurface * shm_surface_create(struct display *display, struct wl_surface *wl_surface, uint32_t flags, struct rectangle *rectangle) { struct shm_surface *surface; DBG_OBJ(wl_surface, "\n"); surface = xzalloc(sizeof *surface); surface->base.prepare = shm_surface_prepare; surface->base.swap = shm_surface_swap; surface->base.acquire = shm_surface_acquire; surface->base.release = shm_surface_release; surface->base.destroy = shm_surface_destroy; surface->display = display; surface->surface = wl_surface; surface->flags = flags; return &surface->base; } /* * The following correspondences between file names and cursors was copied * from: https://bugs.kde.org/attachment.cgi?id=67313 */ static const char *bottom_left_corners[] = { "bottom_left_corner", "sw-resize", "size_bdiag" }; static const char *bottom_right_corners[] = { "bottom_right_corner", "se-resize", "size_fdiag" }; static const char *bottom_sides[] = { "bottom_side", "s-resize", "size_ver" }; static const char *grabbings[] = { "grabbing", "closedhand", "208530c400c041818281048008011002" }; static const char *left_ptrs[] = { "left_ptr", "default", "top_left_arrow", "left-arrow" }; static const char *left_sides[] = { "left_side", "w-resize", "size_hor" }; static const char *right_sides[] = { "right_side", "e-resize", "size_hor" }; static const char *top_left_corners[] = { "top_left_corner", "nw-resize", "size_fdiag" }; static const char *top_right_corners[] = { "top_right_corner", "ne-resize", "size_bdiag" }; static const char *top_sides[] = { "top_side", "n-resize", "size_ver" }; static const char *xterms[] = { "xterm", "ibeam", "text" }; static const char *hand1s[] = { "hand1", "pointer", "pointing_hand", "e29285e634086352946a0e7090d73106" }; static const char *watches[] = { "watch", "wait", "0426c94ea35c87780ff01dc239897213" }; struct cursor_alternatives { const char **names; size_t count; }; static const struct cursor_alternatives cursors[] = { {bottom_left_corners, ARRAY_LENGTH(bottom_left_corners)}, {bottom_right_corners, ARRAY_LENGTH(bottom_right_corners)}, {bottom_sides, ARRAY_LENGTH(bottom_sides)}, {grabbings, ARRAY_LENGTH(grabbings)}, {left_ptrs, ARRAY_LENGTH(left_ptrs)}, {left_sides, ARRAY_LENGTH(left_sides)}, {right_sides, ARRAY_LENGTH(right_sides)}, {top_left_corners, ARRAY_LENGTH(top_left_corners)}, {top_right_corners, ARRAY_LENGTH(top_right_corners)}, {top_sides, ARRAY_LENGTH(top_sides)}, {xterms, ARRAY_LENGTH(xterms)}, {hand1s, ARRAY_LENGTH(hand1s)}, {watches, ARRAY_LENGTH(watches)}, }; static void create_cursors(struct display *display) { const char *config_file; struct weston_config *config; struct weston_config_section *s; int size; char *theme = NULL; unsigned int i, j; struct wl_cursor *cursor; config_file = weston_config_get_name_from_env(); config = weston_config_parse(config_file); s = weston_config_get_section(config, "shell", NULL, NULL); weston_config_section_get_string(s, "cursor-theme", &theme, NULL); weston_config_section_get_int(s, "cursor-size", &size, 32); weston_config_destroy(config); display->cursor_theme = wl_cursor_theme_load(theme, size, display->shm); if (!display->cursor_theme) { fprintf(stderr, "could not load theme '%s'\n", theme); return; } free(theme); display->cursors = xmalloc(ARRAY_LENGTH(cursors) * sizeof display->cursors[0]); for (i = 0; i < ARRAY_LENGTH(cursors); i++) { cursor = NULL; for (j = 0; !cursor && j < cursors[i].count; ++j) cursor = wl_cursor_theme_get_cursor( display->cursor_theme, cursors[i].names[j]); if (!cursor) fprintf(stderr, "could not load cursor '%s'\n", cursors[i].names[0]); display->cursors[i] = cursor; } } static void destroy_cursors(struct display *display) { wl_cursor_theme_destroy(display->cursor_theme); free(display->cursors); } struct wl_cursor_image * display_get_pointer_image(struct display *display, int pointer) { struct wl_cursor *cursor = display->cursors[pointer]; return cursor ? cursor->images[0] : NULL; } static void surface_flush(struct surface *surface) { if (!surface->cairo_surface) return; if (surface->opaque_region) { wl_surface_set_opaque_region(surface->surface, surface->opaque_region); wl_region_destroy(surface->opaque_region); surface->opaque_region = NULL; } if (surface->input_region) { wl_surface_set_input_region(surface->surface, surface->input_region); wl_region_destroy(surface->input_region); surface->input_region = NULL; } surface->toysurface->swap(surface->toysurface, surface->buffer_transform, surface->buffer_scale, &surface->server_allocation); cairo_surface_destroy(surface->cairo_surface); surface->cairo_surface = NULL; } int window_has_focus(struct window *window) { return window->focused; } static void window_close(struct window *window) { if (window->close_handler) window->close_handler(window->user_data); else display_exit(window->display); } struct display * window_get_display(struct window *window) { return window->display; } static void handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, int32_t width, int32_t height) { struct window *window = data; window_schedule_resize(window, width, height); } static const struct ivi_surface_listener ivi_surface_listener = { handle_ivi_surface_configure, }; static void surface_create_surface(struct surface *surface, uint32_t flags) { struct display *display = surface->window->display; struct rectangle allocation = surface->allocation; if (!surface->toysurface && display->dpy && surface->buffer_type == WINDOW_BUFFER_TYPE_EGL_WINDOW) { surface->toysurface = egl_window_surface_create(display, surface->surface, flags, &allocation); } if (!surface->toysurface) surface->toysurface = shm_surface_create(display, surface->surface, flags, &allocation); surface->cairo_surface = surface->toysurface->prepare( surface->toysurface, 0, 0, allocation.width, allocation.height, flags, surface->buffer_transform, surface->buffer_scale); } static void window_create_main_surface(struct window *window) { struct surface *surface = window->main_surface; uint32_t flags = 0; if (window->resizing) flags |= SURFACE_HINT_RESIZE; if (window->preferred_format == WINDOW_PREFERRED_FORMAT_RGB565) flags |= SURFACE_HINT_RGB565; surface_create_surface(surface, flags); } int window_get_buffer_transform(struct window *window) { return window->main_surface->buffer_transform; } void window_set_buffer_transform(struct window *window, enum wl_output_transform transform) { window->main_surface->buffer_transform = transform; wl_surface_set_buffer_transform(window->main_surface->surface, transform); } void window_set_buffer_scale(struct window *window, int32_t scale) { window->main_surface->buffer_scale = scale; wl_surface_set_buffer_scale(window->main_surface->surface, scale); } uint32_t window_get_buffer_scale(struct window *window) { return window->main_surface->buffer_scale; } uint32_t window_get_output_scale(struct window *window) { struct window_output *window_output; struct window_output *window_output_tmp; int scale = 1; wl_list_for_each_safe(window_output, window_output_tmp, &window->window_output_list, link) { if (window_output->output->scale > scale) scale = window_output->output->scale; } return scale; } static void window_frame_destroy(struct window_frame *frame); static void surface_destroy(struct surface *surface) { if (surface->frame_cb) wl_callback_destroy(surface->frame_cb); if (surface->input_region) wl_region_destroy(surface->input_region); if (surface->opaque_region) wl_region_destroy(surface->opaque_region); if (surface->subsurface) wl_subsurface_destroy(surface->subsurface); wl_surface_destroy(surface->surface); if (surface->toysurface) surface->toysurface->destroy(surface->toysurface); wl_list_remove(&surface->link); free(surface); } void window_destroy(struct window *window) { struct display *display = window->display; struct input *input; struct window_output *window_output; struct window_output *window_output_tmp; wl_list_remove(&window->redraw_task.link); wl_list_for_each(input, &display->input_list, link) { if (input->touch_focus == window) input->touch_focus = NULL; if (input->pointer_focus == window) input->pointer_focus = NULL; if (input->keyboard_focus == window) input->keyboard_focus = NULL; if (input->focus_widget && input->focus_widget->window == window) input->focus_widget = NULL; } wl_list_for_each_safe(window_output, window_output_tmp, &window->window_output_list, link) { free (window_output); } if (window->frame) window_frame_destroy(window->frame); if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface); if (window->xdg_popup) xdg_popup_destroy(window->xdg_popup); if (window->ivi_surface) ivi_surface_destroy(window->ivi_surface); surface_destroy(window->main_surface); wl_list_remove(&window->link); free(window->title); free(window); } static struct widget * widget_find_widget(struct widget *widget, int32_t x, int32_t y) { struct widget *child, *target; wl_list_for_each(child, &widget->child_list, link) { target = widget_find_widget(child, x, y); if (target) return target; } if (widget->allocation.x <= x && x < widget->allocation.x + widget->allocation.width && widget->allocation.y <= y && y < widget->allocation.y + widget->allocation.height) { return widget; } return NULL; } static struct widget * window_find_widget(struct window *window, int32_t x, int32_t y) { struct surface *surface; struct widget *widget; wl_list_for_each(surface, &window->subsurface_list, link) { widget = widget_find_widget(surface->widget, x, y); if (widget) return widget; } return NULL; } static struct widget * widget_create(struct window *window, struct surface *surface, void *data) { struct widget *widget; widget = xzalloc(sizeof *widget); widget->window = window; widget->surface = surface; widget->user_data = data; widget->allocation = surface->allocation; wl_list_init(&widget->child_list); widget->opaque = 0; widget->tooltip = NULL; widget->tooltip_count = 0; widget->default_cursor = CURSOR_LEFT_PTR; widget->use_cairo = 1; return widget; } struct widget * window_add_widget(struct window *window, void *data) { struct widget *widget; widget = widget_create(window, window->main_surface, data); wl_list_init(&widget->link); window->main_surface->widget = widget; return widget; } struct widget * widget_add_widget(struct widget *parent, void *data) { struct widget *widget; widget = widget_create(parent->window, parent->surface, data); wl_list_insert(parent->child_list.prev, &widget->link); return widget; } void widget_destroy(struct widget *widget) { struct display *display = widget->window->display; struct surface *surface = widget->surface; struct input *input; /* Destroy the sub-surface along with the root widget */ if (surface->widget == widget && surface->subsurface) surface_destroy(widget->surface); if (widget->tooltip) widget_destroy_tooltip(widget); wl_list_for_each(input, &display->input_list, link) { if (input->focus_widget == widget) input->focus_widget = NULL; } wl_list_remove(&widget->link); free(widget); } void widget_set_default_cursor(struct widget *widget, int cursor) { widget->default_cursor = cursor; } void widget_get_allocation(struct widget *widget, struct rectangle *allocation) { *allocation = widget->allocation; } void widget_set_size(struct widget *widget, int32_t width, int32_t height) { widget->allocation.width = width; widget->allocation.height = height; } void widget_set_allocation(struct widget *widget, int32_t x, int32_t y, int32_t width, int32_t height) { widget->allocation.x = x; widget->allocation.y = y; widget_set_size(widget, width, height); } void widget_set_transparent(struct widget *widget, int transparent) { widget->opaque = !transparent; } void * widget_get_user_data(struct widget *widget) { return widget->user_data; } static cairo_surface_t * widget_get_cairo_surface(struct widget *widget) { struct surface *surface = widget->surface; struct window *window = widget->window; assert(widget->use_cairo); if (!surface->cairo_surface) { if (surface == window->main_surface) window_create_main_surface(window); else surface_create_surface(surface, 0); } return surface->cairo_surface; } static void widget_cairo_update_transform(struct widget *widget, cairo_t *cr) { struct surface *surface = widget->surface; double angle; cairo_matrix_t m; enum wl_output_transform transform; int surface_width, surface_height; int translate_x, translate_y; int32_t scale; surface_width = surface->allocation.width; surface_height = surface->allocation.height; transform = surface->buffer_transform; scale = surface->buffer_scale; switch (transform) { case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_180: case WL_OUTPUT_TRANSFORM_FLIPPED_270: cairo_matrix_init(&m, -1, 0, 0, 1, 0, 0); break; default: cairo_matrix_init_identity(&m); break; } switch (transform) { case WL_OUTPUT_TRANSFORM_NORMAL: default: angle = 0; translate_x = 0; translate_y = 0; break; case WL_OUTPUT_TRANSFORM_FLIPPED: angle = 0; translate_x = surface_width; translate_y = 0; break; case WL_OUTPUT_TRANSFORM_90: angle = M_PI_2; translate_x = surface_height; translate_y = 0; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: angle = M_PI_2; translate_x = surface_height; translate_y = surface_width; break; case WL_OUTPUT_TRANSFORM_180: angle = M_PI; translate_x = surface_width; translate_y = surface_height; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: angle = M_PI; translate_x = 0; translate_y = surface_height; break; case WL_OUTPUT_TRANSFORM_270: angle = M_PI + M_PI_2; translate_x = 0; translate_y = surface_width; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: angle = M_PI + M_PI_2; translate_x = 0; translate_y = 0; break; } cairo_scale(cr, scale, scale); cairo_translate(cr, translate_x, translate_y); cairo_rotate(cr, angle); cairo_transform(cr, &m); } cairo_t * widget_cairo_create(struct widget *widget) { struct surface *surface = widget->surface; cairo_surface_t *cairo_surface; cairo_t *cr; cairo_surface = widget_get_cairo_surface(widget); cr = cairo_create(cairo_surface); widget_cairo_update_transform(widget, cr); cairo_translate(cr, -surface->allocation.x, -surface->allocation.y); return cr; } struct wl_surface * widget_get_wl_surface(struct widget *widget) { return widget->surface->surface; } struct wl_subsurface * widget_get_wl_subsurface(struct widget *widget) { return widget->surface->subsurface; } uint32_t widget_get_last_time(struct widget *widget) { return widget->surface->last_time; } void widget_input_region_add(struct widget *widget, const struct rectangle *rect) { struct wl_compositor *comp = widget->window->display->compositor; struct surface *surface = widget->surface; if (!surface->input_region) surface->input_region = wl_compositor_create_region(comp); if (rect) { wl_region_add(surface->input_region, rect->x, rect->y, rect->width, rect->height); } } void widget_set_resize_handler(struct widget *widget, widget_resize_handler_t handler) { widget->resize_handler = handler; } void widget_set_redraw_handler(struct widget *widget, widget_redraw_handler_t handler) { widget->redraw_handler = handler; } void widget_set_enter_handler(struct widget *widget, widget_enter_handler_t handler) { widget->enter_handler = handler; } void widget_set_leave_handler(struct widget *widget, widget_leave_handler_t handler) { widget->leave_handler = handler; } void widget_set_motion_handler(struct widget *widget, widget_motion_handler_t handler) { widget->motion_handler = handler; } void widget_set_button_handler(struct widget *widget, widget_button_handler_t handler) { widget->button_handler = handler; } void widget_set_touch_up_handler(struct widget *widget, widget_touch_up_handler_t handler) { widget->touch_up_handler = handler; } void widget_set_touch_down_handler(struct widget *widget, widget_touch_down_handler_t handler) { widget->touch_down_handler = handler; } void widget_set_touch_motion_handler(struct widget *widget, widget_touch_motion_handler_t handler) { widget->touch_motion_handler = handler; } void widget_set_touch_frame_handler(struct widget *widget, widget_touch_frame_handler_t handler) { widget->touch_frame_handler = handler; } void widget_set_touch_cancel_handler(struct widget *widget, widget_touch_cancel_handler_t handler) { widget->touch_cancel_handler = handler; } void widget_set_axis_handler(struct widget *widget, widget_axis_handler_t handler) { widget->axis_handler = handler; } static void window_schedule_redraw_task(struct window *window); void widget_schedule_redraw(struct widget *widget) { DBG_OBJ(widget->surface->surface, "widget %p\n", widget); widget->surface->redraw_needed = 1; window_schedule_redraw_task(widget->window); } void widget_set_use_cairo(struct widget *widget, int use_cairo) { widget->use_cairo = use_cairo; } cairo_surface_t * window_get_surface(struct window *window) { cairo_surface_t *cairo_surface; cairo_surface = widget_get_cairo_surface(window->main_surface->widget); return cairo_surface_reference(cairo_surface); } struct wl_surface * window_get_wl_surface(struct window *window) { return window->main_surface->surface; } static void tooltip_redraw_handler(struct widget *widget, void *data) { cairo_t *cr; const int32_t r = 3; struct tooltip *tooltip = data; int32_t width, height; cr = widget_cairo_create(widget); cairo_translate(cr, widget->allocation.x, widget->allocation.y); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0); cairo_paint(cr); width = widget->allocation.width; height = widget->allocation.height; rounded_rect(cr, 0, 0, width, height, r); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_set_source_rgba(cr, 0.0, 0.0, 0.4, 0.8); cairo_fill(cr); cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_move_to(cr, 10, 16); cairo_show_text(cr, tooltip->entry); cairo_destroy(cr); } static cairo_text_extents_t get_text_extents(struct display *display, struct tooltip *tooltip) { cairo_t *cr; cairo_text_extents_t extents; /* Use the dummy_surface because tooltip's surface was not * created yet, and parent does not have a valid surface * outside repaint, either. */ cr = cairo_create(display->dummy_surface); cairo_text_extents(cr, tooltip->entry, &extents); cairo_destroy(cr); return extents; } static int window_create_tooltip(struct tooltip *tooltip) { struct widget *parent = tooltip->parent; struct display *display = parent->window->display; const int offset_y = 27; const int margin = 3; cairo_text_extents_t extents; if (tooltip->widget) return 0; tooltip->widget = window_add_subsurface(parent->window, tooltip, SUBSURFACE_DESYNCHRONIZED); extents = get_text_extents(display, tooltip); widget_set_redraw_handler(tooltip->widget, tooltip_redraw_handler); widget_set_allocation(tooltip->widget, tooltip->x, tooltip->y + offset_y, extents.width + 20, 20 + margin * 2); return 0; } void widget_destroy_tooltip(struct widget *parent) { struct tooltip *tooltip = parent->tooltip; parent->tooltip_count = 0; if (!tooltip) return; if (tooltip->widget) { widget_destroy(tooltip->widget); tooltip->widget = NULL; } close(tooltip->tooltip_fd); free(tooltip->entry); free(tooltip); parent->tooltip = NULL; } static void tooltip_func(struct task *task, uint32_t events) { struct tooltip *tooltip = container_of(task, struct tooltip, tooltip_task); uint64_t exp; if (read(tooltip->tooltip_fd, &exp, sizeof (uint64_t)) != sizeof (uint64_t)) abort(); window_create_tooltip(tooltip); } #define TOOLTIP_TIMEOUT 500 static int tooltip_timer_reset(struct tooltip *tooltip) { struct itimerspec its; its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = TOOLTIP_TIMEOUT / 1000; its.it_value.tv_nsec = (TOOLTIP_TIMEOUT % 1000) * 1000 * 1000; if (timerfd_settime(tooltip->tooltip_fd, 0, &its, NULL) < 0) { fprintf(stderr, "could not set timerfd\n: %m"); return -1; } return 0; } int widget_set_tooltip(struct widget *parent, char *entry, float x, float y) { struct tooltip *tooltip = parent->tooltip; parent->tooltip_count++; if (tooltip) { tooltip->x = x; tooltip->y = y; tooltip_timer_reset(tooltip); return 0; } /* the handler might be triggered too fast via input device motion, so * we need this check here to make sure tooltip is fully initialized */ if (parent->tooltip_count > 1) return 0; tooltip = malloc(sizeof *tooltip); if (!tooltip) return -1; parent->tooltip = tooltip; tooltip->parent = parent; tooltip->widget = NULL; tooltip->x = x; tooltip->y = y; tooltip->entry = strdup(entry); tooltip->tooltip_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); if (tooltip->tooltip_fd < 0) { fprintf(stderr, "could not create timerfd\n: %m"); return -1; } tooltip->tooltip_task.run = tooltip_func; display_watch_fd(parent->window->display, tooltip->tooltip_fd, EPOLLIN, &tooltip->tooltip_task); tooltip_timer_reset(tooltip); return 0; } static void workspace_manager_state(void *data, struct workspace_manager *workspace_manager, uint32_t current, uint32_t count) { struct display *display = data; display->workspace = current; display->workspace_count = count; } static const struct workspace_manager_listener workspace_manager_listener = { workspace_manager_state }; static void frame_resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct window_frame *frame = data; struct widget *child = frame->child; struct rectangle interior; struct rectangle input; struct rectangle opaque; if (widget->window->fullscreen) { interior.x = 0; interior.y = 0; interior.width = width; interior.height = height; } else { frame_resize(frame->frame, width, height); frame_interior(frame->frame, &interior.x, &interior.y, &interior.width, &interior.height); } widget_set_allocation(child, interior.x, interior.y, interior.width, interior.height); if (child->resize_handler) { child->resize_handler(child, interior.width, interior.height, child->user_data); if (widget->window->fullscreen) { width = child->allocation.width; height = child->allocation.height; } else { frame_resize_inside(frame->frame, child->allocation.width, child->allocation.height); width = frame_width(frame->frame); height = frame_height(frame->frame); } } widget_set_allocation(widget, 0, 0, width, height); widget->surface->input_region = wl_compositor_create_region(widget->window->display->compositor); if (!widget->window->fullscreen) { frame_input_rect(frame->frame, &input.x, &input.y, &input.width, &input.height); wl_region_add(widget->surface->input_region, input.x, input.y, input.width, input.height); } else { wl_region_add(widget->surface->input_region, 0, 0, width, height); } widget_set_allocation(widget, 0, 0, width, height); if (child->opaque) { if (!widget->window->fullscreen) { frame_opaque_rect(frame->frame, &opaque.x, &opaque.y, &opaque.width, &opaque.height); wl_region_add(widget->surface->opaque_region, opaque.x, opaque.y, opaque.width, opaque.height); } else { wl_region_add(widget->surface->opaque_region, 0, 0, width, height); } } widget_schedule_redraw(widget); } static void frame_redraw_handler(struct widget *widget, void *data) { cairo_t *cr; struct window_frame *frame = data; struct window *window = widget->window; if (window->fullscreen) return; cr = widget_cairo_create(widget); frame_repaint(frame->frame, cr); cairo_destroy(cr); } static int frame_get_pointer_image_for_location(struct window_frame *frame, enum theme_location location) { struct window *window = frame->widget->window; if (window->custom) return CURSOR_LEFT_PTR; switch (location) { case THEME_LOCATION_RESIZING_TOP: return CURSOR_TOP; case THEME_LOCATION_RESIZING_BOTTOM: return CURSOR_BOTTOM; case THEME_LOCATION_RESIZING_LEFT: return CURSOR_LEFT; case THEME_LOCATION_RESIZING_RIGHT: return CURSOR_RIGHT; case THEME_LOCATION_RESIZING_TOP_LEFT: return CURSOR_TOP_LEFT; case THEME_LOCATION_RESIZING_TOP_RIGHT: return CURSOR_TOP_RIGHT; case THEME_LOCATION_RESIZING_BOTTOM_LEFT: return CURSOR_BOTTOM_LEFT; case THEME_LOCATION_RESIZING_BOTTOM_RIGHT: return CURSOR_BOTTOM_RIGHT; case THEME_LOCATION_EXTERIOR: case THEME_LOCATION_TITLEBAR: default: return CURSOR_LEFT_PTR; } } static void frame_menu_func(void *data, struct input *input, int index) { struct window *window = data; struct display *display; switch (index) { case 0: /* close */ window_close(window); break; case 1: /* move to workspace above */ display = window->display; if (display->workspace > 0) workspace_manager_move_surface( display->workspace_manager, window->main_surface->surface, display->workspace - 1); break; case 2: /* move to workspace below */ display = window->display; if (display->workspace < display->workspace_count - 1) workspace_manager_move_surface( display->workspace_manager, window->main_surface->surface, display->workspace + 1); break; case 3: /* fullscreen */ /* we don't have a way to get out of fullscreen for now */ if (window->fullscreen_handler) window->fullscreen_handler(window, window->user_data); break; } } void window_show_frame_menu(struct window *window, struct input *input, uint32_t time) { int32_t x, y; int count; static const char *entries[] = { "Close", "Move to workspace above", "Move to workspace below", "Fullscreen" }; if (window->fullscreen_handler) count = ARRAY_LENGTH(entries); else count = ARRAY_LENGTH(entries) - 1; input_get_position(input, &x, &y); window_show_menu(window->display, input, time, window, x - 10, y - 10, frame_menu_func, entries, count); } static int frame_enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct window_frame *frame = data; enum theme_location location; location = frame_pointer_enter(frame->frame, input, x, y); if (frame_status(frame->frame) & FRAME_STATUS_REPAINT) widget_schedule_redraw(frame->widget); return frame_get_pointer_image_for_location(data, location); } static int frame_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct window_frame *frame = data; enum theme_location location; location = frame_pointer_motion(frame->frame, input, x, y); if (frame_status(frame->frame) & FRAME_STATUS_REPAINT) widget_schedule_redraw(frame->widget); return frame_get_pointer_image_for_location(data, location); } static void frame_leave_handler(struct widget *widget, struct input *input, void *data) { struct window_frame *frame = data; frame_pointer_leave(frame->frame, input); if (frame_status(frame->frame) & FRAME_STATUS_REPAINT) widget_schedule_redraw(frame->widget); } static void frame_handle_status(struct window_frame *frame, struct input *input, uint32_t time, enum theme_location location) { struct window *window = frame->widget->window; uint32_t status; status = frame_status(frame->frame); if (status & FRAME_STATUS_REPAINT) widget_schedule_redraw(frame->widget); if (status & FRAME_STATUS_MINIMIZE) { window_set_minimized(window); frame_status_clear(frame->frame, FRAME_STATUS_MINIMIZE); } if (status & FRAME_STATUS_MENU) { window_show_frame_menu(window, input, time); frame_status_clear(frame->frame, FRAME_STATUS_MENU); } if (status & FRAME_STATUS_MAXIMIZE) { window_set_maximized(window, !window->maximized); frame_status_clear(frame->frame, FRAME_STATUS_MAXIMIZE); } if (status & FRAME_STATUS_CLOSE) { window_close(window); return; } if ((status & FRAME_STATUS_MOVE) && window->xdg_surface) { input_ungrab(input); xdg_surface_move(window->xdg_surface, input_get_seat(input), window->display->serial); frame_status_clear(frame->frame, FRAME_STATUS_MOVE); } if ((status & FRAME_STATUS_RESIZE) && window->xdg_surface) { input_ungrab(input); xdg_surface_resize(window->xdg_surface, input_get_seat(input), window->display->serial, location); frame_status_clear(frame->frame, FRAME_STATUS_RESIZE); } } #define DOUBLE_CLICK_PERIOD 250 static void frame_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct window_frame *frame = data; enum theme_location location; frame->double_click = 0; if (state == WL_POINTER_BUTTON_STATE_PRESSED) { if (time - frame->last_time <= DOUBLE_CLICK_PERIOD) { frame->double_click = 1; frame->did_double = 1; } else frame->did_double = 0; frame->last_time = time; } else if (frame->did_double == 1) { frame->double_click = 1; frame->did_double = 0; } if (frame->double_click) location = frame_double_click(frame->frame, input, button, state); else location = frame_pointer_button(frame->frame, input, button, state); frame_handle_status(frame, input, time, location); } static void frame_touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct window_frame *frame = data; frame->double_click = 0; if (time - frame->last_time <= DOUBLE_CLICK_PERIOD && frame->last_id == id) { frame->double_click = 1; frame->did_double = 1; frame->double_id = id; } else frame->did_double = 0; frame->last_time = time; frame->last_id = id; if (frame->double_click) frame_double_touch_down(frame->frame, input, id, x, y); else frame_touch_down(frame->frame, input, id, x, y); frame_handle_status(frame, input, time, THEME_LOCATION_CLIENT_AREA); } static void frame_touch_up_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data) { struct window_frame *frame = data; if (frame->double_id == id && frame->did_double) { frame->did_double = 0; frame->double_id = 0; frame_double_touch_up(frame->frame, input, id); } else frame_touch_up(frame->frame, input, id); frame_handle_status(frame, input, time, THEME_LOCATION_CLIENT_AREA); } struct widget * window_frame_create(struct window *window, void *data) { struct window_frame *frame; uint32_t buttons; if (window->custom) { buttons = FRAME_BUTTON_NONE; } else { buttons = FRAME_BUTTON_ALL; } frame = xzalloc(sizeof *frame); frame->frame = frame_create(window->display->theme, 0, 0, buttons, window->title); frame->widget = window_add_widget(window, frame); frame->child = widget_add_widget(frame->widget, data); widget_set_redraw_handler(frame->widget, frame_redraw_handler); widget_set_resize_handler(frame->widget, frame_resize_handler); widget_set_enter_handler(frame->widget, frame_enter_handler); widget_set_leave_handler(frame->widget, frame_leave_handler); widget_set_motion_handler(frame->widget, frame_motion_handler); widget_set_button_handler(frame->widget, frame_button_handler); widget_set_touch_down_handler(frame->widget, frame_touch_down_handler); widget_set_touch_up_handler(frame->widget, frame_touch_up_handler); window->frame = frame; return frame->child; } void window_frame_set_child_size(struct widget *widget, int child_width, int child_height) { struct display *display = widget->window->display; struct theme *t = display->theme; int decoration_width, decoration_height; int width, height; int margin = widget->window->maximized ? 0 : t->margin; if (!widget->window->fullscreen) { decoration_width = (t->width + margin) * 2; decoration_height = t->width + t->titlebar_height + margin * 2; width = child_width + decoration_width; height = child_height + decoration_height; } else { width = child_width; height = child_height; } window_schedule_resize(widget->window, width, height); } static void window_frame_destroy(struct window_frame *frame) { frame_destroy(frame->frame); /* frame->child must be destroyed by the application */ widget_destroy(frame->widget); free(frame); } static void input_set_focus_widget(struct input *input, struct widget *focus, float x, float y) { struct widget *old, *widget; int cursor; if (focus == input->focus_widget) return; old = input->focus_widget; if (old) { widget = old; if (input->grab) widget = input->grab; if (widget->leave_handler) widget->leave_handler(old, input, widget->user_data); input->focus_widget = NULL; } if (focus) { widget = focus; if (input->grab) widget = input->grab; input->focus_widget = focus; if (widget->enter_handler) cursor = widget->enter_handler(focus, input, x, y, widget->user_data); else cursor = widget->default_cursor; input_set_pointer_image(input, cursor); } } void touch_grab(struct input *input, int32_t touch_id) { input->touch_grab = 1; input->touch_grab_id = touch_id; } void touch_ungrab(struct input *input) { struct touch_point *tp, *tmp; input->touch_grab = 0; wl_list_for_each_safe(tp, tmp, &input->touch_point_list, link) { if (tp->id != input->touch_grab_id) continue; wl_list_remove(&tp->link); free(tp); return; } } void input_grab(struct input *input, struct widget *widget, uint32_t button) { input->grab = widget; input->grab_button = button; input_set_focus_widget(input, widget, input->sx, input->sy); } void input_ungrab(struct input *input) { struct widget *widget; input->grab = NULL; if (input->pointer_focus) { widget = window_find_widget(input->pointer_focus, input->sx, input->sy); input_set_focus_widget(input, widget, input->sx, input->sy); } } static void cursor_delay_timer_reset(struct input *input, uint32_t duration) { struct itimerspec its; if (!duration) input->cursor_timer_running = false; else input->cursor_timer_running = true; its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = duration / 1000; its.it_value.tv_nsec = (duration % 1000) * 1000 * 1000; if (timerfd_settime(input->cursor_delay_fd, 0, &its, NULL) < 0) fprintf(stderr, "could not set cursor timerfd\n: %m"); } static void cancel_pointer_image_update(struct input *input) { if (input->cursor_timer_running) cursor_delay_timer_reset(input, 0); } static void input_remove_pointer_focus(struct input *input) { struct window *window = input->pointer_focus; if (!window) return; input_set_focus_widget(input, NULL, 0, 0); input->pointer_focus = NULL; input->current_cursor = CURSOR_UNSET; cancel_pointer_image_update(input); } static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w) { struct input *input = data; struct window *window; struct widget *widget; float sx = wl_fixed_to_double(sx_w); float sy = wl_fixed_to_double(sy_w); if (!surface) { /* enter event for a window we've just destroyed */ return; } window = wl_surface_get_user_data(surface); if (surface != window->main_surface->surface) { DBG("Ignoring input event from subsurface %p\n", surface); return; } input->display->serial = serial; input->pointer_enter_serial = serial; input->pointer_focus = window; input->sx = sx; input->sy = sy; widget = window_find_widget(window, sx, sy); input_set_focus_widget(input, widget, sx, sy); } static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) { struct input *input = data; input->display->serial = serial; input_remove_pointer_focus(input); } static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { struct input *input = data; struct window *window = input->pointer_focus; struct widget *widget; int cursor; float sx = wl_fixed_to_double(sx_w); float sy = wl_fixed_to_double(sy_w); if (!window) return; input->sx = sx; input->sy = sy; /* when making the window smaller - e.g. after a unmaximise we might * still have a pending motion event that the compositor has picked * based on the old surface dimensions */ if (sx > window->main_surface->allocation.width || sy > window->main_surface->allocation.height) return; if (!(input->grab && input->grab_button)) { widget = window_find_widget(window, sx, sy); input_set_focus_widget(input, widget, sx, sy); } if (input->grab) widget = input->grab; else widget = input->focus_widget; if (widget) { if (widget->motion_handler) cursor = widget->motion_handler(input->focus_widget, input, time, sx, sy, widget->user_data); else cursor = widget->default_cursor; } else cursor = CURSOR_LEFT_PTR; input_set_pointer_image(input, cursor); } static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w) { struct input *input = data; struct widget *widget; enum wl_pointer_button_state state = state_w; input->display->serial = serial; if (input->focus_widget && input->grab == NULL && state == WL_POINTER_BUTTON_STATE_PRESSED) input_grab(input, input->focus_widget, button); widget = input->grab; if (widget && widget->button_handler) (*widget->button_handler)(widget, input, time, button, state, input->grab->user_data); if (input->grab && input->grab_button == button && state == WL_POINTER_BUTTON_STATE_RELEASED) input_ungrab(input); } static void pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct input *input = data; struct widget *widget; widget = input->focus_widget; if (input->grab) widget = input->grab; if (widget && widget->axis_handler) (*widget->axis_handler)(widget, input, time, axis, value, widget->user_data); } static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, }; static void input_remove_keyboard_focus(struct input *input) { struct window *window = input->keyboard_focus; struct itimerspec its; its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = 0; its.it_value.tv_nsec = 0; timerfd_settime(input->repeat_timer_fd, 0, &its, NULL); if (!window) return; if (window->keyboard_focus_handler) (*window->keyboard_focus_handler)(window, NULL, window->user_data); input->keyboard_focus = NULL; } static void keyboard_repeat_func(struct task *task, uint32_t events) { struct input *input = container_of(task, struct input, repeat_task); struct window *window = input->keyboard_focus; uint64_t exp; if (read(input->repeat_timer_fd, &exp, sizeof exp) != sizeof exp) /* If we change the timer between the fd becoming * readable and getting here, there'll be nothing to * read and we get EAGAIN. */ return; if (window && window->key_handler) { (*window->key_handler)(window, input, input->repeat_time, input->repeat_key, input->repeat_sym, WL_KEYBOARD_KEY_STATE_PRESSED, window->user_data); } } static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { struct input *input = data; struct xkb_keymap *keymap; struct xkb_state *state; char *map_str; if (!data) { close(fd); return; } if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { close(fd); return; } map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (map_str == MAP_FAILED) { close(fd); return; } keymap = xkb_keymap_new_from_string(input->display->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(map_str, size); close(fd); if (!keymap) { fprintf(stderr, "failed to compile keymap\n"); return; } state = xkb_state_new(keymap); if (!state) { fprintf(stderr, "failed to create XKB state\n"); xkb_keymap_unref(keymap); return; } xkb_keymap_unref(input->xkb.keymap); xkb_state_unref(input->xkb.state); input->xkb.keymap = keymap; input->xkb.state = state; input->xkb.control_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Control"); input->xkb.alt_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Mod1"); input->xkb.shift_mask = 1 << xkb_keymap_mod_get_index(input->xkb.keymap, "Shift"); } static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { struct input *input = data; struct window *window; input->display->serial = serial; input->keyboard_focus = wl_surface_get_user_data(surface); window = input->keyboard_focus; if (window->keyboard_focus_handler) (*window->keyboard_focus_handler)(window, input, window->user_data); } static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { struct input *input = data; input->display->serial = serial; input_remove_keyboard_focus(input); } static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w) { struct input *input = data; struct window *window = input->keyboard_focus; uint32_t code, num_syms; enum wl_keyboard_key_state state = state_w; const xkb_keysym_t *syms; xkb_keysym_t sym; struct itimerspec its; input->display->serial = serial; code = key + 8; if (!window || !input->xkb.state) return; /* We only use input grabs for pointer events for now, so just * ignore key presses if a grab is active. We expand the key * event delivery mechanism to route events to widgets to * properly handle key grabs. In the meantime, this prevents * key event devlivery while a grab is active. */ if (input->grab && input->grab_button == 0) return; num_syms = xkb_state_key_get_syms(input->xkb.state, code, &syms); sym = XKB_KEY_NoSymbol; if (num_syms == 1) sym = syms[0]; if (sym == XKB_KEY_F5 && input->modifiers == MOD_ALT_MASK) { if (state == WL_KEYBOARD_KEY_STATE_PRESSED) window_set_maximized(window, !window->maximized); } else if (sym == XKB_KEY_F11 && window->fullscreen_handler && state == WL_KEYBOARD_KEY_STATE_PRESSED) { window->fullscreen_handler(window, window->user_data); } else if (sym == XKB_KEY_F4 && input->modifiers == MOD_ALT_MASK && state == WL_KEYBOARD_KEY_STATE_PRESSED) { window_close(window); } else if (window->key_handler) { (*window->key_handler)(window, input, time, key, sym, state, window->user_data); } if (state == WL_KEYBOARD_KEY_STATE_RELEASED && key == input->repeat_key) { its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = 0; its.it_value.tv_nsec = 0; timerfd_settime(input->repeat_timer_fd, 0, &its, NULL); } else if (state == WL_KEYBOARD_KEY_STATE_PRESSED && xkb_keymap_key_repeats(input->xkb.keymap, code)) { input->repeat_sym = sym; input->repeat_key = key; input->repeat_time = time; its.it_interval.tv_sec = input->repeat_rate_sec; its.it_interval.tv_nsec = input->repeat_rate_nsec; its.it_value.tv_sec = input->repeat_delay_sec; its.it_value.tv_nsec = input->repeat_delay_nsec; timerfd_settime(input->repeat_timer_fd, 0, &its, NULL); } } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct input *input = data; xkb_mod_mask_t mask; /* If we're not using a keymap, then we don't handle PC-style modifiers */ if (!input->xkb.keymap) return; xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched, mods_locked, 0, 0, group); mask = xkb_state_serialize_mods(input->xkb.state, XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED); input->modifiers = 0; if (mask & input->xkb.control_mask) input->modifiers |= MOD_CONTROL_MASK; if (mask & input->xkb.alt_mask) input->modifiers |= MOD_ALT_MASK; if (mask & input->xkb.shift_mask) input->modifiers |= MOD_SHIFT_MASK; } static void set_repeat_info(struct input *input, int32_t rate, int32_t delay) { input->repeat_rate_sec = input->repeat_rate_nsec = 0; input->repeat_delay_sec = input->repeat_delay_nsec = 0; /* a rate of zero disables any repeating, regardless of the delay's * value */ if (rate == 0) return; if (rate == 1) input->repeat_rate_sec = 1; else input->repeat_rate_nsec = 1000000000 / rate; input->repeat_delay_sec = delay / 1000; delay -= (input->repeat_delay_sec * 1000); input->repeat_delay_nsec = delay * 1000 * 1000; } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay) { struct input *input = data; set_repeat_info(input, rate, delay); } static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, keyboard_handle_repeat_info }; static void touch_handle_down(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct input *input = data; struct widget *widget; float sx = wl_fixed_to_double(x_w); float sy = wl_fixed_to_double(y_w); input->display->serial = serial; input->touch_focus = wl_surface_get_user_data(surface); if (!input->touch_focus) { DBG("Failed to find to touch focus for surface %p\n", surface); return; } if (surface != input->touch_focus->main_surface->surface) { DBG("Ignoring input event from subsurface %p\n", surface); input->touch_focus = NULL; return; } if (input->grab) widget = input->grab; else widget = window_find_widget(input->touch_focus, wl_fixed_to_double(x_w), wl_fixed_to_double(y_w)); if (widget) { struct touch_point *tp = xmalloc(sizeof *tp); if (tp) { tp->id = id; tp->widget = widget; tp->x = sx; tp->y = sy; wl_list_insert(&input->touch_point_list, &tp->link); if (widget->touch_down_handler) (*widget->touch_down_handler)(widget, input, serial, time, id, sx, sy, widget->user_data); } } } static void touch_handle_up(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id) { struct input *input = data; struct touch_point *tp, *tmp; if (!input->touch_focus) { DBG("No touch focus found for touch up event!\n"); return; } wl_list_for_each_safe(tp, tmp, &input->touch_point_list, link) { if (tp->id != id) continue; if (tp->widget->touch_up_handler) (*tp->widget->touch_up_handler)(tp->widget, input, serial, time, id, tp->widget->user_data); wl_list_remove(&tp->link); free(tp); return; } } static void touch_handle_motion(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct input *input = data; struct touch_point *tp; float sx = wl_fixed_to_double(x_w); float sy = wl_fixed_to_double(y_w); DBG("touch_handle_motion: %i %i\n", id, wl_list_length(&input->touch_point_list)); if (!input->touch_focus) { DBG("No touch focus found for touch motion event!\n"); return; } wl_list_for_each(tp, &input->touch_point_list, link) { if (tp->id != id) continue; tp->x = sx; tp->y = sy; if (tp->widget->touch_motion_handler) (*tp->widget->touch_motion_handler)(tp->widget, input, time, id, sx, sy, tp->widget->user_data); return; } } static void touch_handle_frame(void *data, struct wl_touch *wl_touch) { struct input *input = data; struct touch_point *tp, *tmp; DBG("touch_handle_frame\n"); if (!input->touch_focus) { DBG("No touch focus found for touch frame event!\n"); return; } wl_list_for_each_safe(tp, tmp, &input->touch_point_list, link) { if (tp->widget->touch_frame_handler) (*tp->widget->touch_frame_handler)(tp->widget, input, tp->widget->user_data); } } static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) { struct input *input = data; struct touch_point *tp, *tmp; DBG("touch_handle_cancel\n"); if (!input->touch_focus) { DBG("No touch focus found for touch cancel event!\n"); return; } wl_list_for_each_safe(tp, tmp, &input->touch_point_list, link) { if (tp->widget->touch_cancel_handler) (*tp->widget->touch_cancel_handler)(tp->widget, input, tp->widget->user_data); wl_list_remove(&tp->link); free(tp); } } static const struct wl_touch_listener touch_listener = { touch_handle_down, touch_handle_up, touch_handle_motion, touch_handle_frame, touch_handle_cancel, }; static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { struct input *input = data; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !input->pointer) { input->pointer = wl_seat_get_pointer(seat); wl_pointer_set_user_data(input->pointer, input); wl_pointer_add_listener(input->pointer, &pointer_listener, input); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && input->pointer) { wl_pointer_destroy(input->pointer); input->pointer = NULL; } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->keyboard) { input->keyboard = wl_seat_get_keyboard(seat); wl_keyboard_set_user_data(input->keyboard, input); wl_keyboard_add_listener(input->keyboard, &keyboard_listener, input); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->keyboard) { wl_keyboard_destroy(input->keyboard); input->keyboard = NULL; } if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !input->touch) { input->touch = wl_seat_get_touch(seat); wl_touch_set_user_data(input->touch, input); wl_touch_add_listener(input->touch, &touch_listener, input); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && input->touch) { wl_touch_destroy(input->touch); input->touch = NULL; } } static void seat_handle_name(void *data, struct wl_seat *seat, const char *name) { } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, seat_handle_name }; void input_get_position(struct input *input, int32_t *x, int32_t *y) { *x = input->sx; *y = input->sy; } int input_get_touch(struct input *input, int32_t id, float *x, float *y) { struct touch_point *tp; wl_list_for_each(tp, &input->touch_point_list, link) { if (tp->id != id) continue; *x = tp->x; *y = tp->y; return 0; } return -1; } struct display * input_get_display(struct input *input) { return input->display; } struct wl_seat * input_get_seat(struct input *input) { return input->seat; } uint32_t input_get_modifiers(struct input *input) { return input->modifiers; } struct widget * input_get_focus_widget(struct input *input) { return input->focus_widget; } struct data_offer { struct wl_data_offer *offer; struct input *input; struct wl_array types; int refcount; struct task io_task; int fd; data_func_t func; int32_t x, y; void *user_data; }; static void data_offer_offer(void *data, struct wl_data_offer *wl_data_offer, const char *type) { struct data_offer *offer = data; char **p; p = wl_array_add(&offer->types, sizeof *p); *p = strdup(type); } static const struct wl_data_offer_listener data_offer_listener = { data_offer_offer, }; static void data_offer_destroy(struct data_offer *offer) { char **p; offer->refcount--; if (offer->refcount == 0) { wl_data_offer_destroy(offer->offer); for (p = offer->types.data; *p; p++) free(*p); wl_array_release(&offer->types); free(offer); } } static void data_device_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *_offer) { struct data_offer *offer; offer = xmalloc(sizeof *offer); wl_array_init(&offer->types); offer->refcount = 1; offer->input = data; offer->offer = _offer; wl_data_offer_add_listener(offer->offer, &data_offer_listener, offer); } static void data_device_enter(void *data, struct wl_data_device *data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x_w, wl_fixed_t y_w, struct wl_data_offer *offer) { struct input *input = data; struct window *window; void *types_data; float x = wl_fixed_to_double(x_w); float y = wl_fixed_to_double(y_w); char **p; window = wl_surface_get_user_data(surface); input->drag_enter_serial = serial; input->drag_focus = window, input->drag_x = x; input->drag_y = y; if (!input->touch_grab) input->pointer_enter_serial = serial; if (offer) { input->drag_offer = wl_data_offer_get_user_data(offer); p = wl_array_add(&input->drag_offer->types, sizeof *p); *p = NULL; types_data = input->drag_offer->types.data; } else { input->drag_offer = NULL; types_data = NULL; } if (window->data_handler) window->data_handler(window, input, x, y, types_data, window->user_data); } static void data_device_leave(void *data, struct wl_data_device *data_device) { struct input *input = data; if (input->drag_offer) { data_offer_destroy(input->drag_offer); input->drag_offer = NULL; } } static void data_device_motion(void *data, struct wl_data_device *data_device, uint32_t time, wl_fixed_t x_w, wl_fixed_t y_w) { struct input *input = data; struct window *window = input->drag_focus; float x = wl_fixed_to_double(x_w); float y = wl_fixed_to_double(y_w); void *types_data; input->drag_x = x; input->drag_y = y; if (input->drag_offer) types_data = input->drag_offer->types.data; else types_data = NULL; if (window->data_handler) window->data_handler(window, input, x, y, types_data, window->user_data); } static void data_device_drop(void *data, struct wl_data_device *data_device) { struct input *input = data; struct window *window = input->drag_focus; float x, y; x = input->drag_x; y = input->drag_y; if (window->drop_handler) window->drop_handler(window, input, x, y, window->user_data); if (input->touch_grab) touch_ungrab(input); } static void data_device_selection(void *data, struct wl_data_device *wl_data_device, struct wl_data_offer *offer) { struct input *input = data; char **p; if (input->selection_offer) data_offer_destroy(input->selection_offer); if (offer) { input->selection_offer = wl_data_offer_get_user_data(offer); p = wl_array_add(&input->selection_offer->types, sizeof *p); *p = NULL; } else { input->selection_offer = NULL; } } static const struct wl_data_device_listener data_device_listener = { data_device_data_offer, data_device_enter, data_device_leave, data_device_motion, data_device_drop, data_device_selection }; static void input_set_pointer_image_index(struct input *input, int index) { struct wl_buffer *buffer; struct wl_cursor *cursor; struct wl_cursor_image *image; if (!input->pointer) return; cursor = input->display->cursors[input->current_cursor]; if (!cursor) return; if (index >= (int) cursor->image_count) { fprintf(stderr, "cursor index out of range\n"); return; } image = cursor->images[index]; buffer = wl_cursor_image_get_buffer(image); if (!buffer) return; wl_surface_attach(input->pointer_surface, buffer, 0, 0); wl_surface_damage(input->pointer_surface, 0, 0, image->width, image->height); wl_surface_commit(input->pointer_surface); wl_pointer_set_cursor(input->pointer, input->pointer_enter_serial, input->pointer_surface, image->hotspot_x, image->hotspot_y); } static const struct wl_callback_listener pointer_surface_listener; static bool input_set_pointer_special(struct input *input) { if (input->current_cursor == CURSOR_BLANK) { wl_pointer_set_cursor(input->pointer, input->pointer_enter_serial, NULL, 0, 0); return true; } if (input->current_cursor == CURSOR_UNSET) return true; return false; } static void schedule_pointer_image_update(struct input *input, struct wl_cursor *cursor, uint32_t duration, bool force_frame) { /* Some silly cursor sets have enormous pauses in them. In these * cases it's better to use a timer even if it results in less * accurate presentation, since it will save us having to set the * same cursor image over and over again. * * This is really not the way we're supposed to time any kind of * animation, but we're pretending it's OK here because we don't * want animated cursors with long delays to needlessly hog CPU. * * We use force_frame to ensure we don't accumulate large timing * errors by running off the wrong clock. */ if (!force_frame && duration > 100) { struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp); input->cursor_timer_start = tp.tv_sec * 1000 + tp.tv_nsec / 1000000; cursor_delay_timer_reset(input, duration); return; } /* for short durations we'll just spin on frame callbacks for * accurate timing - the way any kind of timing sensitive animation * should really be done. */ input->cursor_frame_cb = wl_surface_frame(input->pointer_surface); wl_callback_add_listener(input->cursor_frame_cb, &pointer_surface_listener, input); } static void pointer_surface_frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct input *input = data; struct wl_cursor *cursor; int i; uint32_t duration; bool force_frame = true; cancel_pointer_image_update(input); if (callback) { assert(callback == input->cursor_frame_cb); wl_callback_destroy(callback); input->cursor_frame_cb = NULL; force_frame = false; } if (!input->pointer) return; if (input_set_pointer_special(input)) return; cursor = input->display->cursors[input->current_cursor]; if (!cursor) return; /* FIXME We don't have the current time on the first call so we set * the animation start to the time of the first frame callback. */ if (time == 0) input->cursor_anim_start = 0; else if (input->cursor_anim_start == 0) input->cursor_anim_start = time; input->cursor_anim_current = time; if (time == 0 || input->cursor_anim_start == 0) { duration = 0; i = 0; } else i = wl_cursor_frame_and_duration( cursor, time - input->cursor_anim_start, &duration); if (cursor->image_count > 1) schedule_pointer_image_update(input, cursor, duration, force_frame); input_set_pointer_image_index(input, i); } static void cursor_timer_func(struct task *task, uint32_t events) { struct input *input = container_of(task, struct input, cursor_task); struct timespec tp; struct wl_cursor *cursor; uint32_t time; uint64_t exp; if (!input->cursor_timer_running) return; if (read(input->cursor_delay_fd, &exp, sizeof (uint64_t)) != sizeof (uint64_t)) return; cursor = input->display->cursors[input->current_cursor]; if (!cursor) return; clock_gettime(CLOCK_MONOTONIC, &tp); time = tp.tv_sec * 1000 + tp.tv_nsec / 1000000 - input->cursor_timer_start; pointer_surface_frame_callback(input, NULL, input->cursor_anim_current + time); } static const struct wl_callback_listener pointer_surface_listener = { pointer_surface_frame_callback }; void input_set_pointer_image(struct input *input, int pointer) { int force = 0; if (!input->pointer) return; if (input->pointer_enter_serial > input->cursor_serial) force = 1; if (!force && pointer == input->current_cursor) return; input->current_cursor = pointer; input->cursor_serial = input->pointer_enter_serial; if (!input->cursor_frame_cb) pointer_surface_frame_callback(input, NULL, 0); else if (force && !input_set_pointer_special(input)) { /* The current frame callback may be stuck if, for instance, * the set cursor request was processed by the server after * this client lost the focus. In this case the cursor surface * might not be mapped and the frame callback wouldn't ever * complete. Send a set_cursor and attach to try to map the * cursor surface again so that the callback will finish */ input_set_pointer_image_index(input, 0); } } struct wl_data_device * input_get_data_device(struct input *input) { return input->data_device; } void input_set_selection(struct input *input, struct wl_data_source *source, uint32_t time) { if (input->data_device) wl_data_device_set_selection(input->data_device, source, time); } void input_accept(struct input *input, const char *type) { wl_data_offer_accept(input->drag_offer->offer, input->drag_enter_serial, type); } static void offer_io_func(struct task *task, uint32_t events) { struct data_offer *offer = container_of(task, struct data_offer, io_task); unsigned int len; char buffer[4096]; len = read(offer->fd, buffer, sizeof buffer); offer->func(buffer, len, offer->x, offer->y, offer->user_data); if (len == 0) { close(offer->fd); data_offer_destroy(offer); } } static void data_offer_receive_data(struct data_offer *offer, const char *mime_type, data_func_t func, void *user_data) { int p[2]; if (pipe2(p, O_CLOEXEC) == -1) return; wl_data_offer_receive(offer->offer, mime_type, p[1]); close(p[1]); offer->io_task.run = offer_io_func; offer->fd = p[0]; offer->func = func; offer->refcount++; offer->user_data = user_data; display_watch_fd(offer->input->display, offer->fd, EPOLLIN, &offer->io_task); } void input_receive_drag_data(struct input *input, const char *mime_type, data_func_t func, void *data) { data_offer_receive_data(input->drag_offer, mime_type, func, data); input->drag_offer->x = input->drag_x; input->drag_offer->y = input->drag_y; } int input_receive_drag_data_to_fd(struct input *input, const char *mime_type, int fd) { if (input->drag_offer) wl_data_offer_receive(input->drag_offer->offer, mime_type, fd); return 0; } int input_receive_selection_data(struct input *input, const char *mime_type, data_func_t func, void *data) { char **p; if (input->selection_offer == NULL) return -1; for (p = input->selection_offer->types.data; *p; p++) if (strcmp(mime_type, *p) == 0) break; if (*p == NULL) return -1; data_offer_receive_data(input->selection_offer, mime_type, func, data); return 0; } int input_receive_selection_data_to_fd(struct input *input, const char *mime_type, int fd) { if (input->selection_offer) wl_data_offer_receive(input->selection_offer->offer, mime_type, fd); return 0; } void window_move(struct window *window, struct input *input, uint32_t serial) { if (!window->xdg_surface) return; xdg_surface_move(window->xdg_surface, input->seat, serial); } static void surface_set_synchronized(struct surface *surface) { if (!surface->subsurface) return; if (surface->synchronized) return; wl_subsurface_set_sync(surface->subsurface); surface->synchronized = 1; } static void surface_set_synchronized_default(struct surface *surface) { if (!surface->subsurface) return; if (surface->synchronized == surface->synchronized_default) return; if (surface->synchronized_default) wl_subsurface_set_sync(surface->subsurface); else wl_subsurface_set_desync(surface->subsurface); surface->synchronized = surface->synchronized_default; } static void surface_resize(struct surface *surface) { struct widget *widget = surface->widget; struct wl_compositor *compositor = widget->window->display->compositor; if (surface->input_region) { wl_region_destroy(surface->input_region); surface->input_region = NULL; } if (surface->opaque_region) wl_region_destroy(surface->opaque_region); surface->opaque_region = wl_compositor_create_region(compositor); if (widget->resize_handler) widget->resize_handler(widget, widget->allocation.width, widget->allocation.height, widget->user_data); if (surface->subsurface && (surface->allocation.x != widget->allocation.x || surface->allocation.y != widget->allocation.y)) { wl_subsurface_set_position(surface->subsurface, widget->allocation.x, widget->allocation.y); } if (surface->allocation.width != widget->allocation.width || surface->allocation.height != widget->allocation.height) { window_schedule_redraw(widget->window); } surface->allocation = widget->allocation; if (widget->opaque) wl_region_add(surface->opaque_region, 0, 0, widget->allocation.width, widget->allocation.height); } static void window_do_resize(struct window *window) { struct surface *surface; widget_set_allocation(window->main_surface->widget, window->pending_allocation.x, window->pending_allocation.y, window->pending_allocation.width, window->pending_allocation.height); surface_resize(window->main_surface); /* The main surface is in the list, too. Main surface's * resize_handler is responsible for calling widget_set_allocation() * on all sub-surface root widgets, so they will be resized * properly. */ wl_list_for_each(surface, &window->subsurface_list, link) { if (surface == window->main_surface) continue; surface_set_synchronized(surface); surface_resize(surface); } if (!window->fullscreen && !window->maximized) window->saved_allocation = window->pending_allocation; } static void idle_resize(struct window *window) { window->resize_needed = 0; window->redraw_needed = 1; DBG("from %dx%d to %dx%d\n", window->main_surface->server_allocation.width, window->main_surface->server_allocation.height, window->pending_allocation.width, window->pending_allocation.height); window_do_resize(window); } static void undo_resize(struct window *window) { window->pending_allocation.width = window->main_surface->server_allocation.width; window->pending_allocation.height = window->main_surface->server_allocation.height; DBG("back to %dx%d\n", window->main_surface->server_allocation.width, window->main_surface->server_allocation.height); window_do_resize(window); if (window->pending_allocation.width == 0 && window->pending_allocation.height == 0) { fprintf(stderr, "Error: Could not draw a surface, " "most likely due to insufficient disk space in " "%s (XDG_RUNTIME_DIR).\n", getenv("XDG_RUNTIME_DIR")); exit(EXIT_FAILURE); } } void window_schedule_resize(struct window *window, int width, int height) { /* We should probably get these numbers from the theme. */ const int min_width = 200, min_height = 200; window->pending_allocation.x = 0; window->pending_allocation.y = 0; window->pending_allocation.width = width; window->pending_allocation.height = height; if (window->min_allocation.width == 0) { if (width < min_width && window->frame) window->min_allocation.width = min_width; else window->min_allocation.width = width; if (height < min_height && window->frame) window->min_allocation.height = min_height; else window->min_allocation.height = height; } if (window->pending_allocation.width < window->min_allocation.width) window->pending_allocation.width = window->min_allocation.width; if (window->pending_allocation.height < window->min_allocation.height) window->pending_allocation.height = window->min_allocation.height; window->resize_needed = 1; window_schedule_redraw(window); } void widget_schedule_resize(struct widget *widget, int32_t width, int32_t height) { window_schedule_resize(widget->window, width, height); } static int window_get_shadow_margin(struct window *window) { if (window->frame && !window->fullscreen) return frame_get_shadow_margin(window->frame->frame); else return 0; } static void handle_surface_configure(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) { struct window *window = data; uint32_t *p; window->maximized = 0; window->fullscreen = 0; window->resizing = 0; window->focused = 0; wl_array_for_each(p, states) { uint32_t state = *p; switch (state) { case XDG_SURFACE_STATE_MAXIMIZED: window->maximized = 1; break; case XDG_SURFACE_STATE_FULLSCREEN: window->fullscreen = 1; break; case XDG_SURFACE_STATE_RESIZING: window->resizing = 1; break; case XDG_SURFACE_STATE_ACTIVATED: window->focused = 1; break; default: /* Unknown state */ break; } } if (window->frame) { if (window->maximized) { frame_set_flag(window->frame->frame, FRAME_FLAG_MAXIMIZED); } else { frame_unset_flag(window->frame->frame, FRAME_FLAG_MAXIMIZED); } if (window->focused) { frame_set_flag(window->frame->frame, FRAME_FLAG_ACTIVE); } else { frame_unset_flag(window->frame->frame, FRAME_FLAG_ACTIVE); } } if (width > 0 && height > 0) { /* The width / height params are for window geometry, * but window_schedule_resize takes allocation. Add * on the shadow margin to get the difference. */ int margin = window_get_shadow_margin(window); window_schedule_resize(window, width + margin * 2, height + margin * 2); } else { window_schedule_resize(window, window->saved_allocation.width, window->saved_allocation.height); } xdg_surface_ack_configure(window->xdg_surface, serial); if (window->state_changed_handler) window->state_changed_handler(window, window->user_data); } static void handle_surface_delete(void *data, struct xdg_surface *xdg_surface) { struct window *window = data; window_close(window); } static const struct xdg_surface_listener xdg_surface_listener = { handle_surface_configure, handle_surface_delete, }; static void window_sync_parent(struct window *window) { struct xdg_surface *parent_surface; if (!window->xdg_surface) return; if (window->parent == window->last_parent) return; if (window->parent) parent_surface = window->parent->xdg_surface; else parent_surface = NULL; xdg_surface_set_parent(window->xdg_surface, parent_surface); window->last_parent = window->parent; } static void window_get_geometry(struct window *window, struct rectangle *geometry) { if (window->frame && !window->fullscreen) frame_input_rect(window->frame->frame, &geometry->x, &geometry->y, &geometry->width, &geometry->height); else window_get_allocation(window, geometry); } static void window_sync_geometry(struct window *window) { struct rectangle geometry; if (!window->xdg_surface) return; window_get_geometry(window, &geometry); if (geometry.x == window->last_geometry.x && geometry.y == window->last_geometry.y && geometry.width == window->last_geometry.width && geometry.height == window->last_geometry.height) return; xdg_surface_set_window_geometry(window->xdg_surface, geometry.x, geometry.y, geometry.width, geometry.height); window->last_geometry = geometry; } static void window_flush(struct window *window) { struct surface *surface; if (!window->custom) { if (window->xdg_surface) { window_sync_parent(window); window_sync_geometry(window); } } wl_list_for_each(surface, &window->subsurface_list, link) { if (surface == window->main_surface) continue; surface_flush(surface); } surface_flush(window->main_surface); } static void menu_destroy(struct menu *menu) { widget_destroy(menu->widget); window_destroy(menu->window); frame_destroy(menu->frame); free(menu); } void window_get_allocation(struct window *window, struct rectangle *allocation) { *allocation = window->main_surface->allocation; } static void widget_redraw(struct widget *widget) { struct widget *child; if (widget->redraw_handler) widget->redraw_handler(widget, widget->user_data); wl_list_for_each(child, &widget->child_list, link) widget_redraw(child); } static void frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct surface *surface = data; assert(callback == surface->frame_cb); DBG_OBJ(callback, "done\n"); wl_callback_destroy(callback); surface->frame_cb = NULL; surface->last_time = time; if (surface->redraw_needed || surface->window->redraw_needed) { DBG_OBJ(surface->surface, "window_schedule_redraw_task\n"); window_schedule_redraw_task(surface->window); } } static const struct wl_callback_listener listener = { frame_callback }; static int surface_redraw(struct surface *surface) { DBG_OBJ(surface->surface, "begin\n"); if (!surface->window->redraw_needed && !surface->redraw_needed) return 0; /* Whole-window redraw forces a redraw even if the previous has * not yet hit the screen. */ if (surface->frame_cb) { if (!surface->window->redraw_needed) return 0; DBG_OBJ(surface->frame_cb, "cancelled\n"); wl_callback_destroy(surface->frame_cb); } if (surface->widget->use_cairo && !widget_get_cairo_surface(surface->widget)) { DBG_OBJ(surface->surface, "cancelled due buffer failure\n"); return -1; } surface->frame_cb = wl_surface_frame(surface->surface); wl_callback_add_listener(surface->frame_cb, &listener, surface); DBG_OBJ(surface->frame_cb, "new\n"); surface->redraw_needed = 0; DBG_OBJ(surface->surface, "-> widget_redraw\n"); widget_redraw(surface->widget); DBG_OBJ(surface->surface, "done\n"); return 0; } static void idle_redraw(struct task *task, uint32_t events) { struct window *window = container_of(task, struct window, redraw_task); struct surface *surface; int failed = 0; int resized = 0; DBG(" --------- \n"); wl_list_init(&window->redraw_task.link); window->redraw_task_scheduled = 0; if (window->resize_needed) { /* throttle resizing to the main surface display */ if (window->main_surface->frame_cb) { DBG_OBJ(window->main_surface->frame_cb, "pending\n"); return; } idle_resize(window); resized = 1; } if (surface_redraw(window->main_surface) < 0) { /* * Only main_surface failure will cause us to undo the resize. * If sub-surfaces fail, they will just be broken with old * content. */ failed = 1; } else { wl_list_for_each(surface, &window->subsurface_list, link) { if (surface == window->main_surface) continue; surface_redraw(surface); } } window->redraw_needed = 0; window_flush(window); wl_list_for_each(surface, &window->subsurface_list, link) surface_set_synchronized_default(surface); if (resized && failed) { /* Restore widget tree to correspond to what is on screen. */ undo_resize(window); } } static void window_schedule_redraw_task(struct window *window) { if (!window->redraw_task_scheduled) { window->redraw_task.run = idle_redraw; display_defer(window->display, &window->redraw_task); window->redraw_task_scheduled = 1; } } void window_schedule_redraw(struct window *window) { struct surface *surface; DBG_OBJ(window->main_surface->surface, "window %p\n", window); wl_list_for_each(surface, &window->subsurface_list, link) surface->redraw_needed = 1; window_schedule_redraw_task(window); } int window_is_fullscreen(struct window *window) { return window->fullscreen; } void window_set_fullscreen(struct window *window, int fullscreen) { if (!window->xdg_surface) return; if (window->fullscreen == fullscreen) return; if (fullscreen) xdg_surface_set_fullscreen(window->xdg_surface, NULL); else xdg_surface_unset_fullscreen(window->xdg_surface); } int window_is_maximized(struct window *window) { return window->maximized; } void window_set_maximized(struct window *window, int maximized) { if (!window->xdg_surface) return; if (window->maximized == maximized) return; if (maximized) xdg_surface_set_maximized(window->xdg_surface); else xdg_surface_unset_maximized(window->xdg_surface); } int window_is_resizing(struct window *window) { return window->resizing; } void window_set_minimized(struct window *window) { if (!window->xdg_surface) return; xdg_surface_set_minimized(window->xdg_surface); } void window_set_user_data(struct window *window, void *data) { window->user_data = data; } void * window_get_user_data(struct window *window) { return window->user_data; } void window_set_key_handler(struct window *window, window_key_handler_t handler) { window->key_handler = handler; } void window_set_keyboard_focus_handler(struct window *window, window_keyboard_focus_handler_t handler) { window->keyboard_focus_handler = handler; } void window_set_data_handler(struct window *window, window_data_handler_t handler) { window->data_handler = handler; } void window_set_drop_handler(struct window *window, window_drop_handler_t handler) { window->drop_handler = handler; } void window_set_close_handler(struct window *window, window_close_handler_t handler) { window->close_handler = handler; } void window_set_fullscreen_handler(struct window *window, window_fullscreen_handler_t handler) { window->fullscreen_handler = handler; } void window_set_output_handler(struct window *window, window_output_handler_t handler) { window->output_handler = handler; } void window_set_state_changed_handler(struct window *window, window_state_changed_handler_t handler) { window->state_changed_handler = handler; } void window_set_title(struct window *window, const char *title) { free(window->title); window->title = strdup(title); if (window->frame) { frame_set_title(window->frame->frame, title); widget_schedule_redraw(window->frame->widget); } if (window->xdg_surface) xdg_surface_set_title(window->xdg_surface, title); } const char * window_get_title(struct window *window) { return window->title; } void window_set_text_cursor_position(struct window *window, int32_t x, int32_t y) { struct text_cursor_position *text_cursor_position = window->display->text_cursor_position; if (!text_cursor_position) return; text_cursor_position_notify(text_cursor_position, window->main_surface->surface, wl_fixed_from_int(x), wl_fixed_from_int(y)); } void window_damage(struct window *window, int32_t x, int32_t y, int32_t width, int32_t height) { wl_surface_damage(window->main_surface->surface, x, y, width, height); } static void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output) { struct window *window = data; struct output *output; struct output *output_found = NULL; struct window_output *window_output; wl_list_for_each(output, &window->display->output_list, link) { if (output->output == wl_output) { output_found = output; break; } } if (!output_found) return; window_output = xmalloc(sizeof *window_output); window_output->output = output_found; wl_list_insert (&window->window_output_list, &window_output->link); if (window->output_handler) window->output_handler(window, output_found, 1, window->user_data); } static void surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output) { struct window *window = data; struct window_output *window_output; struct window_output *window_output_found = NULL; wl_list_for_each(window_output, &window->window_output_list, link) { if (window_output->output->output == output) { window_output_found = window_output; break; } } if (window_output_found) { wl_list_remove(&window_output_found->link); if (window->output_handler) window->output_handler(window, window_output->output, 0, window->user_data); free(window_output_found); } } static const struct wl_surface_listener surface_listener = { surface_enter, surface_leave }; static struct surface * surface_create(struct window *window) { struct display *display = window->display; struct surface *surface; surface = xzalloc(sizeof *surface); surface->window = window; surface->surface = wl_compositor_create_surface(display->compositor); surface->buffer_scale = 1; wl_surface_add_listener(surface->surface, &surface_listener, window); wl_list_insert(&window->subsurface_list, &surface->link); return surface; } static enum window_buffer_type get_preferred_buffer_type(struct display *display) { #ifdef HAVE_CAIRO_EGL if (display->argb_device && !getenv("TOYTOOLKIT_NO_EGL")) return WINDOW_BUFFER_TYPE_EGL_WINDOW; #endif return WINDOW_BUFFER_TYPE_SHM; } static struct window * window_create_internal(struct display *display, int custom) { struct window *window; struct surface *surface; window = xzalloc(sizeof *window); wl_list_init(&window->subsurface_list); window->display = display; surface = surface_create(window); window->main_surface = surface; assert(custom || display->xdg_shell || display->ivi_application); window->custom = custom; window->preferred_format = WINDOW_PREFERRED_FORMAT_NONE; surface->buffer_type = get_preferred_buffer_type(display); wl_surface_set_user_data(surface->surface, window); wl_list_insert(display->window_list.prev, &window->link); wl_list_init(&window->redraw_task.link); wl_list_init (&window->window_output_list); return window; } struct window * window_create(struct display *display) { struct window *window; uint32_t id_ivisurf; window = window_create_internal(display, 0); if (window->display->xdg_shell) { window->xdg_surface = xdg_shell_get_xdg_surface(window->display->xdg_shell, window->main_surface->surface); fail_on_null(window->xdg_surface); xdg_surface_set_user_data(window->xdg_surface, window); xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); } else if (display->ivi_application) { /* auto generation of ivi_id based on process id + basement of id */ id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); window->ivi_surface = ivi_application_surface_create(display->ivi_application, id_ivisurf, window->main_surface->surface); fail_on_null(window->ivi_surface); ivi_surface_add_listener(window->ivi_surface, &ivi_surface_listener, window); } return window; } struct window * window_create_custom(struct display *display) { return window_create_internal(display, 1); } void window_set_parent(struct window *window, struct window *parent_window) { window->parent = parent_window; window_sync_parent(window); } struct window * window_get_parent(struct window *window) { return window->parent; } static void menu_set_item(struct menu *menu, int sy) { int32_t x, y, width, height; int next; frame_interior(menu->frame, &x, &y, &width, &height); next = (sy - y) / 20; if (menu->current != next) { menu->current = next; widget_schedule_redraw(menu->widget); } } static int menu_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct menu *menu = data; if (widget == menu->widget) menu_set_item(data, y); return CURSOR_LEFT_PTR; } static int menu_enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct menu *menu = data; if (widget == menu->widget) menu_set_item(data, y); return CURSOR_LEFT_PTR; } static void menu_leave_handler(struct widget *widget, struct input *input, void *data) { struct menu *menu = data; if (widget == menu->widget) menu_set_item(data, -200); } static void menu_button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct menu *menu = data; if (state == WL_POINTER_BUTTON_STATE_RELEASED && (menu->release_count > 0 || time - menu->time > 500)) { /* Either relase after press-drag-release or * click-motion-click. */ menu->func(menu->user_data, input, menu->current); input_ungrab(input); menu_destroy(menu); } else if (state == WL_POINTER_BUTTON_STATE_RELEASED) { menu->release_count++; } } static void menu_touch_up_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data) { struct menu *menu = data; input_ungrab(input); menu_destroy(menu); } static void menu_redraw_handler(struct widget *widget, void *data) { cairo_t *cr; struct menu *menu = data; int32_t x, y, width, height, i; cr = widget_cairo_create(widget); frame_repaint(menu->frame, cr); frame_interior(menu->frame, &x, &y, &width, &height); theme_set_background_source(menu->window->display->theme, cr, THEME_FRAME_ACTIVE); cairo_rectangle(cr, x, y, width, height); cairo_fill(cr); cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 12); for (i = 0; i < menu->count; i++) { if (i == menu->current) { cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_rectangle(cr, x, y + i * 20, width, 20); cairo_fill(cr); cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); cairo_move_to(cr, x + 10, y + i * 20 + 16); cairo_show_text(cr, menu->entries[i]); } else { cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); cairo_move_to(cr, x + 10, y + i * 20 + 16); cairo_show_text(cr, menu->entries[i]); } } cairo_destroy(cr); } static void handle_popup_popup_done(void *data, struct xdg_popup *xdg_popup) { struct window *window = data; struct menu *menu = window->main_surface->widget->user_data; input_ungrab(menu->input); menu_destroy(menu); } static const struct xdg_popup_listener xdg_popup_listener = { handle_popup_popup_done, }; static struct menu * create_menu(struct display *display, struct input *input, uint32_t time, menu_func_t func, const char **entries, int count, void *user_data) { struct window *window; struct menu *menu; menu = malloc(sizeof *menu); if (!menu) return NULL; window = window_create_internal(display, 0); if (!window) { free(menu); return NULL; } menu->window = window; menu->user_data = user_data; menu->widget = window_add_widget(menu->window, menu); menu->frame = frame_create(window->display->theme, 0, 0, FRAME_BUTTON_NONE, NULL); fail_on_null(menu->frame); menu->entries = entries; menu->count = count; menu->release_count = 0; menu->current = -1; menu->time = time; menu->func = func; menu->input = input; input_ungrab(input); widget_set_redraw_handler(menu->widget, menu_redraw_handler); widget_set_enter_handler(menu->widget, menu_enter_handler); widget_set_leave_handler(menu->widget, menu_leave_handler); widget_set_motion_handler(menu->widget, menu_motion_handler); widget_set_button_handler(menu->widget, menu_button_handler); widget_set_touch_up_handler(menu->widget, menu_touch_up_handler); input_grab(input, menu->widget, 0); frame_resize_inside(menu->frame, 200, count * 20); frame_set_flag(menu->frame, FRAME_FLAG_ACTIVE); window_schedule_resize(window, frame_width(menu->frame), frame_height(menu->frame)); return menu; } struct window * window_create_menu(struct display *display, struct input *input, uint32_t time, menu_func_t func, const char **entries, int count, void *user_data) { struct menu *menu; menu = create_menu(display, input, time, func, entries, count, user_data); if (menu == NULL) return NULL; return menu->window; } void window_show_menu(struct display *display, struct input *input, uint32_t time, struct window *parent, int32_t x, int32_t y, menu_func_t func, const char **entries, int count) { struct menu *menu; struct window *window; int32_t ix, iy; menu = create_menu(display, input, time, func, entries, count, parent); if (menu == NULL) return; window = menu->window; window_set_buffer_scale (menu->window, window_get_buffer_scale (parent)); window_set_buffer_transform (menu->window, window_get_buffer_transform (parent)); window->x = x; window->y = y; frame_interior(menu->frame, &ix, &iy, NULL, NULL); if (!display->xdg_shell) return; window->xdg_popup = xdg_shell_get_xdg_popup(display->xdg_shell, window->main_surface->surface, parent->main_surface->surface, input->seat, display_get_serial(window->display), window->x - ix, window->y - iy); fail_on_null(window->xdg_popup); xdg_popup_set_user_data(window->xdg_popup, window); xdg_popup_add_listener(window->xdg_popup, &xdg_popup_listener, window); } void window_set_buffer_type(struct window *window, enum window_buffer_type type) { window->main_surface->buffer_type = type; } enum window_buffer_type window_get_buffer_type(struct window *window) { return window->main_surface->buffer_type; } void window_set_preferred_format(struct window *window, enum preferred_format format) { window->preferred_format = format; } struct widget * window_add_subsurface(struct window *window, void *data, enum subsurface_mode default_mode) { struct widget *widget; struct surface *surface; struct wl_surface *parent; struct wl_subcompositor *subcompo = window->display->subcompositor; surface = surface_create(window); surface->buffer_type = window_get_buffer_type(window); widget = widget_create(window, surface, data); wl_list_init(&widget->link); surface->widget = widget; parent = window->main_surface->surface; surface->subsurface = wl_subcompositor_get_subsurface(subcompo, surface->surface, parent); surface->synchronized = 1; switch (default_mode) { case SUBSURFACE_SYNCHRONIZED: surface->synchronized_default = 1; break; case SUBSURFACE_DESYNCHRONIZED: surface->synchronized_default = 0; break; default: assert(!"bad enum subsurface_mode"); } window->resize_needed = 1; window_schedule_redraw(window); return widget; } static void display_handle_geometry(void *data, struct wl_output *wl_output, int x, int y, int physical_width, int physical_height, int subpixel, const char *make, const char *model, int transform) { struct output *output = data; output->allocation.x = x; output->allocation.y = y; output->transform = transform; if (output->make) free(output->make); output->make = strdup(make); if (output->model) free(output->model); output->model = strdup(model); } static void display_handle_done(void *data, struct wl_output *wl_output) { } static void display_handle_scale(void *data, struct wl_output *wl_output, int32_t scale) { struct output *output = data; output->scale = scale; } static void display_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int width, int height, int refresh) { struct output *output = data; struct display *display = output->display; if (flags & WL_OUTPUT_MODE_CURRENT) { output->allocation.width = width; output->allocation.height = height; if (display->output_configure_handler) (*display->output_configure_handler)( output, display->user_data); } } static const struct wl_output_listener output_listener = { display_handle_geometry, display_handle_mode, display_handle_done, display_handle_scale }; static void display_add_output(struct display *d, uint32_t id) { struct output *output; output = xzalloc(sizeof *output); output->display = d; output->scale = 1; output->output = wl_registry_bind(d->registry, id, &wl_output_interface, 2); output->server_output_id = id; wl_list_insert(d->output_list.prev, &output->link); wl_output_add_listener(output->output, &output_listener, output); } static void output_destroy(struct output *output) { if (output->destroy_handler) (*output->destroy_handler)(output, output->user_data); wl_output_destroy(output->output); wl_list_remove(&output->link); free(output); } static void display_destroy_output(struct display *d, uint32_t id) { struct output *output; wl_list_for_each(output, &d->output_list, link) { if (output->server_output_id == id) { output_destroy(output); break; } } } void display_set_global_handler(struct display *display, display_global_handler_t handler) { struct global *global; display->global_handler = handler; if (!handler) return; wl_list_for_each(global, &display->global_list, link) display->global_handler(display, global->name, global->interface, global->version, display->user_data); } void display_set_global_handler_remove(struct display *display, display_global_handler_t remove_handler) { display->global_handler_remove = remove_handler; if (!remove_handler) return; } void display_set_output_configure_handler(struct display *display, display_output_handler_t handler) { struct output *output; display->output_configure_handler = handler; if (!handler) return; wl_list_for_each(output, &display->output_list, link) { if (output->allocation.width == 0 && output->allocation.height == 0) continue; (*display->output_configure_handler)(output, display->user_data); } } void output_set_user_data(struct output *output, void *data) { output->user_data = data; } void * output_get_user_data(struct output *output) { return output->user_data; } void output_set_destroy_handler(struct output *output, display_output_handler_t handler) { output->destroy_handler = handler; /* FIXME: implement this, once we have way to remove outputs */ } void output_get_allocation(struct output *output, struct rectangle *base) { struct rectangle allocation = output->allocation; switch (output->transform) { case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: /* Swap width and height */ allocation.width = output->allocation.height; allocation.height = output->allocation.width; break; } *base = allocation; } struct wl_output * output_get_wl_output(struct output *output) { return output->output; } enum wl_output_transform output_get_transform(struct output *output) { return output->transform; } uint32_t output_get_scale(struct output *output) { return output->scale; } const char * output_get_make(struct output *output) { return output->make; } const char * output_get_model(struct output *output) { return output->model; } static void fini_xkb(struct input *input) { xkb_state_unref(input->xkb.state); xkb_keymap_unref(input->xkb.keymap); } static void display_add_input(struct display *d, uint32_t id) { struct input *input; input = xzalloc(sizeof *input); input->display = d; input->seat = wl_registry_bind(d->registry, id, &wl_seat_interface, MIN(d->seat_version, 4)); input->touch_focus = NULL; input->pointer_focus = NULL; input->keyboard_focus = NULL; wl_list_init(&input->touch_point_list); wl_list_insert(d->input_list.prev, &input->link); wl_seat_add_listener(input->seat, &seat_listener, input); wl_seat_set_user_data(input->seat, input); if (d->data_device_manager) { input->data_device = wl_data_device_manager_get_data_device(d->data_device_manager, input->seat); wl_data_device_add_listener(input->data_device, &data_device_listener, input); } input->pointer_surface = wl_compositor_create_surface(d->compositor); input->cursor_task.run = cursor_timer_func; input->cursor_delay_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK); display_watch_fd(d, input->cursor_delay_fd, EPOLLIN, &input->cursor_task); set_repeat_info(input, 40, 400); input->repeat_timer_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK); input->repeat_task.run = keyboard_repeat_func; display_watch_fd(d, input->repeat_timer_fd, EPOLLIN, &input->repeat_task); } static void input_destroy(struct input *input) { input_remove_keyboard_focus(input); input_remove_pointer_focus(input); if (input->drag_offer) data_offer_destroy(input->drag_offer); if (input->selection_offer) data_offer_destroy(input->selection_offer); if (input->data_device) { if (input->display->data_device_manager_version >= 2) wl_data_device_release(input->data_device); else wl_data_device_destroy(input->data_device); } if (input->display->seat_version >= 3) { if (input->pointer) wl_pointer_release(input->pointer); if (input->keyboard) wl_keyboard_release(input->keyboard); } fini_xkb(input); wl_surface_destroy(input->pointer_surface); wl_list_remove(&input->link); wl_seat_destroy(input->seat); close(input->repeat_timer_fd); close(input->cursor_delay_fd); free(input); } static void init_workspace_manager(struct display *d, uint32_t id) { d->workspace_manager = wl_registry_bind(d->registry, id, &workspace_manager_interface, 1); if (d->workspace_manager != NULL) workspace_manager_add_listener(d->workspace_manager, &workspace_manager_listener, d); } static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct display *d = data; if (format == WL_SHM_FORMAT_RGB565) d->has_rgb565 = 1; } struct wl_shm_listener shm_listener = { shm_format }; static void xdg_shell_ping(void *data, struct xdg_shell *shell, uint32_t serial) { xdg_shell_pong(shell, serial); } static const struct xdg_shell_listener xdg_shell_listener = { xdg_shell_ping, }; #define XDG_VERSION 5 /* The version of xdg-shell that we implement */ #ifdef static_assert static_assert(XDG_VERSION == XDG_SHELL_VERSION_CURRENT, "Interface version doesn't match implementation version"); #endif static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; struct global *global; global = xmalloc(sizeof *global); global->name = id; global->interface = strdup(interface); global->version = version; wl_list_insert(d->global_list.prev, &global->link); if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 3); } else if (strcmp(interface, "wl_output") == 0) { display_add_output(d, id); } else if (strcmp(interface, "wl_seat") == 0) { d->seat_version = version; display_add_input(d, id); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(d->shm, &shm_listener, d); } else if (strcmp(interface, "wl_data_device_manager") == 0) { d->data_device_manager_version = MIN(version, 2); d->data_device_manager = wl_registry_bind(registry, id, &wl_data_device_manager_interface, d->data_device_manager_version); } else if (strcmp(interface, "xdg_shell") == 0) { d->xdg_shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1); xdg_shell_use_unstable_version(d->xdg_shell, XDG_VERSION); xdg_shell_add_listener(d->xdg_shell, &xdg_shell_listener, d); } else if (strcmp(interface, "text_cursor_position") == 0) { d->text_cursor_position = wl_registry_bind(registry, id, &text_cursor_position_interface, 1); } else if (strcmp(interface, "workspace_manager") == 0) { init_workspace_manager(d, id); } else if (strcmp(interface, "wl_subcompositor") == 0) { d->subcompositor = wl_registry_bind(registry, id, &wl_subcompositor_interface, 1); } else if (strcmp(interface, "ivi_application") == 0) { d->ivi_application = wl_registry_bind(registry, id, &ivi_application_interface, 1); } if (d->global_handler) d->global_handler(d, id, interface, version, d->user_data); } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { struct display *d = data; struct global *global; struct global *tmp; wl_list_for_each_safe(global, tmp, &d->global_list, link) { if (global->name != name) continue; if (strcmp(global->interface, "wl_output") == 0) display_destroy_output(d, name); /* XXX: Should destroy remaining bound globals */ if (d->global_handler_remove) d->global_handler_remove(d, name, global->interface, global->version, d->user_data); wl_list_remove(&global->link); free(global->interface); free(global); } } void * display_bind(struct display *display, uint32_t name, const struct wl_interface *interface, uint32_t version) { return wl_registry_bind(display->registry, name, interface, version); } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; #ifdef HAVE_CAIRO_EGL static int init_egl(struct display *d) { EGLint major, minor; EGLint n; #ifdef USE_CAIRO_GLESV2 # define GL_BIT EGL_OPENGL_ES2_BIT #else # define GL_BIT EGL_OPENGL_BIT #endif static const EGLint argb_cfg_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 1, EGL_DEPTH_SIZE, 1, EGL_RENDERABLE_TYPE, GL_BIT, EGL_NONE }; #ifdef USE_CAIRO_GLESV2 static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; EGLint api = EGL_OPENGL_ES_API; #else EGLint *context_attribs = NULL; EGLint api = EGL_OPENGL_API; #endif d->dpy = weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR, d->display, NULL); if (!eglInitialize(d->dpy, &major, &minor)) { fprintf(stderr, "failed to initialize EGL\n"); return -1; } if (!eglBindAPI(api)) { fprintf(stderr, "failed to bind EGL client API\n"); return -1; } if (!eglChooseConfig(d->dpy, argb_cfg_attribs, &d->argb_config, 1, &n) || n != 1) { fprintf(stderr, "failed to choose argb EGL config\n"); return -1; } d->argb_ctx = eglCreateContext(d->dpy, d->argb_config, EGL_NO_CONTEXT, context_attribs); if (d->argb_ctx == NULL) { fprintf(stderr, "failed to create EGL context\n"); return -1; } d->argb_device = cairo_egl_device_create(d->dpy, d->argb_ctx); if (cairo_device_status(d->argb_device) != CAIRO_STATUS_SUCCESS) { fprintf(stderr, "failed to get cairo EGL argb device\n"); return -1; } return 0; } static void fini_egl(struct display *display) { cairo_device_destroy(display->argb_device); eglMakeCurrent(display->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(display->dpy); eglReleaseThread(); } #endif static void init_dummy_surface(struct display *display) { int len; void *data; len = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, 1); data = xmalloc(len); display->dummy_surface = cairo_image_surface_create_for_data(data, CAIRO_FORMAT_ARGB32, 1, 1, len); display->dummy_surface_data = data; } static void handle_display_data(struct task *task, uint32_t events) { struct display *display = container_of(task, struct display, display_task); struct epoll_event ep; int ret; display->display_fd_events = events; if (events & EPOLLERR || events & EPOLLHUP) { display_exit(display); return; } if (events & EPOLLIN) { ret = wl_display_dispatch(display->display); if (ret == -1) { display_exit(display); return; } } if (events & EPOLLOUT) { ret = wl_display_flush(display->display); if (ret == 0) { ep.events = EPOLLIN | EPOLLERR | EPOLLHUP; ep.data.ptr = &display->display_task; epoll_ctl(display->epoll_fd, EPOLL_CTL_MOD, display->display_fd, &ep); } else if (ret == -1 && errno != EAGAIN) { display_exit(display); return; } } } static void log_handler(const char *format, va_list args) { vfprintf(stderr, format, args); } struct display * display_create(int *argc, char *argv[]) { struct display *d; wl_log_set_handler_client(log_handler); d = zalloc(sizeof *d); if (d == NULL) return NULL; d->display = wl_display_connect(NULL); if (d->display == NULL) { fprintf(stderr, "failed to connect to Wayland display: %m\n"); free(d); return NULL; } d->xkb_context = xkb_context_new(0); if (d->xkb_context == NULL) { fprintf(stderr, "Failed to create XKB context\n"); free(d); return NULL; } d->epoll_fd = os_epoll_create_cloexec(); d->display_fd = wl_display_get_fd(d->display); d->display_task.run = handle_display_data; display_watch_fd(d, d->display_fd, EPOLLIN | EPOLLERR | EPOLLHUP, &d->display_task); wl_list_init(&d->deferred_list); wl_list_init(&d->input_list); wl_list_init(&d->output_list); wl_list_init(&d->global_list); d->workspace = 0; d->workspace_count = 1; d->registry = wl_display_get_registry(d->display); wl_registry_add_listener(d->registry, ®istry_listener, d); if (wl_display_roundtrip(d->display) < 0) { fprintf(stderr, "Failed to process Wayland connection: %m\n"); return NULL; } #ifdef HAVE_CAIRO_EGL if (init_egl(d) < 0) fprintf(stderr, "EGL does not seem to work, " "falling back to software rendering and wl_shm.\n"); #endif create_cursors(d); d->theme = theme_create(); wl_list_init(&d->window_list); init_dummy_surface(d); return d; } static void display_destroy_outputs(struct display *display) { struct output *tmp; struct output *output; wl_list_for_each_safe(output, tmp, &display->output_list, link) output_destroy(output); } static void display_destroy_inputs(struct display *display) { struct input *tmp; struct input *input; wl_list_for_each_safe(input, tmp, &display->input_list, link) input_destroy(input); } void display_destroy(struct display *display) { if (!wl_list_empty(&display->window_list)) fprintf(stderr, "toytoolkit warning: %d windows exist.\n", wl_list_length(&display->window_list)); if (!wl_list_empty(&display->deferred_list)) fprintf(stderr, "toytoolkit warning: deferred tasks exist.\n"); cairo_surface_destroy(display->dummy_surface); free(display->dummy_surface_data); display_destroy_outputs(display); display_destroy_inputs(display); xkb_context_unref(display->xkb_context); theme_destroy(display->theme); destroy_cursors(display); #ifdef HAVE_CAIRO_EGL if (display->argb_device) fini_egl(display); #endif if (display->subcompositor) wl_subcompositor_destroy(display->subcompositor); if (display->xdg_shell) xdg_shell_destroy(display->xdg_shell); if (display->ivi_application) ivi_application_destroy(display->ivi_application); if (display->shm) wl_shm_destroy(display->shm); if (display->data_device_manager) wl_data_device_manager_destroy(display->data_device_manager); wl_compositor_destroy(display->compositor); wl_registry_destroy(display->registry); close(display->epoll_fd); if (!(display->display_fd_events & EPOLLERR) && !(display->display_fd_events & EPOLLHUP)) wl_display_flush(display->display); wl_display_disconnect(display->display); free(display); } void display_set_user_data(struct display *display, void *data) { display->user_data = data; } void * display_get_user_data(struct display *display) { return display->user_data; } struct wl_display * display_get_display(struct display *display) { return display->display; } int display_has_subcompositor(struct display *display) { if (display->subcompositor) return 1; wl_display_roundtrip(display->display); return display->subcompositor != NULL; } cairo_device_t * display_get_cairo_device(struct display *display) { return display->argb_device; } struct output * display_get_output(struct display *display) { return container_of(display->output_list.next, struct output, link); } struct wl_compositor * display_get_compositor(struct display *display) { return display->compositor; } uint32_t display_get_serial(struct display *display) { return display->serial; } EGLDisplay display_get_egl_display(struct display *d) { return d->dpy; } struct wl_data_source * display_create_data_source(struct display *display) { if (display->data_device_manager) return wl_data_device_manager_create_data_source(display->data_device_manager); else return NULL; } EGLConfig display_get_argb_egl_config(struct display *d) { return d->argb_config; } int display_acquire_window_surface(struct display *display, struct window *window, EGLContext ctx) { struct surface *surface = window->main_surface; if (surface->buffer_type != WINDOW_BUFFER_TYPE_EGL_WINDOW) return -1; widget_get_cairo_surface(window->main_surface->widget); return surface->toysurface->acquire(surface->toysurface, ctx); } void display_release_window_surface(struct display *display, struct window *window) { struct surface *surface = window->main_surface; if (surface->buffer_type != WINDOW_BUFFER_TYPE_EGL_WINDOW) return; surface->toysurface->release(surface->toysurface); } void display_defer(struct display *display, struct task *task) { wl_list_insert(&display->deferred_list, &task->link); } void display_watch_fd(struct display *display, int fd, uint32_t events, struct task *task) { struct epoll_event ep; ep.events = events; ep.data.ptr = task; epoll_ctl(display->epoll_fd, EPOLL_CTL_ADD, fd, &ep); } void display_unwatch_fd(struct display *display, int fd) { epoll_ctl(display->epoll_fd, EPOLL_CTL_DEL, fd, NULL); } void display_run(struct display *display) { struct task *task; struct epoll_event ep[16]; int i, count, ret; display->running = 1; while (1) { while (!wl_list_empty(&display->deferred_list)) { task = container_of(display->deferred_list.prev, struct task, link); wl_list_remove(&task->link); task->run(task, 0); } wl_display_dispatch_pending(display->display); if (!display->running) break; ret = wl_display_flush(display->display); if (ret < 0 && errno == EAGAIN) { ep[0].events = EPOLLIN | EPOLLOUT | EPOLLERR | EPOLLHUP; ep[0].data.ptr = &display->display_task; epoll_ctl(display->epoll_fd, EPOLL_CTL_MOD, display->display_fd, &ep[0]); } else if (ret < 0) { break; } count = epoll_wait(display->epoll_fd, ep, ARRAY_LENGTH(ep), -1); for (i = 0; i < count; i++) { task = ep[i].data.ptr; task->run(task, ep[i].events); } } } void display_exit(struct display *display) { display->running = 0; } void keysym_modifiers_add(struct wl_array *modifiers_map, const char *name) { size_t len = strlen(name) + 1; char *p; p = wl_array_add(modifiers_map, len); if (p == NULL) return; strncpy(p, name, len); } static xkb_mod_index_t keysym_modifiers_get_index(struct wl_array *modifiers_map, const char *name) { xkb_mod_index_t index = 0; char *p = modifiers_map->data; while ((const char *)p < (const char *)(modifiers_map->data + modifiers_map->size)) { if (strcmp(p, name) == 0) return index; index++; p += strlen(p) + 1; } return XKB_MOD_INVALID; } xkb_mod_mask_t keysym_modifiers_get_mask(struct wl_array *modifiers_map, const char *name) { xkb_mod_index_t index = keysym_modifiers_get_index(modifiers_map, name); if (index == XKB_MOD_INVALID) return XKB_MOD_INVALID; return 1 << index; } void * fail_on_null(void *p) { if (p == NULL) { fprintf(stderr, "%s: out of memory\n", program_invocation_short_name); exit(EXIT_FAILURE); } return p; } void * xmalloc(size_t s) { return fail_on_null(malloc(s)); } void * xzalloc(size_t s) { return fail_on_null(zalloc(s)); } char * xstrdup(const char *s) { return fail_on_null(strdup(s)); } void * xrealloc(char *p, size_t s) { return fail_on_null(realloc(p, s)); } weston-1.9.0/clients/ivi-shell-user-interface.c0000664000175000017500000010277512561200202016400 00000000000000/* * Copyright (C) 2013 DENSO CORPORATION * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/cairo-util.h" #include "shared/config-parser.h" #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "ivi-application-client-protocol.h" #include "ivi-hmi-controller-client-protocol.h" /** * A reference implementation how to use ivi-hmi-controller interface to * interact with hmi-controller. This is launched from hmi-controller by using * hmi_client_start and create a pthread. * * The basic flow is as followed, * 1/ read configuration from weston.ini. * 2/ draw png file to surface according to configuration of weston.ini * 3/ set up UI by using ivi-hmi-controller protocol * 4/ Enter event loop * 5/ If a surface receives touch/pointer event, followings are invoked * according to type of event and surface * 5-1/ If a surface to launch ivi_application receive touch up, it execs * ivi-application configured in weston.ini. * 5-2/ If a surface to switch layout mode receive touch up, it sends a request, * ivi_hmi_controller_switch_mode, to hmi-controller. * 5-3/ If a surface to show workspace having launchers, it sends a request, * ivi_hmi_controller_home, to hmi-controller. * 5-4/ If touch down events happens in workspace, * ivi_hmi_controller_workspace_control is sent to slide workspace. * When control finished, event: ivi_hmi_controller_workspace_end_control * is received. */ /***************************************************************************** * structure, globals ****************************************************************************/ enum cursor_type { CURSOR_BOTTOM_LEFT, CURSOR_BOTTOM_RIGHT, CURSOR_BOTTOM, CURSOR_DRAGGING, CURSOR_LEFT_PTR, CURSOR_LEFT, CURSOR_RIGHT, CURSOR_TOP_LEFT, CURSOR_TOP_RIGHT, CURSOR_TOP, CURSOR_IBEAM, CURSOR_HAND1, CURSOR_WATCH, CURSOR_BLANK }; struct wlContextCommon { struct wl_display *wlDisplay; struct wl_registry *wlRegistry; struct wl_compositor *wlCompositor; struct wl_shm *wlShm; uint32_t formats; struct wl_seat *wlSeat; struct wl_pointer *wlPointer; struct wl_touch *wlTouch; struct ivi_application *iviApplication; struct ivi_hmi_controller *hmiCtrl; struct hmi_homescreen_setting *hmi_setting; struct wl_list list_wlContextStruct; struct wl_surface *enterSurface; int32_t is_home_on; struct wl_cursor_theme *cursor_theme; struct wl_cursor **cursors; struct wl_surface *pointer_surface; enum cursor_type current_cursor; uint32_t enter_serial; }; struct wlContextStruct { struct wlContextCommon *cmm; struct wl_surface *wlSurface; struct wl_buffer *wlBuffer; cairo_surface_t *ctx_image; void *data; uint32_t id_surface; struct wl_list link; }; struct hmi_homescreen_srf { uint32_t id; char *filePath; uint32_t color; }; struct hmi_homescreen_workspace { struct wl_array launcher_id_array; struct wl_list link; }; struct hmi_homescreen_launcher { uint32_t icon_surface_id; uint32_t workspace_id; char *icon; char *path; struct wl_list link; }; struct hmi_homescreen_setting { struct hmi_homescreen_srf background; struct hmi_homescreen_srf panel; struct hmi_homescreen_srf tiling; struct hmi_homescreen_srf sidebyside; struct hmi_homescreen_srf fullscreen; struct hmi_homescreen_srf random; struct hmi_homescreen_srf home; struct hmi_homescreen_srf workspace_background; struct wl_list workspace_list; struct wl_list launcher_list; char *cursor_theme; int32_t cursor_size; uint32_t transition_duration; }; static void * fail_on_null(void *p, size_t size, char *file, int32_t line) { if (size && !p) { fprintf(stderr, "%s(%d) %zd: out of memory\n", file, line, size); exit(EXIT_FAILURE); } return p; } static void * mem_alloc(size_t size, char *file, int32_t line) { return fail_on_null(calloc(1, size), size, file, line); } #define MEM_ALLOC(s) mem_alloc((s),__FILE__,__LINE__) /***************************************************************************** * Event Handler ****************************************************************************/ static void shm_format(void *data, struct wl_shm *pWlShm, uint32_t format) { struct wlContextCommon *pCtx = data; pCtx->formats |= (1 << format); } static struct wl_shm_listener shm_listenter = { shm_format }; static int32_t getIdOfWlSurface(struct wlContextCommon *pCtx, struct wl_surface *wlSurface) { struct wlContextStruct *pWlCtxSt = NULL; if (NULL == pCtx || NULL == wlSurface ) return 0; wl_list_for_each(pWlCtxSt, &pCtx->list_wlContextStruct, link) { if (pWlCtxSt->wlSurface == wlSurface) return pWlCtxSt->id_surface; } return -1; } static void set_pointer_image(struct wlContextCommon *pCtx, uint32_t index) { struct wl_cursor *cursor = NULL; struct wl_cursor_image *image = NULL; struct wl_buffer *buffer = NULL; if (!pCtx->wlPointer || !pCtx->cursors) return; if (CURSOR_BLANK == pCtx->current_cursor) { wl_pointer_set_cursor(pCtx->wlPointer, pCtx->enter_serial, NULL, 0, 0); return; } cursor = pCtx->cursors[pCtx->current_cursor]; if (!cursor) return; if (cursor->image_count <= index) { fprintf(stderr, "cursor index out of range\n"); return; } image = cursor->images[index]; buffer = wl_cursor_image_get_buffer(image); if (!buffer) return; wl_pointer_set_cursor(pCtx->wlPointer, pCtx->enter_serial, pCtx->pointer_surface, image->hotspot_x, image->hotspot_y); wl_surface_attach(pCtx->pointer_surface, buffer, 0, 0); wl_surface_damage(pCtx->pointer_surface, 0, 0, image->width, image->height); wl_surface_commit(pCtx->pointer_surface); } static void PointerHandleEnter(void *data, struct wl_pointer *wlPointer, uint32_t serial, struct wl_surface *wlSurface, wl_fixed_t sx, wl_fixed_t sy) { struct wlContextCommon *pCtx = data; pCtx->enter_serial = serial; pCtx->enterSurface = wlSurface; set_pointer_image(pCtx, 0); #ifdef _DEBUG printf("ENTER PointerHandleEnter: x(%d), y(%d)\n", sx, sy); #endif } static void PointerHandleLeave(void *data, struct wl_pointer *wlPointer, uint32_t serial, struct wl_surface *wlSurface) { struct wlContextCommon *pCtx = data; pCtx->enterSurface = NULL; #ifdef _DEBUG printf("ENTER PointerHandleLeave: serial(%d)\n", serial); #endif } static void PointerHandleMotion(void *data, struct wl_pointer *wlPointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { #ifdef _DEBUG printf("ENTER PointerHandleMotion: x(%d), y(%d)\n", sx, sy); #endif } /** * if a surface assigned as launcher receives touch-off event, invoking * ivi-application which configured in weston.ini with path to binary. */ extern char **environ; /*defied by libc */ static pid_t execute_process(char *path, char *argv[]) { pid_t pid = fork(); if (pid < 0) fprintf(stderr, "Failed to fork\n"); if (pid) return pid; if (-1 == execve(path, argv, environ)) { fprintf(stderr, "Failed to execve %s\n", path); exit(1); } return pid; } static int32_t launcher_button(uint32_t surfaceId, struct wl_list *launcher_list) { struct hmi_homescreen_launcher *launcher = NULL; wl_list_for_each(launcher, launcher_list, link) { char *argv[] = { NULL }; if (surfaceId != launcher->icon_surface_id) continue; execute_process(launcher->path, argv); return 1; } return 0; } /** * is-method to identify a surface set as launcher in workspace or workspace * itself. This is-method is used to decide whether request; * ivi_hmi_controller_workspace_control is sent or not. */ static int32_t isWorkspaceSurface(uint32_t id, struct hmi_homescreen_setting *hmi_setting) { struct hmi_homescreen_launcher *launcher = NULL; if (id == hmi_setting->workspace_background.id) return 1; wl_list_for_each(launcher, &hmi_setting->launcher_list, link) { if (id == launcher->icon_surface_id) return 1; } return 0; } /** * Decide which request is sent to hmi-controller */ static void touch_up(struct ivi_hmi_controller *hmi_ctrl, uint32_t id_surface, int32_t *is_home_on, struct hmi_homescreen_setting *hmi_setting) { if (launcher_button(id_surface, &hmi_setting->launcher_list)) { *is_home_on = 0; ivi_hmi_controller_home(hmi_ctrl, IVI_HMI_CONTROLLER_HOME_OFF); } else if (id_surface == hmi_setting->tiling.id) { ivi_hmi_controller_switch_mode(hmi_ctrl, IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING); } else if (id_surface == hmi_setting->sidebyside.id) { ivi_hmi_controller_switch_mode(hmi_ctrl, IVI_HMI_CONTROLLER_LAYOUT_MODE_SIDE_BY_SIDE); } else if (id_surface == hmi_setting->fullscreen.id) { ivi_hmi_controller_switch_mode(hmi_ctrl, IVI_HMI_CONTROLLER_LAYOUT_MODE_FULL_SCREEN); } else if (id_surface == hmi_setting->random.id) { ivi_hmi_controller_switch_mode(hmi_ctrl, IVI_HMI_CONTROLLER_LAYOUT_MODE_RANDOM); } else if (id_surface == hmi_setting->home.id) { *is_home_on = !(*is_home_on); if (*is_home_on) { ivi_hmi_controller_home(hmi_ctrl, IVI_HMI_CONTROLLER_HOME_ON); } else { ivi_hmi_controller_home(hmi_ctrl, IVI_HMI_CONTROLLER_HOME_OFF); } } } /** * Even handler of Pointer event. IVI system is usually manipulated by touch * screen. However, some systems also have pointer device. * Release is the same behavior as touch off * Pressed is the same behavior as touch on */ static void PointerHandleButton(void *data, struct wl_pointer *wlPointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { struct wlContextCommon *pCtx = data; struct ivi_hmi_controller *hmi_ctrl = pCtx->hmiCtrl; const uint32_t id_surface = getIdOfWlSurface(pCtx, pCtx->enterSurface); if (BTN_RIGHT == button) return; switch (state) { case WL_POINTER_BUTTON_STATE_RELEASED: touch_up(hmi_ctrl, id_surface, &pCtx->is_home_on, pCtx->hmi_setting); break; case WL_POINTER_BUTTON_STATE_PRESSED: if (isWorkspaceSurface(id_surface, pCtx->hmi_setting)) { ivi_hmi_controller_workspace_control(hmi_ctrl, pCtx->wlSeat, serial); } break; } #ifdef _DEBUG printf("ENTER PointerHandleButton: button(%d), state(%d)\n", button, state); #endif } static void PointerHandleAxis(void *data, struct wl_pointer *wlPointer, uint32_t time, uint32_t axis, wl_fixed_t value) { #ifdef _DEBUG printf("ENTER PointerHandleAxis: axis(%d), value(%d)\n", axis, value); #endif } static struct wl_pointer_listener pointer_listener = { PointerHandleEnter, PointerHandleLeave, PointerHandleMotion, PointerHandleButton, PointerHandleAxis }; /** * Even handler of touch event */ static void TouchHandleDown(void *data, struct wl_touch *wlTouch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct wlContextCommon *pCtx = data; struct ivi_hmi_controller *hmi_ctrl = pCtx->hmiCtrl; uint32_t id_surface = 0; if (0 == id) pCtx->enterSurface = surface; id_surface = getIdOfWlSurface(pCtx, pCtx->enterSurface); /** * When touch down happens on surfaces of workspace, ask * hmi-controller to start control workspace to select page of * workspace. After sending seat to hmi-controller by * ivi_hmi_controller_workspace_control, * hmi-controller-homescreen doesn't receive any event till * hmi-controller sends back it. */ if (isWorkspaceSurface(id_surface, pCtx->hmi_setting)) { ivi_hmi_controller_workspace_control(hmi_ctrl, pCtx->wlSeat, serial); } } static void TouchHandleUp(void *data, struct wl_touch *wlTouch, uint32_t serial, uint32_t time, int32_t id) { struct wlContextCommon *pCtx = data; struct ivi_hmi_controller *hmi_ctrl = pCtx->hmiCtrl; const uint32_t id_surface = getIdOfWlSurface(pCtx, pCtx->enterSurface); /** * triggering event according to touch-up happening on which surface. */ if (id == 0){ touch_up(hmi_ctrl, id_surface, &pCtx->is_home_on, pCtx->hmi_setting); } } static void TouchHandleMotion(void *data, struct wl_touch *wlTouch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { } static void TouchHandleFrame(void *data, struct wl_touch *wlTouch) { } static void TouchHandleCancel(void *data, struct wl_touch *wlTouch) { } static struct wl_touch_listener touch_listener = { TouchHandleDown, TouchHandleUp, TouchHandleMotion, TouchHandleFrame, TouchHandleCancel, }; /** * Handler of capabilities */ static void seat_handle_capabilities(void *data, struct wl_seat *seat, uint32_t caps) { struct wlContextCommon *p_wlCtx = (struct wlContextCommon*)data; struct wl_seat *wlSeat = p_wlCtx->wlSeat; struct wl_pointer *wlPointer = p_wlCtx->wlPointer; struct wl_touch *wlTouch = p_wlCtx->wlTouch; if (p_wlCtx->hmi_setting->cursor_theme) { if ((caps & WL_SEAT_CAPABILITY_POINTER) && !wlPointer){ wlPointer = wl_seat_get_pointer(wlSeat); wl_pointer_add_listener(wlPointer, &pointer_listener, data); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && wlPointer){ wl_pointer_destroy(wlPointer); wlPointer = NULL; } p_wlCtx->wlPointer = wlPointer; } if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !wlTouch){ wlTouch = wl_seat_get_touch(wlSeat); wl_touch_add_listener(wlTouch, &touch_listener, data); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && wlTouch){ wl_touch_destroy(wlTouch); wlTouch = NULL; } p_wlCtx->wlTouch = wlTouch; } static struct wl_seat_listener seat_Listener = { seat_handle_capabilities, }; /** * Registration of event * This event is received when hmi-controller server finished controlling * workspace. */ static void ivi_hmi_controller_workspace_end_control(void *data, struct ivi_hmi_controller *hmi_ctrl, int32_t is_controlled) { struct wlContextCommon *pCtx = data; const uint32_t id_surface = getIdOfWlSurface(pCtx, pCtx->enterSurface); if (is_controlled) return; /** * During being controlled by hmi-controller, any input event is not * notified. So when control ends with touch up, it invokes launcher * if up event happens on a launcher surface. * */ if (launcher_button(id_surface, &pCtx->hmi_setting->launcher_list)) { pCtx->is_home_on = 0; ivi_hmi_controller_home(hmi_ctrl, IVI_HMI_CONTROLLER_HOME_OFF); } } static const struct ivi_hmi_controller_listener hmi_controller_listener = { ivi_hmi_controller_workspace_end_control }; /** * Registration of interfaces */ static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct wlContextCommon *p_wlCtx = (struct wlContextCommon*)data; if (!strcmp(interface, "wl_compositor")) { p_wlCtx->wlCompositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (!strcmp(interface, "wl_shm")) { p_wlCtx->wlShm = wl_registry_bind(registry, name, &wl_shm_interface, 1); wl_shm_add_listener(p_wlCtx->wlShm, &shm_listenter, p_wlCtx); } else if (!strcmp(interface, "wl_seat")) { p_wlCtx->wlSeat = wl_registry_bind(registry, name, &wl_seat_interface, 1); wl_seat_add_listener(p_wlCtx->wlSeat, &seat_Listener, data); } else if (!strcmp(interface, "ivi_application")) { p_wlCtx->iviApplication = wl_registry_bind(registry, name, &ivi_application_interface, 1); } else if (!strcmp(interface, "ivi_hmi_controller")) { p_wlCtx->hmiCtrl = wl_registry_bind(registry, name, &ivi_hmi_controller_interface, 1); ivi_hmi_controller_add_listener(p_wlCtx->hmiCtrl, &hmi_controller_listener, p_wlCtx); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static void frame_listener_func(void *data, struct wl_callback *callback, uint32_t time) { if (callback) wl_callback_destroy(callback); } static const struct wl_callback_listener frame_listener = { frame_listener_func }; /* * The following correspondences between file names and cursors was copied * from: https://bugs.kde.org/attachment.cgi?id=67313 */ static const char *bottom_left_corners[] = { "bottom_left_corner", "sw-resize", "size_bdiag" }; static const char *bottom_right_corners[] = { "bottom_right_corner", "se-resize", "size_fdiag" }; static const char *bottom_sides[] = { "bottom_side", "s-resize", "size_ver" }; static const char *grabbings[] = { "grabbing", "closedhand", "208530c400c041818281048008011002" }; static const char *left_ptrs[] = { "left_ptr", "default", "top_left_arrow", "left-arrow" }; static const char *left_sides[] = { "left_side", "w-resize", "size_hor" }; static const char *right_sides[] = { "right_side", "e-resize", "size_hor" }; static const char *top_left_corners[] = { "top_left_corner", "nw-resize", "size_fdiag" }; static const char *top_right_corners[] = { "top_right_corner", "ne-resize", "size_bdiag" }; static const char *top_sides[] = { "top_side", "n-resize", "size_ver" }; static const char *xterms[] = { "xterm", "ibeam", "text" }; static const char *hand1s[] = { "hand1", "pointer", "pointing_hand", "e29285e634086352946a0e7090d73106" }; static const char *watches[] = { "watch", "wait", "0426c94ea35c87780ff01dc239897213" }; struct cursor_alternatives { const char **names; size_t count; }; static const struct cursor_alternatives cursors[] = { { bottom_left_corners, ARRAY_LENGTH(bottom_left_corners) }, { bottom_right_corners, ARRAY_LENGTH(bottom_right_corners) }, { bottom_sides, ARRAY_LENGTH(bottom_sides) }, { grabbings, ARRAY_LENGTH(grabbings) }, { left_ptrs, ARRAY_LENGTH(left_ptrs) }, { left_sides, ARRAY_LENGTH(left_sides) }, { right_sides, ARRAY_LENGTH(right_sides) }, { top_left_corners, ARRAY_LENGTH(top_left_corners) }, { top_right_corners, ARRAY_LENGTH(top_right_corners) }, { top_sides, ARRAY_LENGTH(top_sides) }, { xterms, ARRAY_LENGTH(xterms) }, { hand1s, ARRAY_LENGTH(hand1s) }, { watches, ARRAY_LENGTH(watches) }, }; static void create_cursors(struct wlContextCommon *cmm) { uint32_t i = 0; uint32_t j = 0; struct wl_cursor *cursor = NULL; char *cursor_theme = cmm->hmi_setting->cursor_theme; int32_t cursor_size = cmm->hmi_setting->cursor_size; cmm->cursor_theme = wl_cursor_theme_load(cursor_theme, cursor_size, cmm->wlShm); cmm->cursors = MEM_ALLOC(ARRAY_LENGTH(cursors) * sizeof(cmm->cursors[0])); for (i = 0; i < ARRAY_LENGTH(cursors); i++) { cursor = NULL; for (j = 0; !cursor && j < cursors[i].count; ++j) { cursor = wl_cursor_theme_get_cursor( cmm->cursor_theme, cursors[i].names[j]); } if (!cursor) { fprintf(stderr, "could not load cursor '%s'\n", cursors[i].names[0]); } cmm->cursors[i] = cursor; } } static void destroy_cursors(struct wlContextCommon *cmm) { if (cmm->cursor_theme) wl_cursor_theme_destroy(cmm->cursor_theme); free(cmm->cursors); } /** * Internal method to prepare parts of UI */ static void createShmBuffer(struct wlContextStruct *p_wlCtx) { struct wl_shm_pool *pool; int fd = -1; int size = 0; int width = 0; int height = 0; int stride = 0; width = cairo_image_surface_get_width(p_wlCtx->ctx_image); height = cairo_image_surface_get_height(p_wlCtx->ctx_image); stride = cairo_image_surface_get_stride(p_wlCtx->ctx_image); size = stride * height; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return ; } p_wlCtx->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (MAP_FAILED == p_wlCtx->data) { fprintf(stderr, "mmap failed: %m\n"); close(fd); return; } pool = wl_shm_create_pool(p_wlCtx->cmm->wlShm, fd, size); p_wlCtx->wlBuffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_ARGB8888); if (NULL == p_wlCtx->wlBuffer) { fprintf(stderr, "wl_shm_create_buffer failed: %m\n"); close(fd); return; } wl_shm_pool_destroy(pool); close(fd); } static void destroyWLContextCommon(struct wlContextCommon *p_wlCtx) { destroy_cursors(p_wlCtx); if (p_wlCtx->pointer_surface) wl_surface_destroy(p_wlCtx->pointer_surface); if (p_wlCtx->wlCompositor) wl_compositor_destroy(p_wlCtx->wlCompositor); } static void destroyWLContextStruct(struct wlContextStruct *p_wlCtx) { if (p_wlCtx->wlSurface) wl_surface_destroy(p_wlCtx->wlSurface); if (p_wlCtx->ctx_image) { cairo_surface_destroy(p_wlCtx->ctx_image); p_wlCtx->ctx_image = NULL; } } static int createSurface(struct wlContextStruct *p_wlCtx) { p_wlCtx->wlSurface = wl_compositor_create_surface(p_wlCtx->cmm->wlCompositor); if (NULL == p_wlCtx->wlSurface) { printf("Error: wl_compositor_create_surface failed.\n"); destroyWLContextCommon(p_wlCtx->cmm); abort(); } return 0; } static void drawImage(struct wlContextStruct *p_wlCtx) { struct wl_callback *callback; int width = 0; int height = 0; int stride = 0; void *data = NULL; width = cairo_image_surface_get_width(p_wlCtx->ctx_image); height = cairo_image_surface_get_height(p_wlCtx->ctx_image); stride = cairo_image_surface_get_stride(p_wlCtx->ctx_image); data = cairo_image_surface_get_data(p_wlCtx->ctx_image); memcpy(p_wlCtx->data, data, stride * height); wl_surface_attach(p_wlCtx->wlSurface, p_wlCtx->wlBuffer, 0, 0); wl_surface_damage(p_wlCtx->wlSurface, 0, 0, width, height); callback = wl_surface_frame(p_wlCtx->wlSurface); wl_callback_add_listener(callback, &frame_listener, NULL); wl_surface_commit(p_wlCtx->wlSurface); } static void create_ivisurface(struct wlContextStruct *p_wlCtx, uint32_t id_surface, cairo_surface_t *surface) { struct ivi_surface *ivisurf = NULL; p_wlCtx->ctx_image = surface; p_wlCtx->id_surface = id_surface; wl_list_init(&p_wlCtx->link); wl_list_insert(&p_wlCtx->cmm->list_wlContextStruct, &p_wlCtx->link); createSurface(p_wlCtx); createShmBuffer(p_wlCtx); ivisurf = ivi_application_surface_create(p_wlCtx->cmm->iviApplication, id_surface, p_wlCtx->wlSurface); if (ivisurf == NULL) { fprintf(stderr, "Failed to create ivi_client_surface\n"); return; } drawImage(p_wlCtx); } static void create_ivisurfaceFromFile(struct wlContextStruct *p_wlCtx, uint32_t id_surface, const char *imageFile) { cairo_surface_t *surface = load_cairo_surface(imageFile); if (NULL == surface) { fprintf(stderr, "Failed to load_cairo_surface %s\n", imageFile); return; } create_ivisurface(p_wlCtx, id_surface, surface); } static void set_hex_color(cairo_t *cr, uint32_t color) { cairo_set_source_rgba(cr, ((color >> 16) & 0xff) / 255.0, ((color >> 8) & 0xff) / 255.0, ((color >> 0) & 0xff) / 255.0, ((color >> 24) & 0xff) / 255.0); } static void create_ivisurfaceFromColor(struct wlContextStruct *p_wlCtx, uint32_t id_surface, uint32_t width, uint32_t height, uint32_t color) { cairo_surface_t *surface = NULL; cairo_t *cr = NULL; surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_rectangle(cr, 0, 0, width, height); set_hex_color(cr, color); cairo_fill(cr); cairo_destroy(cr); create_ivisurface(p_wlCtx, id_surface, surface); } static void UI_ready(struct ivi_hmi_controller *controller) { ivi_hmi_controller_UI_ready(controller); } /** * Internal method to set up UI by using ivi-hmi-controller */ static void create_background(struct wlContextStruct *p_wlCtx, const uint32_t id_surface, const char *imageFile) { create_ivisurfaceFromFile(p_wlCtx, id_surface, imageFile); } static void create_panel(struct wlContextStruct *p_wlCtx, const uint32_t id_surface, const char *imageFile) { create_ivisurfaceFromFile(p_wlCtx, id_surface, imageFile); } static void create_button(struct wlContextStruct *p_wlCtx, const uint32_t id_surface, const char *imageFile, uint32_t number) { create_ivisurfaceFromFile(p_wlCtx, id_surface, imageFile); } static void create_home_button(struct wlContextStruct *p_wlCtx, const uint32_t id_surface, const char *imageFile) { create_ivisurfaceFromFile(p_wlCtx, id_surface, imageFile); } static void create_workspace_background(struct wlContextStruct *p_wlCtx, struct hmi_homescreen_srf *srf) { create_ivisurfaceFromColor(p_wlCtx, srf->id, 1, 1, srf->color); } static void create_launchers(struct wlContextCommon *cmm, struct wl_list *launcher_list) { struct hmi_homescreen_launcher **launchers; struct hmi_homescreen_launcher *launcher = NULL; int launcher_count = wl_list_length(launcher_list); int ii = 0; int start = 0; if (0 == launcher_count) return; launchers = MEM_ALLOC(launcher_count * sizeof(*launchers)); wl_list_for_each(launcher, launcher_list, link) { launchers[ii] = launcher; ii++; } for (ii = 0; ii < launcher_count; ii++) { int jj = 0; if (ii != launcher_count - 1 && launchers[ii]->workspace_id == launchers[ii + 1]->workspace_id) continue; for (jj = start; jj <= ii; jj++) { struct wlContextStruct *p_wlCtx; p_wlCtx = MEM_ALLOC(sizeof(*p_wlCtx)); p_wlCtx->cmm = cmm; create_ivisurfaceFromFile(p_wlCtx, launchers[jj]->icon_surface_id, launchers[jj]->icon); } start = ii + 1; } free(launchers); } /** * Internal method to read out weston.ini to get configuration */ static struct hmi_homescreen_setting * hmi_homescreen_setting_create(void) { const char *config_file; struct weston_config *config = NULL; struct weston_config_section *shellSection = NULL; struct hmi_homescreen_setting *setting = MEM_ALLOC(sizeof(*setting)); struct weston_config_section *section = NULL; const char *name = NULL; uint32_t workspace_layer_id; uint32_t icon_surface_id = 0; wl_list_init(&setting->workspace_list); wl_list_init(&setting->launcher_list); config_file = weston_config_get_name_from_env(); config = weston_config_parse(config_file); shellSection = weston_config_get_section(config, "ivi-shell", NULL, NULL); weston_config_section_get_string( shellSection, "cursor-theme", &setting->cursor_theme, NULL); weston_config_section_get_int( shellSection, "cursor-size", &setting->cursor_size, 32); weston_config_section_get_uint( shellSection, "workspace-layer-id", &workspace_layer_id, 3000); weston_config_section_get_string( shellSection, "background-image", &setting->background.filePath, DATADIR "/weston/background.png"); weston_config_section_get_uint( shellSection, "background-id", &setting->background.id, 1001); weston_config_section_get_string( shellSection, "panel-image", &setting->panel.filePath, DATADIR "/weston/panel.png"); weston_config_section_get_uint( shellSection, "panel-id", &setting->panel.id, 1002); weston_config_section_get_string( shellSection, "tiling-image", &setting->tiling.filePath, DATADIR "/weston/tiling.png"); weston_config_section_get_uint( shellSection, "tiling-id", &setting->tiling.id, 1003); weston_config_section_get_string( shellSection, "sidebyside-image", &setting->sidebyside.filePath, DATADIR "/weston/sidebyside.png"); weston_config_section_get_uint( shellSection, "sidebyside-id", &setting->sidebyside.id, 1004); weston_config_section_get_string( shellSection, "fullscreen-image", &setting->fullscreen.filePath, DATADIR "/weston/fullscreen.png"); weston_config_section_get_uint( shellSection, "fullscreen-id", &setting->fullscreen.id, 1005); weston_config_section_get_string( shellSection, "random-image", &setting->random.filePath, DATADIR "/weston/random.png"); weston_config_section_get_uint( shellSection, "random-id", &setting->random.id, 1006); weston_config_section_get_string( shellSection, "home-image", &setting->home.filePath, DATADIR "/weston/home.png"); weston_config_section_get_uint( shellSection, "home-id", &setting->home.id, 1007); weston_config_section_get_uint( shellSection, "workspace-background-color", &setting->workspace_background.color, 0x99000000); weston_config_section_get_uint( shellSection, "workspace-background-id", &setting->workspace_background.id, 2001); icon_surface_id = workspace_layer_id + 1; while (weston_config_next_section(config, §ion, &name)) { struct hmi_homescreen_launcher *launcher; if (strcmp(name, "ivi-launcher") != 0) continue; launcher = MEM_ALLOC(sizeof(*launcher)); wl_list_init(&launcher->link); weston_config_section_get_string(section, "icon", &launcher->icon, NULL); weston_config_section_get_string(section, "path", &launcher->path, NULL); weston_config_section_get_uint(section, "workspace-id", &launcher->workspace_id, 0); weston_config_section_get_uint(section, "icon-id", &launcher->icon_surface_id, icon_surface_id); icon_surface_id++; wl_list_insert(setting->launcher_list.prev, &launcher->link); } weston_config_destroy(config); return setting; } /** * Main thread * * The basic flow are as followed, * 1/ read configuration from weston.ini by hmi_homescreen_setting_create * 2/ draw png file to surface according to configuration of weston.ini and * set up UI by using ivi-hmi-controller protocol by each create_* method */ int main(int argc, char **argv) { struct wlContextCommon wlCtxCommon; struct wlContextStruct wlCtx_BackGround; struct wlContextStruct wlCtx_Panel; struct wlContextStruct wlCtx_Button_1; struct wlContextStruct wlCtx_Button_2; struct wlContextStruct wlCtx_Button_3; struct wlContextStruct wlCtx_Button_4; struct wlContextStruct wlCtx_HomeButton; struct wlContextStruct wlCtx_WorkSpaceBackGround; struct wl_list launcher_wlCtxList; int ret = 0; struct hmi_homescreen_setting *hmi_setting; struct wlContextStruct *pWlCtxSt = NULL; hmi_setting = hmi_homescreen_setting_create(); memset(&wlCtxCommon, 0x00, sizeof(wlCtxCommon)); memset(&wlCtx_BackGround, 0x00, sizeof(wlCtx_BackGround)); memset(&wlCtx_Panel, 0x00, sizeof(wlCtx_Panel)); memset(&wlCtx_Button_1, 0x00, sizeof(wlCtx_Button_1)); memset(&wlCtx_Button_2, 0x00, sizeof(wlCtx_Button_2)); memset(&wlCtx_Button_3, 0x00, sizeof(wlCtx_Button_3)); memset(&wlCtx_Button_4, 0x00, sizeof(wlCtx_Button_4)); memset(&wlCtx_HomeButton, 0x00, sizeof(wlCtx_HomeButton)); memset(&wlCtx_WorkSpaceBackGround, 0x00, sizeof(wlCtx_WorkSpaceBackGround)); wl_list_init(&launcher_wlCtxList); wl_list_init(&wlCtxCommon.list_wlContextStruct); wlCtxCommon.hmi_setting = hmi_setting; wlCtxCommon.wlDisplay = wl_display_connect(NULL); if (NULL == wlCtxCommon.wlDisplay) { printf("Error: wl_display_connect failed.\n"); return -1; } /* get wl_registry */ wlCtxCommon.formats = 0; wlCtxCommon.wlRegistry = wl_display_get_registry(wlCtxCommon.wlDisplay); wl_registry_add_listener(wlCtxCommon.wlRegistry, ®istry_listener, &wlCtxCommon); wl_display_roundtrip(wlCtxCommon.wlDisplay); if (wlCtxCommon.wlShm == NULL) { fprintf(stderr, "No wl_shm global\n"); exit(1); } wl_display_roundtrip(wlCtxCommon.wlDisplay); if (!(wlCtxCommon.formats & (1 << WL_SHM_FORMAT_XRGB8888))) { fprintf(stderr, "WL_SHM_FORMAT_XRGB32 not available\n"); exit(1); } if (wlCtxCommon.hmi_setting->cursor_theme) { create_cursors(&wlCtxCommon); wlCtxCommon.pointer_surface = wl_compositor_create_surface(wlCtxCommon.wlCompositor); wlCtxCommon.current_cursor = CURSOR_LEFT_PTR; } wlCtx_BackGround.cmm = &wlCtxCommon; wlCtx_Panel.cmm = &wlCtxCommon; wlCtx_Button_1.cmm = &wlCtxCommon; wlCtx_Button_2.cmm = &wlCtxCommon; wlCtx_Button_3.cmm = &wlCtxCommon; wlCtx_Button_4.cmm = &wlCtxCommon; wlCtx_HomeButton.cmm = &wlCtxCommon; wlCtx_WorkSpaceBackGround.cmm = &wlCtxCommon; /* create desktop widgets */ create_background(&wlCtx_BackGround, hmi_setting->background.id, hmi_setting->background.filePath); create_panel(&wlCtx_Panel, hmi_setting->panel.id, hmi_setting->panel.filePath); create_button(&wlCtx_Button_1, hmi_setting->tiling.id, hmi_setting->tiling.filePath, 0); create_button(&wlCtx_Button_2, hmi_setting->sidebyside.id, hmi_setting->sidebyside.filePath, 1); create_button(&wlCtx_Button_3, hmi_setting->fullscreen.id, hmi_setting->fullscreen.filePath, 2); create_button(&wlCtx_Button_4, hmi_setting->random.id, hmi_setting->random.filePath, 3); create_workspace_background(&wlCtx_WorkSpaceBackGround, &hmi_setting->workspace_background); create_launchers(&wlCtxCommon, &hmi_setting->launcher_list); create_home_button(&wlCtx_HomeButton, hmi_setting->home.id, hmi_setting->home.filePath); UI_ready(wlCtxCommon.hmiCtrl); while (ret != -1) ret = wl_display_dispatch(wlCtxCommon.wlDisplay); wl_list_for_each(pWlCtxSt, &wlCtxCommon.list_wlContextStruct, link) { destroyWLContextStruct(pWlCtxSt); } destroyWLContextCommon(&wlCtxCommon); return 0; } weston-1.9.0/clients/weston-info.c0000664000175000017500000004110312537664710014052 00000000000000/* * Copyright © 2012 Philipp Brüschweiler * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "presentation_timing-client-protocol.h" typedef void (*print_info_t)(void *info); typedef void (*destroy_info_t)(void *info); struct global_info { struct wl_list link; uint32_t id; uint32_t version; char *interface; print_info_t print; destroy_info_t destroy; }; struct output_mode { struct wl_list link; uint32_t flags; int32_t width, height; int32_t refresh; }; struct output_info { struct global_info global; struct wl_output *output; struct { int32_t x, y; int32_t physical_width, physical_height; enum wl_output_subpixel subpixel; enum wl_output_transform output_transform; char *make; char *model; } geometry; struct wl_list modes; }; struct shm_format { struct wl_list link; uint32_t format; }; struct shm_info { struct global_info global; struct wl_shm *shm; struct wl_list formats; }; struct seat_info { struct global_info global; struct wl_seat *seat; struct weston_info *info; uint32_t capabilities; char *name; int32_t repeat_rate; int32_t repeat_delay; }; struct presentation_info { struct global_info global; struct presentation *presentation; clockid_t clk_id; }; struct weston_info { struct wl_display *display; struct wl_registry *registry; struct wl_list infos; bool roundtrip_needed; }; static void * fail_on_null(void *p) { if (p == NULL) { fprintf(stderr, "%s: out of memory\n", program_invocation_short_name); exit(EXIT_FAILURE); } return p; } static void * xmalloc(size_t s) { return fail_on_null(malloc(s)); } static void * xzalloc(size_t s) { return fail_on_null(calloc(1, s)); } static char * xstrdup(const char *s) { return fail_on_null(strdup(s)); } static void print_global_info(void *data) { struct global_info *global = data; printf("interface: '%s', version: %u, name: %u\n", global->interface, global->version, global->id); } static void init_global_info(struct weston_info *info, struct global_info *global, uint32_t id, const char *interface, uint32_t version) { global->id = id; global->version = version; global->interface = xstrdup(interface); wl_list_insert(info->infos.prev, &global->link); } static void print_output_info(void *data) { struct output_info *output = data; struct output_mode *mode; const char *subpixel_orientation; const char *transform; print_global_info(data); switch (output->geometry.subpixel) { case WL_OUTPUT_SUBPIXEL_UNKNOWN: subpixel_orientation = "unknown"; break; case WL_OUTPUT_SUBPIXEL_NONE: subpixel_orientation = "none"; break; case WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB: subpixel_orientation = "horizontal rgb"; break; case WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR: subpixel_orientation = "horizontal bgr"; break; case WL_OUTPUT_SUBPIXEL_VERTICAL_RGB: subpixel_orientation = "vertical rgb"; break; case WL_OUTPUT_SUBPIXEL_VERTICAL_BGR: subpixel_orientation = "vertical bgr"; break; default: fprintf(stderr, "unknown subpixel orientation %u\n", output->geometry.subpixel); subpixel_orientation = "unexpected value"; break; } switch (output->geometry.output_transform) { case WL_OUTPUT_TRANSFORM_NORMAL: transform = "normal"; break; case WL_OUTPUT_TRANSFORM_90: transform = "90°"; break; case WL_OUTPUT_TRANSFORM_180: transform = "180°"; break; case WL_OUTPUT_TRANSFORM_270: transform = "270°"; break; case WL_OUTPUT_TRANSFORM_FLIPPED: transform = "flipped"; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: transform = "flipped 90°"; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: transform = "flipped 180°"; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: transform = "flipped 270°"; break; default: fprintf(stderr, "unknown output transform %u\n", output->geometry.output_transform); transform = "unexpected value"; break; } printf("\tx: %d, y: %d,\n", output->geometry.x, output->geometry.y); printf("\tphysical_width: %d mm, physical_height: %d mm,\n", output->geometry.physical_width, output->geometry.physical_height); printf("\tmake: '%s', model: '%s',\n", output->geometry.make, output->geometry.model); printf("\tsubpixel_orientation: %s, output_transform: %s,\n", subpixel_orientation, transform); wl_list_for_each(mode, &output->modes, link) { printf("\tmode:\n"); printf("\t\twidth: %d px, height: %d px, refresh: %.f Hz,\n", mode->width, mode->height, (float) mode->refresh / 1000); printf("\t\tflags:"); if (mode->flags & WL_OUTPUT_MODE_CURRENT) printf(" current"); if (mode->flags & WL_OUTPUT_MODE_PREFERRED) printf(" preferred"); printf("\n"); } } static void print_shm_info(void *data) { struct shm_info *shm = data; struct shm_format *format; print_global_info(data); printf("\tformats:"); wl_list_for_each(format, &shm->formats, link) switch (format->format) { case WL_SHM_FORMAT_ARGB8888: printf(" ARGB8888"); break; case WL_SHM_FORMAT_XRGB8888: printf(" XRGB8888"); break; case WL_SHM_FORMAT_RGB565: printf(" RGB565"); break; default: printf(" unknown(%08x)", format->format); break; } printf("\n"); } static void print_seat_info(void *data) { struct seat_info *seat = data; print_global_info(data); printf("\tname: %s\n", seat->name); printf("\tcapabilities:"); if (seat->capabilities & WL_SEAT_CAPABILITY_POINTER) printf(" pointer"); if (seat->capabilities & WL_SEAT_CAPABILITY_KEYBOARD) printf(" keyboard"); if (seat->capabilities & WL_SEAT_CAPABILITY_TOUCH) printf(" touch"); printf("\n"); if (seat->repeat_rate > 0) printf("\tkeyboard repeat rate: %d\n", seat->repeat_rate); if (seat->repeat_delay > 0) printf("\tkeyboard repeat delay: %d\n", seat->repeat_delay); } static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { } static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { } static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { } static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay) { struct seat_info *seat = data; seat->repeat_rate = rate; seat->repeat_delay = delay; } static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, keyboard_handle_repeat_info, }; static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, enum wl_seat_capability caps) { struct seat_info *seat = data; seat->capabilities = caps; /* we want listen for repeat_info from wl_keyboard, but only * do so if the seat info is >= 4 and if we actually have a * keyboard */ if (seat->global.version < 4) return; if (caps & WL_SEAT_CAPABILITY_KEYBOARD) { struct wl_keyboard *keyboard; keyboard = wl_seat_get_keyboard(seat->seat); wl_keyboard_add_listener(keyboard, &keyboard_listener, seat); seat->info->roundtrip_needed = true; } } static void seat_handle_name(void *data, struct wl_seat *wl_seat, const char *name) { struct seat_info *seat = data; seat->name = xstrdup(name); } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, seat_handle_name, }; static void destroy_seat_info(void *data) { struct seat_info *seat = data; wl_seat_destroy(seat->seat); if (seat->name != NULL) free(seat->name); } static void add_seat_info(struct weston_info *info, uint32_t id, uint32_t version) { struct seat_info *seat = xzalloc(sizeof *seat); /* required to set roundtrip_needed to true in capabilities * handler */ seat->info = info; init_global_info(info, &seat->global, id, "wl_seat", version); seat->global.print = print_seat_info; seat->global.destroy = destroy_seat_info; seat->seat = wl_registry_bind(info->registry, id, &wl_seat_interface, MIN(version, 4)); wl_seat_add_listener(seat->seat, &seat_listener, seat); seat->repeat_rate = seat->repeat_delay = -1; info->roundtrip_needed = true; } static void shm_handle_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct shm_info *shm = data; struct shm_format *shm_format = xzalloc(sizeof *shm_format); wl_list_insert(&shm->formats, &shm_format->link); shm_format->format = format; } static const struct wl_shm_listener shm_listener = { shm_handle_format, }; static void destroy_shm_info(void *data) { struct shm_info *shm = data; struct shm_format *format, *tmp; wl_list_for_each_safe(format, tmp, &shm->formats, link) { wl_list_remove(&format->link); free(format); } wl_shm_destroy(shm->shm); } static void add_shm_info(struct weston_info *info, uint32_t id, uint32_t version) { struct shm_info *shm = xzalloc(sizeof *shm); init_global_info(info, &shm->global, id, "wl_shm", version); shm->global.print = print_shm_info; shm->global.destroy = destroy_shm_info; wl_list_init(&shm->formats); shm->shm = wl_registry_bind(info->registry, id, &wl_shm_interface, 1); wl_shm_add_listener(shm->shm, &shm_listener, shm); info->roundtrip_needed = true; } static void output_handle_geometry(void *data, struct wl_output *wl_output, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t output_transform) { struct output_info *output = data; output->geometry.x = x; output->geometry.y = y; output->geometry.physical_width = physical_width; output->geometry.physical_height = physical_height; output->geometry.subpixel = subpixel; output->geometry.make = xstrdup(make); output->geometry.model = xstrdup(model); output->geometry.output_transform = output_transform; } static void output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags, int32_t width, int32_t height, int32_t refresh) { struct output_info *output = data; struct output_mode *mode = xmalloc(sizeof *mode); mode->flags = flags; mode->width = width; mode->height = height; mode->refresh = refresh; wl_list_insert(output->modes.prev, &mode->link); } static const struct wl_output_listener output_listener = { output_handle_geometry, output_handle_mode, }; static void destroy_output_info(void *data) { struct output_info *output = data; struct output_mode *mode, *tmp; wl_output_destroy(output->output); if (output->geometry.make != NULL) free(output->geometry.make); if (output->geometry.model != NULL) free(output->geometry.model); wl_list_for_each_safe(mode, tmp, &output->modes, link) { wl_list_remove(&mode->link); free(mode); } } static void add_output_info(struct weston_info *info, uint32_t id, uint32_t version) { struct output_info *output = xzalloc(sizeof *output); init_global_info(info, &output->global, id, "wl_output", version); output->global.print = print_output_info; output->global.destroy = destroy_output_info; wl_list_init(&output->modes); output->output = wl_registry_bind(info->registry, id, &wl_output_interface, 1); wl_output_add_listener(output->output, &output_listener, output); info->roundtrip_needed = true; } static void destroy_presentation_info(void *info) { struct presentation_info *prinfo = info; presentation_destroy(prinfo->presentation); } static const char * clock_name(clockid_t clk_id) { static const char *names[] = { [CLOCK_REALTIME] = "CLOCK_REALTIME", [CLOCK_MONOTONIC] = "CLOCK_MONOTONIC", [CLOCK_MONOTONIC_RAW] = "CLOCK_MONOTONIC_RAW", [CLOCK_REALTIME_COARSE] = "CLOCK_REALTIME_COARSE", [CLOCK_MONOTONIC_COARSE] = "CLOCK_MONOTONIC_COARSE", [CLOCK_BOOTTIME] = "CLOCK_BOOTTIME", }; if (clk_id < 0 || (unsigned)clk_id >= ARRAY_LENGTH(names)) return "unknown"; return names[clk_id]; } static void print_presentation_info(void *info) { struct presentation_info *prinfo = info; print_global_info(info); printf("\tpresentation clock id: %d (%s)\n", prinfo->clk_id, clock_name(prinfo->clk_id)); } static void presentation_handle_clock_id(void *data, struct presentation *presentation, uint32_t clk_id) { struct presentation_info *prinfo = data; prinfo->clk_id = clk_id; } static const struct presentation_listener presentation_listener = { presentation_handle_clock_id }; static void add_presentation_info(struct weston_info *info, uint32_t id, uint32_t version) { struct presentation_info *prinfo = xzalloc(sizeof *prinfo); init_global_info(info, &prinfo->global, id, "presentation", version); prinfo->global.print = print_presentation_info; prinfo->global.destroy = destroy_presentation_info; prinfo->clk_id = -1; prinfo->presentation = wl_registry_bind(info->registry, id, &presentation_interface, 1); presentation_add_listener(prinfo->presentation, &presentation_listener, prinfo); info->roundtrip_needed = true; } static void destroy_global_info(void *data) { } static void add_global_info(struct weston_info *info, uint32_t id, const char *interface, uint32_t version) { struct global_info *global = xzalloc(sizeof *global); init_global_info(info, global, id, interface, version); global->print = print_global_info; global->destroy = destroy_global_info; } static void global_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct weston_info *info = data; if (!strcmp(interface, "wl_seat")) add_seat_info(info, id, version); else if (!strcmp(interface, "wl_shm")) add_shm_info(info, id, version); else if (!strcmp(interface, "wl_output")) add_output_info(info, id, version); else if (!strcmp(interface, "presentation")) add_presentation_info(info, id, version); else add_global_info(info, id, interface, version); } static void global_remove_handler(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { global_handler, global_remove_handler }; static void print_infos(struct wl_list *infos) { struct global_info *info; wl_list_for_each(info, infos, link) info->print(info); } static void destroy_info(void *data) { struct global_info *global = data; global->destroy(data); wl_list_remove(&global->link); free(global->interface); free(data); } static void destroy_infos(struct wl_list *infos) { struct global_info *info, *tmp; wl_list_for_each_safe(info, tmp, infos, link) destroy_info(info); } int main(int argc, char **argv) { struct weston_info info; info.display = wl_display_connect(NULL); if (!info.display) { fprintf(stderr, "failed to create display: %m\n"); return -1; } wl_list_init(&info.infos); info.registry = wl_display_get_registry(info.display); wl_registry_add_listener(info.registry, ®istry_listener, &info); do { info.roundtrip_needed = false; wl_display_roundtrip(info.display); } while (info.roundtrip_needed); print_infos(&info.infos); destroy_infos(&info.infos); wl_registry_destroy(info.registry); wl_display_disconnect(info.display); return 0; } weston-1.9.0/clients/scaler.c0000664000175000017500000002172512537627702013063 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2013 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "window.h" #include "scaler-client-protocol.h" #define BUFFER_SCALE 2 static const int BUFFER_WIDTH = 421 * BUFFER_SCALE; static const int BUFFER_HEIGHT = 337 * BUFFER_SCALE; static const int SURFACE_WIDTH = 55 * 4; static const int SURFACE_HEIGHT = 77 * 4; static const double RECT_X = 21 * BUFFER_SCALE; /* buffer coords */ static const double RECT_Y = 25 * BUFFER_SCALE; static const double RECT_W = 55 * BUFFER_SCALE; static const double RECT_H = 77 * BUFFER_SCALE; struct box { struct display *display; struct window *window; struct widget *widget; int width, height; struct wl_scaler *scaler; int scaler_version; struct wl_viewport *viewport; enum { MODE_NO_VIEWPORT, MODE_SRC_ONLY, MODE_DST_ONLY, MODE_SRC_DST } mode; }; static void set_my_viewport(struct box *box) { wl_fixed_t src_x, src_y, src_width, src_height; int32_t dst_width = SURFACE_WIDTH; int32_t dst_height = SURFACE_HEIGHT; if (box->mode == MODE_NO_VIEWPORT) return; /* Cut the green border in half, take white border fully in, * and black border fully out. The borders are 1px wide in buffer. * * The gl-renderer uses linear texture sampling, this means the * top and left edges go to 100% green, bottom goes to 50% blue/black, * right edge has thick white sliding to 50% red. */ src_x = wl_fixed_from_double((RECT_X + 0.5) / BUFFER_SCALE); src_y = wl_fixed_from_double((RECT_Y + 0.5) / BUFFER_SCALE); src_width = wl_fixed_from_double((RECT_W - 0.5) / BUFFER_SCALE); src_height = wl_fixed_from_double((RECT_H - 0.5) / BUFFER_SCALE); if (box->scaler_version < 2 && box->mode != MODE_SRC_DST) { fprintf(stderr, "Error: server's wl_scaler interface version " "%d does not support this mode.\n", box->scaler_version); exit(1); } switch (box->mode){ case MODE_SRC_ONLY: wl_viewport_set_source(box->viewport, src_x, src_y, src_width, src_height); break; case MODE_DST_ONLY: wl_viewport_set_destination(box->viewport, dst_width, dst_height); break; case MODE_SRC_DST: if (box->scaler_version < 2) { wl_viewport_set(box->viewport, src_x, src_y, src_width, src_height, dst_width, dst_height); } else { wl_viewport_set_source(box->viewport, src_x, src_y, src_width, src_height); wl_viewport_set_destination(box->viewport, dst_width, dst_height); } break; default: assert(!"not reached"); } } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct box *box = data; /* Dont resize me */ widget_set_size(box->widget, box->width, box->height); } static void redraw_handler(struct widget *widget, void *data) { struct box *box = data; cairo_surface_t *surface; cairo_t *cr; surface = window_get_surface(box->window); if (surface == NULL || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { fprintf(stderr, "failed to create cairo egl surface\n"); return; } cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_line_width(cr, 1.0); cairo_translate(cr, RECT_X, RECT_Y); /* red background */ cairo_set_source_rgba(cr, 255, 0, 0, 255); cairo_paint(cr); /* blue box */ cairo_set_source_rgba(cr, 0, 0, 255, 255); cairo_rectangle(cr, 0, 0, RECT_W, RECT_H); cairo_fill(cr); /* black border outside the box */ cairo_set_source_rgb(cr, 0, 0, 0); cairo_move_to(cr, 0, RECT_H + 0.5); cairo_line_to(cr, RECT_W, RECT_H + 0.5); cairo_stroke(cr); /* white border inside the box */ cairo_set_source_rgb(cr, 1, 1, 1); cairo_move_to(cr, RECT_W - 0.5, 0); cairo_line_to(cr, RECT_W - 0.5, RECT_H); cairo_stroke(cr); /* the green border on inside the box, to be split half by crop */ cairo_set_source_rgb(cr, 0, 1, 0); cairo_move_to(cr, 0.5, RECT_H); cairo_line_to(cr, 0.5, 0); cairo_move_to(cr, 0, 0.5); cairo_line_to(cr, RECT_W, 0.5); cairo_stroke(cr); cairo_destroy(cr); /* TODO: buffer_transform */ cairo_surface_destroy(surface); } static void global_handler(struct display *display, uint32_t name, const char *interface, uint32_t version, void *data) { struct box *box = data; if (strcmp(interface, "wl_scaler") == 0) { box->scaler_version = version < 2 ? version : 2; box->scaler = display_bind(display, name, &wl_scaler_interface, box->scaler_version); box->viewport = wl_scaler_get_viewport(box->scaler, widget_get_wl_surface(box->widget)); set_my_viewport(box); } } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct box *box = data; if (button != BTN_LEFT) return; if (state == WL_POINTER_BUTTON_STATE_PRESSED) { window_move(box->window, input, display_get_serial(box->display)); } } static void touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct box *box = data; window_move(box->window, input, display_get_serial(box->display)); } static void usage(const char *progname) { fprintf(stderr, "Usage: %s [mode]\n" "where 'mode' is one of\n" " -b\tset both src and dst in viewport (default)\n" " -d\tset only dst in viewport\n" " -s\tset only src in viewport\n" " -n\tdo not set viewport at all\n\n", progname); fprintf(stderr, "Expected output with output_scale=1:\n"); fprintf(stderr, "Mode -n:\n" " window size %dx%d px\n" " Red box with a blue box in the upper left part.\n" " The blue box has white right edge, black bottom edge,\n" " and thin green left and top edges that can really\n" " be seen only when zoomed in.\n\n", BUFFER_WIDTH / BUFFER_SCALE, BUFFER_HEIGHT / BUFFER_SCALE); fprintf(stderr, "Mode -b:\n" " window size %dx%d px\n" " Blue box with green top and left edge,\n" " thick white right edge with a hint of red,\n" " and a hint of black in bottom edge.\n\n", SURFACE_WIDTH, SURFACE_HEIGHT); fprintf(stderr, "Mode -s:\n" " window size %.0fx%.0f px\n" " The same as mode -b, but scaled a lot smaller.\n\n", RECT_W / BUFFER_SCALE, RECT_H / BUFFER_SCALE); fprintf(stderr, "Mode -d:\n" " window size %dx%d px\n" " This is horizontally squashed version of the -n mode.\n\n", SURFACE_WIDTH, SURFACE_HEIGHT); } int main(int argc, char *argv[]) { struct box box; struct display *d; struct timeval tv; int i; box.mode = MODE_SRC_DST; for (i = 1; i < argc; i++) { if (strcmp("-s", argv[i]) == 0) box.mode = MODE_SRC_ONLY; else if (strcmp("-d", argv[i]) == 0) box.mode = MODE_DST_ONLY; else if (strcmp("-b", argv[i]) == 0) box.mode = MODE_SRC_DST; else if (strcmp("-n", argv[i]) == 0) box.mode = MODE_NO_VIEWPORT; else { usage(argv[0]); exit(1); } } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } gettimeofday(&tv, NULL); srandom(tv.tv_usec); box.width = BUFFER_WIDTH / BUFFER_SCALE; box.height = BUFFER_HEIGHT / BUFFER_SCALE; box.display = d; box.window = window_create(d); box.widget = window_add_widget(box.window, &box); window_set_title(box.window, "Scaler Test Box"); window_set_buffer_scale(box.window, BUFFER_SCALE); widget_set_resize_handler(box.widget, resize_handler); widget_set_redraw_handler(box.widget, redraw_handler); widget_set_button_handler(box.widget, button_handler); widget_set_default_cursor(box.widget, CURSOR_HAND1); widget_set_touch_down_handler(box.widget, touch_down_handler); window_schedule_resize(box.window, box.width, box.height); display_set_user_data(box.display, &box); display_set_global_handler(box.display, global_handler); display_run(d); widget_destroy(box.widget); window_destroy(box.window); display_destroy(d); return 0; } weston-1.9.0/clients/keyboard.c0000664000175000017500000006566512537627702013425 00000000000000/* * Copyright © 2012 Openismus GmbH * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include "window.h" #include "input-method-client-protocol.h" #include "text-client-protocol.h" struct keyboard; struct virtual_keyboard { struct wl_input_panel *input_panel; struct wl_input_method *input_method; struct wl_input_method_context *context; struct display *display; struct output *output; char *preedit_string; uint32_t preedit_style; struct { xkb_mod_mask_t shift_mask; } keysym; uint32_t serial; uint32_t content_hint; uint32_t content_purpose; char *preferred_language; char *surrounding_text; uint32_t surrounding_cursor; struct keyboard *keyboard; }; enum key_type { keytype_default, keytype_backspace, keytype_enter, keytype_space, keytype_switch, keytype_symbols, keytype_tab, keytype_arrow_up, keytype_arrow_left, keytype_arrow_right, keytype_arrow_down, keytype_style }; struct key { enum key_type key_type; char *label; char *uppercase; char *symbol; unsigned int width; }; struct layout { const struct key *keys; uint32_t count; uint32_t columns; uint32_t rows; const char *language; uint32_t text_direction; }; static const struct key normal_keys[] = { { keytype_default, "q", "Q", "1", 1}, { keytype_default, "w", "W", "2", 1}, { keytype_default, "e", "E", "3", 1}, { keytype_default, "r", "R", "4", 1}, { keytype_default, "t", "T", "5", 1}, { keytype_default, "y", "Y", "6", 1}, { keytype_default, "u", "U", "7", 1}, { keytype_default, "i", "I", "8", 1}, { keytype_default, "o", "O", "9", 1}, { keytype_default, "p", "P", "0", 1}, { keytype_backspace, "<--", "<--", "<--", 2}, { keytype_tab, "->|", "->|", "->|", 1}, { keytype_default, "a", "A", "-", 1}, { keytype_default, "s", "S", "@", 1}, { keytype_default, "d", "D", "*", 1}, { keytype_default, "f", "F", "^", 1}, { keytype_default, "g", "G", ":", 1}, { keytype_default, "h", "H", ";", 1}, { keytype_default, "j", "J", "(", 1}, { keytype_default, "k", "K", ")", 1}, { keytype_default, "l", "L", "~", 1}, { keytype_enter, "Enter", "Enter", "Enter", 2}, { keytype_switch, "ABC", "abc", "ABC", 2}, { keytype_default, "z", "Z", "/", 1}, { keytype_default, "x", "X", "\'", 1}, { keytype_default, "c", "C", "\"", 1}, { keytype_default, "v", "V", "+", 1}, { keytype_default, "b", "B", "=", 1}, { keytype_default, "n", "N", "?", 1}, { keytype_default, "m", "M", "!", 1}, { keytype_default, ",", ",", "\\", 1}, { keytype_default, ".", ".", "|", 1}, { keytype_switch, "ABC", "abc", "ABC", 1}, { keytype_symbols, "?123", "?123", "abc", 1}, { keytype_space, "", "", "", 5}, { keytype_arrow_up, "/\\", "/\\", "/\\", 1}, { keytype_arrow_left, "<", "<", "<", 1}, { keytype_arrow_right, ">", ">", ">", 1}, { keytype_arrow_down, "\\/", "\\/", "\\/", 1}, { keytype_style, "", "", "", 2} }; static const struct key numeric_keys[] = { { keytype_default, "1", "1", "1", 1}, { keytype_default, "2", "2", "2", 1}, { keytype_default, "3", "3", "3", 1}, { keytype_default, "4", "4", "4", 1}, { keytype_default, "5", "5", "5", 1}, { keytype_default, "6", "6", "6", 1}, { keytype_default, "7", "7", "7", 1}, { keytype_default, "8", "8", "8", 1}, { keytype_default, "9", "9", "9", 1}, { keytype_default, "0", "0", "0", 1}, { keytype_backspace, "<--", "<--", "<--", 2}, { keytype_space, "", "", "", 4}, { keytype_enter, "Enter", "Enter", "Enter", 2}, { keytype_arrow_up, "/\\", "/\\", "/\\", 1}, { keytype_arrow_left, "<", "<", "<", 1}, { keytype_arrow_right, ">", ">", ">", 1}, { keytype_arrow_down, "\\/", "\\/", "\\/", 1}, { keytype_style, "", "", "", 2} }; static const struct key arabic_keys[] = { { keytype_default, "ض", "ﹶ", "۱", 1}, { keytype_default, "ص", "ﹰ", "۲", 1}, { keytype_default, "ث", "ﹸ", "۳", 1}, { keytype_default, "ق", "ﹲ", "۴", 1}, { keytype_default, "ف", "ﻹ", "۵", 1}, { keytype_default, "غ", "ﺇ", "۶", 1}, { keytype_default, "ع", "`", "۷", 1}, { keytype_default, "ه", "٪", "۸", 1}, { keytype_default, "خ", ">", "۹", 1}, { keytype_default, "ح", "<", "۰", 1}, { keytype_backspace, "-->", "-->", "-->", 2}, { keytype_tab, "->|", "->|", "->|", 1}, { keytype_default, "ش", "ﹺ", "ﹼ", 1}, { keytype_default, "س", "ﹴ", "!", 1}, { keytype_default, "ي", "[", "@", 1}, { keytype_default, "ب", "]", "#", 1}, { keytype_default, "ل", "ﻷ", "$", 1}, { keytype_default, "ا", "أ", "%", 1}, { keytype_default, "ت", "-", "^", 1}, { keytype_default, "ن", "x", "&", 1}, { keytype_default, "م", "/", "*", 1}, { keytype_default, "ك", ":", "_", 1}, { keytype_default, "د", "\"", "+", 1}, { keytype_enter, "Enter", "Enter", "Enter", 2}, { keytype_switch, "Shift", "Base", "Shift", 2}, { keytype_default, "ئ", "~", ")", 1}, { keytype_default, "ء", "°", "(", 1}, { keytype_default, "ؤ", "{", "\"", 1}, { keytype_default, "ر", "}", "\'", 1}, { keytype_default, "ى", "ﺁ", "؟", 1}, { keytype_default, "ة", "'", "!", 1}, { keytype_default, "و", ",", ";", 1}, { keytype_default, "ﺯ", ".", "\\", 1}, { keytype_default, "ظ", "؟", "=", 1}, { keytype_switch, "Shift", "Base", "Shift", 2}, { keytype_symbols, "؟٣٢١", "؟٣٢١", "Base", 1}, { keytype_default, "ﻻ", "ﻵ", "|", 1}, { keytype_default, ",", "،", "،", 1}, { keytype_space, "", "", "", 6}, { keytype_default, ".", "ذ", "]", 1}, { keytype_default, "ط", "ﺝ", "[", 1}, { keytype_style, "", "", "", 2} }; static const struct layout normal_layout = { normal_keys, sizeof(normal_keys) / sizeof(*normal_keys), 12, 4, "en", WL_TEXT_INPUT_TEXT_DIRECTION_LTR }; static const struct layout numeric_layout = { numeric_keys, sizeof(numeric_keys) / sizeof(*numeric_keys), 12, 2, "en", WL_TEXT_INPUT_TEXT_DIRECTION_LTR }; static const struct layout arabic_layout = { arabic_keys, sizeof(arabic_keys) / sizeof(*arabic_keys), 13, 4, "ar", WL_TEXT_INPUT_TEXT_DIRECTION_RTL }; static const char *style_labels[] = { "default", "none", "active", "inactive", "highlight", "underline", "selection", "incorrect" }; static const double key_width = 60; static const double key_height = 50; enum keyboard_state { KEYBOARD_STATE_DEFAULT, KEYBOARD_STATE_UPPERCASE, KEYBOARD_STATE_SYMBOLS }; struct keyboard { struct virtual_keyboard *keyboard; struct window *window; struct widget *widget; enum keyboard_state state; }; static void __attribute__ ((format (printf, 1, 2))) dbg(const char *fmt, ...) { #ifdef DEBUG int l; va_list argp; va_start(argp, fmt); l = vfprintf(stderr, fmt, argp); va_end(argp); #endif } static const char * label_from_key(struct keyboard *keyboard, const struct key *key) { if (key->key_type == keytype_style) return style_labels[keyboard->keyboard->preedit_style]; switch(keyboard->state) { case KEYBOARD_STATE_DEFAULT: return key->label; case KEYBOARD_STATE_UPPERCASE: return key->uppercase; case KEYBOARD_STATE_SYMBOLS: return key->symbol; } return ""; } static void draw_key(struct keyboard *keyboard, const struct key *key, cairo_t *cr, unsigned int row, unsigned int col) { const char *label; cairo_text_extents_t extents; cairo_save(cr); cairo_rectangle(cr, col * key_width, row * key_height, key->width * key_width, key_height); cairo_clip(cr); /* Paint frame */ cairo_rectangle(cr, col * key_width, row * key_height, key->width * key_width, key_height); cairo_set_line_width(cr, 3); cairo_stroke(cr); /* Paint text */ label = label_from_key(keyboard, key); cairo_text_extents(cr, label, &extents); cairo_translate(cr, col * key_width, row * key_height); cairo_translate(cr, (key->width * key_width - extents.width) / 2, (key_height - extents.y_bearing) / 2); cairo_show_text(cr, label); cairo_restore(cr); } static const struct layout * get_current_layout(struct virtual_keyboard *keyboard) { switch (keyboard->content_purpose) { case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: case WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER: return &numeric_layout; default: if (keyboard->preferred_language && strcmp(keyboard->preferred_language, "ar") == 0) return &arabic_layout; else return &normal_layout; } } static void redraw_handler(struct widget *widget, void *data) { struct keyboard *keyboard = data; cairo_surface_t *surface; struct rectangle allocation; cairo_t *cr; unsigned int i; unsigned int row = 0, col = 0; const struct layout *layout; layout = get_current_layout(keyboard->keyboard); surface = window_get_surface(keyboard->window); widget_get_allocation(keyboard->widget, &allocation); cr = cairo_create(surface); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr, 16); cairo_translate(cr, allocation.x, allocation.y); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 1, 1, 1, 0.75); cairo_rectangle(cr, 0, 0, layout->columns * key_width, layout->rows * key_height); cairo_paint(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); for (i = 0; i < layout->count; ++i) { cairo_set_source_rgb(cr, 0, 0, 0); draw_key(keyboard, &layout->keys[i], cr, row, col); col += layout->keys[i].width; if (col >= layout->columns) { row += 1; col = 0; } } cairo_destroy(cr); cairo_surface_destroy(surface); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { /* struct keyboard *keyboard = data; */ } static char * insert_text(const char *text, uint32_t offset, const char *insert) { int tlen = strlen(text), ilen = strlen(insert); char *new_text = xmalloc(tlen + ilen + 1); memcpy(new_text, text, offset); memcpy(new_text + offset, insert, ilen); memcpy(new_text + offset + ilen, text + offset, tlen - offset); new_text[tlen + ilen] = '\0'; return new_text; } static void virtual_keyboard_commit_preedit(struct virtual_keyboard *keyboard) { char *surrounding_text; if (!keyboard->preedit_string || strlen(keyboard->preedit_string) == 0) return; wl_input_method_context_cursor_position(keyboard->context, 0, 0); wl_input_method_context_commit_string(keyboard->context, keyboard->serial, keyboard->preedit_string); if (keyboard->surrounding_text) { surrounding_text = insert_text(keyboard->surrounding_text, keyboard->surrounding_cursor, keyboard->preedit_string); free(keyboard->surrounding_text); keyboard->surrounding_text = surrounding_text; keyboard->surrounding_cursor += strlen(keyboard->preedit_string); } else { keyboard->surrounding_text = strdup(keyboard->preedit_string); keyboard->surrounding_cursor = strlen(keyboard->preedit_string); } free(keyboard->preedit_string); keyboard->preedit_string = strdup(""); } static void virtual_keyboard_send_preedit(struct virtual_keyboard *keyboard, int32_t cursor) { uint32_t index = strlen(keyboard->preedit_string); if (keyboard->preedit_style) wl_input_method_context_preedit_styling(keyboard->context, 0, strlen(keyboard->preedit_string), keyboard->preedit_style); if (cursor > 0) index = cursor; wl_input_method_context_preedit_cursor(keyboard->context, index); wl_input_method_context_preedit_string(keyboard->context, keyboard->serial, keyboard->preedit_string, keyboard->preedit_string); } static const char * prev_utf8_char(const char *s, const char *p) { for (--p; p >= s; --p) { if ((*p & 0xc0) != 0x80) return p; } return NULL; } static void delete_before_cursor(struct virtual_keyboard *keyboard) { const char *start, *end; if (!keyboard->surrounding_text) { dbg("delete_before_cursor: No surrounding text available\n"); return; } start = prev_utf8_char(keyboard->surrounding_text, keyboard->surrounding_text + keyboard->surrounding_cursor); if (!start) { dbg("delete_before_cursor: No previous character to delete\n"); return; } end = keyboard->surrounding_text + keyboard->surrounding_cursor; wl_input_method_context_delete_surrounding_text(keyboard->context, (start - keyboard->surrounding_text) - keyboard->surrounding_cursor, end - start); wl_input_method_context_commit_string(keyboard->context, keyboard->serial, ""); /* Update surrounding text */ keyboard->surrounding_cursor = start - keyboard->surrounding_text; keyboard->surrounding_text[keyboard->surrounding_cursor] = '\0'; if (*end) memmove(keyboard->surrounding_text + keyboard->surrounding_cursor, end, strlen(end)); } static char * append(char *s1, const char *s2) { int len1, len2; char *s; len1 = strlen(s1); len2 = strlen(s2); s = xrealloc(s1, len1 + len2 + 1); memcpy(s + len1, s2, len2); s[len1 + len2] = '\0'; return s; } static void keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *key, struct input *input, enum wl_pointer_button_state state) { const char *label = NULL; switch(keyboard->state) { case KEYBOARD_STATE_DEFAULT : label = key->label; break; case KEYBOARD_STATE_UPPERCASE : label = key->uppercase; break; case KEYBOARD_STATE_SYMBOLS : label = key->symbol; break; } xkb_mod_mask_t mod_mask = keyboard->state == KEYBOARD_STATE_DEFAULT ? 0 : keyboard->keyboard->keysym.shift_mask; uint32_t key_state = (state == WL_POINTER_BUTTON_STATE_PRESSED) ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED; switch (key->key_type) { case keytype_default: if (state != WL_POINTER_BUTTON_STATE_PRESSED) break; keyboard->keyboard->preedit_string = append(keyboard->keyboard->preedit_string, label); virtual_keyboard_send_preedit(keyboard->keyboard, -1); break; case keytype_backspace: if (state != WL_POINTER_BUTTON_STATE_PRESSED) break; if (strlen(keyboard->keyboard->preedit_string) == 0) { delete_before_cursor(keyboard->keyboard); } else { keyboard->keyboard->preedit_string[strlen(keyboard->keyboard->preedit_string) - 1] = '\0'; virtual_keyboard_send_preedit(keyboard->keyboard, -1); } break; case keytype_enter: virtual_keyboard_commit_preedit(keyboard->keyboard); wl_input_method_context_keysym(keyboard->keyboard->context, display_get_serial(keyboard->keyboard->display), time, XKB_KEY_Return, key_state, mod_mask); break; case keytype_space: if (state != WL_POINTER_BUTTON_STATE_PRESSED) break; keyboard->keyboard->preedit_string = append(keyboard->keyboard->preedit_string, " "); virtual_keyboard_commit_preedit(keyboard->keyboard); break; case keytype_switch: if (state != WL_POINTER_BUTTON_STATE_PRESSED) break; switch(keyboard->state) { case KEYBOARD_STATE_DEFAULT: keyboard->state = KEYBOARD_STATE_UPPERCASE; break; case KEYBOARD_STATE_UPPERCASE: keyboard->state = KEYBOARD_STATE_DEFAULT; break; case KEYBOARD_STATE_SYMBOLS: keyboard->state = KEYBOARD_STATE_UPPERCASE; break; } break; case keytype_symbols: if (state != WL_POINTER_BUTTON_STATE_PRESSED) break; switch(keyboard->state) { case KEYBOARD_STATE_DEFAULT: keyboard->state = KEYBOARD_STATE_SYMBOLS; break; case KEYBOARD_STATE_UPPERCASE: keyboard->state = KEYBOARD_STATE_SYMBOLS; break; case KEYBOARD_STATE_SYMBOLS: keyboard->state = KEYBOARD_STATE_DEFAULT; break; } break; case keytype_tab: virtual_keyboard_commit_preedit(keyboard->keyboard); wl_input_method_context_keysym(keyboard->keyboard->context, display_get_serial(keyboard->keyboard->display), time, XKB_KEY_Tab, key_state, mod_mask); break; case keytype_arrow_up: virtual_keyboard_commit_preedit(keyboard->keyboard); wl_input_method_context_keysym(keyboard->keyboard->context, display_get_serial(keyboard->keyboard->display), time, XKB_KEY_Up, key_state, mod_mask); break; case keytype_arrow_left: virtual_keyboard_commit_preedit(keyboard->keyboard); wl_input_method_context_keysym(keyboard->keyboard->context, display_get_serial(keyboard->keyboard->display), time, XKB_KEY_Left, key_state, mod_mask); break; case keytype_arrow_right: virtual_keyboard_commit_preedit(keyboard->keyboard); wl_input_method_context_keysym(keyboard->keyboard->context, display_get_serial(keyboard->keyboard->display), time, XKB_KEY_Right, key_state, mod_mask); break; case keytype_arrow_down: virtual_keyboard_commit_preedit(keyboard->keyboard); wl_input_method_context_keysym(keyboard->keyboard->context, display_get_serial(keyboard->keyboard->display), time, XKB_KEY_Down, key_state, mod_mask); break; case keytype_style: if (state != WL_POINTER_BUTTON_STATE_PRESSED) break; keyboard->keyboard->preedit_style = (keyboard->keyboard->preedit_style + 1) % 8; /* TODO */ virtual_keyboard_send_preedit(keyboard->keyboard, -1); break; } } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct keyboard *keyboard = data; struct rectangle allocation; int32_t x, y; int row, col; unsigned int i; const struct layout *layout; layout = get_current_layout(keyboard->keyboard); if (button != BTN_LEFT) { return; } input_get_position(input, &x, &y); widget_get_allocation(keyboard->widget, &allocation); x -= allocation.x; y -= allocation.y; row = y / key_height; col = x / key_width + row * layout->columns; for (i = 0; i < layout->count; ++i) { col -= layout->keys[i].width; if (col < 0) { keyboard_handle_key(keyboard, time, &layout->keys[i], input, state); break; } } widget_schedule_redraw(widget); } static void touch_handler(struct input *input, uint32_t time, float x, float y, uint32_t state, void *data) { struct keyboard *keyboard = data; struct rectangle allocation; int row, col; unsigned int i; const struct layout *layout; layout = get_current_layout(keyboard->keyboard); widget_get_allocation(keyboard->widget, &allocation); x -= allocation.x; y -= allocation.y; row = (int)y / key_height; col = (int)x / key_width + row * layout->columns; for (i = 0; i < layout->count; ++i) { col -= layout->keys[i].width; if (col < 0) { keyboard_handle_key(keyboard, time, &layout->keys[i], input, state); break; } } widget_schedule_redraw(keyboard->widget); } static void touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { touch_handler(input, time, x, y, WL_POINTER_BUTTON_STATE_PRESSED, data); } static void touch_up_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data) { float x, y; input_get_touch(input, id, &x, &y); touch_handler(input, time, x, y, WL_POINTER_BUTTON_STATE_RELEASED, data); } static void handle_surrounding_text(void *data, struct wl_input_method_context *context, const char *text, uint32_t cursor, uint32_t anchor) { struct virtual_keyboard *keyboard = data; free(keyboard->surrounding_text); keyboard->surrounding_text = strdup(text); keyboard->surrounding_cursor = cursor; } static void handle_reset(void *data, struct wl_input_method_context *context) { struct virtual_keyboard *keyboard = data; dbg("Reset pre-edit buffer\n"); if (strlen(keyboard->preedit_string)) { free(keyboard->preedit_string); keyboard->preedit_string = strdup(""); } } static void handle_content_type(void *data, struct wl_input_method_context *context, uint32_t hint, uint32_t purpose) { struct virtual_keyboard *keyboard = data; keyboard->content_hint = hint; keyboard->content_purpose = purpose; } static void handle_invoke_action(void *data, struct wl_input_method_context *context, uint32_t button, uint32_t index) { struct virtual_keyboard *keyboard = data; if (button != BTN_LEFT) return; virtual_keyboard_send_preedit(keyboard, index); } static void handle_commit_state(void *data, struct wl_input_method_context *context, uint32_t serial) { struct virtual_keyboard *keyboard = data; const struct layout *layout; keyboard->serial = serial; layout = get_current_layout(keyboard); if (keyboard->surrounding_text) dbg("Surrounding text updated: %s\n", keyboard->surrounding_text); window_schedule_resize(keyboard->keyboard->window, layout->columns * key_width, layout->rows * key_height); wl_input_method_context_language(context, keyboard->serial, layout->language); wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction); widget_schedule_redraw(keyboard->keyboard->widget); } static void handle_preferred_language(void *data, struct wl_input_method_context *context, const char *language) { struct virtual_keyboard *keyboard = data; if (keyboard->preferred_language) free(keyboard->preferred_language); keyboard->preferred_language = NULL; if (language) keyboard->preferred_language = strdup(language); } static const struct wl_input_method_context_listener input_method_context_listener = { handle_surrounding_text, handle_reset, handle_content_type, handle_invoke_action, handle_commit_state, handle_preferred_language }; static void input_method_activate(void *data, struct wl_input_method *input_method, struct wl_input_method_context *context) { struct virtual_keyboard *keyboard = data; struct wl_array modifiers_map; const struct layout *layout; keyboard->keyboard->state = KEYBOARD_STATE_DEFAULT; if (keyboard->context) wl_input_method_context_destroy(keyboard->context); if (keyboard->preedit_string) free(keyboard->preedit_string); keyboard->preedit_string = strdup(""); keyboard->content_hint = 0; keyboard->content_purpose = 0; free(keyboard->preferred_language); keyboard->preferred_language = NULL; free(keyboard->surrounding_text); keyboard->surrounding_text = NULL; keyboard->serial = 0; keyboard->context = context; wl_input_method_context_add_listener(context, &input_method_context_listener, keyboard); wl_array_init(&modifiers_map); keysym_modifiers_add(&modifiers_map, "Shift"); keysym_modifiers_add(&modifiers_map, "Control"); keysym_modifiers_add(&modifiers_map, "Mod1"); wl_input_method_context_modifiers_map(context, &modifiers_map); keyboard->keysym.shift_mask = keysym_modifiers_get_mask(&modifiers_map, "Shift"); wl_array_release(&modifiers_map); layout = get_current_layout(keyboard); window_schedule_resize(keyboard->keyboard->window, layout->columns * key_width, layout->rows * key_height); wl_input_method_context_language(context, keyboard->serial, layout->language); wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction); widget_schedule_redraw(keyboard->keyboard->widget); } static void input_method_deactivate(void *data, struct wl_input_method *input_method, struct wl_input_method_context *context) { struct virtual_keyboard *keyboard = data; if (!keyboard->context) return; wl_input_method_context_destroy(keyboard->context); keyboard->context = NULL; } static const struct wl_input_method_listener input_method_listener = { input_method_activate, input_method_deactivate }; static void global_handler(struct display *display, uint32_t name, const char *interface, uint32_t version, void *data) { struct virtual_keyboard *keyboard = data; if (!strcmp(interface, "wl_input_panel")) { keyboard->input_panel = display_bind(display, name, &wl_input_panel_interface, 1); } else if (!strcmp(interface, "wl_input_method")) { keyboard->input_method = display_bind(display, name, &wl_input_method_interface, 1); wl_input_method_add_listener(keyboard->input_method, &input_method_listener, keyboard); } } static void keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard) { struct keyboard *keyboard; const struct layout *layout; struct wl_input_panel_surface *ips; layout = get_current_layout(virtual_keyboard); keyboard = xzalloc(sizeof *keyboard); keyboard->keyboard = virtual_keyboard; keyboard->window = window_create_custom(virtual_keyboard->display); keyboard->widget = window_add_widget(keyboard->window, keyboard); virtual_keyboard->keyboard = keyboard; window_set_title(keyboard->window, "Virtual keyboard"); window_set_user_data(keyboard->window, keyboard); widget_set_redraw_handler(keyboard->widget, redraw_handler); widget_set_resize_handler(keyboard->widget, resize_handler); widget_set_button_handler(keyboard->widget, button_handler); widget_set_touch_down_handler(keyboard->widget, touch_down_handler); widget_set_touch_up_handler(keyboard->widget, touch_up_handler); window_schedule_resize(keyboard->window, layout->columns * key_width, layout->rows * key_height); ips = wl_input_panel_get_input_panel_surface(virtual_keyboard->input_panel, window_get_wl_surface(keyboard->window)); wl_input_panel_surface_set_toplevel(ips, output_get_wl_output(output), WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM); } int main(int argc, char *argv[]) { struct virtual_keyboard virtual_keyboard; struct output *output; memset(&virtual_keyboard, 0, sizeof virtual_keyboard); virtual_keyboard.display = display_create(&argc, argv); if (virtual_keyboard.display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } display_set_user_data(virtual_keyboard.display, &virtual_keyboard); display_set_global_handler(virtual_keyboard.display, global_handler); if (virtual_keyboard.input_panel == NULL) { fprintf(stderr, "No input panel global\n"); return -1; } output = display_get_output(virtual_keyboard.display); keyboard_create(output, &virtual_keyboard); display_run(virtual_keyboard.display); return 0; } weston-1.9.0/clients/image.c0000664000175000017500000002462612575610243012671 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2009 Chris Wilson * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "shared/cairo-util.h" struct image { struct window *window; struct widget *widget; struct display *display; char *filename; cairo_surface_t *image; int fullscreen; int *image_counter; int32_t width, height; struct { double x; double y; } pointer; bool button_pressed; bool initialized; cairo_matrix_t matrix; }; static double get_scale(struct image *image) { assert(image->matrix.xy == 0.0 && image->matrix.yx == 0.0 && image->matrix.xx == image->matrix.yy); return image->matrix.xx; } static void clamp_view(struct image *image) { struct rectangle allocation; double scale = get_scale(image); double sw, sh; sw = image->width * scale; sh = image->height * scale; widget_get_allocation(image->widget, &allocation); if (sw < allocation.width) { image->matrix.x0 = (allocation.width - image->width * scale) / 2; } else { if (image->matrix.x0 > 0.0) image->matrix.x0 = 0.0; if (sw + image->matrix.x0 < allocation.width) image->matrix.x0 = allocation.width - sw; } if (sh < allocation.height) { image->matrix.y0 = (allocation.height - image->height * scale) / 2; } else { if (image->matrix.y0 > 0.0) image->matrix.y0 = 0.0; if (sh + image->matrix.y0 < allocation.height) image->matrix.y0 = allocation.height - sh; } } static void redraw_handler(struct widget *widget, void *data) { struct image *image = data; struct rectangle allocation; cairo_t *cr; cairo_surface_t *surface; double width, height, doc_aspect, window_aspect, scale; cairo_matrix_t matrix; cairo_matrix_t translate; surface = window_get_surface(image->window); cr = cairo_create(surface); widget_get_allocation(image->widget, &allocation); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_push_group(cr); cairo_translate(cr, allocation.x, allocation.y); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 1); cairo_paint(cr); if (!image->initialized) { image->initialized = true; width = cairo_image_surface_get_width(image->image); height = cairo_image_surface_get_height(image->image); doc_aspect = width / height; window_aspect = (double) allocation.width / allocation.height; if (doc_aspect < window_aspect) scale = allocation.height / height; else scale = allocation.width / width; image->width = width; image->height = height; cairo_matrix_init_scale(&image->matrix, scale, scale); clamp_view(image); } matrix = image->matrix; cairo_matrix_init_translate(&translate, allocation.x, allocation.y); cairo_matrix_multiply(&matrix, &matrix, &translate); cairo_set_matrix(cr, &matrix); cairo_set_source_surface(cr, image->image, 0, 0); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_paint(cr); cairo_pop_group_to_source(cr); cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct image *image = data; clamp_view(image); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct image *image = data; window_schedule_redraw(image->window); } static int enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct image *image = data; struct rectangle allocation; widget_get_allocation(image->widget, &allocation); x -= allocation.x; y -= allocation.y; image->pointer.x = x; image->pointer.y = y; return 1; } static void move_viewport(struct image *image, double dx, double dy) { double scale = get_scale(image); if (!image->initialized) return; cairo_matrix_translate(&image->matrix, -dx/scale, -dy/scale); clamp_view(image); window_schedule_redraw(image->window); } static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct image *image = data; struct rectangle allocation; widget_get_allocation(image->widget, &allocation); x -= allocation.x; y -= allocation.y; if (image->button_pressed) move_viewport(image, image->pointer.x - x, image->pointer.y - y); image->pointer.x = x; image->pointer.y = y; return image->button_pressed ? CURSOR_DRAGGING : CURSOR_LEFT_PTR; } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct image *image = data; if (button == BTN_LEFT) { image->button_pressed = state == WL_POINTER_BUTTON_STATE_PRESSED; if (state == WL_POINTER_BUTTON_STATE_PRESSED) input_set_pointer_image(input, CURSOR_DRAGGING); else input_set_pointer_image(input, CURSOR_LEFT_PTR); } } static void zoom(struct image *image, double scale) { double x = image->pointer.x; double y = image->pointer.y; cairo_matrix_t scale_matrix; if (!image->initialized) return; if (get_scale(image) * scale > 20.0 || get_scale(image) * scale < 0.02) return; cairo_matrix_init_identity(&scale_matrix); cairo_matrix_translate(&scale_matrix, x, y); cairo_matrix_scale(&scale_matrix, scale, scale); cairo_matrix_translate(&scale_matrix, -x, -y); cairo_matrix_multiply(&image->matrix, &image->matrix, &scale_matrix); clamp_view(image); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct image *image = data; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (sym) { case XKB_KEY_minus: zoom(image, 0.8); window_schedule_redraw(image->window); break; case XKB_KEY_equal: case XKB_KEY_plus: zoom(image, 1.2); window_schedule_redraw(image->window); break; case XKB_KEY_1: image->matrix.xx = 1.0; image->matrix.xy = 0.0; image->matrix.yx = 0.0; image->matrix.yy = 1.0; clamp_view(image); window_schedule_redraw(image->window); break; } } static void axis_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t axis, wl_fixed_t value, void *data) { struct image *image = data; if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL && input_get_modifiers(input) == MOD_CONTROL_MASK) { /* set zoom level to 2% per 10 axis units */ zoom(image, (1.0 - wl_fixed_to_double(value) / 500.0)); window_schedule_redraw(image->window); } else if (input_get_modifiers(input) == 0) { if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) move_viewport(image, 0, wl_fixed_to_double(value)); else if (axis == WL_POINTER_AXIS_HORIZONTAL_SCROLL) move_viewport(image, wl_fixed_to_double(value), 0); } } static void fullscreen_handler(struct window *window, void *data) { struct image *image = data; image->fullscreen ^= 1; window_set_fullscreen(window, image->fullscreen); } static void close_handler(void *data) { struct image *image = data; *image->image_counter -= 1; if (*image->image_counter == 0) display_exit(image->display); widget_destroy(image->widget); window_destroy(image->window); free(image); } static struct image * image_create(struct display *display, const char *filename, int *image_counter) { struct image *image; char *b, *copy, title[512];; image = zalloc(sizeof *image); if (image == NULL) return image; copy = strdup(filename); b = basename(copy); snprintf(title, sizeof title, "Wayland Image - %s", b); free(copy); image->filename = strdup(filename); image->image = load_cairo_surface(filename); if (!image->image) { free(image->filename); free(image); return NULL; } image->window = window_create(display); image->widget = window_frame_create(image->window, image); window_set_title(image->window, title); image->display = display; image->image_counter = image_counter; *image_counter += 1; image->initialized = false; window_set_user_data(image->window, image); widget_set_redraw_handler(image->widget, redraw_handler); widget_set_resize_handler(image->widget, resize_handler); window_set_keyboard_focus_handler(image->window, keyboard_focus_handler); window_set_fullscreen_handler(image->window, fullscreen_handler); window_set_close_handler(image->window, close_handler); widget_set_enter_handler(image->widget, enter_handler); widget_set_motion_handler(image->widget, motion_handler); widget_set_button_handler(image->widget, button_handler); widget_set_axis_handler(image->widget, axis_handler); window_set_key_handler(image->window, key_handler); widget_schedule_resize(image->widget, 500, 400); return image; } int main(int argc, char *argv[]) { struct display *d; int i; int image_counter = 0; if (argc <= 1 || argv[1][0]=='-') { printf("Usage: %s image...\n", argv[0]); return 1; } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } for (i = 1; i < argc; i++) image_create(d, argv[i], &image_counter); if (image_counter > 0) display_run(d); display_destroy(d); return 0; } weston-1.9.0/clients/simple-egl.c0000664000175000017500000005601012537664635013651 00000000000000/* * Copyright © 2011 Benjamin Franzke * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xdg-shell-client-protocol.h" #include #include #include "protocol/ivi-application-client-protocol.h" #define IVI_SURFACE_ID 9000 #include "shared/platform.h" #ifndef EGL_EXT_swap_buffers_with_damage #define EGL_EXT_swap_buffers_with_damage 1 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC)(EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects); #endif #ifndef EGL_EXT_buffer_age #define EGL_EXT_buffer_age 1 #define EGL_BUFFER_AGE_EXT 0x313D #endif struct window; struct seat; struct display { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct xdg_shell *shell; struct wl_seat *seat; struct wl_pointer *pointer; struct wl_touch *touch; struct wl_keyboard *keyboard; struct wl_shm *shm; struct wl_cursor_theme *cursor_theme; struct wl_cursor *default_cursor; struct wl_surface *cursor_surface; struct { EGLDisplay dpy; EGLContext ctx; EGLConfig conf; } egl; struct window *window; struct ivi_application *ivi_application; PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage; }; struct geometry { int width, height; }; struct window { struct display *display; struct geometry geometry, window_size; struct { GLuint rotation_uniform; GLuint pos; GLuint col; } gl; uint32_t benchmark_time, frames; struct wl_egl_window *native; struct wl_surface *surface; struct xdg_surface *xdg_surface; struct ivi_surface *ivi_surface; EGLSurface egl_surface; struct wl_callback *callback; int fullscreen, opaque, buffer_size, frame_sync; }; static const char *vert_shader_text = "uniform mat4 rotation;\n" "attribute vec4 pos;\n" "attribute vec4 color;\n" "varying vec4 v_color;\n" "void main() {\n" " gl_Position = rotation * pos;\n" " v_color = color;\n" "}\n"; static const char *frag_shader_text = "precision mediump float;\n" "varying vec4 v_color;\n" "void main() {\n" " gl_FragColor = v_color;\n" "}\n"; static int running = 1; static void init_egl(struct display *display, struct window *window) { static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; const char *extensions; EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 1, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; EGLint major, minor, n, count, i, size; EGLConfig *configs; EGLBoolean ret; if (window->opaque || window->buffer_size == 16) config_attribs[9] = 0; display->egl.dpy = weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR, display->display, NULL); assert(display->egl.dpy); ret = eglInitialize(display->egl.dpy, &major, &minor); assert(ret == EGL_TRUE); ret = eglBindAPI(EGL_OPENGL_ES_API); assert(ret == EGL_TRUE); if (!eglGetConfigs(display->egl.dpy, NULL, 0, &count) || count < 1) assert(0); configs = calloc(count, sizeof *configs); assert(configs); ret = eglChooseConfig(display->egl.dpy, config_attribs, configs, count, &n); assert(ret && n >= 1); for (i = 0; i < n; i++) { eglGetConfigAttrib(display->egl.dpy, configs[i], EGL_BUFFER_SIZE, &size); if (window->buffer_size == size) { display->egl.conf = configs[i]; break; } } free(configs); if (display->egl.conf == NULL) { fprintf(stderr, "did not find config with buffer size %d\n", window->buffer_size); exit(EXIT_FAILURE); } display->egl.ctx = eglCreateContext(display->egl.dpy, display->egl.conf, EGL_NO_CONTEXT, context_attribs); assert(display->egl.ctx); display->swap_buffers_with_damage = NULL; extensions = eglQueryString(display->egl.dpy, EGL_EXTENSIONS); if (extensions && strstr(extensions, "EGL_EXT_swap_buffers_with_damage") && strstr(extensions, "EGL_EXT_buffer_age")) display->swap_buffers_with_damage = (PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) eglGetProcAddress("eglSwapBuffersWithDamageEXT"); if (display->swap_buffers_with_damage) printf("has EGL_EXT_buffer_age and EGL_EXT_swap_buffers_with_damage\n"); } static void fini_egl(struct display *display) { eglTerminate(display->egl.dpy); eglReleaseThread(); } static GLuint create_shader(struct window *window, const char *source, GLenum shader_type) { GLuint shader; GLint status; shader = glCreateShader(shader_type); assert(shader != 0); glShaderSource(shader, 1, (const char **) &source, NULL); glCompileShader(shader); glGetShaderiv(shader, GL_COMPILE_STATUS, &status); if (!status) { char log[1000]; GLsizei len; glGetShaderInfoLog(shader, 1000, &len, log); fprintf(stderr, "Error: compiling %s: %*s\n", shader_type == GL_VERTEX_SHADER ? "vertex" : "fragment", len, log); exit(1); } return shader; } static void init_gl(struct window *window) { GLuint frag, vert; GLuint program; GLint status; frag = create_shader(window, frag_shader_text, GL_FRAGMENT_SHADER); vert = create_shader(window, vert_shader_text, GL_VERTEX_SHADER); program = glCreateProgram(); glAttachShader(program, frag); glAttachShader(program, vert); glLinkProgram(program); glGetProgramiv(program, GL_LINK_STATUS, &status); if (!status) { char log[1000]; GLsizei len; glGetProgramInfoLog(program, 1000, &len, log); fprintf(stderr, "Error: linking:\n%*s\n", len, log); exit(1); } glUseProgram(program); window->gl.pos = 0; window->gl.col = 1; glBindAttribLocation(program, window->gl.pos, "pos"); glBindAttribLocation(program, window->gl.col, "color"); glLinkProgram(program); window->gl.rotation_uniform = glGetUniformLocation(program, "rotation"); } static void handle_surface_configure(void *data, struct xdg_surface *surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) { struct window *window = data; uint32_t *p; window->fullscreen = 0; wl_array_for_each(p, states) { uint32_t state = *p; switch (state) { case XDG_SURFACE_STATE_FULLSCREEN: window->fullscreen = 1; break; } } if (width > 0 && height > 0) { if (!window->fullscreen) { window->window_size.width = width; window->window_size.height = height; } window->geometry.width = width; window->geometry.height = height; } else if (!window->fullscreen) { window->geometry = window->window_size; } if (window->native) wl_egl_window_resize(window->native, window->geometry.width, window->geometry.height, 0, 0); xdg_surface_ack_configure(surface, serial); } static void handle_surface_delete(void *data, struct xdg_surface *xdg_surface) { running = 0; } static const struct xdg_surface_listener xdg_surface_listener = { handle_surface_configure, handle_surface_delete, }; static void handle_ivi_surface_configure(void *data, struct ivi_surface *ivi_surface, int32_t width, int32_t height) { struct window *window = data; wl_egl_window_resize(window->native, width, height, 0, 0); window->geometry.width = width; window->geometry.height = height; if (!window->fullscreen) window->window_size = window->geometry; } static const struct ivi_surface_listener ivi_surface_listener = { handle_ivi_surface_configure, }; static void create_xdg_surface(struct window *window, struct display *display) { window->xdg_surface = xdg_shell_get_xdg_surface(display->shell, window->surface); xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); xdg_surface_set_title(window->xdg_surface, "simple-egl"); } static void create_ivi_surface(struct window *window, struct display *display) { uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid(); window->ivi_surface = ivi_application_surface_create(display->ivi_application, id_ivisurf, window->surface); if (window->ivi_surface == NULL) { fprintf(stderr, "Failed to create ivi_client_surface\n"); abort(); } ivi_surface_add_listener(window->ivi_surface, &ivi_surface_listener, window); } static void create_surface(struct window *window) { struct display *display = window->display; EGLBoolean ret; window->surface = wl_compositor_create_surface(display->compositor); window->native = wl_egl_window_create(window->surface, window->geometry.width, window->geometry.height); window->egl_surface = weston_platform_create_egl_surface(display->egl.dpy, display->egl.conf, window->native, NULL); if (display->shell) { create_xdg_surface(window, display); } else if (display->ivi_application ) { create_ivi_surface(window, display); } else { assert(0); } ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface, window->egl_surface, window->display->egl.ctx); assert(ret == EGL_TRUE); if (!window->frame_sync) eglSwapInterval(display->egl.dpy, 0); if (!display->shell) return; if (window->fullscreen) xdg_surface_set_fullscreen(window->xdg_surface, NULL); } static void destroy_surface(struct window *window) { /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() * on eglReleaseThread(). */ eglMakeCurrent(window->display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroySurface(window->display->egl.dpy, window->egl_surface); wl_egl_window_destroy(window->native); if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface); if (window->display->ivi_application) ivi_surface_destroy(window->ivi_surface); wl_surface_destroy(window->surface); if (window->callback) wl_callback_destroy(window->callback); } static void redraw(void *data, struct wl_callback *callback, uint32_t time) { struct window *window = data; struct display *display = window->display; static const GLfloat verts[3][2] = { { -0.5, -0.5 }, { 0.5, -0.5 }, { 0, 0.5 } }; static const GLfloat colors[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; GLfloat angle; GLfloat rotation[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } }; static const uint32_t speed_div = 5, benchmark_interval = 5; struct wl_region *region; EGLint rect[4]; EGLint buffer_age = 0; struct timeval tv; assert(window->callback == callback); window->callback = NULL; if (callback) wl_callback_destroy(callback); gettimeofday(&tv, NULL); time = tv.tv_sec * 1000 + tv.tv_usec / 1000; if (window->frames == 0) window->benchmark_time = time; if (time - window->benchmark_time > (benchmark_interval * 1000)) { printf("%d frames in %d seconds: %f fps\n", window->frames, benchmark_interval, (float) window->frames / benchmark_interval); window->benchmark_time = time; window->frames = 0; } angle = (time / speed_div) % 360 * M_PI / 180.0; rotation[0][0] = cos(angle); rotation[0][2] = sin(angle); rotation[2][0] = -sin(angle); rotation[2][2] = cos(angle); if (display->swap_buffers_with_damage) eglQuerySurface(display->egl.dpy, window->egl_surface, EGL_BUFFER_AGE_EXT, &buffer_age); glViewport(0, 0, window->geometry.width, window->geometry.height); glUniformMatrix4fv(window->gl.rotation_uniform, 1, GL_FALSE, (GLfloat *) rotation); glClearColor(0.0, 0.0, 0.0, 0.5); glClear(GL_COLOR_BUFFER_BIT); glVertexAttribPointer(window->gl.pos, 2, GL_FLOAT, GL_FALSE, 0, verts); glVertexAttribPointer(window->gl.col, 3, GL_FLOAT, GL_FALSE, 0, colors); glEnableVertexAttribArray(window->gl.pos); glEnableVertexAttribArray(window->gl.col); glDrawArrays(GL_TRIANGLES, 0, 3); glDisableVertexAttribArray(window->gl.pos); glDisableVertexAttribArray(window->gl.col); if (window->opaque || window->fullscreen) { region = wl_compositor_create_region(window->display->compositor); wl_region_add(region, 0, 0, window->geometry.width, window->geometry.height); wl_surface_set_opaque_region(window->surface, region); wl_region_destroy(region); } else { wl_surface_set_opaque_region(window->surface, NULL); } if (display->swap_buffers_with_damage && buffer_age > 0) { rect[0] = window->geometry.width / 4 - 1; rect[1] = window->geometry.height / 4 - 1; rect[2] = window->geometry.width / 2 + 2; rect[3] = window->geometry.height / 2 + 2; display->swap_buffers_with_damage(display->egl.dpy, window->egl_surface, rect, 1); } else { eglSwapBuffers(display->egl.dpy, window->egl_surface); } window->frames++; } static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy) { struct display *display = data; struct wl_buffer *buffer; struct wl_cursor *cursor = display->default_cursor; struct wl_cursor_image *image; if (display->window->fullscreen) wl_pointer_set_cursor(pointer, serial, NULL, 0, 0); else if (cursor) { image = display->default_cursor->images[0]; buffer = wl_cursor_image_get_buffer(image); if (!buffer) return; wl_pointer_set_cursor(pointer, serial, display->cursor_surface, image->hotspot_x, image->hotspot_y); wl_surface_attach(display->cursor_surface, buffer, 0, 0); wl_surface_damage(display->cursor_surface, 0, 0, image->width, image->height); wl_surface_commit(display->cursor_surface); } } static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) { } static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { } static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { struct display *display = data; if (!display->window->xdg_surface) return; if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) xdg_surface_move(display->window->xdg_surface, display->seat, serial); } static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { } static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, }; static void touch_handle_down(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct display *d = (struct display *)data; if (!d->shell) return; xdg_surface_move(d->window->xdg_surface, d->seat, serial); } static void touch_handle_up(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id) { } static void touch_handle_motion(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { } static void touch_handle_frame(void *data, struct wl_touch *wl_touch) { } static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) { } static const struct wl_touch_listener touch_listener = { touch_handle_down, touch_handle_up, touch_handle_motion, touch_handle_frame, touch_handle_cancel, }; static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { } static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { } static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { } static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) { struct display *d = data; if (!d->shell) return; if (key == KEY_F11 && state) { if (d->window->fullscreen) xdg_surface_unset_fullscreen(d->window->xdg_surface); else xdg_surface_set_fullscreen(d->window->xdg_surface, NULL); } else if (key == KEY_ESC && state) running = 0; } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { } static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, }; static void seat_handle_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps) { struct display *d = data; if ((caps & WL_SEAT_CAPABILITY_POINTER) && !d->pointer) { d->pointer = wl_seat_get_pointer(seat); wl_pointer_add_listener(d->pointer, &pointer_listener, d); } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && d->pointer) { wl_pointer_destroy(d->pointer); d->pointer = NULL; } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !d->keyboard) { d->keyboard = wl_seat_get_keyboard(seat); wl_keyboard_add_listener(d->keyboard, &keyboard_listener, d); } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && d->keyboard) { wl_keyboard_destroy(d->keyboard); d->keyboard = NULL; } if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !d->touch) { d->touch = wl_seat_get_touch(seat); wl_touch_set_user_data(d->touch, d); wl_touch_add_listener(d->touch, &touch_listener, d); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && d->touch) { wl_touch_destroy(d->touch); d->touch = NULL; } } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, }; static void xdg_shell_ping(void *data, struct xdg_shell *shell, uint32_t serial) { xdg_shell_pong(shell, serial); } static const struct xdg_shell_listener xdg_shell_listener = { xdg_shell_ping, }; #define XDG_VERSION 5 /* The version of xdg-shell that we implement */ #ifdef static_assert static_assert(XDG_VERSION == XDG_SHELL_VERSION_CURRENT, "Interface version doesn't match implementation version"); #endif static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "xdg_shell") == 0) { d->shell = wl_registry_bind(registry, name, &xdg_shell_interface, 1); xdg_shell_add_listener(d->shell, &xdg_shell_listener, d); xdg_shell_use_unstable_version(d->shell, XDG_VERSION); } else if (strcmp(interface, "wl_seat") == 0) { d->seat = wl_registry_bind(registry, name, &wl_seat_interface, 1); wl_seat_add_listener(d->seat, &seat_listener, d); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); d->cursor_theme = wl_cursor_theme_load(NULL, 32, d->shm); if (!d->cursor_theme) { fprintf(stderr, "unable to load default theme\n"); return; } d->default_cursor = wl_cursor_theme_get_cursor(d->cursor_theme, "left_ptr"); if (!d->default_cursor) { fprintf(stderr, "unable to load default left pointer\n"); // TODO: abort ? } } else if (strcmp(interface, "ivi_application") == 0) { d->ivi_application = wl_registry_bind(registry, name, &ivi_application_interface, 1); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static void signal_int(int signum) { running = 0; } static void usage(int error_code) { fprintf(stderr, "Usage: simple-egl [OPTIONS]\n\n" " -f\tRun in fullscreen mode\n" " -o\tCreate an opaque surface\n" " -s\tUse a 16 bpp EGL config\n" " -b\tDon't sync to compositor redraw (eglSwapInterval 0)\n" " -h\tThis help text\n\n"); exit(error_code); } int main(int argc, char **argv) { struct sigaction sigint; struct display display = { 0 }; struct window window = { 0 }; int i, ret = 0; window.display = &display; display.window = &window; window.geometry.width = 250; window.geometry.height = 250; window.window_size = window.geometry; window.buffer_size = 32; window.frame_sync = 1; for (i = 1; i < argc; i++) { if (strcmp("-f", argv[i]) == 0) window.fullscreen = 1; else if (strcmp("-o", argv[i]) == 0) window.opaque = 1; else if (strcmp("-s", argv[i]) == 0) window.buffer_size = 16; else if (strcmp("-b", argv[i]) == 0) window.frame_sync = 0; else if (strcmp("-h", argv[i]) == 0) usage(EXIT_SUCCESS); else usage(EXIT_FAILURE); } display.display = wl_display_connect(NULL); assert(display.display); display.registry = wl_display_get_registry(display.display); wl_registry_add_listener(display.registry, ®istry_listener, &display); wl_display_dispatch(display.display); init_egl(&display, &window); create_surface(&window); init_gl(&window); display.cursor_surface = wl_compositor_create_surface(display.compositor); sigint.sa_handler = signal_int; sigemptyset(&sigint.sa_mask); sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); /* The mainloop here is a little subtle. Redrawing will cause * EGL to read events so we can just call * wl_display_dispatch_pending() to handle any events that got * queued up as a side effect. */ while (running && ret != -1) { wl_display_dispatch_pending(display.display); redraw(&window, NULL, 0); } fprintf(stderr, "simple-egl exiting\n"); destroy_surface(&window); fini_egl(&display); wl_surface_destroy(display.cursor_surface); if (display.cursor_theme) wl_cursor_theme_destroy(display.cursor_theme); if (display.shell) xdg_shell_destroy(display.shell); if (display.ivi_application) ivi_application_destroy(display.ivi_application); if (display.compositor) wl_compositor_destroy(display.compositor); wl_registry_destroy(display.registry); wl_display_flush(display.display); wl_display_disconnect(display.display); return 0; } weston-1.9.0/clients/simple-damage.c0000664000175000017500000005441112537664635014323 00000000000000/* * Copyright © 2014 Jason Ekstrand * Copyright © 2011 Benjamin Franzke * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include "shared/os-compatibility.h" #include "xdg-shell-client-protocol.h" #include "fullscreen-shell-client-protocol.h" #include "scaler-client-protocol.h" int print_debug = 0; struct display { struct wl_display *display; struct wl_registry *registry; int compositor_version; struct wl_compositor *compositor; struct wl_scaler *scaler; struct xdg_shell *shell; struct _wl_fullscreen_shell *fshell; struct wl_shm *shm; uint32_t formats; }; struct buffer { struct wl_buffer *buffer; uint32_t *shm_data; int busy; }; enum window_flags { WINDOW_FLAG_USE_VIEWPORT = 0x1, WINDOW_FLAG_ROTATING_TRANSFORM = 0x2, }; struct window { struct display *display; int width, height, border; struct wl_surface *surface; struct wl_viewport *viewport; struct xdg_surface *xdg_surface; struct wl_callback *callback; struct buffer buffers[2]; struct buffer *prev_buffer; enum window_flags flags; int scale; enum wl_output_transform transform; struct { float x, y; /* position in pixels */ float dx, dy; /* velocity in pixels/second */ int radius; /* radius in pixels */ uint32_t prev_time; } ball; }; static int running = 1; static void buffer_release(void *data, struct wl_buffer *buffer) { struct buffer *mybuf = data; mybuf->busy = 0; } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static int create_shm_buffer(struct display *display, struct buffer *buffer, int width, int height, uint32_t format) { struct wl_shm_pool *pool; int fd, size, pitch; void *data; pitch = width * 4; size = pitch * height; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return -1; } data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { fprintf(stderr, "mmap failed: %m\n"); close(fd); return -1; } pool = wl_shm_create_pool(display->shm, fd, size); buffer->buffer = wl_shm_pool_create_buffer(pool, 0, width, height, pitch, format); wl_buffer_add_listener(buffer->buffer, &buffer_listener, buffer); wl_shm_pool_destroy(pool); close(fd); buffer->shm_data = data; return 0; } static void handle_configure(void *data, struct xdg_surface *surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) { } static void handle_close(void *data, struct xdg_surface *xdg_surface) { running = 0; } static const struct xdg_surface_listener xdg_surface_listener = { handle_configure, handle_close, }; static float bounded_randf(float a, float b) { return a + ((float)rand() / (float)RAND_MAX) * (b - a); } static void window_init_game(struct window *window) { int ax1, ay1, ax2, ay2; /* playable arena size */ struct timeval tv; gettimeofday(&tv, NULL); srand(tv.tv_usec); window->ball.radius = 10; ax1 = window->border + window->ball.radius; ay1 = window->border + window->ball.radius; ax2 = window->width - window->border - window->ball.radius; ay2 = window->height - window->border - window->ball.radius; window->ball.x = bounded_randf(ax1, ax2); window->ball.y = bounded_randf(ay1, ay2); window->ball.dx = bounded_randf(0, window->width); window->ball.dy = bounded_randf(0, window->height); window->ball.prev_time = 0; } static void window_advance_game(struct window *window, uint32_t timestamp) { int ax1, ay1, ax2, ay2; /* Arena size */ float dt; if (window->ball.prev_time == 0) { /* first pass, don't do anything */ window->ball.prev_time = timestamp; return; } /* dt in seconds */ dt = (float)(timestamp - window->ball.prev_time) / 1000.0f; ax1 = window->border + window->ball.radius; ay1 = window->border + window->ball.radius; ax2 = window->width - window->border - window->ball.radius; ay2 = window->height - window->border - window->ball.radius; window->ball.x += window->ball.dx * dt; while (window->ball.x < ax1 || ax2 < window->ball.x) { if (window->ball.x < ax1) window->ball.x = 2 * ax1 - window->ball.x; if (ax2 <= window->ball.x) window->ball.x = 2 * ax2 - window->ball.x; window->ball.dx *= -1.0f; } window->ball.y += window->ball.dy * dt; while (window->ball.y < ay1 || ay2 < window->ball.y) { if (window->ball.y < ay1) window->ball.y = 2 * ay1 - window->ball.y; if (ay2 <= window->ball.y) window->ball.y = 2 * ay2 - window->ball.y; window->ball.dy *= -1.0f; } window->ball.prev_time = timestamp; } static struct window * create_window(struct display *display, int width, int height, enum wl_output_transform transform, int scale, enum window_flags flags) { struct window *window; if (display->compositor_version < 2 && (transform != WL_OUTPUT_TRANSFORM_NORMAL || flags & WINDOW_FLAG_ROTATING_TRANSFORM)) { fprintf(stderr, "wl_surface.buffer_transform unsupported in " "wl_surface version %d\n", display->compositor_version); exit(1); } if (display->compositor_version < 3 && (! (flags & WINDOW_FLAG_USE_VIEWPORT)) && scale != 1) { fprintf(stderr, "wl_surface.buffer_scale unsupported in " "wl_surface version %d\n", display->compositor_version); exit(1); } if (display->scaler == NULL && (flags & WINDOW_FLAG_USE_VIEWPORT)) { fprintf(stderr, "Compositor does not support wl_viewport"); exit(1); } window = calloc(1, sizeof *window); if (!window) return NULL; window->callback = NULL; window->display = display; window->width = width; window->height = height; window->border = 10; window->flags = flags; window->transform = transform; window->scale = scale; window_init_game(window); window->surface = wl_compositor_create_surface(display->compositor); if (window->flags & WINDOW_FLAG_USE_VIEWPORT) window->viewport = wl_scaler_get_viewport(display->scaler, window->surface); if (display->shell) { window->xdg_surface = xdg_shell_get_xdg_surface(display->shell, window->surface); assert(window->xdg_surface); xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); xdg_surface_set_title(window->xdg_surface, "simple-damage"); } else if (display->fshell) { _wl_fullscreen_shell_present_surface(display->fshell, window->surface, _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT, NULL); } else { assert(0); } /* Initialise damage to full surface, so the padding gets painted */ wl_surface_damage(window->surface, 0, 0, INT32_MAX, INT32_MAX); return window; } static void destroy_window(struct window *window) { if (window->callback) wl_callback_destroy(window->callback); if (window->buffers[0].buffer) wl_buffer_destroy(window->buffers[0].buffer); if (window->buffers[1].buffer) wl_buffer_destroy(window->buffers[1].buffer); if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface); if (window->viewport) wl_viewport_destroy(window->viewport); wl_surface_destroy(window->surface); free(window); } static struct buffer * window_next_buffer(struct window *window) { struct buffer *buffer; int ret = 0, bwidth, bheight; if (!window->buffers[0].busy) buffer = &window->buffers[0]; else if (!window->buffers[1].busy) buffer = &window->buffers[1]; else return NULL; switch (window->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_180: bwidth = window->width * window->scale; bheight = window->height * window->scale; break; case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: bwidth = window->height * window->scale; bheight = window->width * window->scale; break; } if (!buffer->buffer) { ret = create_shm_buffer(window->display, buffer, bwidth, bheight, WL_SHM_FORMAT_ARGB8888); if (ret < 0) return NULL; } return buffer; } static void paint_box(uint32_t *pixels, int pitch, int x, int y, int width, int height, uint32_t color) { int i, j; for (j = y; j < y + height; ++j) for (i = x; i < x + width; ++i) pixels[i + j * pitch] = color; } static void paint_circle(uint32_t *pixels, int pitch, float x, float y, int radius, uint32_t color) { int i, j; for (j = y - radius; j <= (int)(y + radius); ++j) for (i = x - radius; i <= (int)(x + radius); ++i) if ((j+0.5f-y)*(j+0.5f-y) + (i+0.5f-x)*(i+0.5f-x) <= radius * radius) pixels[i + j * pitch] = color; } static void window_get_transformed_ball(struct window *window, float *bx, float *by) { float wx, wy; wx = window->ball.x; wy = window->ball.y; switch (window->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: *bx = wx; *by = wy; break; case WL_OUTPUT_TRANSFORM_90: *bx = window->height - wy; *by = wx; break; case WL_OUTPUT_TRANSFORM_180: *bx = window->width - wx; *by = window->height - wy; break; case WL_OUTPUT_TRANSFORM_270: *bx = wy; *by = window->width - wx; break; case WL_OUTPUT_TRANSFORM_FLIPPED: *bx = window->width - wx; *by = wy; break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: *bx = window->height - wy; *by = window->width - wx; break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: *bx = wx; *by = window->height - wy; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: *bx = wy; *by = wx; break; } *bx *= window->scale; *by *= window->scale; if (window->viewport) { /* We're drawing half-size because of the viewport */ *bx /= 2; *by /= 2; } } static const struct wl_callback_listener frame_listener; static void redraw(void *data, struct wl_callback *callback, uint32_t time) { struct window *window = data; struct buffer *buffer; int off_x, off_y, bwidth, bheight, bborder, bpitch, bradius; uint32_t *buffer_data; float bx, by; buffer = window_next_buffer(window); if (!buffer) { fprintf(stderr, !callback ? "Failed to create the first buffer.\n" : "Both buffers busy at redraw(). Server bug?\n"); abort(); } /* Rotate the damage, but keep the even/odd parity so the * dimensions of the buffers don't change */ if (window->flags & WINDOW_FLAG_ROTATING_TRANSFORM) window->transform = (window->transform + 2) % 8; switch (window->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: case WL_OUTPUT_TRANSFORM_180: case WL_OUTPUT_TRANSFORM_FLIPPED: case WL_OUTPUT_TRANSFORM_FLIPPED_180: bwidth = window->width * window->scale; bheight = window->height * window->scale; break; case WL_OUTPUT_TRANSFORM_90: case WL_OUTPUT_TRANSFORM_270: case WL_OUTPUT_TRANSFORM_FLIPPED_90: case WL_OUTPUT_TRANSFORM_FLIPPED_270: bwidth = window->height * window->scale; bheight = window->width * window->scale; break; } bpitch = bwidth; bborder = window->border * window->scale; bradius = window->ball.radius * window->scale; buffer_data = buffer->shm_data; if (window->viewport) { /* Fill the whole thing with red to detect viewport errors */ paint_box(buffer->shm_data, bpitch, 0, 0, bwidth, bheight, 0xffff0000); /* The buffer is the same size. However, we crop it * and scale it up by a factor of 2 */ bborder /= 2; bradius /= 2; bwidth /= 2; bheight /= 2; /* Offset the drawing region */ off_x = (window->width / 3) * window->scale; off_y = (window->height / 5) * window->scale; switch (window->transform) { default: case WL_OUTPUT_TRANSFORM_NORMAL: buffer_data += off_y * bpitch + off_x; break; case WL_OUTPUT_TRANSFORM_90: buffer_data += off_x * bpitch + (bwidth - off_y); break; case WL_OUTPUT_TRANSFORM_180: buffer_data += (bheight - off_y) * bpitch + (bwidth - off_x); break; case WL_OUTPUT_TRANSFORM_270: buffer_data += (bheight - off_x) * bpitch + off_y; break; case WL_OUTPUT_TRANSFORM_FLIPPED: buffer_data += off_y * bpitch + (bwidth - off_x); break; case WL_OUTPUT_TRANSFORM_FLIPPED_90: buffer_data += (bheight - off_x) * bpitch + (bwidth - off_y); break; case WL_OUTPUT_TRANSFORM_FLIPPED_180: buffer_data += (bheight - off_y) * bpitch + off_x; break; case WL_OUTPUT_TRANSFORM_FLIPPED_270: buffer_data += off_x * bpitch + off_y; break; } wl_viewport_set_source(window->viewport, wl_fixed_from_int(window->width / 3), wl_fixed_from_int(window->height / 5), wl_fixed_from_int(window->width / 2), wl_fixed_from_int(window->height / 2)); } /* Paint the border */ paint_box(buffer_data, bpitch, 0, 0, bwidth, bborder, 0xffffffff); paint_box(buffer_data, bpitch, 0, 0, bborder, bheight, 0xffffffff); paint_box(buffer_data, bpitch, bwidth - bborder, 0, bborder, bheight, 0xffffffff); paint_box(buffer_data, bpitch, 0, bheight - bborder, bwidth, bborder, 0xffffffff); /* fill with translucent */ paint_box(buffer_data, bpitch, bborder, bborder, bwidth - 2 * bborder, bheight - 2 * bborder, 0x80000000); /* Damage where the ball was */ wl_surface_damage(window->surface, window->ball.x - window->ball.radius, window->ball.y - window->ball.radius, window->ball.radius * 2 + 1, window->ball.radius * 2 + 1); window_advance_game(window, time); window_get_transformed_ball(window, &bx, &by); /* Paint the ball */ paint_circle(buffer_data, bpitch, bx, by, bradius, 0xff00ff00); if (print_debug) { printf("Ball now located at (%f, %f)\n", window->ball.x, window->ball.y); printf("Circle painted at (%f, %f), radius %d\n", bx, by, bradius); printf("Buffer damage rectangle: (%d, %d) @ %dx%d\n", (int)(bx - bradius), (int)(by - bradius), bradius * 2 + 1, bradius * 2 + 1); } /* Damage where the ball is now */ wl_surface_damage(window->surface, window->ball.x - window->ball.radius, window->ball.y - window->ball.radius, window->ball.radius * 2 + 1, window->ball.radius * 2 + 1); wl_surface_attach(window->surface, buffer->buffer, 0, 0); if (window->display->compositor_version >= 2 && (window->transform != WL_OUTPUT_TRANSFORM_NORMAL || window->flags & WINDOW_FLAG_ROTATING_TRANSFORM)) wl_surface_set_buffer_transform(window->surface, window->transform); if (window->viewport) wl_viewport_set_destination(window->viewport, window->width, window->height); if (window->scale != 1) wl_surface_set_buffer_scale(window->surface, window->scale); if (callback) wl_callback_destroy(callback); window->callback = wl_surface_frame(window->surface); wl_callback_add_listener(window->callback, &frame_listener, window); wl_surface_commit(window->surface); buffer->busy = 1; } static const struct wl_callback_listener frame_listener = { redraw }; static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct display *d = data; d->formats |= (1 << format); } struct wl_shm_listener shm_listener = { shm_format }; static void xdg_shell_ping(void *data, struct xdg_shell *shell, uint32_t serial) { xdg_shell_pong(shell, serial); } static const struct xdg_shell_listener xdg_shell_listener = { xdg_shell_ping, }; #define XDG_VERSION 5 /* The version of xdg-shell that we implement */ #ifdef static_assert static_assert(XDG_VERSION == XDG_SHELL_VERSION_CURRENT, "Interface version doesn't match implementation version"); #endif static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { if (d->compositor_version > (int)version) { fprintf(stderr, "Compositor does not support " "wl_surface version %d\n", d->compositor_version); exit(1); } if (d->compositor_version < 0) d->compositor_version = version; d->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, d->compositor_version); } else if (strcmp(interface, "wl_scaler") == 0 && version >= 2) { d->scaler = wl_registry_bind(registry, id, &wl_scaler_interface, 2); } else if (strcmp(interface, "xdg_shell") == 0) { d->shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1); xdg_shell_use_unstable_version(d->shell, XDG_VERSION); xdg_shell_add_listener(d->shell, &xdg_shell_listener, d); } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) { d->fshell = wl_registry_bind(registry, id, &_wl_fullscreen_shell_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(d->shm, &shm_listener, d); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static struct display * create_display(int version) { struct display *display; display = malloc(sizeof *display); if (display == NULL) { fprintf(stderr, "out of memory\n"); exit(1); } display->display = wl_display_connect(NULL); assert(display->display); display->compositor_version = version; display->formats = 0; display->registry = wl_display_get_registry(display->display); wl_registry_add_listener(display->registry, ®istry_listener, display); wl_display_roundtrip(display->display); if (display->shm == NULL) { fprintf(stderr, "No wl_shm global\n"); exit(1); } wl_display_roundtrip(display->display); if (!(display->formats & (1 << WL_SHM_FORMAT_XRGB8888))) { fprintf(stderr, "WL_SHM_FORMAT_XRGB32 not available\n"); exit(1); } return display; } static void destroy_display(struct display *display) { if (display->shm) wl_shm_destroy(display->shm); if (display->shell) xdg_shell_destroy(display->shell); if (display->fshell) _wl_fullscreen_shell_release(display->fshell); if (display->scaler) wl_scaler_destroy(display->scaler); if (display->compositor) wl_compositor_destroy(display->compositor); wl_registry_destroy(display->registry); wl_display_flush(display->display); wl_display_disconnect(display->display); free(display); } static void signal_int(int signum) { running = 0; } static void print_usage(int retval) { printf( "usage: weston-simple-damage [options]\n\n" "options:\n" " -h, --help\t\tPring this help\n" " --verbose\t\tPrint verbose log information\n" " --version=VERSION\tVersion of wl_surface to use\n" " --width=WIDTH\t\tWidth of the window\n" " --height=HEIGHT\tHeight of the window\n" " --scale=SCALE\t\tScale factor for the surface\n" " --transform=TRANSFORM\tTransform for the surface\n" " --rotating-transform\tUse a different buffer_transform for each frame\n" " --use-viewport\tUse wl_viewport\n" ); exit(retval); } static int parse_transform(const char *str, enum wl_output_transform *transform) { int i; static const struct { const char *name; enum wl_output_transform transform; } names[] = { { "normal", WL_OUTPUT_TRANSFORM_NORMAL }, { "90", WL_OUTPUT_TRANSFORM_90 }, { "180", WL_OUTPUT_TRANSFORM_180 }, { "270", WL_OUTPUT_TRANSFORM_270 }, { "flipped", WL_OUTPUT_TRANSFORM_FLIPPED }, { "flipped-90", WL_OUTPUT_TRANSFORM_FLIPPED_90 }, { "flipped-180", WL_OUTPUT_TRANSFORM_FLIPPED_180 }, { "flipped-270", WL_OUTPUT_TRANSFORM_FLIPPED_270 }, }; for (i = 0; i < 8; i++) { if (strcmp(names[i].name, str) == 0) { *transform = names[i].transform; return 1; } } return 0; } int main(int argc, char **argv) { struct sigaction sigint; struct display *display; struct window *window; int i, ret = 0; int version = -1; int width = 300, height = 200, scale = 1; enum wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; enum window_flags flags = 0; for (i = 1; i < argc; ++i) { if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { print_usage(0); } else if (sscanf(argv[i], "--version=%d", &version) > 0) { if (version < 1 || version > 3) { fprintf(stderr, "Unsupported wl_surface version: %d\n", version); return 1; } continue; } else if (strcmp(argv[i], "--verbose") == 0) { print_debug = 1; continue; } else if (sscanf(argv[i], "--width=%d", &width) > 0) { continue; } else if (sscanf(argv[i], "--height=%d", &height) > 0) { continue; } else if (strncmp(argv[i], "--transform=", 12) == 0 && parse_transform(argv[i] + 12, &transform) > 0) { continue; } else if (strcmp(argv[i], "--rotating-transform") == 0) { flags |= WINDOW_FLAG_ROTATING_TRANSFORM; continue; } else if (sscanf(argv[i], "--scale=%d", &scale) > 0) { continue; } else if (strcmp(argv[i], "--use-viewport") == 0) { flags |= WINDOW_FLAG_USE_VIEWPORT; continue; } else { printf("Invalid option: %s\n", argv[i]); print_usage(255); } } display = create_display(version); window = create_window(display, width, height, transform, scale, flags); if (!window) return 1; sigint.sa_handler = signal_int; sigemptyset(&sigint.sa_mask); sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); redraw(window, NULL, 0); while (running && ret != -1) ret = wl_display_dispatch(display->display); fprintf(stderr, "simple-shm exiting\n"); destroy_window(window); destroy_display(display); return 0; } weston-1.9.0/clients/stacking.c0000664000175000017500000001725212537664701013415 00000000000000/* * Copyright © 2013 Collabora Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "shared/helpers.h" #include "window.h" struct stacking { struct display *display; struct window *root_window; }; static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data); static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data); static void keyboard_focus_handler(struct window *window, struct input *device, void *data); static void fullscreen_handler(struct window *window, void *data); static void redraw_handler(struct widget *widget, void *data); /* Iff parent_window is set, the new window will be transient. */ static struct window * new_window(struct stacking *stacking, struct window *parent_window) { struct window *new_window; struct widget *new_widget; new_window = window_create(stacking->display); window_set_parent(new_window, parent_window); new_widget = window_frame_create(new_window, new_window); window_set_title(new_window, "Stacking Test"); window_set_key_handler(new_window, key_handler); window_set_keyboard_focus_handler(new_window, keyboard_focus_handler); window_set_fullscreen_handler(new_window, fullscreen_handler); widget_set_button_handler(new_widget, button_handler); widget_set_redraw_handler(new_widget, redraw_handler); window_set_user_data(new_window, stacking); window_schedule_resize(new_window, 300, 300); return new_window; } static void show_popup_cb(void *data, struct input *input, int index) { /* Ignore the selected menu item. */ } static void show_popup(struct stacking *stacking, struct input *input, uint32_t time, struct window *window) { int32_t x, y; static const char *entries[] = { "Test Entry", "Another Test Entry", }; input_get_position(input, &x, &y); window_show_menu(stacking->display, input, time, window, x, y, show_popup_cb, entries, ARRAY_LENGTH(entries)); } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct stacking *stacking = data; switch (button) { case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) show_popup(stacking, input, time, widget_get_user_data(widget)); break; case BTN_LEFT: default: break; } } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct stacking *stacking = data; if (state != WL_KEYBOARD_KEY_STATE_PRESSED) return; switch (sym) { case XKB_KEY_f: fullscreen_handler(window, data); break; case XKB_KEY_m: window_set_maximized(window, !window_is_maximized(window)); break; case XKB_KEY_n: /* New top-level window. */ new_window(stacking, NULL); break; case XKB_KEY_p: show_popup(stacking, input, time, window); break; case XKB_KEY_q: exit (0); break; case XKB_KEY_t: /* New transient window. */ new_window(stacking, window); break; default: break; } } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { window_schedule_redraw(window); } static void fullscreen_handler(struct window *window, void *data) { window_set_fullscreen(window, !window_is_fullscreen(window)); } static void draw_string(cairo_t *cr, const char *fmt, ...) __attribute__((format (gnu_printf, 2, 3))); static void draw_string(cairo_t *cr, const char *fmt, ...) { char buffer[4096]; char *p, *end; va_list argp; cairo_text_extents_t text_extents; cairo_font_extents_t font_extents; cairo_save(cr); cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 14); cairo_font_extents(cr, &font_extents); va_start(argp, fmt); vsnprintf(buffer, sizeof(buffer), fmt, argp); p = buffer; while (*p) { end = strchr(p, '\n'); if (end) *end = 0; cairo_show_text(cr, p); cairo_text_extents(cr, p, &text_extents); cairo_rel_move_to(cr, -text_extents.x_advance, font_extents.height); if (end) p = end + 1; else break; } va_end(argp); cairo_restore(cr); } static void set_window_background_colour(cairo_t *cr, struct window *window) { if (window_get_parent(window)) cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 0.4); else if (window_is_maximized(window)) cairo_set_source_rgba(cr, 1.0, 1.0, 0.0, 0.6); else if (window_is_fullscreen(window)) cairo_set_source_rgba(cr, 0.0, 1.0, 1.0, 0.6); else cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0); } static void redraw_handler(struct widget *widget, void *data) { struct window *window; struct rectangle allocation; cairo_t *cr; widget_get_allocation(widget, &allocation); window = widget_get_user_data(widget); cr = widget_cairo_create(widget); cairo_translate(cr, allocation.x, allocation.y); /* Draw background. */ cairo_push_group(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); set_window_background_colour(cr, window); cairo_rectangle(cr, 0, 0, allocation.width, allocation.height); cairo_fill(cr); cairo_pop_group_to_source(cr); cairo_paint(cr); /* Print the instructions. */ cairo_move_to(cr, 5, 15); cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); draw_string(cr, "Window: %p\n" "Fullscreen? %u\n" "Maximized? %u\n" "Transient? %u\n" "Keys: (f)ullscreen, (m)aximize,\n" " (n)ew window, (p)opup,\n" " (q)uit, (t)ransient window\n", window, window_is_fullscreen(window), window_is_maximized(window), window_get_parent(window) ? 1 : 0); cairo_destroy(cr); } int main(int argc, char *argv[]) { struct stacking stacking; memset(&stacking, 0, sizeof stacking); #ifdef HAVE_PANGO g_type_init(); #endif stacking.display = display_create(&argc, argv); if (stacking.display == NULL) { fprintf(stderr, "Failed to create display: %m\n"); return -1; } display_set_user_data(stacking.display, &stacking); stacking.root_window = new_window(&stacking, NULL); display_run(stacking.display); window_destroy(stacking.root_window); display_destroy(stacking.display); return 0; } weston-1.9.0/clients/calibrator.c0000664000175000017500000001564712537664701013742 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "window.h" #include "shared/helpers.h" #include "shared/matrix.h" /* Our points for the calibration must be not be on a line */ static const struct { float x_ratio, y_ratio; } test_ratios[] = { { 0.20, 0.40 }, { 0.80, 0.60 }, { 0.40, 0.80 } }; struct calibrator { struct tests { int32_t drawn_x, drawn_y; int32_t clicked_x, clicked_y; } tests[ARRAY_LENGTH(test_ratios)]; int current_test; struct display *display; struct window *window; struct widget *widget; }; /* * Calibration algorithm: * * The equation we want to apply at event time where x' and y' are the * calibrated co-ordinates. * * x' = Ax + By + C * y' = Dx + Ey + F * * For example "zero calibration" would be A=1.0 B=0.0 C=0.0, D=0.0, E=1.0, * and F=0.0. * * With 6 unknowns we need 6 equations to find the constants: * * x1' = Ax1 + By1 + C * y1' = Dx1 + Ey1 + F * ... * x3' = Ax3 + By3 + C * y3' = Dx3 + Ey3 + F * * In matrix form: * * x1' x1 y1 1 A * x2' = x2 y2 1 x B * x3' x3 y3 1 C * * So making the matrix M we can find the constants with: * * A x1' * B = M^-1 x x2' * C x3' * * (and similarly for D, E and F) * * For the calibration the desired values x, y are the same values at which * we've drawn at. * */ static void finish_calibration (struct calibrator *calibrator) { struct weston_matrix m; struct weston_matrix inverse; struct weston_vector x_calib, y_calib; int i; /* * x1 y1 1 0 * x2 y2 1 0 * x3 y3 1 0 * 0 0 0 1 */ memset(&m, 0, sizeof(m)); for (i = 0; i < (int)ARRAY_LENGTH(test_ratios); i++) { m.d[i] = calibrator->tests[i].clicked_x; m.d[i + 4] = calibrator->tests[i].clicked_y; m.d[i + 8] = 1; } m.d[15] = 1; weston_matrix_invert(&inverse, &m); memset(&x_calib, 0, sizeof(x_calib)); memset(&y_calib, 0, sizeof(y_calib)); for (i = 0; i < (int)ARRAY_LENGTH(test_ratios); i++) { x_calib.f[i] = calibrator->tests[i].drawn_x; y_calib.f[i] = calibrator->tests[i].drawn_y; } /* Multiples into the vector */ weston_matrix_transform(&inverse, &x_calib); weston_matrix_transform(&inverse, &y_calib); printf ("Calibration values: %f %f %f %f %f %f\n", x_calib.f[0], x_calib.f[1], x_calib.f[2], y_calib.f[0], y_calib.f[1], y_calib.f[2]); exit(0); } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct calibrator *calibrator = data; int32_t x, y; if (state == WL_POINTER_BUTTON_STATE_PRESSED && button == BTN_LEFT) { input_get_position(input, &x, &y); calibrator->tests[calibrator->current_test].clicked_x = x; calibrator->tests[calibrator->current_test].clicked_y = y; calibrator->current_test--; if (calibrator->current_test < 0) finish_calibration(calibrator); } widget_schedule_redraw(widget); } static void touch_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct calibrator *calibrator = data; calibrator->tests[calibrator->current_test].clicked_x = x; calibrator->tests[calibrator->current_test].clicked_y = y; calibrator->current_test--; if (calibrator->current_test < 0) finish_calibration(calibrator); widget_schedule_redraw(widget); } static void redraw_handler(struct widget *widget, void *data) { struct calibrator *calibrator = data; struct rectangle allocation; cairo_surface_t *surface; cairo_t *cr; int32_t drawn_x, drawn_y; widget_get_allocation(calibrator->widget, &allocation); surface = window_get_surface(calibrator->window); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 1.0); cairo_paint(cr); drawn_x = test_ratios[calibrator->current_test].x_ratio * allocation.width; drawn_y = test_ratios[calibrator->current_test].y_ratio * allocation.height; calibrator->tests[calibrator->current_test].drawn_x = drawn_x; calibrator->tests[calibrator->current_test].drawn_y = drawn_y; cairo_translate(cr, drawn_x, drawn_y); cairo_set_line_width(cr, 2.0); cairo_set_source_rgb(cr, 1.0, 0.0, 0.0); cairo_move_to(cr, 0, -10.0); cairo_line_to(cr, 0, 10.0); cairo_stroke(cr); cairo_move_to(cr, -10.0, 0); cairo_line_to(cr, 10.0, 0.0); cairo_stroke(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static struct calibrator * calibrator_create(struct display *display) { struct calibrator *calibrator; calibrator = malloc(sizeof *calibrator); if (calibrator == NULL) return NULL; calibrator->window = window_create(display); calibrator->widget = window_add_widget(calibrator->window, calibrator); window_set_title(calibrator->window, "Wayland calibrator"); calibrator->display = display; calibrator->current_test = ARRAY_LENGTH(test_ratios) - 1; widget_set_button_handler(calibrator->widget, button_handler); widget_set_touch_down_handler(calibrator->widget, touch_handler); widget_set_redraw_handler(calibrator->widget, redraw_handler); window_set_fullscreen(calibrator->window, 1); return calibrator; } static void calibrator_destroy(struct calibrator *calibrator) { widget_destroy(calibrator->widget); window_destroy(calibrator->window); free(calibrator); } int main(int argc, char *argv[]) { struct display *display; struct calibrator *calibrator; display = display_create(&argc, argv); if (display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } calibrator = calibrator_create(display); if (!calibrator) return -1; display_run(display); calibrator_destroy(calibrator); display_destroy(display); return 0; } weston-1.9.0/clients/flower.c0000664000175000017500000001256112537627702013106 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "window.h" struct flower { struct display *display; struct window *window; struct widget *widget; int width, height; }; static void set_random_color(cairo_t *cr) { cairo_set_source_rgba(cr, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 50) / 49.0, 0.5 + (random() % 100) / 99.0); } static void draw_stuff(cairo_surface_t *surface, int width, int height) { const int petal_count = 3 + random() % 5; const double r1 = 60 + random() % 35; const double r2 = 20 + random() % 40; const double u = (10 + random() % 90) / 100.0; const double v = (random() % 90) / 100.0; cairo_t *cr; int i; double t, dt = 2 * M_PI / (petal_count * 2); double x1, y1, x2, y2, x3, y3; cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 0); cairo_paint(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_translate(cr, width / 2, height / 2); cairo_move_to(cr, cos(0) * r1, sin(0) * r1); for (t = 0, i = 0; i < petal_count; i++, t += dt * 2) { x1 = cos(t) * r1; y1 = sin(t) * r1; x2 = cos(t + dt) * r2; y2 = sin(t + dt) * r2; x3 = cos(t + 2 * dt) * r1; y3 = sin(t + 2 * dt) * r1; cairo_curve_to(cr, x1 - y1 * u, y1 + x1 * u, x2 + y2 * v, y2 - x2 * v, x2, y2); cairo_curve_to(cr, x2 - y2 * v, y2 + x2 * v, x3 + y3 * u, y3 - x3 * u, x3, y3); } cairo_close_path(cr); set_random_color(cr); cairo_fill_preserve(cr); set_random_color(cr); cairo_stroke(cr); cairo_destroy(cr); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct flower *flower = data; /* Dont resize me */ widget_set_size(flower->widget, flower->width, flower->height); } static void redraw_handler(struct widget *widget, void *data) { struct flower *flower = data; cairo_surface_t *surface; surface = window_get_surface(flower->window); if (surface == NULL || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { fprintf(stderr, "failed to create cairo egl surface\n"); return; } draw_stuff(surface, flower->width, flower->height); cairo_surface_destroy(surface); } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct flower *flower = data; switch (button) { case BTN_LEFT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) window_move(flower->window, input, display_get_serial(flower->display)); break; case BTN_MIDDLE: if (state == WL_POINTER_BUTTON_STATE_PRESSED) widget_schedule_redraw(widget); break; case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) window_show_frame_menu(flower->window, input, time); break; } } static void touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct flower *flower = data; window_move(flower->window, input, display_get_serial(flower->display)); } int main(int argc, char *argv[]) { struct flower flower; struct display *d; struct timeval tv; d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } gettimeofday(&tv, NULL); srandom(tv.tv_usec); flower.width = 200; flower.height = 200; flower.display = d; flower.window = window_create(d); flower.widget = window_add_widget(flower.window, &flower); window_set_title(flower.window, "Flower"); widget_set_resize_handler(flower.widget, resize_handler); widget_set_redraw_handler(flower.widget, redraw_handler); widget_set_button_handler(flower.widget, button_handler); widget_set_default_cursor(flower.widget, CURSOR_HAND1); widget_set_touch_down_handler(flower.widget, touch_down_handler); window_schedule_resize(flower.window, flower.width, flower.height); display_run(d); widget_destroy(flower.widget); window_destroy(flower.window); display_destroy(d); return 0; } weston-1.9.0/clients/nested-client.c0000664000175000017500000002134412537627702014345 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include "../shared/platform.h" struct window; struct seat; struct nested_client { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; EGLDisplay egl_display; EGLContext egl_context; EGLConfig egl_config; EGLSurface egl_surface; struct program *color_program; GLuint vert, frag, program; GLuint rotation; GLuint pos; GLuint col; struct wl_surface *surface; struct wl_egl_window *native; int width, height; }; #define POS 0 #define COL 1 static GLuint create_shader(const char *source, GLenum shader_type) { GLuint shader; GLint status; shader = glCreateShader(shader_type); if (shader == 0) return 0; glShaderSource(shader, 1, (const char **) &source, NULL); glCompileShader(shader); glGetShaderiv(shader, GL_COMPILE_STATUS, &status); if (!status) { char log[1000]; GLsizei len; glGetShaderInfoLog(shader, 1000, &len, log); fprintf(stderr, "Error: compiling %s: %*s\n", shader_type == GL_VERTEX_SHADER ? "vertex" : "fragment", len, log); return 0; } return shader; } static void create_program(struct nested_client *client, const char *vert, const char *frag) { GLint status; client->vert = create_shader(vert, GL_VERTEX_SHADER); client->frag = create_shader(frag, GL_FRAGMENT_SHADER); client->program = glCreateProgram(); glAttachShader(client->program, client->frag); glAttachShader(client->program, client->vert); glBindAttribLocation(client->program, POS, "pos"); glBindAttribLocation(client->program, COL, "color"); glLinkProgram(client->program); glGetProgramiv(client->program, GL_LINK_STATUS, &status); if (!status) { char log[1000]; GLsizei len; glGetProgramInfoLog(client->program, 1000, &len, log); fprintf(stderr, "Error: linking:\n%*s\n", len, log); exit(1); } client->rotation = glGetUniformLocation(client->program, "rotation"); } static const char vertex_shader_text[] = "uniform mat4 rotation;\n" "attribute vec4 pos;\n" "attribute vec4 color;\n" "varying vec4 v_color;\n" "void main() {\n" " gl_Position = rotation * pos;\n" " v_color = color;\n" "}\n"; static const char color_fragment_shader_text[] = "precision mediump float;\n" "varying vec4 v_color;\n" "void main() {\n" " gl_FragColor = v_color;\n" "}\n"; static void render_triangle(struct nested_client *client, uint32_t time) { static const GLfloat verts[3][2] = { { -0.5, -0.5 }, { 0.5, -0.5 }, { 0, 0.5 } }; static const GLfloat colors[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; GLfloat angle; GLfloat rotation[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } }; static const int32_t speed_div = 5; static uint32_t start_time = 0; if (client->program == 0) create_program(client, vertex_shader_text, color_fragment_shader_text); if (start_time == 0) start_time = time; angle = ((time - start_time) / speed_div) % 360 * M_PI / 180.0; rotation[0][0] = cos(angle); rotation[0][2] = sin(angle); rotation[2][0] = -sin(angle); rotation[2][2] = cos(angle); glClearColor(0.4, 0.4, 0.4, 1.0); glClear(GL_COLOR_BUFFER_BIT); glUseProgram(client->program); glViewport(0, 0, client->width, client->height); glUniformMatrix4fv(client->rotation, 1, GL_FALSE, (GLfloat *) rotation); glVertexAttribPointer(POS, 2, GL_FLOAT, GL_FALSE, 0, verts); glVertexAttribPointer(COL, 3, GL_FLOAT, GL_FALSE, 0, colors); glEnableVertexAttribArray(POS); glEnableVertexAttribArray(COL); glDrawArrays(GL_TRIANGLES, 0, 3); glDisableVertexAttribArray(POS); glDisableVertexAttribArray(COL); glFlush(); } static void frame_callback(void *data, struct wl_callback *callback, uint32_t time); static const struct wl_callback_listener frame_listener = { frame_callback }; static void frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct nested_client *client = data; if (callback) wl_callback_destroy(callback); callback = wl_surface_frame(client->surface); wl_callback_add_listener(callback, &frame_listener, client); render_triangle(client, time); eglSwapBuffers(client->egl_display, client->egl_surface); } static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct nested_client *client = data; if (strcmp(interface, "wl_compositor") == 0) { client->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static struct nested_client * nested_client_create(void) { static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; static const EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 1, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; EGLint major, minor, n; EGLBoolean ret; struct nested_client *client; client = malloc(sizeof *client); if (client == NULL) return NULL; client->width = 250; client->height = 250; client->display = wl_display_connect(NULL); client->registry = wl_display_get_registry(client->display); wl_registry_add_listener(client->registry, ®istry_listener, client); /* get globals */ wl_display_roundtrip(client->display); client->egl_display = weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR, client->display, NULL); if (client->egl_display == NULL) return NULL; ret = eglInitialize(client->egl_display, &major, &minor); if (!ret) return NULL; ret = eglBindAPI(EGL_OPENGL_ES_API); if (!ret) return NULL; ret = eglChooseConfig(client->egl_display, config_attribs, &client->egl_config, 1, &n); if (!ret || n != 1) return NULL; client->egl_context = eglCreateContext(client->egl_display, client->egl_config, EGL_NO_CONTEXT, context_attribs); if (!client->egl_context) return NULL; client->surface = wl_compositor_create_surface(client->compositor); client->native = wl_egl_window_create(client->surface, client->width, client->height); client->egl_surface = weston_platform_create_egl_surface(client->egl_display, client->egl_config, client->native, NULL); eglMakeCurrent(client->egl_display, client->egl_surface, client->egl_surface, client->egl_context); wl_egl_window_resize(client->native, client->width, client->height, 0, 0); frame_callback(client, NULL, 0); return client; } static void nested_client_destroy(struct nested_client *client) { eglMakeCurrent(client->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); wl_egl_window_destroy(client->native); wl_surface_destroy(client->surface); if (client->compositor) wl_compositor_destroy(client->compositor); wl_registry_destroy(client->registry); wl_display_flush(client->display); wl_display_disconnect(client->display); } int main(int argc, char **argv) { struct nested_client *client; int ret = 0; if (getenv("WAYLAND_SOCKET") == NULL) { fprintf(stderr, "must be run by nested, don't run standalone\n"); return EXIT_FAILURE; } client = nested_client_create(); if (client == NULL) return EXIT_FAILURE; while (ret != -1) ret = wl_display_dispatch(client->display); nested_client_destroy(client); return 0; } weston-1.9.0/clients/clickdot.c0000664000175000017500000002155612537664716013416 00000000000000/* * Copyright © 2010 Intel Corporation * Copyright © 2012 Collabora, Ltd. * Copyright © 2012 Jonas Ådahl * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" #include "shared/helpers.h" struct clickdot { struct display *display; struct window *window; struct widget *widget; cairo_surface_t *buffer; struct { int32_t x, y; } dot; struct { int32_t x, y; int32_t old_x, old_y; } line; int reset; struct input *cursor_timeout_input; int cursor_timeout_fd; struct task cursor_timeout_task; }; static void draw_line(struct clickdot *clickdot, cairo_t *cr, struct rectangle *allocation) { cairo_t *bcr; cairo_surface_t *tmp_buffer = NULL; if (clickdot->reset) { tmp_buffer = clickdot->buffer; clickdot->buffer = NULL; clickdot->line.x = -1; clickdot->line.y = -1; clickdot->line.old_x = -1; clickdot->line.old_y = -1; clickdot->reset = 0; } if (clickdot->buffer == NULL) { clickdot->buffer = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, allocation->width, allocation->height); bcr = cairo_create(clickdot->buffer); cairo_set_source_rgba(bcr, 0, 0, 0, 0); cairo_rectangle(bcr, 0, 0, allocation->width, allocation->height); cairo_fill(bcr); } else bcr = cairo_create(clickdot->buffer); if (tmp_buffer) { cairo_set_source_surface(bcr, tmp_buffer, 0, 0); cairo_rectangle(bcr, 0, 0, allocation->width, allocation->height); cairo_clip(bcr); cairo_paint(bcr); cairo_surface_destroy(tmp_buffer); } if (clickdot->line.x != -1 && clickdot->line.y != -1) { if (clickdot->line.old_x != -1 && clickdot->line.old_y != -1) { cairo_set_line_width(bcr, 2.0); cairo_set_source_rgb(bcr, 1, 1, 1); cairo_translate(bcr, -allocation->x, -allocation->y); cairo_move_to(bcr, clickdot->line.old_x, clickdot->line.old_y); cairo_line_to(bcr, clickdot->line.x, clickdot->line.y); cairo_stroke(bcr); } clickdot->line.old_x = clickdot->line.x; clickdot->line.old_y = clickdot->line.y; } cairo_destroy(bcr); cairo_set_source_surface(cr, clickdot->buffer, allocation->x, allocation->y); cairo_set_operator(cr, CAIRO_OPERATOR_ADD); cairo_rectangle(cr, allocation->x, allocation->y, allocation->width, allocation->height); cairo_clip(cr); cairo_paint(cr); } static void redraw_handler(struct widget *widget, void *data) { static const double r = 10.0; struct clickdot *clickdot = data; cairo_surface_t *surface; cairo_t *cr; struct rectangle allocation; widget_get_allocation(clickdot->widget, &allocation); surface = window_get_surface(clickdot->window); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_set_source_rgba(cr, 0, 0, 0, 0.8); cairo_fill(cr); draw_line(clickdot, cr, &allocation); cairo_translate(cr, clickdot->dot.x + 0.5, clickdot->dot.y + 0.5); cairo_set_line_width(cr, 1.0); cairo_set_source_rgb(cr, 0.1, 0.9, 0.9); cairo_move_to(cr, 0.0, -r); cairo_line_to(cr, 0.0, r); cairo_move_to(cr, -r, 0.0); cairo_line_to(cr, r, 0.0); cairo_arc(cr, 0.0, 0.0, r, 0.0, 2.0 * M_PI); cairo_stroke(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct clickdot *clickdot = data; window_schedule_redraw(clickdot->window); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct clickdot *clickdot = data; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (sym) { case XKB_KEY_Escape: display_exit(clickdot->display); break; } } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct clickdot *clickdot = data; if (state == WL_POINTER_BUTTON_STATE_PRESSED && button == BTN_LEFT) input_get_position(input, &clickdot->dot.x, &clickdot->dot.y); widget_schedule_redraw(widget); } static void cursor_timeout_reset(struct clickdot *clickdot) { const long cursor_timeout = 500; struct itimerspec its; its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = cursor_timeout / 1000; its.it_value.tv_nsec = (cursor_timeout % 1000) * 1000 * 1000; timerfd_settime(clickdot->cursor_timeout_fd, 0, &its, NULL); } static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct clickdot *clickdot = data; clickdot->line.x = x; clickdot->line.y = y; window_schedule_redraw(clickdot->window); cursor_timeout_reset(clickdot); clickdot->cursor_timeout_input = input; return CURSOR_BLANK; } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct clickdot *clickdot = data; clickdot->reset = 1; } static void leave_handler(struct widget *widget, struct input *input, void *data) { struct clickdot *clickdot = data; clickdot->reset = 1; } static void cursor_timeout_func(struct task *task, uint32_t events) { struct clickdot *clickdot = container_of(task, struct clickdot, cursor_timeout_task); uint64_t exp; if (read(clickdot->cursor_timeout_fd, &exp, sizeof (uint64_t)) != sizeof(uint64_t)) abort(); input_set_pointer_image(clickdot->cursor_timeout_input, CURSOR_LEFT_PTR); } static struct clickdot * clickdot_create(struct display *display) { struct clickdot *clickdot; clickdot = xzalloc(sizeof *clickdot); clickdot->window = window_create(display); clickdot->widget = window_frame_create(clickdot->window, clickdot); window_set_title(clickdot->window, "Wayland ClickDot"); clickdot->display = display; clickdot->buffer = NULL; window_set_key_handler(clickdot->window, key_handler); window_set_user_data(clickdot->window, clickdot); window_set_keyboard_focus_handler(clickdot->window, keyboard_focus_handler); widget_set_redraw_handler(clickdot->widget, redraw_handler); widget_set_button_handler(clickdot->widget, button_handler); widget_set_motion_handler(clickdot->widget, motion_handler); widget_set_resize_handler(clickdot->widget, resize_handler); widget_set_leave_handler(clickdot->widget, leave_handler); widget_schedule_resize(clickdot->widget, 500, 400); clickdot->dot.x = 250; clickdot->dot.y = 200; clickdot->line.x = -1; clickdot->line.y = -1; clickdot->line.old_x = -1; clickdot->line.old_y = -1; clickdot->reset = 0; clickdot->cursor_timeout_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC); clickdot->cursor_timeout_task.run = cursor_timeout_func; display_watch_fd(window_get_display(clickdot->window), clickdot->cursor_timeout_fd, EPOLLIN, &clickdot->cursor_timeout_task); return clickdot; } static void clickdot_destroy(struct clickdot *clickdot) { display_unwatch_fd(window_get_display(clickdot->window), clickdot->cursor_timeout_fd); close(clickdot->cursor_timeout_fd); if (clickdot->buffer) cairo_surface_destroy(clickdot->buffer); widget_destroy(clickdot->widget); window_destroy(clickdot->window); free(clickdot); } int main(int argc, char *argv[]) { struct display *display; struct clickdot *clickdot; display = display_create(&argc, argv); if (display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } clickdot = clickdot_create(display); display_run(display); clickdot_destroy(clickdot); display_destroy(display); return 0; } weston-1.9.0/clients/presentation-shm.c0000664000175000017500000005204112552056467015106 00000000000000/* * Copyright © 2011 Benjamin Franzke * Copyright © 2010 Intel Corporation * Copyright © 2014 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "shared/os-compatibility.h" #include "presentation_timing-client-protocol.h" enum run_mode { RUN_MODE_FEEDBACK, RUN_MODE_FEEDBACK_IDLE, RUN_MODE_PRESENT, }; static const char * const run_mode_name[] = { [RUN_MODE_FEEDBACK] = "feedback", [RUN_MODE_FEEDBACK_IDLE] = "feedback-idle", [RUN_MODE_PRESENT] = "low-lat present", }; struct output { struct wl_output *output; uint32_t name; struct wl_list link; }; struct display { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shell *shell; struct wl_shm *shm; uint32_t formats; struct presentation *presentation; clockid_t clk_id; struct wl_list output_list; /* struct output::link */ }; struct feedback { struct window *window; unsigned frame_no; struct presentation_feedback *feedback; struct timespec commit; struct timespec target; uint32_t frame_stamp; struct wl_list link; struct timespec present; }; struct buffer { struct wl_buffer *buffer; void *shm_data; int busy; }; struct window { struct display *display; int width, height; enum run_mode mode; struct wl_surface *surface; struct wl_shell_surface *shell_surface; struct buffer *buffers; int num_buffers; int next; int refresh_nsec; int commit_delay_msecs; struct wl_callback *callback; struct wl_list feedback_list; struct feedback *received_feedback; }; #define NSEC_PER_SEC 1000000000 static void buffer_release(void *data, struct wl_buffer *buffer) { struct buffer *mybuf = data; mybuf->busy = 0; } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static int create_shm_buffers(struct display *display, struct buffer **buffers, int num_buffers, int width, int height, uint32_t format) { struct buffer *bufs; struct wl_shm_pool *pool; int fd, size, stride, offset; void *data; int i; stride = width * 4; size = stride * height * num_buffers; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return -1; } data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == MAP_FAILED) { fprintf(stderr, "mmap failed: %m\n"); close(fd); return -1; } pool = wl_shm_create_pool(display->shm, fd, size); offset = 0; bufs = calloc(num_buffers, sizeof(*bufs)); assert(bufs); for (i = 0; i < num_buffers; i++) { bufs[i].buffer = wl_shm_pool_create_buffer(pool, offset, width, height, stride, format); assert(bufs[i].buffer); wl_buffer_add_listener(bufs[i].buffer, &buffer_listener, &bufs[i]); bufs[i].shm_data = (char *)data + offset; offset += stride * height; } wl_shm_pool_destroy(pool); close(fd); *buffers = bufs; return 0; } static void handle_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial) { wl_shell_surface_pong(shell_surface, serial); } static void handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t edges, int32_t width, int32_t height) { } static void handle_popup_done(void *data, struct wl_shell_surface *shell_surface) { } static const struct wl_shell_surface_listener shell_surface_listener = { handle_ping, handle_configure, handle_popup_done }; static struct window * create_window(struct display *display, int width, int height, enum run_mode mode, int commit_delay_msecs) { struct window *window; char title[128]; int ret; snprintf(title, sizeof(title), "presentation-shm: %s [Delay %i msecs]", run_mode_name[mode], commit_delay_msecs); window = calloc(1, sizeof *window); if (!window) return NULL; window->commit_delay_msecs = commit_delay_msecs; window->mode = mode; window->callback = NULL; wl_list_init(&window->feedback_list); window->display = display; window->width = width; window->height = height; window->surface = wl_compositor_create_surface(display->compositor); window->shell_surface = wl_shell_get_shell_surface(display->shell, window->surface); if (window->shell_surface) wl_shell_surface_add_listener(window->shell_surface, &shell_surface_listener, window); wl_shell_surface_set_title(window->shell_surface, title); wl_shell_surface_set_toplevel(window->shell_surface); window->num_buffers = 60; window->refresh_nsec = NSEC_PER_SEC / 60; /* 60 Hz guess */ window->next = 0; ret = create_shm_buffers(window->display, &window->buffers, window->num_buffers, window->width, window->height, WL_SHM_FORMAT_XRGB8888); assert(ret == 0); return window; } static void destroy_feedback(struct feedback *feedback) { if (feedback->feedback) presentation_feedback_destroy(feedback->feedback); wl_list_remove(&feedback->link); free(feedback); } static void destroy_window(struct window *window) { int i; while (!wl_list_empty(&window->feedback_list)) { struct feedback *f; f = wl_container_of(window->feedback_list.next, f, link); printf("clean up feedback %u\n", f->frame_no); destroy_feedback(f); } if (window->callback) wl_callback_destroy(window->callback); wl_shell_surface_destroy(window->shell_surface); wl_surface_destroy(window->surface); for (i = 0; i < window->num_buffers; i++) wl_buffer_destroy(window->buffers[i].buffer); /* munmap(window->buffers[0].shm_data, size); */ free(window->buffers); free(window); } static struct buffer * window_next_buffer(struct window *window) { struct buffer *buf = &window->buffers[window->next]; window->next = (window->next + 1) % window->num_buffers; return buf; } static void paint_pixels(void *image, int width, int height, uint32_t phase) { const int halfh = height / 2; const int halfw = width / 2; uint32_t *pixel = image; int y, or; double ang = M_PI * 2.0 / 1000000.0 * phase; double s = sin(ang); double c = cos(ang); /* squared radii thresholds */ or = (halfw < halfh ? halfw : halfh) - 16; or *= or; for (y = 0; y < height; y++) { int x; int oy = y - halfh; int y2 = oy * oy; for (x = 0; x < width; x++) { int ox = x - halfw; uint32_t v = 0xff000000; double rx, ry; if (ox * ox + y2 > or) { if (ox * oy > 0) *pixel++ = 0xff000000; else *pixel++ = 0xffffffff; continue; } rx = c * ox + s * oy; ry = -s * ox + c * oy; if (rx < 0.0) v |= 0x00ff0000; if (ry < 0.0) v |= 0x0000ff00; if ((rx < 0.0) == (ry < 0.0)) v |= 0x000000ff; *pixel++ = v; } } } static void feedback_sync_output(void *data, struct presentation_feedback *presentation_feedback, struct wl_output *output) { /* not interested */ } static char * pflags_to_str(uint32_t flags, char *str, unsigned len) { static const struct { uint32_t flag; char sym; } desc[] = { { PRESENTATION_FEEDBACK_KIND_VSYNC, 's' }, { PRESENTATION_FEEDBACK_KIND_HW_CLOCK, 'c' }, { PRESENTATION_FEEDBACK_KIND_HW_COMPLETION, 'e' }, { PRESENTATION_FEEDBACK_KIND_ZERO_COPY, 'z' }, }; unsigned i; *str = '\0'; if (len < ARRAY_LENGTH(desc) + 1) return str; for (i = 0; i < ARRAY_LENGTH(desc); i++) str[i] = flags & desc[i].flag ? desc[i].sym : '_'; str[ARRAY_LENGTH(desc)] = '\0'; return str; } static uint32_t timespec_to_ms(const struct timespec *ts) { return (uint32_t)ts->tv_sec * 1000 + ts->tv_nsec / 1000000; } static void timespec_from_proto(struct timespec *tm, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec) { tm->tv_sec = ((uint64_t)tv_sec_hi << 32) + tv_sec_lo; tm->tv_nsec = tv_nsec; } static int timespec_diff_to_usec(const struct timespec *a, const struct timespec *b) { time_t secs = a->tv_sec - b->tv_sec; long nsec = a->tv_nsec - b->tv_nsec; return secs * 1000000 + nsec / 1000; } static void feedback_presented(void *data, struct presentation_feedback *presentation_feedback, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh_nsec, uint32_t seq_hi, uint32_t seq_lo, uint32_t flags) { struct feedback *feedback = data; struct window *window = feedback->window; struct feedback *prev_feedback = window->received_feedback; uint64_t seq = ((uint64_t)seq_hi << 32) + seq_lo; const struct timespec *prevpresent; uint32_t commit, present; uint32_t f2c, c2p, f2p; int p2p, t2p; char flagstr[10]; timespec_from_proto(&feedback->present, tv_sec_hi, tv_sec_lo, tv_nsec); commit = timespec_to_ms(&feedback->commit); present = timespec_to_ms(&feedback->present); if (prev_feedback) prevpresent = &prev_feedback->present; else prevpresent = &feedback->present; f2c = commit - feedback->frame_stamp; c2p = present - commit; f2p = present - feedback->frame_stamp; p2p = timespec_diff_to_usec(&feedback->present, prevpresent); t2p = timespec_diff_to_usec(&feedback->present, &feedback->target); switch (window->mode) { case RUN_MODE_PRESENT: printf("%6u: c2p %4u ms, p2p %5d us, t2p %6d us, [%s] " "seq %" PRIu64 "\n", feedback->frame_no, c2p, p2p, t2p, pflags_to_str(flags, flagstr, sizeof(flagstr)), seq); break; case RUN_MODE_FEEDBACK: case RUN_MODE_FEEDBACK_IDLE: printf("%6u: f2c %2u ms, c2p %2u ms, f2p %2u ms, p2p %5d us, " "t2p %6d, [%s], seq %" PRIu64 "\n", feedback->frame_no, f2c, c2p, f2p, p2p, t2p, pflags_to_str(flags, flagstr, sizeof(flagstr)), seq); } if (window->received_feedback) destroy_feedback(window->received_feedback); window->received_feedback = feedback; } static void feedback_discarded(void *data, struct presentation_feedback *presentation_feedback) { struct feedback *feedback = data; printf("discarded %u\n", feedback->frame_no); destroy_feedback(feedback); } static const struct presentation_feedback_listener feedback_listener = { feedback_sync_output, feedback_presented, feedback_discarded }; static void window_emulate_rendering(struct window *window) { struct timespec delay; int ret; if (window->commit_delay_msecs <= 0) return; delay.tv_sec = window->commit_delay_msecs / 1000; delay.tv_nsec = (window->commit_delay_msecs % 1000) * 1000000; ret = nanosleep(&delay, NULL); if (ret) printf("nanosleep failed: %m\n"); } static void window_create_feedback(struct window *window, uint32_t frame_stamp) { static unsigned seq; struct presentation *pres = window->display->presentation; struct feedback *feedback; seq++; if (!pres) return; feedback = calloc(1, sizeof *feedback); if (!feedback) return; feedback->window = window; feedback->feedback = presentation_feedback(pres, window->surface); presentation_feedback_add_listener(feedback->feedback, &feedback_listener, feedback); feedback->frame_no = seq; clock_gettime(window->display->clk_id, &feedback->commit); feedback->frame_stamp = frame_stamp; feedback->target = feedback->commit; wl_list_insert(&window->feedback_list, &feedback->link); } static void window_commit_next(struct window *window) { struct buffer *buffer; buffer = window_next_buffer(window); assert(buffer); wl_surface_attach(window->surface, buffer->buffer, 0, 0); wl_surface_damage(window->surface, 0, 0, window->width, window->height); wl_surface_commit(window->surface); buffer->busy = 1; } static const struct wl_callback_listener frame_listener_mode_feedback; static void redraw_mode_feedback(void *data, struct wl_callback *callback, uint32_t time) { struct window *window = data; if (callback && window->mode == RUN_MODE_FEEDBACK_IDLE) sleep(1); if (callback) wl_callback_destroy(callback); window_emulate_rendering(window); window->callback = wl_surface_frame(window->surface); wl_callback_add_listener(window->callback, &frame_listener_mode_feedback, window); window_create_feedback(window, time); window_commit_next(window); } static const struct wl_callback_listener frame_listener_mode_feedback = { redraw_mode_feedback }; static const struct presentation_feedback_listener feedkick_listener; static void window_feedkick(struct window *window) { struct presentation *pres = window->display->presentation; struct presentation_feedback *fback; fback = presentation_feedback(pres, window->surface); presentation_feedback_add_listener(fback, &feedkick_listener, window); } static void feedkick_presented(void *data, struct presentation_feedback *presentation_feedback, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh_nsec, uint32_t seq_hi, uint32_t seq_lo, uint32_t flags) { struct window *window = data; presentation_feedback_destroy(presentation_feedback); window->refresh_nsec = refresh_nsec; switch (window->mode) { case RUN_MODE_PRESENT: window_emulate_rendering(window); window_create_feedback(window, 0); window_feedkick(window); window_commit_next(window); break; case RUN_MODE_FEEDBACK: case RUN_MODE_FEEDBACK_IDLE: assert(0 && "bad mode"); } } static void feedkick_discarded(void *data, struct presentation_feedback *presentation_feedback) { struct window *window = data; presentation_feedback_destroy(presentation_feedback); switch (window->mode) { case RUN_MODE_PRESENT: window_emulate_rendering(window); window_create_feedback(window, 0); window_feedkick(window); window_commit_next(window); break; case RUN_MODE_FEEDBACK: case RUN_MODE_FEEDBACK_IDLE: assert(0 && "bad mode"); } } static const struct presentation_feedback_listener feedkick_listener = { feedback_sync_output, feedkick_presented, feedkick_discarded }; static void firstdraw_mode_burst(struct window *window) { window_emulate_rendering(window); switch (window->mode) { case RUN_MODE_PRESENT: window_create_feedback(window, 0); break; case RUN_MODE_FEEDBACK: case RUN_MODE_FEEDBACK_IDLE: assert(0 && "bad mode"); } window_feedkick(window); window_commit_next(window); } static void window_prerender(struct window *window) { int i; int timefactor = 1000000 / window->num_buffers; for (i = 0; i < window->num_buffers; i++) { struct buffer *buf = &window->buffers[i]; if (buf->busy) fprintf(stderr, "wl_buffer id %u) busy\n", wl_proxy_get_id( (struct wl_proxy *)buf->buffer)); paint_pixels(buf->shm_data, window->width, window->height, i * timefactor); } } static void output_destroy(struct output *o) { wl_output_destroy(o->output); wl_list_remove(&o->link); free(o); } static void display_add_output(struct display *d, uint32_t name, uint32_t version) { struct output *o; o = calloc(1, sizeof(*o)); assert(o); o->output = wl_registry_bind(d->registry, name, &wl_output_interface, 1); o->name = name; wl_list_insert(&d->output_list, &o->link); } static void presentation_clock_id(void *data, struct presentation *presentation, uint32_t clk_id) { struct display *d = data; d->clk_id = clk_id; } static const struct presentation_listener presentation_listener = { presentation_clock_id }; static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct display *d = data; d->formats |= (1 << format); } static const struct wl_shm_listener shm_listener = { shm_format }; static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { d->shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); wl_shm_add_listener(d->shm, &shm_listener, d); } else if (strcmp(interface, "wl_output") == 0) { display_add_output(d, name, version); } else if (strcmp(interface, "presentation") == 0) { d->presentation = wl_registry_bind(registry, name, &presentation_interface, 1); presentation_add_listener(d->presentation, &presentation_listener, d); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { struct display *d = data; struct output *output, *otmp; wl_list_for_each_safe(output, otmp, &d->output_list, link) { if (output->name != name) continue; output_destroy(output); } } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static struct display * create_display(void) { struct display *display; display = malloc(sizeof *display); if (display == NULL) { fprintf(stderr, "out of memory\n"); exit(1); } display->display = wl_display_connect(NULL); assert(display->display); display->formats = 0; display->clk_id = -1; wl_list_init(&display->output_list); display->registry = wl_display_get_registry(display->display); wl_registry_add_listener(display->registry, ®istry_listener, display); wl_display_roundtrip(display->display); if (display->shm == NULL) { fprintf(stderr, "No wl_shm global\n"); exit(1); } wl_display_roundtrip(display->display); if (!(display->formats & (1 << WL_SHM_FORMAT_XRGB8888))) { fprintf(stderr, "WL_SHM_FORMAT_XRGB32 not available\n"); exit(1); } wl_display_get_fd(display->display); return display; } static void destroy_display(struct display *display) { while (!wl_list_empty(&display->output_list)) { struct output *o; o = wl_container_of(display->output_list.next, o, link); output_destroy(o); } if (display->shm) wl_shm_destroy(display->shm); if (display->shell) wl_shell_destroy(display->shell); if (display->compositor) wl_compositor_destroy(display->compositor); wl_registry_destroy(display->registry); wl_display_flush(display->display); wl_display_disconnect(display->display); free(display); } static int running = 1; static void signal_int(int signum) { running = 0; } static void usage(const char *prog, int exit_code) { fprintf(stderr, "Usage: %s [mode] [options]\n" "where 'mode' is one of\n" " -f\t\trun in feedback mode (default)\n" " -i\t\trun in feedback-idle mode; sleep 1s between frames\n" " -p\t\trun in low-latency presentation mode\n" "and 'options' may include\n" " -d msecs\temulate the time used for rendering by a delay \n" "\t\tof the given milliseconds before commit\n\n", prog); fprintf(stderr, "Printed timing statistics, depending on mode:\n" " commit sequence number\n" " f2c: time from frame callback timestamp to commit\n" " c2p: time from commit to presentation\n" " f2p: time from frame callback timestamp to presentation\n" " p2p: time from previous presentation to this one\n" " t2p: time from target timestamp to presentation\n" " seq: MSC\n"); exit(exit_code); } int main(int argc, char **argv) { struct sigaction sigint; struct display *display; struct window *window; int ret = 0; enum run_mode mode = RUN_MODE_FEEDBACK; int i; int commit_delay_msecs = 0; for (i = 1; i < argc; i++) { if (strcmp("-f", argv[i]) == 0) mode = RUN_MODE_FEEDBACK; else if (strcmp("-i", argv[i]) == 0) mode = RUN_MODE_FEEDBACK_IDLE; else if (strcmp("-p", argv[i]) == 0) mode = RUN_MODE_PRESENT; else if ((strcmp("-d", argv[i]) == 0) && (i + 1 < argc)) { i++; commit_delay_msecs = atoi(argv[i]); } else usage(argv[0], EXIT_FAILURE); } display = create_display(); window = create_window(display, 250, 250, mode, commit_delay_msecs); if (!window) return 1; sigint.sa_handler = signal_int; sigemptyset(&sigint.sa_mask); sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); window_prerender(window); switch (mode) { case RUN_MODE_FEEDBACK: case RUN_MODE_FEEDBACK_IDLE: redraw_mode_feedback(window, NULL, 0); break; case RUN_MODE_PRESENT: firstdraw_mode_burst(window); break; } while (running && ret != -1) ret = wl_display_dispatch(display->display); fprintf(stderr, "presentation-shm exiting\n"); destroy_window(window); destroy_display(display); return 0; } weston-1.9.0/clients/smoke.c0000664000175000017500000001754112537627702012731 00000000000000/* * Copyright © 2010 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "window.h" struct smoke { struct display *display; struct window *window; struct widget *widget; int width, height; int current; struct { float *d, *u, *v; } b[2]; }; static void diffuse(struct smoke *smoke, uint32_t time, float *source, float *dest) { float *s, *d; int x, y, k, stride; float t, a = 0.0002; stride = smoke->width; for (k = 0; k < 5; k++) { for (y = 1; y < smoke->height - 1; y++) { s = source + y * stride; d = dest + y * stride; for (x = 1; x < smoke->width - 1; x++) { t = d[x - 1] + d[x + 1] + d[x - stride] + d[x + stride]; d[x] = (s[x] + a * t) / (1 + 4 * a) * 0.995; } } } } static void advect(struct smoke *smoke, uint32_t time, float *uu, float *vv, float *source, float *dest) { float *s, *d; float *u, *v; int x, y, stride; int i, j; float px, py, fx, fy; stride = smoke->width; for (y = 1; y < smoke->height - 1; y++) { d = dest + y * stride; u = uu + y * stride; v = vv + y * stride; for (x = 1; x < smoke->width - 1; x++) { px = x - u[x]; py = y - v[x]; if (px < 0.5) px = 0.5; if (py < 0.5) py = 0.5; if (px > smoke->width - 1.5) px = smoke->width - 1.5; if (py > smoke->height - 1.5) py = smoke->height - 1.5; i = (int) px; j = (int) py; fx = px - i; fy = py - j; s = source + j * stride + i; d[x] = (s[0] * (1 - fx) + s[1] * fx) * (1 - fy) + (s[stride] * (1 - fx) + s[stride + 1] * fx) * fy; } } } static void project(struct smoke *smoke, uint32_t time, float *u, float *v, float *p, float *div) { int x, y, k, l, s; float h; h = 1.0 / smoke->width; s = smoke->width; memset(p, 0, smoke->height * smoke->width); for (y = 1; y < smoke->height - 1; y++) { l = y * s; for (x = 1; x < smoke->width - 1; x++) { div[l + x] = -0.5 * h * (u[l + x + 1] - u[l + x - 1] + v[l + x + s] - v[l + x - s]); p[l + x] = 0; } } for (k = 0; k < 5; k++) { for (y = 1; y < smoke->height - 1; y++) { l = y * s; for (x = 1; x < smoke->width - 1; x++) { p[l + x] = (div[l + x] + p[l + x - 1] + p[l + x + 1] + p[l + x - s] + p[l + x + s]) / 4; } } } for (y = 1; y < smoke->height - 1; y++) { l = y * s; for (x = 1; x < smoke->width - 1; x++) { u[l + x] -= 0.5 * (p[l + x + 1] - p[l + x - 1]) / h; v[l + x] -= 0.5 * (p[l + x + s] - p[l + x - s]) / h; } } } static void render(struct smoke *smoke, cairo_surface_t *surface) { unsigned char *dest; int x, y, width, height, stride; float *s; uint32_t *d, c, a; dest = cairo_image_surface_get_data(surface); width = cairo_image_surface_get_width(surface); height = cairo_image_surface_get_height(surface); stride = cairo_image_surface_get_stride(surface); for (y = 1; y < height - 1; y++) { s = smoke->b[smoke->current].d + y * smoke->height; d = (uint32_t *) (dest + y * stride); for (x = 1; x < width - 1; x++) { c = (int) (s[x] * 800); if (c > 255) c = 255; a = c; if (a < 0x33) a = 0x33; d[x] = (a << 24) | (c << 16) | (c << 8) | c; } } } static void redraw_handler(struct widget *widget, void *data) { struct smoke *smoke = data; uint32_t time = widget_get_last_time(smoke->widget); cairo_surface_t *surface; diffuse(smoke, time / 30, smoke->b[0].u, smoke->b[1].u); diffuse(smoke, time / 30, smoke->b[0].v, smoke->b[1].v); project(smoke, time / 30, smoke->b[1].u, smoke->b[1].v, smoke->b[0].u, smoke->b[0].v); advect(smoke, time / 30, smoke->b[1].u, smoke->b[1].v, smoke->b[1].u, smoke->b[0].u); advect(smoke, time / 30, smoke->b[1].u, smoke->b[1].v, smoke->b[1].v, smoke->b[0].v); project(smoke, time / 30, smoke->b[0].u, smoke->b[0].v, smoke->b[1].u, smoke->b[1].v); diffuse(smoke, time / 30, smoke->b[0].d, smoke->b[1].d); advect(smoke, time / 30, smoke->b[0].u, smoke->b[0].v, smoke->b[1].d, smoke->b[0].d); surface = window_get_surface(smoke->window); render(smoke, surface); window_damage(smoke->window, 0, 0, smoke->width, smoke->height); cairo_surface_destroy(surface); widget_schedule_redraw(smoke->widget); } static void smoke_motion_handler(struct smoke *smoke, float x, float y) { int i, i0, i1, j, j0, j1, k, d = 5; if (x - d < 1) i0 = 1; else i0 = x - d; if (i0 + 2 * d > smoke->width - 1) i1 = smoke->width - 1; else i1 = i0 + 2 * d; if (y - d < 1) j0 = 1; else j0 = y - d; if (j0 + 2 * d > smoke->height - 1) j1 = smoke->height - 1; else j1 = j0 + 2 * d; for (i = i0; i < i1; i++) for (j = j0; j < j1; j++) { k = j * smoke->width + i; smoke->b[0].u[k] += 256 - (random() & 512); smoke->b[0].v[k] += 256 - (random() & 512); smoke->b[0].d[k] += 1; } } static int mouse_motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { smoke_motion_handler(data, x, y); return CURSOR_HAND1; } static void touch_motion_handler(struct widget *widget, struct input *input, uint32_t time, int32_t id, float x, float y, void *data) { smoke_motion_handler(data, x, y); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct smoke *smoke = data; /* Dont resize me */ widget_set_size(smoke->widget, smoke->width, smoke->height); } int main(int argc, char *argv[]) { struct timespec ts; struct smoke smoke; struct display *d; int size; d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } smoke.width = 200; smoke.height = 200; smoke.display = d; smoke.window = window_create(d); smoke.widget = window_add_widget(smoke.window, &smoke); window_set_title(smoke.window, "smoke"); window_set_buffer_type(smoke.window, WINDOW_BUFFER_TYPE_SHM); clock_gettime(CLOCK_MONOTONIC, &ts); srandom(ts.tv_nsec); smoke.current = 0; size = smoke.height * smoke.width; smoke.b[0].d = calloc(size, sizeof(float)); smoke.b[0].u = calloc(size, sizeof(float)); smoke.b[0].v = calloc(size, sizeof(float)); smoke.b[1].d = calloc(size, sizeof(float)); smoke.b[1].u = calloc(size, sizeof(float)); smoke.b[1].v = calloc(size, sizeof(float)); widget_set_motion_handler(smoke.widget, mouse_motion_handler); widget_set_touch_motion_handler(smoke.widget, touch_motion_handler); widget_set_resize_handler(smoke.widget, resize_handler); widget_set_redraw_handler(smoke.widget, redraw_handler); window_set_user_data(smoke.window, &smoke); widget_schedule_resize(smoke.widget, smoke.width, smoke.height); display_run(d); widget_destroy(smoke.widget); window_destroy(smoke.window); display_destroy(d); return 0; } weston-1.9.0/clients/cliptest.c0000664000175000017500000003635512575610240013435 00000000000000/* * Copyright © 2012 Collabora, Ltd. * Copyright © 2012 Rob Clark * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /* cliptest: for debugging calculate_edges() function. * controls: * clip box position: mouse left drag, keys: w a s d * clip box size: mouse right drag, keys: i j k l * surface orientation: mouse wheel, keys: n m * surface transform disable key: r */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "src/vertex-clipping.h" #include "window.h" typedef float GLfloat; struct geometry { pixman_box32_t clip; pixman_box32_t surf; float s; /* sin phi */ float c; /* cos phi */ float phi; }; struct weston_view { struct { int enabled; } transform; struct geometry *geometry; }; static void weston_view_to_global_float(struct weston_view *view, float sx, float sy, float *x, float *y) { struct geometry *g = view->geometry; /* pure rotation around origin by sine and cosine */ *x = g->c * sx + g->s * sy; *y = -g->s * sx + g->c * sy; } /* ---------------------- copied begins -----------------------*/ /* Keep this in sync with what is in gl-renderer.c! */ #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) > (b)) ? (b) : (a)) /* * Compute the boundary vertices of the intersection of the global coordinate * aligned rectangle 'rect', and an arbitrary quadrilateral produced from * 'surf_rect' when transformed from surface coordinates into global coordinates. * The vertices are written to 'ex' and 'ey', and the return value is the * number of vertices. Vertices are produced in clockwise winding order. * Guarantees to produce either zero vertices, or 3-8 vertices with non-zero * polygon area. */ static int calculate_edges(struct weston_view *ev, pixman_box32_t *rect, pixman_box32_t *surf_rect, GLfloat *ex, GLfloat *ey) { struct clip_context ctx; int i, n; GLfloat min_x, max_x, min_y, max_y; struct polygon8 surf = { { surf_rect->x1, surf_rect->x2, surf_rect->x2, surf_rect->x1 }, { surf_rect->y1, surf_rect->y1, surf_rect->y2, surf_rect->y2 }, 4 }; ctx.clip.x1 = rect->x1; ctx.clip.y1 = rect->y1; ctx.clip.x2 = rect->x2; ctx.clip.y2 = rect->y2; /* transform surface to screen space: */ for (i = 0; i < surf.n; i++) weston_view_to_global_float(ev, surf.x[i], surf.y[i], &surf.x[i], &surf.y[i]); /* find bounding box: */ min_x = max_x = surf.x[0]; min_y = max_y = surf.y[0]; for (i = 1; i < surf.n; i++) { min_x = min(min_x, surf.x[i]); max_x = max(max_x, surf.x[i]); min_y = min(min_y, surf.y[i]); max_y = max(max_y, surf.y[i]); } /* First, simple bounding box check to discard early transformed * surface rects that do not intersect with the clip region: */ if ((min_x >= ctx.clip.x2) || (max_x <= ctx.clip.x1) || (min_y >= ctx.clip.y2) || (max_y <= ctx.clip.y1)) return 0; /* Simple case, bounding box edges are parallel to surface edges, * there will be only four edges. We just need to clip the surface * vertices to the clip rect bounds: */ if (!ev->transform.enabled) return clip_simple(&ctx, &surf, ex, ey); /* Transformed case: use a general polygon clipping algorithm to * clip the surface rectangle with each side of 'rect'. * The algorithm is Sutherland-Hodgman, as explained in * http://www.codeguru.com/cpp/misc/misc/graphics/article.php/c8965/Polygon-Clipping.htm * but without looking at any of that code. */ n = clip_transformed(&ctx, &surf, ex, ey); if (n < 3) return 0; return n; } /* ---------------------- copied ends -----------------------*/ static void geometry_set_phi(struct geometry *g, float phi) { g->phi = phi; g->s = sin(phi); g->c = cos(phi); } static void geometry_init(struct geometry *g) { g->clip.x1 = -50; g->clip.y1 = -50; g->clip.x2 = -10; g->clip.y2 = -10; g->surf.x1 = -20; g->surf.y1 = -20; g->surf.x2 = 20; g->surf.y2 = 20; geometry_set_phi(g, 0.0); } struct ui_state { uint32_t button; int down; int down_pos[2]; struct geometry geometry; }; struct cliptest { struct window *window; struct widget *widget; struct display *display; int fullscreen; struct ui_state ui; struct geometry geometry; struct weston_view view; }; static void draw_polygon_closed(cairo_t *cr, GLfloat *x, GLfloat *y, int n) { int i; cairo_move_to(cr, x[0], y[0]); for (i = 1; i < n; i++) cairo_line_to(cr, x[i], y[i]); cairo_line_to(cr, x[0], y[0]); } static void draw_polygon_labels(cairo_t *cr, GLfloat *x, GLfloat *y, int n) { char str[16]; int i; for (i = 0; i < n; i++) { snprintf(str, 16, "%d", i); cairo_move_to(cr, x[i], y[i]); cairo_show_text(cr, str); } } static void draw_coordinates(cairo_t *cr, double ox, double oy, GLfloat *x, GLfloat *y, int n) { char str[64]; int i; cairo_font_extents_t ext; cairo_font_extents(cr, &ext); for (i = 0; i < n; i++) { snprintf(str, 64, "%d: %14.9f, %14.9f", i, x[i], y[i]); cairo_move_to(cr, ox, oy + ext.height * (i + 1)); cairo_show_text(cr, str); } } static void draw_box(cairo_t *cr, pixman_box32_t *box, struct weston_view *view) { GLfloat x[4], y[4]; if (view) { weston_view_to_global_float(view, box->x1, box->y1, &x[0], &y[0]); weston_view_to_global_float(view, box->x2, box->y1, &x[1], &y[1]); weston_view_to_global_float(view, box->x2, box->y2, &x[2], &y[2]); weston_view_to_global_float(view, box->x1, box->y2, &x[3], &y[3]); } else { x[0] = box->x1; y[0] = box->y1; x[1] = box->x2; y[1] = box->y1; x[2] = box->x2; y[2] = box->y2; x[3] = box->x1; y[3] = box->y2; } draw_polygon_closed(cr, x, y, 4); } static void draw_geometry(cairo_t *cr, struct weston_view *view, GLfloat *ex, GLfloat *ey, int n) { struct geometry *g = view->geometry; float cx, cy; draw_box(cr, &g->surf, view); cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, 0.4); cairo_fill(cr); weston_view_to_global_float(view, g->surf.x1 - 4, g->surf.y1 - 4, &cx, &cy); cairo_arc(cr, cx, cy, 1.5, 0.0, 2.0 * M_PI); if (view->transform.enabled == 0) cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, 0.8); cairo_fill(cr); draw_box(cr, &g->clip, NULL); cairo_set_source_rgba(cr, 0.0, 0.0, 1.0, 0.4); cairo_fill(cr); if (n) { draw_polygon_closed(cr, ex, ey, n); cairo_set_source_rgb(cr, 0.0, 1.0, 0.0); cairo_stroke(cr); cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 0.5); draw_polygon_labels(cr, ex, ey, n); } } static void redraw_handler(struct widget *widget, void *data) { struct cliptest *cliptest = data; struct geometry *g = cliptest->view.geometry; struct rectangle allocation; cairo_t *cr; cairo_surface_t *surface; GLfloat ex[8]; GLfloat ey[8]; int n; n = calculate_edges(&cliptest->view, &g->clip, &g->surf, ex, ey); widget_get_allocation(cliptest->widget, &allocation); surface = window_get_surface(cliptest->window); cr = cairo_create(surface); widget_get_allocation(cliptest->widget, &allocation); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_set_source_rgba(cr, 0, 0, 0, 1); cairo_paint(cr); cairo_translate(cr, allocation.x, allocation.y); cairo_set_line_width(cr, 1.0); cairo_move_to(cr, allocation.width / 2.0, 0.0); cairo_line_to(cr, allocation.width / 2.0, allocation.height); cairo_move_to(cr, 0.0, allocation.height / 2.0); cairo_line_to(cr, allocation.width, allocation.height / 2.0); cairo_set_source_rgba(cr, 0.5, 0.5, 0.5, 1.0); cairo_stroke(cr); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_push_group(cr); cairo_translate(cr, allocation.width / 2.0, allocation.height / 2.0); cairo_scale(cr, 4.0, 4.0); cairo_set_line_width(cr, 0.5); cairo_set_line_join(cr, CAIRO_LINE_JOIN_BEVEL); cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); cairo_set_font_size(cr, 5.0); draw_geometry(cr, &cliptest->view, ex, ey, n); cairo_pop_group_to_source(cr); cairo_paint(cr); cairo_set_source_rgba(cr, 0.0, 1.0, 0.0, 1.0); cairo_select_font_face(cr, "monospace", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 12.0); draw_coordinates(cr, 10.0, 10.0, ex, ey, n); cairo_destroy(cr); cairo_surface_destroy(surface); } static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct cliptest *cliptest = data; struct ui_state *ui = &cliptest->ui; struct geometry *ref = &ui->geometry; struct geometry *geom = &cliptest->geometry; float dx, dy; if (!ui->down) return CURSOR_LEFT_PTR; dx = (x - ui->down_pos[0]) * 0.25; dy = (y - ui->down_pos[1]) * 0.25; switch (ui->button) { case BTN_LEFT: geom->clip.x1 = ref->clip.x1 + dx; geom->clip.y1 = ref->clip.y1 + dy; /* fall through */ case BTN_RIGHT: geom->clip.x2 = ref->clip.x2 + dx; geom->clip.y2 = ref->clip.y2 + dy; break; default: return CURSOR_LEFT_PTR; } widget_schedule_redraw(cliptest->widget); return CURSOR_BLANK; } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct cliptest *cliptest = data; struct ui_state *ui = &cliptest->ui; ui->button = button; if (state == WL_POINTER_BUTTON_STATE_PRESSED) { ui->down = 1; input_get_position(input, &ui->down_pos[0], &ui->down_pos[1]); } else { ui->down = 0; ui->geometry = cliptest->geometry; } } static void axis_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t axis, wl_fixed_t value, void *data) { struct cliptest *cliptest = data; struct geometry *geom = &cliptest->geometry; if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL) return; geometry_set_phi(geom, geom->phi + (M_PI / 12.0) * wl_fixed_to_double(value)); cliptest->view.transform.enabled = 1; widget_schedule_redraw(cliptest->widget); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct cliptest *cliptest = data; struct geometry *g = &cliptest->geometry; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (sym) { case XKB_KEY_Escape: display_exit(cliptest->display); return; case XKB_KEY_w: g->clip.y1 -= 1; g->clip.y2 -= 1; break; case XKB_KEY_a: g->clip.x1 -= 1; g->clip.x2 -= 1; break; case XKB_KEY_s: g->clip.y1 += 1; g->clip.y2 += 1; break; case XKB_KEY_d: g->clip.x1 += 1; g->clip.x2 += 1; break; case XKB_KEY_i: g->clip.y2 -= 1; break; case XKB_KEY_j: g->clip.x2 -= 1; break; case XKB_KEY_k: g->clip.y2 += 1; break; case XKB_KEY_l: g->clip.x2 += 1; break; case XKB_KEY_n: geometry_set_phi(g, g->phi + (M_PI / 24.0)); cliptest->view.transform.enabled = 1; break; case XKB_KEY_m: geometry_set_phi(g, g->phi - (M_PI / 24.0)); cliptest->view.transform.enabled = 1; break; case XKB_KEY_r: geometry_set_phi(g, 0.0); cliptest->view.transform.enabled = 0; break; default: return; } widget_schedule_redraw(cliptest->widget); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct cliptest *cliptest = data; window_schedule_redraw(cliptest->window); } static void fullscreen_handler(struct window *window, void *data) { struct cliptest *cliptest = data; cliptest->fullscreen ^= 1; window_set_fullscreen(window, cliptest->fullscreen); } static struct cliptest * cliptest_create(struct display *display) { struct cliptest *cliptest; cliptest = xzalloc(sizeof *cliptest); cliptest->view.geometry = &cliptest->geometry; cliptest->view.transform.enabled = 0; geometry_init(&cliptest->geometry); geometry_init(&cliptest->ui.geometry); cliptest->window = window_create(display); cliptest->widget = window_frame_create(cliptest->window, cliptest); window_set_title(cliptest->window, "cliptest"); cliptest->display = display; window_set_user_data(cliptest->window, cliptest); widget_set_redraw_handler(cliptest->widget, redraw_handler); widget_set_button_handler(cliptest->widget, button_handler); widget_set_motion_handler(cliptest->widget, motion_handler); widget_set_axis_handler(cliptest->widget, axis_handler); window_set_keyboard_focus_handler(cliptest->window, keyboard_focus_handler); window_set_key_handler(cliptest->window, key_handler); window_set_fullscreen_handler(cliptest->window, fullscreen_handler); /* set minimum size */ widget_schedule_resize(cliptest->widget, 200, 100); /* set current size */ widget_schedule_resize(cliptest->widget, 500, 400); return cliptest; } static struct timespec begin_time; static void reset_timer(void) { clock_gettime(CLOCK_MONOTONIC, &begin_time); } static double read_timer(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return (double)(t.tv_sec - begin_time.tv_sec) + 1e-9 * (t.tv_nsec - begin_time.tv_nsec); } static int benchmark(void) { struct weston_view view; struct geometry geom; GLfloat ex[8], ey[8]; int i; double t; const int N = 1000000; geom.clip.x1 = -19; geom.clip.y1 = -19; geom.clip.x2 = 19; geom.clip.y2 = 19; geom.surf.x1 = -20; geom.surf.y1 = -20; geom.surf.x2 = 20; geom.surf.y2 = 20; geometry_set_phi(&geom, 0.0); view.transform.enabled = 1; view.geometry = &geom; reset_timer(); for (i = 0; i < N; i++) { geometry_set_phi(&geom, (float)i / 360.0f); calculate_edges(&view, &geom.clip, &geom.surf, ex, ey); } t = read_timer(); printf("%d calls took %g s, average %g us/call\n", N, t, t / N * 1e6); return 0; } static void cliptest_destroy(struct cliptest *cliptest) { widget_destroy(cliptest->widget); window_destroy(cliptest->window); free(cliptest); } int main(int argc, char *argv[]) { struct display *d; struct cliptest *cliptest; if (argc > 1) { if (argc == 2 && !strcmp(argv[1], "-b")) return benchmark(); printf("Usage: %s [OPTIONS]\n -b run benchmark\n", argv[0]); return 1; } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } cliptest = cliptest_create(d); display_run(d); cliptest_destroy(cliptest); display_destroy(d); return 0; } weston-1.9.0/clients/simple-dmabuf.c0000664000175000017500000003260012563431500014315 00000000000000/* * Copyright © 2011 Benjamin Franzke * Copyright © 2010 Intel Corporation * Copyright © 2014 Collabora Ltd. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of the copyright holders not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holders make no representations * about the suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xdg-shell-client-protocol.h" #include "fullscreen-shell-client-protocol.h" #include "linux-dmabuf-client-protocol.h" struct display { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct xdg_shell *shell; struct _wl_fullscreen_shell *fshell; struct zlinux_dmabuf *dmabuf; int xrgb8888_format_found; }; struct buffer { struct wl_buffer *buffer; int busy; int drm_fd; drm_intel_bufmgr *bufmgr; drm_intel_bo *bo; uint32_t gem_handle; int dmabuf_fd; uint8_t *mmap; int width; int height; int bpp; unsigned long stride; }; struct window { struct display *display; int width, height; struct wl_surface *surface; struct xdg_surface *xdg_surface; struct buffer buffers[2]; struct buffer *prev_buffer; struct wl_callback *callback; }; static int running = 1; static void buffer_release(void *data, struct wl_buffer *buffer) { struct buffer *mybuf = data; mybuf->busy = 0; } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static int drm_connect(struct buffer *my_buf) { /* This won't work with card0 as we need to be authenticated; instead, * boot with drm.rnodes=1 and use that. */ my_buf->drm_fd = open("/dev/dri/renderD128", O_RDWR); if (my_buf->drm_fd < 0) return 0; my_buf->bufmgr = drm_intel_bufmgr_gem_init(my_buf->drm_fd, 32); if (!my_buf->bufmgr) return 0; return 1; } static void drm_shutdown(struct buffer *my_buf) { drm_intel_bufmgr_destroy(my_buf->bufmgr); close(my_buf->drm_fd); } static int alloc_bo(struct buffer *my_buf) { /* XXX: try different tiling modes for testing FB modifiers. */ uint32_t tiling = I915_TILING_NONE; assert(my_buf->bufmgr); my_buf->bo = drm_intel_bo_alloc_tiled(my_buf->bufmgr, "test", my_buf->width, my_buf->height, (my_buf->bpp / 8), &tiling, &my_buf->stride, 0); printf("buffer allocated w %d, h %d, stride %lu, size %lu\n", my_buf->width, my_buf->height, my_buf->stride, my_buf->bo->size); if (!my_buf->bo) return 0; if (tiling != I915_TILING_NONE) return 0; return 1; } static void free_bo(struct buffer *my_buf) { drm_intel_bo_unreference(my_buf->bo); } static int map_bo(struct buffer *my_buf) { if (drm_intel_gem_bo_map_gtt(my_buf->bo) != 0) return 0; my_buf->mmap = my_buf->bo->virtual; return 1; } static void fill_content(struct buffer *my_buf) { int x = 0, y = 0; uint32_t *pix; assert(my_buf->mmap); for (y = 0; y < my_buf->height; y++) { pix = (uint32_t *)(my_buf->mmap + y * my_buf->stride); for (x = 0; x < my_buf->width; x++) { *pix++ = (0xff << 24) | ((x % 256) << 16) | ((y % 256) << 8) | 0xf0; } } } static void unmap_bo(struct buffer *my_buf) { drm_intel_gem_bo_unmap_gtt(my_buf->bo); } static void create_succeeded(void *data, struct zlinux_buffer_params *params, struct wl_buffer *new_buffer) { struct buffer *buffer = data; buffer->buffer = new_buffer; wl_buffer_add_listener(buffer->buffer, &buffer_listener, buffer); zlinux_buffer_params_destroy(params); } static void create_failed(void *data, struct zlinux_buffer_params *params) { struct buffer *buffer = data; buffer->buffer = NULL; zlinux_buffer_params_destroy(params); fprintf(stderr, "Error: zlinux_buffer_params.create failed.\n"); } static const struct zlinux_buffer_params_listener params_listener = { create_succeeded, create_failed }; static int create_dmabuf_buffer(struct display *display, struct buffer *buffer, int width, int height) { struct zlinux_buffer_params *params; uint64_t modifier; uint32_t flags; if (!drm_connect(buffer)) { fprintf(stderr, "drm_connect failed\n"); goto error; } buffer->width = width; buffer->height = height; buffer->bpp = 32; /* hardcoded XRGB8888 format */ if (!alloc_bo(buffer)) { fprintf(stderr, "alloc_bo failed\n"); goto error1; } if (!map_bo(buffer)) { fprintf(stderr, "map_bo failed\n"); goto error2; } fill_content(buffer); unmap_bo(buffer); if (drm_intel_bo_gem_export_to_prime(buffer->bo, &buffer->dmabuf_fd) != 0) { fprintf(stderr, "drm_intel_bo_gem_export_to_prime failed\n"); goto error2; } if (buffer->dmabuf_fd < 0) { fprintf(stderr, "error: dmabuf_fd < 0\n"); goto error2; } /* We now have a dmabuf! It should contain 2x2 tiles (i.e. each tile * is 256x256) of misc colours, and be mappable, either as ARGB8888, or * XRGB8888. */ modifier = 0; flags = 0; params = zlinux_dmabuf_create_params(display->dmabuf); zlinux_buffer_params_add(params, buffer->dmabuf_fd, 0, /* plane_idx */ 0, /* offset */ buffer->stride, modifier >> 32, modifier & 0xffffffff); zlinux_buffer_params_add_listener(params, ¶ms_listener, buffer); zlinux_buffer_params_create(params, buffer->width, buffer->height, DRM_FORMAT_XRGB8888, flags); /* params is destroyed by the event handlers */ wl_display_roundtrip(display->display); if (buffer->buffer == NULL) { goto error2; } return 0; error2: free_bo(buffer); error1: drm_shutdown(buffer); error: return -1; } static void handle_configure(void *data, struct xdg_surface *surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) { } static void handle_delete(void *data, struct xdg_surface *xdg_surface) { running = 0; } static const struct xdg_surface_listener xdg_surface_listener = { handle_configure, handle_delete, }; static struct window * create_window(struct display *display, int width, int height) { struct window *window; window = calloc(1, sizeof *window); if (!window) return NULL; window->callback = NULL; window->display = display; window->width = width; window->height = height; window->surface = wl_compositor_create_surface(display->compositor); if (display->shell) { window->xdg_surface = xdg_shell_get_xdg_surface(display->shell, window->surface); assert(window->xdg_surface); xdg_surface_add_listener(window->xdg_surface, &xdg_surface_listener, window); xdg_surface_set_title(window->xdg_surface, "simple-dmabuf"); } else if (display->fshell) { _wl_fullscreen_shell_present_surface(display->fshell, window->surface, _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT, NULL); } else { assert(0); } return window; } static void destroy_window(struct window *window) { int i; if (window->callback) wl_callback_destroy(window->callback); for (i = 0; i < 2; i++) { if (!window->buffers[i].buffer) continue; wl_buffer_destroy(window->buffers[i].buffer); free_bo(&window->buffers[i]); close(window->buffers[i].dmabuf_fd); drm_shutdown(&window->buffers[i]); } if (window->xdg_surface) xdg_surface_destroy(window->xdg_surface); wl_surface_destroy(window->surface); free(window); } static struct buffer * window_next_buffer(struct window *window) { struct buffer *buffer; int ret = 0; if (!window->buffers[0].busy) buffer = &window->buffers[0]; else if (!window->buffers[1].busy) buffer = &window->buffers[1]; else return NULL; if (!buffer->buffer) { ret = create_dmabuf_buffer(window->display, buffer, window->width, window->height); if (ret < 0) return NULL; } return buffer; } static const struct wl_callback_listener frame_listener; static void redraw(void *data, struct wl_callback *callback, uint32_t time) { struct window *window = data; struct buffer *buffer; buffer = window_next_buffer(window); if (!buffer) { fprintf(stderr, !callback ? "Failed to create the first buffer.\n" : "Both buffers busy at redraw(). Server bug?\n"); abort(); } /* XXX: would be nice to draw something that changes here... */ wl_surface_attach(window->surface, buffer->buffer, 0, 0); wl_surface_damage(window->surface, 0, 0, window->width, window->height); if (callback) wl_callback_destroy(callback); window->callback = wl_surface_frame(window->surface); wl_callback_add_listener(window->callback, &frame_listener, window); wl_surface_commit(window->surface); buffer->busy = 1; } static const struct wl_callback_listener frame_listener = { redraw }; static void dmabuf_format(void *data, struct zlinux_dmabuf *zlinux_dmabuf, uint32_t format) { struct display *d = data; if (format == DRM_FORMAT_XRGB8888) d->xrgb8888_format_found = 1; } static const struct zlinux_dmabuf_listener dmabuf_listener = { dmabuf_format }; static void xdg_shell_ping(void *data, struct xdg_shell *shell, uint32_t serial) { xdg_shell_pong(shell, serial); } static const struct xdg_shell_listener xdg_shell_listener = { xdg_shell_ping, }; #define XDG_VERSION 5 /* The version of xdg-shell that we implement */ #ifdef static_assert static_assert(XDG_VERSION == XDG_SHELL_VERSION_CURRENT, "Interface version doesn't match implementation version"); #endif static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "xdg_shell") == 0) { d->shell = wl_registry_bind(registry, id, &xdg_shell_interface, 1); xdg_shell_use_unstable_version(d->shell, XDG_VERSION); xdg_shell_add_listener(d->shell, &xdg_shell_listener, d); } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) { d->fshell = wl_registry_bind(registry, id, &_wl_fullscreen_shell_interface, 1); } else if (strcmp(interface, "zlinux_dmabuf") == 0) { d->dmabuf = wl_registry_bind(registry, id, &zlinux_dmabuf_interface, 1); zlinux_dmabuf_add_listener(d->dmabuf, &dmabuf_listener, d); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static struct display * create_display(void) { struct display *display; display = malloc(sizeof *display); if (display == NULL) { fprintf(stderr, "out of memory\n"); exit(1); } display->display = wl_display_connect(NULL); assert(display->display); /* XXX: fake, because the compositor does not yet advertise anything */ display->xrgb8888_format_found = 1; display->registry = wl_display_get_registry(display->display); wl_registry_add_listener(display->registry, ®istry_listener, display); wl_display_roundtrip(display->display); if (display->dmabuf == NULL) { fprintf(stderr, "No zlinux_dmabuf global\n"); exit(1); } wl_display_roundtrip(display->display); if (!display->xrgb8888_format_found) { fprintf(stderr, "DRM_FORMAT_XRGB8888 not available\n"); exit(1); } return display; } static void destroy_display(struct display *display) { if (display->dmabuf) zlinux_dmabuf_destroy(display->dmabuf); if (display->shell) xdg_shell_destroy(display->shell); if (display->fshell) _wl_fullscreen_shell_release(display->fshell); if (display->compositor) wl_compositor_destroy(display->compositor); wl_registry_destroy(display->registry); wl_display_flush(display->display); wl_display_disconnect(display->display); free(display); } static void signal_int(int signum) { running = 0; } int main(int argc, char **argv) { struct sigaction sigint; struct display *display; struct window *window; int ret = 0; display = create_display(); window = create_window(display, 250, 250); if (!window) return 1; sigint.sa_handler = signal_int; sigemptyset(&sigint.sa_mask); sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); /* Initialise damage to full surface, so the padding gets painted */ wl_surface_damage(window->surface, 0, 0, window->width, window->height); redraw(window, NULL, 0); while (running && ret != -1) ret = wl_display_dispatch(display->display); fprintf(stderr, "simple-dmabuf exiting\n"); destroy_window(window); destroy_display(display); return 0; } weston-1.9.0/clients/weston-simple-im.c0000664000175000017500000003215212537627702015017 00000000000000/* * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include "window.h" #include "input-method-client-protocol.h" enum compose_state { state_normal, state_compose }; struct compose_seq { uint32_t keys[4]; const char *text; }; struct simple_im; typedef void (*keyboard_input_key_handler_t)(struct simple_im *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t unicode, enum wl_keyboard_key_state state); struct simple_im { struct wl_input_method *input_method; struct wl_input_method_context *context; struct wl_display *display; struct wl_registry *registry; struct wl_keyboard *keyboard; enum compose_state compose_state; struct compose_seq compose_seq; struct xkb_context *xkb_context; uint32_t modifiers; struct xkb_keymap *keymap; struct xkb_state *state; xkb_mod_mask_t control_mask; xkb_mod_mask_t alt_mask; xkb_mod_mask_t shift_mask; keyboard_input_key_handler_t key_handler; uint32_t serial; }; static const struct compose_seq compose_seqs[] = { { { XKB_KEY_quotedbl, XKB_KEY_A, 0 }, "Ä" }, { { XKB_KEY_quotedbl, XKB_KEY_O, 0 }, "Ö" }, { { XKB_KEY_quotedbl, XKB_KEY_U, 0 }, "Ü" }, { { XKB_KEY_quotedbl, XKB_KEY_a, 0 }, "ä" }, { { XKB_KEY_quotedbl, XKB_KEY_o, 0 }, "ö" }, { { XKB_KEY_quotedbl, XKB_KEY_u, 0 }, "ü" }, { { XKB_KEY_apostrophe, XKB_KEY_A, 0 }, "Á" }, { { XKB_KEY_apostrophe, XKB_KEY_a, 0 }, "á" }, { { XKB_KEY_slash, XKB_KEY_O, 0 }, "Ø" }, { { XKB_KEY_slash, XKB_KEY_o, 0 }, "ø" }, { { XKB_KEY_less, XKB_KEY_3, 0 }, "♥" }, { { XKB_KEY_A, XKB_KEY_A, 0 }, "Å" }, { { XKB_KEY_A, XKB_KEY_E, 0 }, "Æ" }, { { XKB_KEY_O, XKB_KEY_C, 0 }, "©" }, { { XKB_KEY_O, XKB_KEY_R, 0 }, "®" }, { { XKB_KEY_s, XKB_KEY_s, 0 }, "ß" }, { { XKB_KEY_a, XKB_KEY_e, 0 }, "æ" }, { { XKB_KEY_a, XKB_KEY_a, 0 }, "å" }, }; static const uint32_t ignore_keys_on_compose[] = { XKB_KEY_Shift_L, XKB_KEY_Shift_R }; static void handle_surrounding_text(void *data, struct wl_input_method_context *context, const char *text, uint32_t cursor, uint32_t anchor) { fprintf(stderr, "Surrounding text updated: %s\n", text); } static void handle_reset(void *data, struct wl_input_method_context *context) { struct simple_im *keyboard = data; fprintf(stderr, "Reset pre-edit buffer\n"); keyboard->compose_state = state_normal; } static void handle_content_type(void *data, struct wl_input_method_context *context, uint32_t hint, uint32_t purpose) { } static void handle_invoke_action(void *data, struct wl_input_method_context *context, uint32_t button, uint32_t index) { } static void handle_commit_state(void *data, struct wl_input_method_context *context, uint32_t serial) { struct simple_im *keyboard = data; keyboard->serial = serial; } static void handle_preferred_language(void *data, struct wl_input_method_context *context, const char *language) { } static const struct wl_input_method_context_listener input_method_context_listener = { handle_surrounding_text, handle_reset, handle_content_type, handle_invoke_action, handle_commit_state, handle_preferred_language }; static void input_method_keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard, uint32_t format, int32_t fd, uint32_t size) { struct simple_im *keyboard = data; char *map_str; if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { close(fd); return; } map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); if (map_str == MAP_FAILED) { close(fd); return; } keyboard->keymap = xkb_keymap_new_from_string(keyboard->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, 0); munmap(map_str, size); close(fd); if (!keyboard->keymap) { fprintf(stderr, "failed to compile keymap\n"); return; } keyboard->state = xkb_state_new(keyboard->keymap); if (!keyboard->state) { fprintf(stderr, "failed to create XKB state\n"); xkb_keymap_unref(keyboard->keymap); return; } keyboard->control_mask = 1 << xkb_keymap_mod_get_index(keyboard->keymap, "Control"); keyboard->alt_mask = 1 << xkb_keymap_mod_get_index(keyboard->keymap, "Mod1"); keyboard->shift_mask = 1 << xkb_keymap_mod_get_index(keyboard->keymap, "Shift"); } static void input_method_keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w) { struct simple_im *keyboard = data; uint32_t code; uint32_t num_syms; const xkb_keysym_t *syms; xkb_keysym_t sym; enum wl_keyboard_key_state state = state_w; if (!keyboard->state) return; code = key + 8; num_syms = xkb_state_key_get_syms(keyboard->state, code, &syms); sym = XKB_KEY_NoSymbol; if (num_syms == 1) sym = syms[0]; if (keyboard->key_handler) (*keyboard->key_handler)(keyboard, serial, time, key, sym, state); } static void input_method_keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { struct simple_im *keyboard = data; struct wl_input_method_context *context = keyboard->context; xkb_mod_mask_t mask; xkb_state_update_mask(keyboard->state, mods_depressed, mods_latched, mods_locked, 0, 0, group); mask = xkb_state_serialize_mods(keyboard->state, XKB_STATE_MODS_DEPRESSED | XKB_STATE_MODS_LATCHED); keyboard->modifiers = 0; if (mask & keyboard->control_mask) keyboard->modifiers |= MOD_CONTROL_MASK; if (mask & keyboard->alt_mask) keyboard->modifiers |= MOD_ALT_MASK; if (mask & keyboard->shift_mask) keyboard->modifiers |= MOD_SHIFT_MASK; wl_input_method_context_modifiers(context, serial, mods_depressed, mods_depressed, mods_latched, group); } static const struct wl_keyboard_listener input_method_keyboard_listener = { input_method_keyboard_keymap, NULL, /* enter */ NULL, /* leave */ input_method_keyboard_key, input_method_keyboard_modifiers }; static void input_method_activate(void *data, struct wl_input_method *input_method, struct wl_input_method_context *context) { struct simple_im *keyboard = data; if (keyboard->context) wl_input_method_context_destroy(keyboard->context); keyboard->compose_state = state_normal; keyboard->serial = 0; keyboard->context = context; wl_input_method_context_add_listener(context, &input_method_context_listener, keyboard); keyboard->keyboard = wl_input_method_context_grab_keyboard(context); wl_keyboard_add_listener(keyboard->keyboard, &input_method_keyboard_listener, keyboard); } static void input_method_deactivate(void *data, struct wl_input_method *input_method, struct wl_input_method_context *context) { struct simple_im *keyboard = data; if (!keyboard->context) return; wl_input_method_context_destroy(keyboard->context); keyboard->context = NULL; } static const struct wl_input_method_listener input_method_listener = { input_method_activate, input_method_deactivate }; static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct simple_im *keyboard = data; if (!strcmp(interface, "wl_input_method")) { keyboard->input_method = wl_registry_bind(registry, name, &wl_input_method_interface, 1); wl_input_method_add_listener(keyboard->input_method, &input_method_listener, keyboard); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static int compare_compose_keys(const void *c1, const void *c2) { const struct compose_seq *cs1 = c1; const struct compose_seq *cs2 = c2; int i; for (i = 0; cs1->keys[i] != 0 && cs2->keys[i] != 0; i++) { if (cs1->keys[i] != cs2->keys[i]) return cs1->keys[i] - cs2->keys[i]; } if (cs1->keys[i] == cs2->keys[i] || cs1->keys[i] == 0) return 0; return cs1->keys[i] - cs2->keys[i]; } static void simple_im_key_handler(struct simple_im *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state) { struct wl_input_method_context *context = keyboard->context; char text[64]; if (sym == XKB_KEY_Multi_key && state == WL_KEYBOARD_KEY_STATE_RELEASED && keyboard->compose_state == state_normal) { keyboard->compose_state = state_compose; memset(&keyboard->compose_seq, 0, sizeof(struct compose_seq)); return; } if (keyboard->compose_state == state_compose) { uint32_t i = 0; struct compose_seq *cs; if (state == WL_KEYBOARD_KEY_STATE_PRESSED) return; for (i = 0; i < sizeof(ignore_keys_on_compose) / sizeof(ignore_keys_on_compose[0]); i++) { if (sym == ignore_keys_on_compose[i]) { wl_input_method_context_key(context, keyboard->serial, time, key, state); return; } } for (i = 0; keyboard->compose_seq.keys[i] != 0; i++); keyboard->compose_seq.keys[i] = sym; cs = bsearch (&keyboard->compose_seq, compose_seqs, sizeof(compose_seqs) / sizeof(compose_seqs[0]), sizeof(compose_seqs[0]), compare_compose_keys); if (cs) { if (cs->keys[i + 1] == 0) { wl_input_method_context_preedit_cursor(keyboard->context, 0); wl_input_method_context_preedit_string(keyboard->context, keyboard->serial, "", ""); wl_input_method_context_cursor_position(keyboard->context, 0, 0); wl_input_method_context_commit_string(keyboard->context, keyboard->serial, cs->text); keyboard->compose_state = state_normal; } else { uint32_t j = 0, idx = 0; for (; j <= i; j++) { idx += xkb_keysym_to_utf8(cs->keys[j], text + idx, sizeof(text) - idx); } wl_input_method_context_preedit_cursor(keyboard->context, strlen(text)); wl_input_method_context_preedit_string(keyboard->context, keyboard->serial, text, text); } } else { uint32_t j = 0, idx = 0; for (; j <= i; j++) { idx += xkb_keysym_to_utf8(keyboard->compose_seq.keys[j], text + idx, sizeof(text) - idx); } wl_input_method_context_preedit_cursor(keyboard->context, 0); wl_input_method_context_preedit_string(keyboard->context, keyboard->serial, "", ""); wl_input_method_context_cursor_position(keyboard->context, 0, 0); wl_input_method_context_commit_string(keyboard->context, keyboard->serial, text); keyboard->compose_state = state_normal; } return; } if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0) { wl_input_method_context_key(context, serial, time, key, state); return; } if (state == WL_KEYBOARD_KEY_STATE_PRESSED) return; wl_input_method_context_cursor_position(keyboard->context, 0, 0); wl_input_method_context_commit_string(keyboard->context, keyboard->serial, text); } int main(int argc, char *argv[]) { struct simple_im simple_im; int ret = 0; memset(&simple_im, 0, sizeof(simple_im)); simple_im.display = wl_display_connect(NULL); if (simple_im.display == NULL) { fprintf(stderr, "failed to connect to server: %m\n"); return -1; } simple_im.registry = wl_display_get_registry(simple_im.display); wl_registry_add_listener(simple_im.registry, ®istry_listener, &simple_im); wl_display_roundtrip(simple_im.display); if (simple_im.input_method == NULL) { fprintf(stderr, "No input_method global\n"); exit(1); } simple_im.xkb_context = xkb_context_new(0); if (simple_im.xkb_context == NULL) { fprintf(stderr, "Failed to create XKB context\n"); return -1; } simple_im.context = NULL; simple_im.key_handler = simple_im_key_handler; while (ret != -1) ret = wl_display_dispatch(simple_im.display); if (ret == -1) { fprintf(stderr, "Dispatch error: %m\n"); exit(1); } return 0; } weston-1.9.0/clients/transformed.c0000664000175000017500000001664612537627702014144 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include "window.h" struct transformed { struct display *display; struct window *window; struct widget *widget; int width, height; int fullscreen; }; static void draw_stuff(cairo_t *cr, int width, int height) { cairo_matrix_t m; cairo_get_matrix (cr, &m); cairo_translate(cr, width / 2, height / 2); cairo_scale(cr, width / 2, height / 2); cairo_set_source_rgba(cr, 0, 0, 0.3, 1.0); cairo_set_source_rgba(cr, 0, 0, 0, 1.0); cairo_rectangle(cr, -1, -1, 2, 2); cairo_fill(cr); cairo_set_source_rgb(cr, 1, 0, 0); cairo_move_to(cr, 0, 0); cairo_line_to(cr, 0, -1); cairo_save(cr); cairo_set_matrix(cr, &m); cairo_set_line_width(cr, 2.0); cairo_stroke(cr); cairo_restore(cr); cairo_set_source_rgb(cr, 0, 1, 0); cairo_move_to(cr, 0, 0); cairo_line_to(cr, 1, 0); cairo_save(cr); cairo_set_matrix(cr, &m); cairo_set_line_width(cr, 2.0); cairo_stroke(cr); cairo_restore(cr); cairo_set_source_rgb(cr, 1, 1, 1); cairo_move_to(cr, 0, 0); cairo_line_to(cr, 0, 1); cairo_move_to(cr, 0, 0); cairo_line_to(cr, -1, 0); cairo_save(cr); cairo_set_matrix(cr, &m); cairo_set_line_width(cr, 2.0); cairo_stroke(cr); cairo_restore(cr); cairo_destroy(cr); } static void fullscreen_handler(struct window *window, void *data) { struct transformed *transformed = data; transformed->fullscreen ^= 1; window_set_fullscreen(window, transformed->fullscreen); } static void redraw_handler(struct widget *widget, void *data) { struct transformed *transformed = data; struct rectangle allocation; cairo_surface_t *surface; cairo_t *cr; surface = window_get_surface(transformed->window); if (surface == NULL || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { fprintf(stderr, "failed to create cairo egl surface\n"); return; } widget_get_allocation(transformed->widget, &allocation); cr = widget_cairo_create(widget); draw_stuff(cr, allocation.width, allocation.height); cairo_surface_destroy(surface); } static void output_handler(struct window *window, struct output *output, int enter, void *data) { if (!enter) return; window_set_buffer_transform(window, output_get_transform(output)); window_set_buffer_scale(window, output_get_scale(output)); window_schedule_redraw(window); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { int transform, scale; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; transform = window_get_buffer_transform (window); scale = window_get_buffer_scale (window); switch (sym) { case XKB_KEY_Left: if (transform == 0) transform = 3; else if (transform == 4) transform = 7; else transform--; break; case XKB_KEY_Right: if (transform == 3) transform = 0; else if (transform == 7) transform = 4; else transform++; break; case XKB_KEY_space: if (transform >= 4) transform -= 4; else transform += 4; break; case XKB_KEY_z: if (scale == 1) scale = 2; else scale = 1; break; } printf ("setting buffer transform to %d\n", transform); printf ("setting buffer scale to %d\n", scale); window_set_buffer_transform(window, transform); window_set_buffer_scale(window, scale); window_schedule_redraw(window); } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct transformed *transformed = data; switch (button) { case BTN_LEFT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) window_move(transformed->window, input, display_get_serial(transformed->display)); break; case BTN_MIDDLE: if (state == WL_POINTER_BUTTON_STATE_PRESSED) widget_schedule_redraw(widget); break; case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) window_show_frame_menu(transformed->window, input, time); break; } } static void touch_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct transformed *transformed = data; window_move(transformed->window, input, display_get_serial(transformed->display)); } static void usage(int error_code) { fprintf(stderr, "Usage: transformed [OPTIONS]\n\n" " -d\t\tUse \"driver\" fullscreen method\n" " -w \tSet window width to \n" " -h \tSet window height to \n" " --help\tShow this help text\n\n"); exit(error_code); } int main(int argc, char *argv[]) { struct transformed transformed; struct display *d; int i; transformed.width = 500; transformed.height = 250; transformed.fullscreen = 0; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-w") == 0) { if (++i >= argc) usage(EXIT_FAILURE); transformed.width = atol(argv[i]); } else if (strcmp(argv[i], "-h") == 0) { if (++i >= argc) usage(EXIT_FAILURE); transformed.height = atol(argv[i]); } else if (strcmp(argv[i], "--help") == 0) usage(EXIT_SUCCESS); else usage(EXIT_FAILURE); } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } transformed.display = d; transformed.window = window_create(d); transformed.widget = window_add_widget(transformed.window, &transformed); window_set_title(transformed.window, "Transformed"); widget_set_transparent(transformed.widget, 0); widget_set_default_cursor(transformed.widget, CURSOR_BLANK); widget_set_redraw_handler(transformed.widget, redraw_handler); widget_set_button_handler(transformed.widget, button_handler); widget_set_touch_down_handler(transformed.widget, touch_handler); window_set_key_handler(transformed.window, key_handler); window_set_fullscreen_handler(transformed.window, fullscreen_handler); window_set_output_handler(transformed.window, output_handler); window_set_user_data(transformed.window, &transformed); window_schedule_resize(transformed.window, transformed.width, transformed.height); display_run(d); widget_destroy(transformed.widget); window_destroy(transformed.window); display_destroy(d); return 0; } weston-1.9.0/clients/multi-resource.c0000664000175000017500000003205612537664635014576 00000000000000/* * Copyright © 2011 Benjamin Franzke * Copyright © 2010, 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/os-compatibility.h" struct device { enum { KEYBOARD, POINTER } type; int start_time; int end_time; struct wl_list link; union { struct wl_keyboard *keyboard; struct wl_pointer *pointer; } p; }; struct display { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shell *shell; struct wl_seat *seat; struct wl_shm *shm; uint32_t formats; struct wl_list devices; }; struct window { struct display *display; int width, height; struct wl_surface *surface; struct wl_shell_surface *shell_surface; }; static void buffer_release(void *data, struct wl_buffer *buffer) { wl_buffer_destroy(buffer); } static const struct wl_buffer_listener buffer_listener = { buffer_release }; static inline void * xzalloc(size_t s) { void *p; p = calloc(1, s); if (p == NULL) { fprintf(stderr, "%s: out of memory\n", program_invocation_short_name); exit(EXIT_FAILURE); } return p; } static int attach_buffer(struct window *window, int width, int height) { struct wl_shm_pool *pool; struct wl_buffer *buffer; int fd, size, stride; stride = width * 4; size = stride * height; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); return -1; } pool = wl_shm_create_pool(window->display->shm, fd, size); buffer = wl_shm_pool_create_buffer(pool, 0, width, height, stride, WL_SHM_FORMAT_XRGB8888); wl_surface_attach(window->surface, buffer, 0, 0); wl_buffer_add_listener(buffer, &buffer_listener, buffer); wl_shm_pool_destroy(pool); close(fd); return 0; } static void handle_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial) { wl_shell_surface_pong(shell_surface, serial); } static void handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t edges, int32_t width, int32_t height) { } static void handle_popup_done(void *data, struct wl_shell_surface *shell_surface) { } static const struct wl_shell_surface_listener shell_surface_listener = { handle_ping, handle_configure, handle_popup_done }; static struct window * create_window(struct display *display, int width, int height) { struct window *window; window = xzalloc(sizeof *window); window->display = display; window->width = width; window->height = height; window->surface = wl_compositor_create_surface(display->compositor); window->shell_surface = wl_shell_get_shell_surface(display->shell, window->surface); if (window->shell_surface) wl_shell_surface_add_listener(window->shell_surface, &shell_surface_listener, window); wl_shell_surface_set_title(window->shell_surface, "simple-shm"); wl_shell_surface_set_toplevel(window->shell_surface); wl_surface_damage(window->surface, 0, 0, width, height); attach_buffer(window, width, height); wl_surface_commit(window->surface); return window; } static void destroy_window(struct window *window) { wl_shell_surface_destroy(window->shell_surface); wl_surface_destroy(window->surface); free(window); } static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct display *d = data; d->formats |= (1 << format); } struct wl_shm_listener shm_listener = { shm_format }; static void registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { struct display *d = data; if (strcmp(interface, "wl_compositor") == 0) { d->compositor = wl_registry_bind(registry, id, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { d->shell = wl_registry_bind(registry, id, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); wl_shm_add_listener(d->shm, &shm_listener, d); } else if (strcmp(interface, "wl_seat") == 0 && d->seat == NULL) { d->seat = wl_registry_bind(registry, id, &wl_seat_interface, 3); } } static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { registry_handle_global, registry_handle_global_remove }; static struct display * create_display(void) { struct display *display; display = xzalloc(sizeof *display); display->display = wl_display_connect(NULL); assert(display->display); display->formats = 0; display->registry = wl_display_get_registry(display->display); wl_registry_add_listener(display->registry, ®istry_listener, display); wl_display_roundtrip(display->display); if (display->shm == NULL) { fprintf(stderr, "No wl_shm global\n"); exit(1); } wl_display_roundtrip(display->display); if (!(display->formats & (1 << WL_SHM_FORMAT_XRGB8888))) { fprintf(stderr, "WL_SHM_FORMAT_XRGB32 not available\n"); exit(1); } wl_list_init(&display->devices); return display; } static void pointer_handle_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w) { } static void pointer_handle_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface) { } static void pointer_handle_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t sx_w, wl_fixed_t sy_w) { } static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state_w) { } static void pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { } static const struct wl_pointer_listener pointer_listener = { pointer_handle_enter, pointer_handle_leave, pointer_handle_motion, pointer_handle_button, pointer_handle_axis, }; static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, uint32_t format, int fd, uint32_t size) { } static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys) { } static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface) { } static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, uint32_t state_w) { } static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) { } static const struct wl_keyboard_listener keyboard_listener = { keyboard_handle_keymap, keyboard_handle_enter, keyboard_handle_leave, keyboard_handle_key, keyboard_handle_modifiers, }; static void start_device(struct display *display, struct device *device) { if (display->seat == NULL) return; switch (device->type) { case KEYBOARD: if (device->p.keyboard == NULL) { device->p.keyboard = wl_seat_get_keyboard(display->seat); wl_keyboard_add_listener(device->p.keyboard, &keyboard_listener, NULL); } break; case POINTER: if (device->p.pointer == NULL) { device->p.pointer = wl_seat_get_pointer(display->seat); wl_pointer_add_listener(device->p.pointer, &pointer_listener, NULL); } break; } } static void destroy_device(struct device *device) { switch (device->type) { case KEYBOARD: if (device->p.keyboard) wl_keyboard_release(device->p.keyboard); break; case POINTER: if (device->p.pointer) wl_pointer_release(device->p.pointer); break; } wl_list_remove(&device->link); free(device); } static void destroy_devices(struct display *display) { struct device *device, *tmp; wl_list_for_each_safe(device, tmp, &display->devices, link) destroy_device(device); } static void destroy_display(struct display *display) { destroy_devices(display); if (display->shm) wl_shm_destroy(display->shm); if (display->shell) wl_shell_destroy(display->shell); if (display->seat) wl_seat_destroy(display->seat); if (display->compositor) wl_compositor_destroy(display->compositor); wl_registry_destroy(display->registry); wl_display_flush(display->display); wl_display_disconnect(display->display); free(display); } static int running = 1; static void signal_int(int signum) { running = 0; } static int create_device(struct display *display, const char *time_desc, int type) { int start_time; int end_time = -1; char *tail; struct device *device; if (time_desc == NULL) { fprintf(stderr, "missing time description\n"); return -1; } errno = 0; start_time = strtoul(time_desc, &tail, 10); if (errno) goto error; if (*tail == ':') { end_time = strtoul(tail + 1, &tail, 10); if (errno || *tail != '\0') goto error; } else if (*tail != '\0') { goto error; } device = xzalloc(sizeof *device); device->type = type; device->start_time = start_time; device->end_time = end_time; wl_list_insert(&display->devices, &device->link); return 0; error: fprintf(stderr, "invalid time description\n"); return -1; } static struct timespec begin_time; static void reset_timer(void) { clock_gettime(CLOCK_MONOTONIC, &begin_time); } static double read_timer(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return (double)(t.tv_sec - begin_time.tv_sec) + 1e-9 * (t.tv_nsec - begin_time.tv_nsec); } static void main_loop(struct display *display) { reset_timer(); while (running) { struct device *device, *tmp; struct pollfd fds[1]; double sleep_time = DBL_MAX; double now; if (wl_display_dispatch_pending(display->display) == -1) break; if (wl_display_flush(display->display) == -1) break; now = read_timer(); wl_list_for_each(device, &display->devices, link) { double next_time = device->start_time - now; if (next_time < 0.0) { sleep_time = 0.0; break; } else if (next_time < sleep_time) { sleep_time = next_time; } next_time = device->end_time - now; if (next_time < 0.0) { sleep_time = 0.0; break; } else if (next_time < sleep_time) { sleep_time = next_time; } } fds[0].fd = wl_display_get_fd(display->display); fds[0].events = POLLIN; fds[0].revents = 0; poll(fds, sizeof fds / sizeof fds[0], sleep_time == DBL_MAX ? -1 : ceil(sleep_time * 1000.0)); if (fds[0].revents && wl_display_dispatch(display->display) == -1) break; now = read_timer(); wl_list_for_each_safe(device, tmp, &display->devices, link) { if (device->start_time <= now) start_device(display, device); if (device->end_time >= 0 && device->end_time <= now) destroy_device(device); } } } int main(int argc, char **argv) { struct sigaction sigint; struct display *display; struct window *window; int i; display = create_display(); window = create_window(display, 250, 250); for (i = 1; i < argc; i++) { if (!strncmp(argv[i], "-p", 2)) { char *arg; if (argv[i][2]) { arg = argv[i] + 2; } else { arg = argv[i + 1]; i++; } if (create_device(display, arg, POINTER) == -1) return 1; } else if (!strncmp(argv[i], "-k", 2)) { char *arg; if (argv[i][2]) { arg = argv[i] + 2; } else { arg = argv[i + 1]; i++; } if (create_device(display, arg, KEYBOARD) == -1) return 1; } else { fprintf(stderr, "unknown argument %s\n", argv[i]); return 1; } } sigint.sa_handler = signal_int; sigemptyset(&sigint.sa_mask); sigint.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sigint, NULL); main_loop(display); fprintf(stderr, "multi-resource exiting\n"); destroy_window(window); destroy_display(display); return 0; } weston-1.9.0/clients/subsurfaces.c0000664000175000017500000004775612561177776014163 00000000000000/* * Copyright © 2010 Intel Corporation * Copyright © 2011 Benjamin Franzke * Copyright © 2012-2013 Collabora, Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "window.h" #if 0 #define DBG(fmt, ...) \ fprintf(stderr, "%d:%s " fmt, __LINE__, __func__, ##__VA_ARGS__) #else #define DBG(...) do {} while (0) #endif static int32_t option_red_mode; static int32_t option_triangle_mode; static int32_t option_no_triangle; static int32_t option_help; static const struct weston_option options[] = { { WESTON_OPTION_INTEGER, "red-mode", 'r', &option_red_mode }, { WESTON_OPTION_INTEGER, "triangle-mode", 't', &option_triangle_mode }, { WESTON_OPTION_BOOLEAN, "no-triangle", 'n', &option_no_triangle }, { WESTON_OPTION_BOOLEAN, "help", 'h', &option_help }, }; static enum subsurface_mode int_to_mode(int32_t i) { switch (i) { case 0: return SUBSURFACE_DESYNCHRONIZED; case 1: return SUBSURFACE_SYNCHRONIZED; default: fprintf(stderr, "error: %d is not a valid commit mode.\n", i); exit(1); } } static const char help_text[] = "Usage: %s [options]\n" "\n" " -r, --red-mode=MODE\t\tthe commit mode for the red sub-surface (0)\n" " -t, --triangle-mode=MODE\tthe commit mode for the GL sub-surface (0)\n" " -n, --no-triangle\t\tDo not create the GL sub-surface.\n" "\n" "The MODE is the wl_subsurface commit mode used by default for the\n" "given sub-surface. Valid values are the integers:\n" " 0\tfor desynchronized, i.e. free-running\n" " 1\tfor synchronized\n" "\n" "This program demonstrates sub-surfaces with the toytoolkit.\n" "The main surface contains the decorations, a green canvas, and a\n" "green spinner. One sub-surface is red with a red spinner. These\n" "are rendered with Cairo. The other sub-surface contains a spinning\n" "triangle rendered in EGL/GLESv2, without Cairo, i.e. it is a raw GL\n" "widget.\n" "\n" "The GL widget animates on its own. The spinners follow wall clock\n" "time and update only when their surface is repainted, so you see\n" "which surfaces get redrawn. The red sub-surface animates on its own,\n" "but can be toggled with the spacebar.\n" "\n" "Even though the sub-surfaces attempt to animate on their own, they\n" "are subject to the commit mode. If commit mode is synchronized,\n" "they will need a commit on the main surface to actually display.\n" "You can trigger a main surface repaint, without a resize, by\n" "hovering the pointer over the title bar buttons.\n" "\n" "Resizing will temporarily toggle the commit mode of all sub-surfaces\n" "to guarantee synchronized rendering on size changes. It also forces\n" "a repaint of all surfaces.\n" "\n" "Using -t1 -r1 is especially useful for trying to catch inconsistent\n" "rendering and deadlocks, since free-running sub-surfaces would\n" "immediately hide the problem.\n" "\n" "Key controls:\n" " space - toggle red sub-surface animation loop\n" " up - step window size shorter\n" " down - step window size taller\n" "\n"; struct egl_state { EGLDisplay dpy; EGLContext ctx; EGLConfig conf; }; struct triangle_gl_state { GLuint rotation_uniform; GLuint pos; GLuint col; }; struct triangle { struct egl_state *egl; struct wl_surface *wl_surface; struct wl_egl_window *egl_window; EGLSurface egl_surface; int width; int height; struct triangle_gl_state gl; struct widget *widget; uint32_t time; struct wl_callback *frame_cb; }; /******** Pure EGL/GLESv2/libwayland-client component: ***************/ static const char *vert_shader_text = "uniform mat4 rotation;\n" "attribute vec4 pos;\n" "attribute vec4 color;\n" "varying vec4 v_color;\n" "void main() {\n" " gl_Position = rotation * pos;\n" " v_color = color;\n" "}\n"; static const char *frag_shader_text = "precision mediump float;\n" "varying vec4 v_color;\n" "void main() {\n" " gl_FragColor = v_color;\n" "}\n"; static void egl_print_config_info(struct egl_state *egl) { EGLint r, g, b, a; printf("Chosen EGL config details:\n"); printf("\tRGBA bits"); if (eglGetConfigAttrib(egl->dpy, egl->conf, EGL_RED_SIZE, &r) && eglGetConfigAttrib(egl->dpy, egl->conf, EGL_GREEN_SIZE, &g) && eglGetConfigAttrib(egl->dpy, egl->conf, EGL_BLUE_SIZE, &b) && eglGetConfigAttrib(egl->dpy, egl->conf, EGL_ALPHA_SIZE, &a)) printf(": %d %d %d %d\n", r, g, b, a); else printf(" unknown\n"); printf("\tswap interval range"); if (eglGetConfigAttrib(egl->dpy, egl->conf, EGL_MIN_SWAP_INTERVAL, &a) && eglGetConfigAttrib(egl->dpy, egl->conf, EGL_MAX_SWAP_INTERVAL, &b)) printf(": %d - %d\n", a, b); else printf(" unknown\n"); } static struct egl_state * egl_state_create(struct wl_display *display) { struct egl_state *egl; static const EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; EGLint config_attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 1, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; EGLint major, minor, n; EGLBoolean ret; egl = calloc(1, sizeof *egl); assert(egl); egl->dpy = weston_platform_get_egl_display(EGL_PLATFORM_WAYLAND_KHR, display, NULL); assert(egl->dpy); ret = eglInitialize(egl->dpy, &major, &minor); assert(ret == EGL_TRUE); ret = eglBindAPI(EGL_OPENGL_ES_API); assert(ret == EGL_TRUE); ret = eglChooseConfig(egl->dpy, config_attribs, &egl->conf, 1, &n); assert(ret && n == 1); egl->ctx = eglCreateContext(egl->dpy, egl->conf, EGL_NO_CONTEXT, context_attribs); assert(egl->ctx); egl_print_config_info(egl); return egl; } static void egl_state_destroy(struct egl_state *egl) { /* Required, otherwise segfault in egl_dri2.c: dri2_make_current() * on eglReleaseThread(). */ eglMakeCurrent(egl->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglTerminate(egl->dpy); eglReleaseThread(); free(egl); } static void egl_make_swapbuffers_nonblock(struct egl_state *egl) { EGLint a = EGL_MIN_SWAP_INTERVAL; EGLint b = EGL_MAX_SWAP_INTERVAL; if (!eglGetConfigAttrib(egl->dpy, egl->conf, a, &a) || !eglGetConfigAttrib(egl->dpy, egl->conf, b, &b)) { fprintf(stderr, "warning: swap interval range unknown\n"); } else if (a > 0) { fprintf(stderr, "warning: minimum swap interval is %d, " "while 0 is required to not deadlock on resize.\n", a); } /* * We rely on the Wayland compositor to sync to vblank anyway. * We just need to be able to call eglSwapBuffers() without the * risk of waiting for a frame callback in it. */ if (!eglSwapInterval(egl->dpy, 0)) { fprintf(stderr, "error: eglSwapInterval() failed.\n"); } } static GLuint create_shader(const char *source, GLenum shader_type) { GLuint shader; GLint status; shader = glCreateShader(shader_type); assert(shader != 0); glShaderSource(shader, 1, (const char **) &source, NULL); glCompileShader(shader); glGetShaderiv(shader, GL_COMPILE_STATUS, &status); if (!status) { char log[1000]; GLsizei len; glGetShaderInfoLog(shader, 1000, &len, log); fprintf(stderr, "Error: compiling %s: %*s\n", shader_type == GL_VERTEX_SHADER ? "vertex" : "fragment", len, log); exit(1); } return shader; } static void triangle_init_gl(struct triangle_gl_state *trigl) { GLuint frag, vert; GLuint program; GLint status; frag = create_shader(frag_shader_text, GL_FRAGMENT_SHADER); vert = create_shader(vert_shader_text, GL_VERTEX_SHADER); program = glCreateProgram(); glAttachShader(program, frag); glAttachShader(program, vert); glLinkProgram(program); glGetProgramiv(program, GL_LINK_STATUS, &status); if (!status) { char log[1000]; GLsizei len; glGetProgramInfoLog(program, 1000, &len, log); fprintf(stderr, "Error: linking:\n%*s\n", len, log); exit(1); } glUseProgram(program); trigl->pos = 0; trigl->col = 1; glBindAttribLocation(program, trigl->pos, "pos"); glBindAttribLocation(program, trigl->col, "color"); glLinkProgram(program); trigl->rotation_uniform = glGetUniformLocation(program, "rotation"); } static void triangle_draw(const struct triangle_gl_state *trigl, uint32_t time) { static const GLfloat verts[3][2] = { { -0.5, -0.5 }, { 0.5, -0.5 }, { 0, 0.5 } }; static const GLfloat colors[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; GLfloat angle; GLfloat rotation[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } }; static const int32_t speed_div = 5; angle = (time / speed_div) % 360 * M_PI / 180.0; rotation[0][0] = cos(angle); rotation[0][2] = sin(angle); rotation[2][0] = -sin(angle); rotation[2][2] = cos(angle); glUniformMatrix4fv(trigl->rotation_uniform, 1, GL_FALSE, (GLfloat *) rotation); glClearColor(0.0, 0.0, 0.0, 0.5); glClear(GL_COLOR_BUFFER_BIT); glVertexAttribPointer(trigl->pos, 2, GL_FLOAT, GL_FALSE, 0, verts); glVertexAttribPointer(trigl->col, 3, GL_FLOAT, GL_FALSE, 0, colors); glEnableVertexAttribArray(trigl->pos); glEnableVertexAttribArray(trigl->col); glDrawArrays(GL_TRIANGLES, 0, 3); glDisableVertexAttribArray(trigl->pos); glDisableVertexAttribArray(trigl->col); } static void triangle_frame_callback(void *data, struct wl_callback *callback, uint32_t time); static const struct wl_callback_listener triangle_frame_listener = { triangle_frame_callback }; static void triangle_frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct triangle *tri = data; DBG("%stime %u\n", callback ? "" : "artificial ", time); assert(callback == tri->frame_cb); tri->time = time; if (callback) wl_callback_destroy(callback); eglMakeCurrent(tri->egl->dpy, tri->egl_surface, tri->egl_surface, tri->egl->ctx); glViewport(0, 0, tri->width, tri->height); triangle_draw(&tri->gl, tri->time); tri->frame_cb = wl_surface_frame(tri->wl_surface); wl_callback_add_listener(tri->frame_cb, &triangle_frame_listener, tri); eglSwapBuffers(tri->egl->dpy, tri->egl_surface); } static void triangle_create_egl_surface(struct triangle *tri, int width, int height) { EGLBoolean ret; tri->wl_surface = widget_get_wl_surface(tri->widget); tri->egl_window = wl_egl_window_create(tri->wl_surface, width, height); tri->egl_surface = weston_platform_create_egl_surface(tri->egl->dpy, tri->egl->conf, tri->egl_window, NULL); ret = eglMakeCurrent(tri->egl->dpy, tri->egl_surface, tri->egl_surface, tri->egl->ctx); assert(ret == EGL_TRUE); egl_make_swapbuffers_nonblock(tri->egl); triangle_init_gl(&tri->gl); } /********* The widget code interfacing the toolkit agnostic code: **********/ static void triangle_resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct triangle *tri = data; DBG("to %dx%d\n", width, height); tri->width = width; tri->height = height; if (tri->egl_surface) { wl_egl_window_resize(tri->egl_window, width, height, 0, 0); } else { triangle_create_egl_surface(tri, width, height); triangle_frame_callback(tri, NULL, 0); } } static void triangle_redraw_handler(struct widget *widget, void *data) { struct triangle *tri = data; int w, h; wl_egl_window_get_attached_size(tri->egl_window, &w, &h); DBG("previous %dx%d, new %dx%d\n", w, h, tri->width, tri->height); /* If size is not changing, do not redraw ahead of time. * That would risk blocking in eglSwapbuffers(). */ if (w == tri->width && h == tri->height) return; if (tri->frame_cb) { wl_callback_destroy(tri->frame_cb); tri->frame_cb = NULL; } triangle_frame_callback(tri, NULL, tri->time); } static void set_empty_input_region(struct widget *widget, struct display *display) { struct wl_compositor *compositor; struct wl_surface *surface; struct wl_region *region; compositor = display_get_compositor(display); surface = widget_get_wl_surface(widget); region = wl_compositor_create_region(compositor); wl_surface_set_input_region(surface, region); wl_region_destroy(region); } static struct triangle * triangle_create(struct window *window, struct egl_state *egl) { struct triangle *tri; tri = xzalloc(sizeof *tri); tri->egl = egl; tri->widget = window_add_subsurface(window, tri, int_to_mode(option_triangle_mode)); widget_set_use_cairo(tri->widget, 0); widget_set_resize_handler(tri->widget, triangle_resize_handler); widget_set_redraw_handler(tri->widget, triangle_redraw_handler); set_empty_input_region(tri->widget, window_get_display(window)); return tri; } static void triangle_destroy(struct triangle *tri) { if (tri->egl_surface) eglDestroySurface(tri->egl->dpy, tri->egl_surface); if (tri->egl_window) wl_egl_window_destroy(tri->egl_window); widget_destroy(tri->widget); free(tri); } /************** The toytoolkit application code: *********************/ struct demoapp { struct display *display; struct window *window; struct widget *widget; struct widget *subsurface; struct egl_state *egl; struct triangle *triangle; int animate; }; static void draw_spinner(cairo_t *cr, const struct rectangle *rect, uint32_t time) { double cx, cy, r, angle; unsigned t; cx = rect->x + rect->width / 2; cy = rect->y + rect->height / 2; r = (rect->width < rect->height ? rect->width : rect->height) * 0.3; t = time % 2000; angle = t * (M_PI / 500.0); cairo_set_line_width(cr, 4.0); if (t < 1000) cairo_arc(cr, cx, cy, r, 0.0, angle); else cairo_arc(cr, cx, cy, r, angle, 0.0); cairo_stroke(cr); } static void sub_redraw_handler(struct widget *widget, void *data) { struct demoapp *app = data; cairo_t *cr; struct rectangle allocation; uint32_t time; widget_get_allocation(app->subsurface, &allocation); cr = widget_cairo_create(widget); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); /* debug: paint whole surface magenta; no magenta should show */ cairo_set_source_rgba(cr, 0.9, 0.0, 0.9, 1.0); cairo_paint(cr); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_set_source_rgba(cr, 0.8, 0, 0, 0.8); cairo_paint(cr); time = widget_get_last_time(widget); cairo_set_source_rgba(cr, 1.0, 0.5, 0.5, 1.0); draw_spinner(cr, &allocation, time); cairo_destroy(cr); if (app->animate) widget_schedule_redraw(app->subsurface); DBG("%dx%d @ %d,%d, last time %u\n", allocation.width, allocation.height, allocation.x, allocation.y, time); } static void sub_resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { DBG("%dx%d\n", width, height); widget_input_region_add(widget, NULL); } static void redraw_handler(struct widget *widget, void *data) { struct demoapp *app = data; cairo_t *cr; struct rectangle allocation; uint32_t time; widget_get_allocation(app->widget, &allocation); cr = widget_cairo_create(widget); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_set_source_rgba(cr, 0, 0.8, 0, 0.8); cairo_fill(cr); time = widget_get_last_time(widget); cairo_set_source_rgba(cr, 0.5, 1.0, 0.5, 1.0); draw_spinner(cr, &allocation, time); cairo_destroy(cr); DBG("%dx%d @ %d,%d, last time %u\n", allocation.width, allocation.height, allocation.x, allocation.y, time); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct demoapp *app = data; struct rectangle area; int side, h; widget_get_allocation(widget, &area); side = area.width < area.height ? area.width / 2 : area.height / 2; h = area.height - side; widget_set_allocation(app->subsurface, area.x + area.width - side, area.y, side, h); if (app->triangle) { widget_set_allocation(app->triangle->widget, area.x + area.width - side, area.y + h, side, side); } DBG("green %dx%d, red %dx%d, GL %dx%d\n", area.width, area.height, side, h, side, side); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct demoapp *app = data; window_schedule_redraw(app->window); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct demoapp *app = data; struct rectangle winrect; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (sym) { case XKB_KEY_space: app->animate = !app->animate; window_schedule_redraw(window); break; case XKB_KEY_Up: window_get_allocation(window, &winrect); winrect.height -= 100; if (winrect.height < 150) winrect.height = 150; window_schedule_resize(window, winrect.width, winrect.height); break; case XKB_KEY_Down: window_get_allocation(window, &winrect); winrect.height += 100; if (winrect.height > 600) winrect.height = 600; window_schedule_resize(window, winrect.width, winrect.height); break; case XKB_KEY_Escape: display_exit(app->display); break; } } static struct demoapp * demoapp_create(struct display *display) { struct demoapp *app; app = xzalloc(sizeof *app); app->egl = egl_state_create(display_get_display(display)); app->display = display; display_set_user_data(app->display, app); app->window = window_create(app->display); app->widget = window_frame_create(app->window, app); window_set_title(app->window, "Wayland Sub-surface Demo"); window_set_key_handler(app->window, key_handler); window_set_user_data(app->window, app); window_set_keyboard_focus_handler(app->window, keyboard_focus_handler); widget_set_redraw_handler(app->widget, redraw_handler); widget_set_resize_handler(app->widget, resize_handler); app->subsurface = window_add_subsurface(app->window, app, int_to_mode(option_red_mode)); widget_set_redraw_handler(app->subsurface, sub_redraw_handler); widget_set_resize_handler(app->subsurface, sub_resize_handler); if (app->egl && !option_no_triangle) app->triangle = triangle_create(app->window, app->egl); /* minimum size */ widget_schedule_resize(app->widget, 100, 100); /* initial size */ widget_schedule_resize(app->widget, 400, 300); app->animate = 1; return app; } static void demoapp_destroy(struct demoapp *app) { if (app->triangle) triangle_destroy(app->triangle); if (app->egl) egl_state_destroy(app->egl); widget_destroy(app->subsurface); widget_destroy(app->widget); window_destroy(app->window); free(app); } int main(int argc, char *argv[]) { struct display *display; struct demoapp *app; if (parse_options(options, ARRAY_LENGTH(options), &argc, argv) > 1 || option_help) { printf(help_text, argv[0]); return 0; } display = display_create(&argc, argv); if (display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } if (!display_has_subcompositor(display)) { fprintf(stderr, "compositor does not support " "the subcompositor extension\n"); return -1; } app = demoapp_create(display); display_run(display); demoapp_destroy(app); display_destroy(display); return 0; } weston-1.9.0/clients/terminal.c0000664000175000017500000024240312575610243013415 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "shared/config-parser.h" #include "shared/helpers.h" #include "window.h" static int option_fullscreen; static char *option_font; static int option_font_size; static char *option_term; static char *option_shell; static struct wl_list terminal_list; static struct terminal * terminal_create(struct display *display); static void terminal_destroy(struct terminal *terminal); static int terminal_run(struct terminal *terminal, const char *path); #define TERMINAL_DRAW_SINGLE_WIDE_CHARACTERS \ " !\"#$%&'()*+,-./" \ "0123456789" \ ":;<=>?@" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "[\\]^_`" \ "abcdefghijklmnopqrstuvwxyz" \ "{|}~" \ "" #define MOD_SHIFT 0x01 #define MOD_ALT 0x02 #define MOD_CTRL 0x04 #define ATTRMASK_BOLD 0x01 #define ATTRMASK_UNDERLINE 0x02 #define ATTRMASK_BLINK 0x04 #define ATTRMASK_INVERSE 0x08 #define ATTRMASK_CONCEALED 0x10 /* Buffer sizes */ #define MAX_RESPONSE 256 #define MAX_ESCAPE 255 /* Terminal modes */ #define MODE_SHOW_CURSOR 0x00000001 #define MODE_INVERSE 0x00000002 #define MODE_AUTOWRAP 0x00000004 #define MODE_AUTOREPEAT 0x00000008 #define MODE_LF_NEWLINE 0x00000010 #define MODE_IRM 0x00000020 #define MODE_DELETE_SENDS_DEL 0x00000040 #define MODE_ALT_SENDS_ESC 0x00000080 union utf8_char { unsigned char byte[4]; uint32_t ch; }; enum utf8_state { utf8state_start, utf8state_accept, utf8state_reject, utf8state_expect3, utf8state_expect2, utf8state_expect1 }; struct utf8_state_machine { enum utf8_state state; int len; union utf8_char s; uint32_t unicode; }; static void init_state_machine(struct utf8_state_machine *machine) { machine->state = utf8state_start; machine->len = 0; machine->s.ch = 0; } static enum utf8_state utf8_next_char(struct utf8_state_machine *machine, unsigned char c) { switch(machine->state) { case utf8state_start: case utf8state_accept: case utf8state_reject: machine->s.ch = 0; machine->len = 0; if (c == 0xC0 || c == 0xC1) { /* overlong encoding, reject */ machine->state = utf8state_reject; } else if ((c & 0x80) == 0) { /* single byte, accept */ machine->s.byte[machine->len++] = c; machine->state = utf8state_accept; machine->unicode = c; } else if ((c & 0xC0) == 0x80) { /* parser out of sync, ignore byte */ machine->state = utf8state_start; } else if ((c & 0xE0) == 0xC0) { /* start of two byte sequence */ machine->s.byte[machine->len++] = c; machine->state = utf8state_expect1; machine->unicode = c & 0x1f; } else if ((c & 0xF0) == 0xE0) { /* start of three byte sequence */ machine->s.byte[machine->len++] = c; machine->state = utf8state_expect2; machine->unicode = c & 0x0f; } else if ((c & 0xF8) == 0xF0) { /* start of four byte sequence */ machine->s.byte[machine->len++] = c; machine->state = utf8state_expect3; machine->unicode = c & 0x07; } else { /* overlong encoding, reject */ machine->state = utf8state_reject; } break; case utf8state_expect3: machine->s.byte[machine->len++] = c; machine->unicode = (machine->unicode << 6) | (c & 0x3f); if ((c & 0xC0) == 0x80) { /* all good, continue */ machine->state = utf8state_expect2; } else { /* missing extra byte, reject */ machine->state = utf8state_reject; } break; case utf8state_expect2: machine->s.byte[machine->len++] = c; machine->unicode = (machine->unicode << 6) | (c & 0x3f); if ((c & 0xC0) == 0x80) { /* all good, continue */ machine->state = utf8state_expect1; } else { /* missing extra byte, reject */ machine->state = utf8state_reject; } break; case utf8state_expect1: machine->s.byte[machine->len++] = c; machine->unicode = (machine->unicode << 6) | (c & 0x3f); if ((c & 0xC0) == 0x80) { /* all good, accept */ machine->state = utf8state_accept; } else { /* missing extra byte, reject */ machine->state = utf8state_reject; } break; default: machine->state = utf8state_reject; break; } return machine->state; } static uint32_t get_unicode(union utf8_char utf8) { struct utf8_state_machine machine; int i; init_state_machine(&machine); for (i = 0; i < 4; i++) { utf8_next_char(&machine, utf8.byte[i]); if (machine.state == utf8state_accept || machine.state == utf8state_reject) break; } if (machine.state == utf8state_reject) return 0xfffd; return machine.unicode; } static bool is_wide(union utf8_char utf8) { uint32_t unichar = get_unicode(utf8); return wcwidth(unichar) > 1; } struct char_sub { union utf8_char match; union utf8_char replace; }; /* Set last char_sub match to NULL char */ typedef struct char_sub *character_set; struct char_sub CS_US[] = { {{{0, }}, {{0, }}} }; static struct char_sub CS_UK[] = { {{{'#', 0, }}, {{0xC2, 0xA3, 0, }}}, /* POUND: £ */ {{{0, }}, {{0, }}} }; static struct char_sub CS_SPECIAL[] = { {{{'`', 0, }}, {{0xE2, 0x99, 0xA6, 0}}}, /* diamond: ♦ */ {{{'a', 0, }}, {{0xE2, 0x96, 0x92, 0}}}, /* 50% cell: ▒ */ {{{'b', 0, }}, {{0xE2, 0x90, 0x89, 0}}}, /* HT: ␉ */ {{{'c', 0, }}, {{0xE2, 0x90, 0x8C, 0}}}, /* FF: ␌ */ {{{'d', 0, }}, {{0xE2, 0x90, 0x8D, 0}}}, /* CR: ␍ */ {{{'e', 0, }}, {{0xE2, 0x90, 0x8A, 0}}}, /* LF: ␊ */ {{{'f', 0, }}, {{0xC2, 0xB0, 0, }}}, /* Degree: ° */ {{{'g', 0, }}, {{0xC2, 0xB1, 0, }}}, /* Plus/Minus: ± */ {{{'h', 0, }}, {{0xE2, 0x90, 0xA4, 0}}}, /* NL: ␤ */ {{{'i', 0, }}, {{0xE2, 0x90, 0x8B, 0}}}, /* VT: ␋ */ {{{'j', 0, }}, {{0xE2, 0x94, 0x98, 0}}}, /* CN_RB: ┘ */ {{{'k', 0, }}, {{0xE2, 0x94, 0x90, 0}}}, /* CN_RT: ┐ */ {{{'l', 0, }}, {{0xE2, 0x94, 0x8C, 0}}}, /* CN_LT: ┌ */ {{{'m', 0, }}, {{0xE2, 0x94, 0x94, 0}}}, /* CN_LB: └ */ {{{'n', 0, }}, {{0xE2, 0x94, 0xBC, 0}}}, /* CROSS: ┼ */ {{{'o', 0, }}, {{0xE2, 0x8E, 0xBA, 0}}}, /* Horiz. Scan Line 1: ⎺ */ {{{'p', 0, }}, {{0xE2, 0x8E, 0xBB, 0}}}, /* Horiz. Scan Line 3: ⎻ */ {{{'q', 0, }}, {{0xE2, 0x94, 0x80, 0}}}, /* Horiz. Scan Line 5: ─ */ {{{'r', 0, }}, {{0xE2, 0x8E, 0xBC, 0}}}, /* Horiz. Scan Line 7: ⎼ */ {{{'s', 0, }}, {{0xE2, 0x8E, 0xBD, 0}}}, /* Horiz. Scan Line 9: ⎽ */ {{{'t', 0, }}, {{0xE2, 0x94, 0x9C, 0}}}, /* TR: ├ */ {{{'u', 0, }}, {{0xE2, 0x94, 0xA4, 0}}}, /* TL: ┤ */ {{{'v', 0, }}, {{0xE2, 0x94, 0xB4, 0}}}, /* TU: ┴ */ {{{'w', 0, }}, {{0xE2, 0x94, 0xAC, 0}}}, /* TD: ┬ */ {{{'x', 0, }}, {{0xE2, 0x94, 0x82, 0}}}, /* V: │ */ {{{'y', 0, }}, {{0xE2, 0x89, 0xA4, 0}}}, /* LE: ≤ */ {{{'z', 0, }}, {{0xE2, 0x89, 0xA5, 0}}}, /* GE: ≥ */ {{{'{', 0, }}, {{0xCF, 0x80, 0, }}}, /* PI: π */ {{{'|', 0, }}, {{0xE2, 0x89, 0xA0, 0}}}, /* NEQ: ≠ */ {{{'}', 0, }}, {{0xC2, 0xA3, 0, }}}, /* POUND: £ */ {{{'~', 0, }}, {{0xE2, 0x8B, 0x85, 0}}}, /* DOT: ⋅ */ {{{0, }}, {{0, }}} }; static void apply_char_set(character_set cs, union utf8_char *utf8) { int i = 0; while (cs[i].match.byte[0]) { if ((*utf8).ch == cs[i].match.ch) { *utf8 = cs[i].replace; break; } i++; } } struct key_map { int sym; int num; char escape; char code; }; /* Set last key_sub sym to NULL */ typedef struct key_map *keyboard_mode; static struct key_map KM_NORMAL[] = { { XKB_KEY_Left, 1, '[', 'D' }, { XKB_KEY_Right, 1, '[', 'C' }, { XKB_KEY_Up, 1, '[', 'A' }, { XKB_KEY_Down, 1, '[', 'B' }, { XKB_KEY_Home, 1, '[', 'H' }, { XKB_KEY_End, 1, '[', 'F' }, { 0, 0, 0, 0 } }; static struct key_map KM_APPLICATION[] = { { XKB_KEY_Left, 1, 'O', 'D' }, { XKB_KEY_Right, 1, 'O', 'C' }, { XKB_KEY_Up, 1, 'O', 'A' }, { XKB_KEY_Down, 1, 'O', 'B' }, { XKB_KEY_Home, 1, 'O', 'H' }, { XKB_KEY_End, 1, 'O', 'F' }, { XKB_KEY_KP_Enter, 1, 'O', 'M' }, { XKB_KEY_KP_Multiply, 1, 'O', 'j' }, { XKB_KEY_KP_Add, 1, 'O', 'k' }, { XKB_KEY_KP_Separator, 1, 'O', 'l' }, { XKB_KEY_KP_Subtract, 1, 'O', 'm' }, { XKB_KEY_KP_Divide, 1, 'O', 'o' }, { 0, 0, 0, 0 } }; static int function_key_response(char escape, int num, uint32_t modifiers, char code, char *response) { int mod_num = 0; int len; if (modifiers & MOD_SHIFT_MASK) mod_num |= 1; if (modifiers & MOD_ALT_MASK) mod_num |= 2; if (modifiers & MOD_CONTROL_MASK) mod_num |= 4; if (mod_num != 0) len = snprintf(response, MAX_RESPONSE, "\e[%d;%d%c", num, mod_num + 1, code); else if (code != '~') len = snprintf(response, MAX_RESPONSE, "\e%c%c", escape, code); else len = snprintf(response, MAX_RESPONSE, "\e%c%d%c", escape, num, code); if (len >= MAX_RESPONSE) return MAX_RESPONSE - 1; else return len; } /* returns the number of bytes written into response, * which must have room for MAX_RESPONSE bytes */ static int apply_key_map(keyboard_mode mode, int sym, uint32_t modifiers, char *response) { struct key_map map; int len = 0; int i = 0; while (mode[i].sym) { map = mode[i++]; if (sym == map.sym) { len = function_key_response(map.escape, map.num, modifiers, map.code, response); break; } } return len; } struct terminal_color { double r, g, b, a; }; struct attr { unsigned char fg, bg; char a; /* attributes format: * 76543210 * cilub */ char s; /* in selection */ }; struct color_scheme { struct terminal_color palette[16]; char border; struct attr default_attr; }; static void attr_init(struct attr *data_attr, struct attr attr, int n) { int i; for (i = 0; i < n; i++) { data_attr[i] = attr; } } enum escape_state { escape_state_normal = 0, escape_state_escape, escape_state_dcs, escape_state_csi, escape_state_osc, escape_state_inner_escape, escape_state_ignore, escape_state_special }; #define ESC_FLAG_WHAT 0x01 #define ESC_FLAG_GT 0x02 #define ESC_FLAG_BANG 0x04 #define ESC_FLAG_CASH 0x08 #define ESC_FLAG_SQUOTE 0x10 #define ESC_FLAG_DQUOTE 0x20 #define ESC_FLAG_SPACE 0x40 enum { SELECT_NONE, SELECT_CHAR, SELECT_WORD, SELECT_LINE }; struct terminal { struct window *window; struct widget *widget; struct display *display; char *title; union utf8_char *data; struct task io_task; char *tab_ruler; struct attr *data_attr; struct attr curr_attr; uint32_t mode; char origin_mode; char saved_origin_mode; struct attr saved_attr; union utf8_char last_char; int margin_top, margin_bottom; character_set cs, g0, g1; character_set saved_cs, saved_g0, saved_g1; keyboard_mode key_mode; int data_pitch, attr_pitch; /* The width in bytes of a line */ int width, height, row, column, max_width; uint32_t buffer_height; uint32_t start, end, saved_start, log_size; wl_fixed_t smooth_scroll; int saved_row, saved_column; int scrolling; int send_cursor_position; int fd, master; uint32_t modifiers; char escape[MAX_ESCAPE+1]; int escape_length; enum escape_state state; enum escape_state outer_state; int escape_flags; struct utf8_state_machine state_machine; int margin; struct color_scheme *color_scheme; struct terminal_color color_table[256]; cairo_font_extents_t extents; double average_width; cairo_scaled_font_t *font_normal, *font_bold; uint32_t hide_cursor_serial; int size_in_title; struct wl_data_source *selection; uint32_t click_time; int dragging, click_count; int selection_start_x, selection_start_y; int selection_end_x, selection_end_y; int selection_start_row, selection_start_col; int selection_end_row, selection_end_col; struct wl_list link; }; /* Create default tab stops, every 8 characters */ static void terminal_init_tabs(struct terminal *terminal) { int i = 0; while (i < terminal->width) { if (i % 8 == 0) terminal->tab_ruler[i] = 1; else terminal->tab_ruler[i] = 0; i++; } } static void terminal_init(struct terminal *terminal) { terminal->curr_attr = terminal->color_scheme->default_attr; terminal->origin_mode = 0; terminal->mode = MODE_SHOW_CURSOR | MODE_AUTOREPEAT | MODE_ALT_SENDS_ESC | MODE_AUTOWRAP; terminal->row = 0; terminal->column = 0; terminal->g0 = CS_US; terminal->g1 = CS_US; terminal->cs = terminal->g0; terminal->key_mode = KM_NORMAL; terminal->saved_g0 = terminal->g0; terminal->saved_g1 = terminal->g1; terminal->saved_cs = terminal->cs; terminal->saved_attr = terminal->curr_attr; terminal->saved_origin_mode = terminal->origin_mode; terminal->saved_row = terminal->row; terminal->saved_column = terminal->column; if (terminal->tab_ruler != NULL) terminal_init_tabs(terminal); } static void init_color_table(struct terminal *terminal) { int c, r; struct terminal_color *color_table = terminal->color_table; for (c = 0; c < 256; c ++) { if (c < 16) { color_table[c] = terminal->color_scheme->palette[c]; } else if (c < 232) { r = c - 16; color_table[c].b = ((double)(r % 6) / 6.0); r /= 6; color_table[c].g = ((double)(r % 6) / 6.0); r /= 6; color_table[c].r = ((double)(r % 6) / 6.0); color_table[c].a = 1.0; } else { r = (c - 232) * 10 + 8; color_table[c].r = ((double) r) / 256.0; color_table[c].g = color_table[c].r; color_table[c].b = color_table[c].r; color_table[c].a = 1.0; } } } static union utf8_char * terminal_get_row(struct terminal *terminal, int row) { int index; index = (row + terminal->start) & (terminal->buffer_height - 1); return (void *) terminal->data + index * terminal->data_pitch; } static struct attr* terminal_get_attr_row(struct terminal *terminal, int row) { int index; index = (row + terminal->start) & (terminal->buffer_height - 1); return (void *) terminal->data_attr + index * terminal->attr_pitch; } union decoded_attr { struct attr attr; uint32_t key; }; static void terminal_decode_attr(struct terminal *terminal, int row, int col, union decoded_attr *decoded) { struct attr attr; int foreground, background, tmp; decoded->attr.s = 0; if (((row == terminal->selection_start_row && col >= terminal->selection_start_col) || row > terminal->selection_start_row) && ((row == terminal->selection_end_row && col < terminal->selection_end_col) || row < terminal->selection_end_row)) decoded->attr.s = 1; /* get the attributes for this character cell */ attr = terminal_get_attr_row(terminal, row)[col]; if ((attr.a & ATTRMASK_INVERSE) || decoded->attr.s || ((terminal->mode & MODE_SHOW_CURSOR) && window_has_focus(terminal->window) && terminal->row == row && terminal->column == col)) { foreground = attr.bg; background = attr.fg; if (attr.a & ATTRMASK_BOLD) { if (foreground <= 16) foreground |= 0x08; if (background <= 16) background &= 0x07; } } else { foreground = attr.fg; background = attr.bg; } if (terminal->mode & MODE_INVERSE) { tmp = foreground; foreground = background; background = tmp; if (attr.a & ATTRMASK_BOLD) { if (foreground <= 16) foreground |= 0x08; if (background <= 16) background &= 0x07; } } decoded->attr.fg = foreground; decoded->attr.bg = background; decoded->attr.a = attr.a; } static void terminal_scroll_buffer(struct terminal *terminal, int d) { int i; terminal->start += d; if (d < 0) { d = 0 - d; for (i = 0; i < d; i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } } else { for (i = terminal->height - d; i < terminal->height; i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } } terminal->selection_start_row -= d; terminal->selection_end_row -= d; } static void terminal_scroll_window(struct terminal *terminal, int d) { int i; int window_height; int from_row, to_row; // scrolling range is inclusive window_height = terminal->margin_bottom - terminal->margin_top + 1; d = d % (window_height + 1); if (d < 0) { d = 0 - d; to_row = terminal->margin_bottom; from_row = terminal->margin_bottom - d; for (i = 0; i < (window_height - d); i++) { memcpy(terminal_get_row(terminal, to_row - i), terminal_get_row(terminal, from_row - i), terminal->data_pitch); memcpy(terminal_get_attr_row(terminal, to_row - i), terminal_get_attr_row(terminal, from_row - i), terminal->attr_pitch); } for (i = terminal->margin_top; i < (terminal->margin_top + d); i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } } else { to_row = terminal->margin_top; from_row = terminal->margin_top + d; for (i = 0; i < (window_height - d); i++) { memcpy(terminal_get_row(terminal, to_row + i), terminal_get_row(terminal, from_row + i), terminal->data_pitch); memcpy(terminal_get_attr_row(terminal, to_row + i), terminal_get_attr_row(terminal, from_row + i), terminal->attr_pitch); } for (i = terminal->margin_bottom - d + 1; i <= terminal->margin_bottom; i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } } } static void terminal_scroll(struct terminal *terminal, int d) { if (terminal->margin_top == 0 && terminal->margin_bottom == terminal->height - 1) terminal_scroll_buffer(terminal, d); else terminal_scroll_window(terminal, d); } static void terminal_shift_line(struct terminal *terminal, int d) { union utf8_char *row; struct attr *attr_row; row = terminal_get_row(terminal, terminal->row); attr_row = terminal_get_attr_row(terminal, terminal->row); if ((terminal->width + d) <= terminal->column) d = terminal->column + 1 - terminal->width; if ((terminal->column + d) >= terminal->width) d = terminal->width - terminal->column - 1; if (d < 0) { d = 0 - d; memmove(&row[terminal->column], &row[terminal->column + d], (terminal->width - terminal->column - d) * sizeof(union utf8_char)); memmove(&attr_row[terminal->column], &attr_row[terminal->column + d], (terminal->width - terminal->column - d) * sizeof(struct attr)); memset(&row[terminal->width - d], 0, d * sizeof(union utf8_char)); attr_init(&attr_row[terminal->width - d], terminal->curr_attr, d); } else { memmove(&row[terminal->column + d], &row[terminal->column], (terminal->width - terminal->column - d) * sizeof(union utf8_char)); memmove(&attr_row[terminal->column + d], &attr_row[terminal->column], (terminal->width - terminal->column - d) * sizeof(struct attr)); memset(&row[terminal->column], 0, d * sizeof(union utf8_char)); attr_init(&attr_row[terminal->column], terminal->curr_attr, d); } } static void terminal_resize_cells(struct terminal *terminal, int width, int height) { union utf8_char *data; struct attr *data_attr; char *tab_ruler; int data_pitch, attr_pitch; int i, l, total_rows; uint32_t d, uheight = height; struct rectangle allocation; struct winsize ws; if (uheight > terminal->buffer_height) height = terminal->buffer_height; if (terminal->width == width && terminal->height == height) return; if (terminal->data && width <= terminal->max_width) { d = 0; if (height < terminal->height && height <= terminal->row) d = terminal->height - height; else if (height > terminal->height && terminal->height - 1 == terminal->row) { d = terminal->height - height; if (terminal->log_size < uheight) d = -terminal->start; } terminal->start += d; terminal->row -= d; } else { terminal->max_width = width; data_pitch = width * sizeof(union utf8_char); data = xzalloc(data_pitch * terminal->buffer_height); attr_pitch = width * sizeof(struct attr); data_attr = xmalloc(attr_pitch * terminal->buffer_height); tab_ruler = xzalloc(width); attr_init(data_attr, terminal->curr_attr, width * terminal->buffer_height); if (terminal->data && terminal->data_attr) { if (width > terminal->width) l = terminal->width; else l = width; if (terminal->height > height) { total_rows = height; i = 1 + terminal->row - height; if (i > 0) { terminal->start += i; terminal->row = terminal->row - i; } } else { total_rows = terminal->height; } for (i = 0; i < total_rows; i++) { memcpy(&data[width * i], terminal_get_row(terminal, i), l * sizeof(union utf8_char)); memcpy(&data_attr[width * i], terminal_get_attr_row(terminal, i), l * sizeof(struct attr)); } free(terminal->data); free(terminal->data_attr); free(terminal->tab_ruler); } terminal->data_pitch = data_pitch; terminal->attr_pitch = attr_pitch; terminal->data = data; terminal->data_attr = data_attr; terminal->tab_ruler = tab_ruler; terminal->start = 0; } terminal->margin_bottom = height - (terminal->height - terminal->margin_bottom); terminal->width = width; terminal->height = height; terminal_init_tabs(terminal); /* Update the window size */ ws.ws_row = terminal->height; ws.ws_col = terminal->width; widget_get_allocation(terminal->widget, &allocation); ws.ws_xpixel = allocation.width; ws.ws_ypixel = allocation.height; ioctl(terminal->master, TIOCSWINSZ, &ws); } static void update_title(struct terminal *terminal) { if (window_is_resizing(terminal->window)) { char *p; if (asprintf(&p, "%s — [%dx%d]", terminal->title, terminal->width, terminal->height) > 0) { window_set_title(terminal->window, p); free(p); } } else { window_set_title(terminal->window, terminal->title); } } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct terminal *terminal = data; int32_t columns, rows, m; m = 2 * terminal->margin; columns = (width - m) / (int32_t) terminal->average_width; rows = (height - m) / (int32_t) terminal->extents.height; if (!window_is_fullscreen(terminal->window) && !window_is_maximized(terminal->window)) { width = columns * terminal->average_width + m; height = rows * terminal->extents.height + m; widget_set_size(terminal->widget, width, height); } terminal_resize_cells(terminal, columns, rows); update_title(terminal); } static void state_changed_handler(struct window *window, void *data) { struct terminal *terminal = data; update_title(terminal); } static void terminal_resize(struct terminal *terminal, int columns, int rows) { int32_t width, height, m; if (window_is_fullscreen(terminal->window) || window_is_maximized(terminal->window)) return; m = 2 * terminal->margin; width = columns * terminal->average_width + m; height = rows * terminal->extents.height + m; window_frame_set_child_size(terminal->widget, width, height); } struct color_scheme DEFAULT_COLORS = { { {0, 0, 0, 1}, /* black */ {0.66, 0, 0, 1}, /* red */ {0 , 0.66, 0, 1}, /* green */ {0.66, 0.33, 0, 1}, /* orange (nicer than muddy yellow) */ {0 , 0 , 0.66, 1}, /* blue */ {0.66, 0 , 0.66, 1}, /* magenta */ {0, 0.66, 0.66, 1}, /* cyan */ {0.66, 0.66, 0.66, 1}, /* light grey */ {0.22, 0.33, 0.33, 1}, /* dark grey */ {1, 0.33, 0.33, 1}, /* high red */ {0.33, 1, 0.33, 1}, /* high green */ {1, 1, 0.33, 1}, /* high yellow */ {0.33, 0.33, 1, 1}, /* high blue */ {1, 0.33, 1, 1}, /* high magenta */ {0.33, 1, 1, 1}, /* high cyan */ {1, 1, 1, 1} /* white */ }, 0, /* black border */ {7, 0, 0, } /* bg:black (0), fg:light gray (7) */ }; static void terminal_set_color(struct terminal *terminal, cairo_t *cr, int index) { cairo_set_source_rgba(cr, terminal->color_table[index].r, terminal->color_table[index].g, terminal->color_table[index].b, terminal->color_table[index].a); } static void terminal_send_selection(struct terminal *terminal, int fd) { int row, col; union utf8_char *p_row; union decoded_attr attr; FILE *fp; int len; fp = fdopen(fd, "w"); if (fp == NULL){ close(fd); return; } for (row = 0; row < terminal->height; row++) { p_row = terminal_get_row(terminal, row); for (col = 0; col < terminal->width; col++) { if (p_row[col].ch == 0x200B) /* space glyph */ continue; /* get the attributes for this character cell */ terminal_decode_attr(terminal, row, col, &attr); if (!attr.attr.s) continue; len = strnlen((char *) p_row[col].byte, 4); if (len > 0) fwrite(p_row[col].byte, 1, len, fp); if (len == 0 || col == terminal->width - 1) { fwrite("\n", 1, 1, fp); break; } } } fclose(fp); } struct glyph_run { struct terminal *terminal; cairo_t *cr; unsigned int count; union decoded_attr attr; cairo_glyph_t glyphs[256], *g; }; static void glyph_run_init(struct glyph_run *run, struct terminal *terminal, cairo_t *cr) { run->terminal = terminal; run->cr = cr; run->g = run->glyphs; run->count = 0; run->attr.key = 0; } static void glyph_run_flush(struct glyph_run *run, union decoded_attr attr) { cairo_scaled_font_t *font; if (run->count > ARRAY_LENGTH(run->glyphs) - 10 || (attr.key != run->attr.key)) { if (run->attr.attr.a & (ATTRMASK_BOLD | ATTRMASK_BLINK)) font = run->terminal->font_bold; else font = run->terminal->font_normal; cairo_set_scaled_font(run->cr, font); terminal_set_color(run->terminal, run->cr, run->attr.attr.fg); if (!(run->attr.attr.a & ATTRMASK_CONCEALED)) cairo_show_glyphs (run->cr, run->glyphs, run->count); run->g = run->glyphs; run->count = 0; } run->attr = attr; } static void glyph_run_add(struct glyph_run *run, int x, int y, union utf8_char *c) { int num_glyphs; cairo_scaled_font_t *font; num_glyphs = ARRAY_LENGTH(run->glyphs) - run->count; if (run->attr.attr.a & (ATTRMASK_BOLD | ATTRMASK_BLINK)) font = run->terminal->font_bold; else font = run->terminal->font_normal; cairo_move_to(run->cr, x, y); cairo_scaled_font_text_to_glyphs (font, x, y, (char *) c->byte, 4, &run->g, &num_glyphs, NULL, NULL, NULL); run->g += num_glyphs; run->count += num_glyphs; } static void redraw_handler(struct widget *widget, void *data) { struct terminal *terminal = data; struct rectangle allocation; cairo_t *cr; int top_margin, side_margin; int row, col, cursor_x, cursor_y; union utf8_char *p_row; union decoded_attr attr; int text_x, text_y; cairo_surface_t *surface; double d; struct glyph_run run; cairo_font_extents_t extents; double average_width; double unichar_width; surface = window_get_surface(terminal->window); widget_get_allocation(terminal->widget, &allocation); cr = widget_cairo_create(terminal->widget); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_clip(cr); cairo_push_group(cr); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); terminal_set_color(terminal, cr, terminal->color_scheme->border); cairo_paint(cr); cairo_set_scaled_font(cr, terminal->font_normal); extents = terminal->extents; average_width = terminal->average_width; side_margin = (allocation.width - terminal->width * average_width) / 2; top_margin = (allocation.height - terminal->height * extents.height) / 2; cairo_set_line_width(cr, 1.0); cairo_translate(cr, allocation.x + side_margin, allocation.y + top_margin); /* paint the background */ for (row = 0; row < terminal->height; row++) { p_row = terminal_get_row(terminal, row); for (col = 0; col < terminal->width; col++) { /* get the attributes for this character cell */ terminal_decode_attr(terminal, row, col, &attr); if (attr.attr.bg == terminal->color_scheme->border) continue; if (is_wide(p_row[col])) unichar_width = 2 * average_width; else unichar_width = average_width; terminal_set_color(terminal, cr, attr.attr.bg); cairo_move_to(cr, col * average_width, row * extents.height); cairo_rel_line_to(cr, unichar_width, 0); cairo_rel_line_to(cr, 0, extents.height); cairo_rel_line_to(cr, -unichar_width, 0); cairo_close_path(cr); cairo_fill(cr); } } cairo_set_operator(cr, CAIRO_OPERATOR_OVER); /* paint the foreground */ glyph_run_init(&run, terminal, cr); for (row = 0; row < terminal->height; row++) { p_row = terminal_get_row(terminal, row); for (col = 0; col < terminal->width; col++) { /* get the attributes for this character cell */ terminal_decode_attr(terminal, row, col, &attr); glyph_run_flush(&run, attr); text_x = col * average_width; text_y = extents.ascent + row * extents.height; if (attr.attr.a & ATTRMASK_UNDERLINE) { terminal_set_color(terminal, cr, attr.attr.fg); cairo_move_to(cr, text_x, (double)text_y + 1.5); cairo_line_to(cr, text_x + average_width, (double) text_y + 1.5); cairo_stroke(cr); } /* skip space glyph (RLE) we use as a placeholder of the right half of a double-width character, because RLE is not available in every font. */ if (p_row[col].ch == 0x200B) continue; glyph_run_add(&run, text_x, text_y, &p_row[col]); } } attr.key = ~0; glyph_run_flush(&run, attr); if ((terminal->mode & MODE_SHOW_CURSOR) && !window_has_focus(terminal->window)) { d = 0.5; cairo_set_line_width(cr, 1); cairo_move_to(cr, terminal->column * average_width + d, terminal->row * extents.height + d); cairo_rel_line_to(cr, average_width - 2 * d, 0); cairo_rel_line_to(cr, 0, extents.height - 2 * d); cairo_rel_line_to(cr, -average_width + 2 * d, 0); cairo_close_path(cr); cairo_stroke(cr); } cairo_pop_group_to_source(cr); cairo_paint(cr); cairo_destroy(cr); cairo_surface_destroy(surface); if (terminal->send_cursor_position) { cursor_x = side_margin + allocation.x + terminal->column * average_width; cursor_y = top_margin + allocation.y + terminal->row * extents.height; window_set_text_cursor_position(terminal->window, cursor_x, cursor_y); terminal->send_cursor_position = 0; } } static void terminal_write(struct terminal *terminal, const char *data, size_t length) { if (write(terminal->master, data, length) < 0) abort(); terminal->send_cursor_position = 1; } static void terminal_data(struct terminal *terminal, const char *data, size_t length); static void handle_char(struct terminal *terminal, union utf8_char utf8); static void handle_sgr(struct terminal *terminal, int code); static void handle_term_parameter(struct terminal *terminal, int code, int sr) { int i; if (terminal->escape_flags & ESC_FLAG_WHAT) { switch(code) { case 1: /* DECCKM */ if (sr) terminal->key_mode = KM_APPLICATION; else terminal->key_mode = KM_NORMAL; break; case 2: /* DECANM */ /* No VT52 support yet */ terminal->g0 = CS_US; terminal->g1 = CS_US; terminal->cs = terminal->g0; break; case 3: /* DECCOLM */ if (sr) terminal_resize(terminal, 132, 24); else terminal_resize(terminal, 80, 24); /* set columns, but also home cursor and clear screen */ terminal->row = 0; terminal->column = 0; for (i = 0; i < terminal->height; i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } break; case 5: /* DECSCNM */ if (sr) terminal->mode |= MODE_INVERSE; else terminal->mode &= ~MODE_INVERSE; break; case 6: /* DECOM */ terminal->origin_mode = sr; if (terminal->origin_mode) terminal->row = terminal->margin_top; else terminal->row = 0; terminal->column = 0; break; case 7: /* DECAWM */ if (sr) terminal->mode |= MODE_AUTOWRAP; else terminal->mode &= ~MODE_AUTOWRAP; break; case 8: /* DECARM */ if (sr) terminal->mode |= MODE_AUTOREPEAT; else terminal->mode &= ~MODE_AUTOREPEAT; break; case 12: /* Very visible cursor (CVVIS) */ /* FIXME: What do we do here. */ break; case 25: if (sr) terminal->mode |= MODE_SHOW_CURSOR; else terminal->mode &= ~MODE_SHOW_CURSOR; break; case 1034: /* smm/rmm, meta mode on/off */ /* ignore */ break; case 1037: /* deleteSendsDel */ if (sr) terminal->mode |= MODE_DELETE_SENDS_DEL; else terminal->mode &= ~MODE_DELETE_SENDS_DEL; break; case 1039: /* altSendsEscape */ if (sr) terminal->mode |= MODE_ALT_SENDS_ESC; else terminal->mode &= ~MODE_ALT_SENDS_ESC; break; case 1049: /* rmcup/smcup, alternate screen */ /* Ignore. Should be possible to implement, * but it's kind of annoying. */ break; default: fprintf(stderr, "Unknown parameter: ?%d\n", code); break; } } else { switch(code) { case 4: /* IRM */ if (sr) terminal->mode |= MODE_IRM; else terminal->mode &= ~MODE_IRM; break; case 20: /* LNM */ if (sr) terminal->mode |= MODE_LF_NEWLINE; else terminal->mode &= ~MODE_LF_NEWLINE; break; default: fprintf(stderr, "Unknown parameter: %d\n", code); break; } } } static void handle_dcs(struct terminal *terminal) { } static void handle_osc(struct terminal *terminal) { char *p; int code; terminal->escape[terminal->escape_length++] = '\0'; p = &terminal->escape[2]; code = strtol(p, &p, 10); if (*p == ';') p++; switch (code) { case 0: /* Icon name and window title */ case 1: /* Icon label */ case 2: /* Window title*/ free(terminal->title); terminal->title = strdup(p); window_set_title(terminal->window, p); break; case 7: /* shell cwd as uri */ break; default: fprintf(stderr, "Unknown OSC escape code %d, text %s\n", code, p); break; } } static void handle_escape(struct terminal *terminal) { union utf8_char *row; struct attr *attr_row; char *p; int i, count, x, y, top, bottom; int args[10], set[10] = { 0, }; char response[MAX_RESPONSE] = {0, }; struct rectangle allocation; terminal->escape[terminal->escape_length++] = '\0'; i = 0; p = &terminal->escape[2]; while ((isdigit(*p) || *p == ';') && i < 10) { if (*p == ';') { if (!set[i]) { args[i] = 0; set[i] = 1; } p++; i++; } else { args[i] = strtol(p, &p, 10); set[i] = 1; } } switch (*p) { case '@': /* ICH */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; terminal_shift_line(terminal, count); break; case 'A': /* CUU */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if (terminal->row - count >= terminal->margin_top) terminal->row -= count; else terminal->row = terminal->margin_top; break; case 'B': /* CUD */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if (terminal->row + count <= terminal->margin_bottom) terminal->row += count; else terminal->row = terminal->margin_bottom; break; case 'C': /* CUF */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if ((terminal->column + count) < terminal->width) terminal->column += count; else terminal->column = terminal->width - 1; break; case 'D': /* CUB */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if ((terminal->column - count) >= 0) terminal->column -= count; else terminal->column = 0; break; case 'E': /* CNL */ count = set[0] ? args[0] : 1; if (terminal->row + count <= terminal->margin_bottom) terminal->row += count; else terminal->row = terminal->margin_bottom; terminal->column = 0; break; case 'F': /* CPL */ count = set[0] ? args[0] : 1; if (terminal->row - count >= terminal->margin_top) terminal->row -= count; else terminal->row = terminal->margin_top; terminal->column = 0; break; case 'G': /* CHA */ y = set[0] ? args[0] : 1; y = y <= 0 ? 1 : y > terminal->width ? terminal->width : y; terminal->column = y - 1; break; case 'f': /* HVP */ case 'H': /* CUP */ x = (set[1] ? args[1] : 1) - 1; x = x < 0 ? 0 : (x >= terminal->width ? terminal->width - 1 : x); y = (set[0] ? args[0] : 1) - 1; if (terminal->origin_mode) { y += terminal->margin_top; y = y < terminal->margin_top ? terminal->margin_top : (y > terminal->margin_bottom ? terminal->margin_bottom : y); } else { y = y < 0 ? 0 : (y >= terminal->height ? terminal->height - 1 : y); } terminal->row = y; terminal->column = x; break; case 'I': /* CHT */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; while (count > 0 && terminal->column < terminal->width) { if (terminal->tab_ruler[terminal->column]) count--; terminal->column++; } terminal->column--; break; case 'J': /* ED */ row = terminal_get_row(terminal, terminal->row); attr_row = terminal_get_attr_row(terminal, terminal->row); if (!set[0] || args[0] == 0 || args[0] > 2) { memset(&row[terminal->column], 0, (terminal->width - terminal->column) * sizeof(union utf8_char)); attr_init(&attr_row[terminal->column], terminal->curr_attr, terminal->width - terminal->column); for (i = terminal->row + 1; i < terminal->height; i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } } else if (args[0] == 1) { memset(row, 0, (terminal->column+1) * sizeof(union utf8_char)); attr_init(attr_row, terminal->curr_attr, terminal->column+1); for (i = 0; i < terminal->row; i++) { memset(terminal_get_row(terminal, i), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, i), terminal->curr_attr, terminal->width); } } else if (args[0] == 2) { /* Clear screen by scrolling contents out */ terminal_scroll_buffer(terminal, terminal->end - terminal->start); } break; case 'K': /* EL */ row = terminal_get_row(terminal, terminal->row); attr_row = terminal_get_attr_row(terminal, terminal->row); if (!set[0] || args[0] == 0 || args[0] > 2) { memset(&row[terminal->column], 0, (terminal->width - terminal->column) * sizeof(union utf8_char)); attr_init(&attr_row[terminal->column], terminal->curr_attr, terminal->width - terminal->column); } else if (args[0] == 1) { memset(row, 0, (terminal->column+1) * sizeof(union utf8_char)); attr_init(attr_row, terminal->curr_attr, terminal->column+1); } else if (args[0] == 2) { memset(row, 0, terminal->data_pitch); attr_init(attr_row, terminal->curr_attr, terminal->width); } break; case 'L': /* IL */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if (terminal->row >= terminal->margin_top && terminal->row < terminal->margin_bottom) { top = terminal->margin_top; terminal->margin_top = terminal->row; terminal_scroll(terminal, 0 - count); terminal->margin_top = top; } else if (terminal->row == terminal->margin_bottom) { memset(terminal_get_row(terminal, terminal->row), 0, terminal->data_pitch); attr_init(terminal_get_attr_row(terminal, terminal->row), terminal->curr_attr, terminal->width); } break; case 'M': /* DL */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if (terminal->row >= terminal->margin_top && terminal->row < terminal->margin_bottom) { top = terminal->margin_top; terminal->margin_top = terminal->row; terminal_scroll(terminal, count); terminal->margin_top = top; } else if (terminal->row == terminal->margin_bottom) { memset(terminal_get_row(terminal, terminal->row), 0, terminal->data_pitch); } break; case 'P': /* DCH */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; terminal_shift_line(terminal, 0 - count); break; case 'S': /* SU */ terminal_scroll(terminal, set[0] ? args[0] : 1); break; case 'T': /* SD */ terminal_scroll(terminal, 0 - (set[0] ? args[0] : 1)); break; case 'X': /* ECH */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if ((terminal->column + count) > terminal->width) count = terminal->width - terminal->column; row = terminal_get_row(terminal, terminal->row); attr_row = terminal_get_attr_row(terminal, terminal->row); memset(&row[terminal->column], 0, count * sizeof(union utf8_char)); attr_init(&attr_row[terminal->column], terminal->curr_attr, count); break; case 'Z': /* CBT */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; while (count > 0 && terminal->column >= 0) { if (terminal->tab_ruler[terminal->column]) count--; terminal->column--; } terminal->column++; break; case '`': /* HPA */ y = set[0] ? args[0] : 1; y = y <= 0 ? 1 : y > terminal->width ? terminal->width : y; terminal->column = y - 1; break; case 'b': /* REP */ count = set[0] ? args[0] : 1; if (count == 0) count = 1; if (terminal->last_char.byte[0]) for (i = 0; i < count; i++) handle_char(terminal, terminal->last_char); terminal->last_char.byte[0] = 0; break; case 'c': /* Primary DA */ terminal_write(terminal, "\e[?6c", 5); break; case 'd': /* VPA */ x = set[0] ? args[0] : 1; x = x <= 0 ? 1 : x > terminal->height ? terminal->height : x; terminal->row = x - 1; break; case 'g': /* TBC */ if (!set[0] || args[0] == 0) { terminal->tab_ruler[terminal->column] = 0; } else if (args[0] == 3) { memset(terminal->tab_ruler, 0, terminal->width); } break; case 'h': /* SM */ for (i = 0; i < 10 && set[i]; i++) { handle_term_parameter(terminal, args[i], 1); } break; case 'l': /* RM */ for (i = 0; i < 10 && set[i]; i++) { handle_term_parameter(terminal, args[i], 0); } break; case 'm': /* SGR */ for (i = 0; i < 10; i++) { if (i <= 7 && set[i] && set[i + 1] && set[i + 2] && args[i + 1] == 5) { if (args[i] == 38) { handle_sgr(terminal, args[i + 2] + 256); break; } else if (args[i] == 48) { handle_sgr(terminal, args[i + 2] + 512); break; } } if (set[i]) { handle_sgr(terminal, args[i]); } else if (i == 0) { handle_sgr(terminal, 0); break; } else { break; } } break; case 'n': /* DSR */ i = set[0] ? args[0] : 0; if (i == 0 || i == 5) { terminal_write(terminal, "\e[0n", 4); } else if (i == 6) { snprintf(response, MAX_RESPONSE, "\e[%d;%dR", terminal->origin_mode ? terminal->row+terminal->margin_top : terminal->row+1, terminal->column+1); terminal_write(terminal, response, strlen(response)); } break; case 'r': if (!set[0]) { terminal->margin_top = 0; terminal->margin_bottom = terminal->height-1; terminal->row = 0; terminal->column = 0; } else { top = (set[0] ? args[0] : 1) - 1; top = top < 0 ? 0 : (top >= terminal->height ? terminal->height - 1 : top); bottom = (set[1] ? args[1] : 1) - 1; bottom = bottom < 0 ? 0 : (bottom >= terminal->height ? terminal->height - 1 : bottom); if (bottom > top) { terminal->margin_top = top; terminal->margin_bottom = bottom; } else { terminal->margin_top = 0; terminal->margin_bottom = terminal->height-1; } if (terminal->origin_mode) terminal->row = terminal->margin_top; else terminal->row = 0; terminal->column = 0; } break; case 's': terminal->saved_row = terminal->row; terminal->saved_column = terminal->column; break; case 't': /* windowOps */ if (!set[0]) break; switch (args[0]) { case 4: /* resize px */ if (set[1] && set[2]) { widget_schedule_resize(terminal->widget, args[2], args[1]); } break; case 8: /* resize ch */ if (set[1] && set[2]) { terminal_resize(terminal, args[2], args[1]); } break; case 13: /* report position */ widget_get_allocation(terminal->widget, &allocation); snprintf(response, MAX_RESPONSE, "\e[3;%d;%dt", allocation.x, allocation.y); terminal_write(terminal, response, strlen(response)); break; case 14: /* report px */ widget_get_allocation(terminal->widget, &allocation); snprintf(response, MAX_RESPONSE, "\e[4;%d;%dt", allocation.height, allocation.width); terminal_write(terminal, response, strlen(response)); break; case 18: /* report ch */ snprintf(response, MAX_RESPONSE, "\e[9;%d;%dt", terminal->height, terminal->width); terminal_write(terminal, response, strlen(response)); break; case 21: /* report title */ snprintf(response, MAX_RESPONSE, "\e]l%s\e\\", window_get_title(terminal->window)); terminal_write(terminal, response, strlen(response)); break; default: if (args[0] >= 24) terminal_resize(terminal, terminal->width, args[0]); else fprintf(stderr, "Unimplemented windowOp %d\n", args[0]); break; } case 'u': terminal->row = terminal->saved_row; terminal->column = terminal->saved_column; break; default: fprintf(stderr, "Unknown CSI escape: %c\n", *p); break; } } static void handle_non_csi_escape(struct terminal *terminal, char code) { switch(code) { case 'M': /* RI */ terminal->row -= 1; if (terminal->row < terminal->margin_top) { terminal->row = terminal->margin_top; terminal_scroll(terminal, -1); } break; case 'E': /* NEL */ terminal->column = 0; // fallthrough case 'D': /* IND */ terminal->row += 1; if (terminal->row > terminal->margin_bottom) { terminal->row = terminal->margin_bottom; terminal_scroll(terminal, +1); } break; case 'c': /* RIS */ terminal_init(terminal); break; case 'H': /* HTS */ terminal->tab_ruler[terminal->column] = 1; break; case '7': /* DECSC */ terminal->saved_row = terminal->row; terminal->saved_column = terminal->column; terminal->saved_attr = terminal->curr_attr; terminal->saved_origin_mode = terminal->origin_mode; terminal->saved_cs = terminal->cs; terminal->saved_g0 = terminal->g0; terminal->saved_g1 = terminal->g1; break; case '8': /* DECRC */ terminal->row = terminal->saved_row; terminal->column = terminal->saved_column; terminal->curr_attr = terminal->saved_attr; terminal->origin_mode = terminal->saved_origin_mode; terminal->cs = terminal->saved_cs; terminal->g0 = terminal->saved_g0; terminal->g1 = terminal->saved_g1; break; case '=': /* DECPAM */ terminal->key_mode = KM_APPLICATION; break; case '>': /* DECPNM */ terminal->key_mode = KM_NORMAL; break; default: fprintf(stderr, "Unknown escape code: %c\n", code); break; } } static void handle_special_escape(struct terminal *terminal, char special, char code) { int i, numChars; if (special == '#') { switch(code) { case '8': /* fill with 'E', no cheap way to do this */ memset(terminal->data, 0, terminal->data_pitch * terminal->height); numChars = terminal->width * terminal->height; for (i = 0; i < numChars; i++) { terminal->data[i].byte[0] = 'E'; } break; default: fprintf(stderr, "Unknown HASH escape #%c\n", code); break; } } else if (special == '(' || special == ')') { switch(code) { case '0': if (special == '(') terminal->g0 = CS_SPECIAL; else terminal->g1 = CS_SPECIAL; break; case 'A': if (special == '(') terminal->g0 = CS_UK; else terminal->g1 = CS_UK; break; case 'B': if (special == '(') terminal->g0 = CS_US; else terminal->g1 = CS_US; break; default: fprintf(stderr, "Unknown character set %c\n", code); break; } } else { fprintf(stderr, "Unknown special escape %c%c\n", special, code); } } static void handle_sgr(struct terminal *terminal, int code) { switch(code) { case 0: terminal->curr_attr = terminal->color_scheme->default_attr; break; case 1: terminal->curr_attr.a |= ATTRMASK_BOLD; if (terminal->curr_attr.fg < 8) terminal->curr_attr.fg += 8; break; case 4: terminal->curr_attr.a |= ATTRMASK_UNDERLINE; break; case 5: terminal->curr_attr.a |= ATTRMASK_BLINK; break; case 8: terminal->curr_attr.a |= ATTRMASK_CONCEALED; break; case 2: case 21: case 22: terminal->curr_attr.a &= ~ATTRMASK_BOLD; if (terminal->curr_attr.fg < 16 && terminal->curr_attr.fg >= 8) terminal->curr_attr.fg -= 8; break; case 24: terminal->curr_attr.a &= ~ATTRMASK_UNDERLINE; break; case 25: terminal->curr_attr.a &= ~ATTRMASK_BLINK; break; case 7: case 26: terminal->curr_attr.a |= ATTRMASK_INVERSE; break; case 27: terminal->curr_attr.a &= ~ATTRMASK_INVERSE; break; case 28: terminal->curr_attr.a &= ~ATTRMASK_CONCEALED; break; case 39: terminal->curr_attr.fg = terminal->color_scheme->default_attr.fg; break; case 49: terminal->curr_attr.bg = terminal->color_scheme->default_attr.bg; break; default: if (code >= 30 && code <= 37) { terminal->curr_attr.fg = code - 30; if (terminal->curr_attr.a & ATTRMASK_BOLD) terminal->curr_attr.fg += 8; } else if (code >= 40 && code <= 47) { terminal->curr_attr.bg = code - 40; } else if (code >= 90 && code <= 97) { terminal->curr_attr.fg = code - 90 + 8; } else if (code >= 100 && code <= 107) { terminal->curr_attr.bg = code - 100 + 8; } else if (code >= 256 && code < 512) { terminal->curr_attr.fg = code - 256; } else if (code >= 512 && code < 768) { terminal->curr_attr.bg = code - 512; } else { fprintf(stderr, "Unknown SGR code: %d\n", code); } break; } } /* Returns 1 if c was special, otherwise 0 */ static int handle_special_char(struct terminal *terminal, char c) { union utf8_char *row; struct attr *attr_row; row = terminal_get_row(terminal, terminal->row); attr_row = terminal_get_attr_row(terminal, terminal->row); switch(c) { case '\r': terminal->column = 0; break; case '\n': if (terminal->mode & MODE_LF_NEWLINE) { terminal->column = 0; } /* fallthrough */ case '\v': case '\f': terminal->row++; if (terminal->row > terminal->margin_bottom) { terminal->row = terminal->margin_bottom; terminal_scroll(terminal, +1); } break; case '\t': while (terminal->column < terminal->width) { if (terminal->mode & MODE_IRM) terminal_shift_line(terminal, +1); if (row[terminal->column].byte[0] == '\0') { row[terminal->column].byte[0] = ' '; row[terminal->column].byte[1] = '\0'; attr_row[terminal->column] = terminal->curr_attr; } terminal->column++; if (terminal->tab_ruler[terminal->column]) break; } if (terminal->column >= terminal->width) { terminal->column = terminal->width - 1; } break; case '\b': if (terminal->column >= terminal->width) { terminal->column = terminal->width - 2; } else if (terminal->column > 0) { terminal->column--; } else if (terminal->mode & MODE_AUTOWRAP) { terminal->column = terminal->width - 1; terminal->row -= 1; if (terminal->row < terminal->margin_top) { terminal->row = terminal->margin_top; terminal_scroll(terminal, -1); } } break; case '\a': /* Bell */ break; case '\x0E': /* SO */ terminal->cs = terminal->g1; break; case '\x0F': /* SI */ terminal->cs = terminal->g0; break; case '\0': break; default: return 0; } return 1; } static void handle_char(struct terminal *terminal, union utf8_char utf8) { union utf8_char *row; struct attr *attr_row; if (handle_special_char(terminal, utf8.byte[0])) return; apply_char_set(terminal->cs, &utf8); /* There are a whole lot of non-characters, control codes, * and formatting codes that should probably be ignored, * for example: */ if (strncmp((char*) utf8.byte, "\xEF\xBB\xBF", 3) == 0) { /* BOM, ignore */ return; } /* Some of these non-characters should be translated, e.g.: */ if (utf8.byte[0] < 32) { utf8.byte[0] = utf8.byte[0] + 64; } /* handle right margin effects */ if (terminal->column >= terminal->width) { if (terminal->mode & MODE_AUTOWRAP) { terminal->column = 0; terminal->row += 1; if (terminal->row > terminal->margin_bottom) { terminal->row = terminal->margin_bottom; terminal_scroll(terminal, +1); } } else { terminal->column--; } } row = terminal_get_row(terminal, terminal->row); attr_row = terminal_get_attr_row(terminal, terminal->row); if (terminal->mode & MODE_IRM) terminal_shift_line(terminal, +1); row[terminal->column] = utf8; attr_row[terminal->column++] = terminal->curr_attr; if (terminal->row + terminal->start + 1 > terminal->end) terminal->end = terminal->row + terminal->start + 1; if (terminal->end == terminal->buffer_height) terminal->log_size = terminal->buffer_height; else if (terminal->log_size < terminal->buffer_height) terminal->log_size = terminal->end; /* cursor jump for wide character. */ if (is_wide(utf8)) row[terminal->column++].ch = 0x200B; /* space glyph */ if (utf8.ch != terminal->last_char.ch) terminal->last_char = utf8; } static void escape_append_utf8(struct terminal *terminal, union utf8_char utf8) { int len, i; if ((utf8.byte[0] & 0x80) == 0x00) len = 1; else if ((utf8.byte[0] & 0xE0) == 0xC0) len = 2; else if ((utf8.byte[0] & 0xF0) == 0xE0) len = 3; else if ((utf8.byte[0] & 0xF8) == 0xF0) len = 4; else len = 1; /* Invalid, cannot happen */ if (terminal->escape_length + len <= MAX_ESCAPE) { for (i = 0; i < len; i++) terminal->escape[terminal->escape_length + i] = utf8.byte[i]; terminal->escape_length += len; } else if (terminal->escape_length < MAX_ESCAPE) { terminal->escape[terminal->escape_length++] = 0; } } static void terminal_data(struct terminal *terminal, const char *data, size_t length) { unsigned int i; union utf8_char utf8; enum utf8_state parser_state; for (i = 0; i < length; i++) { parser_state = utf8_next_char(&terminal->state_machine, data[i]); switch(parser_state) { case utf8state_accept: utf8.ch = terminal->state_machine.s.ch; break; case utf8state_reject: /* the unicode replacement character */ utf8.byte[0] = 0xEF; utf8.byte[1] = 0xBF; utf8.byte[2] = 0xBD; utf8.byte[3] = 0x00; break; default: continue; } /* assume escape codes never use non-ASCII characters */ switch (terminal->state) { case escape_state_escape: escape_append_utf8(terminal, utf8); switch (utf8.byte[0]) { case 'P': /* DCS */ terminal->state = escape_state_dcs; break; case '[': /* CSI */ terminal->state = escape_state_csi; break; case ']': /* OSC */ terminal->state = escape_state_osc; break; case '#': case '(': case ')': /* special */ terminal->state = escape_state_special; break; case '^': /* PM (not implemented) */ case '_': /* APC (not implemented) */ terminal->state = escape_state_ignore; break; default: terminal->state = escape_state_normal; handle_non_csi_escape(terminal, utf8.byte[0]); break; } continue; case escape_state_csi: if (handle_special_char(terminal, utf8.byte[0]) != 0) { /* do nothing */ } else if (utf8.byte[0] == '?') { terminal->escape_flags |= ESC_FLAG_WHAT; } else if (utf8.byte[0] == '>') { terminal->escape_flags |= ESC_FLAG_GT; } else if (utf8.byte[0] == '!') { terminal->escape_flags |= ESC_FLAG_BANG; } else if (utf8.byte[0] == '$') { terminal->escape_flags |= ESC_FLAG_CASH; } else if (utf8.byte[0] == '\'') { terminal->escape_flags |= ESC_FLAG_SQUOTE; } else if (utf8.byte[0] == '"') { terminal->escape_flags |= ESC_FLAG_DQUOTE; } else if (utf8.byte[0] == ' ') { terminal->escape_flags |= ESC_FLAG_SPACE; } else { escape_append_utf8(terminal, utf8); if (terminal->escape_length >= MAX_ESCAPE) terminal->state = escape_state_normal; } if (isalpha(utf8.byte[0]) || utf8.byte[0] == '@' || utf8.byte[0] == '`') { terminal->state = escape_state_normal; handle_escape(terminal); } else { } continue; case escape_state_inner_escape: if (utf8.byte[0] == '\\') { terminal->state = escape_state_normal; if (terminal->outer_state == escape_state_dcs) { handle_dcs(terminal); } else if (terminal->outer_state == escape_state_osc) { handle_osc(terminal); } } else if (utf8.byte[0] == '\e') { terminal->state = terminal->outer_state; escape_append_utf8(terminal, utf8); if (terminal->escape_length >= MAX_ESCAPE) terminal->state = escape_state_normal; } else { terminal->state = terminal->outer_state; if (terminal->escape_length < MAX_ESCAPE) terminal->escape[terminal->escape_length++] = '\e'; escape_append_utf8(terminal, utf8); if (terminal->escape_length >= MAX_ESCAPE) terminal->state = escape_state_normal; } continue; case escape_state_dcs: case escape_state_osc: case escape_state_ignore: if (utf8.byte[0] == '\e') { terminal->outer_state = terminal->state; terminal->state = escape_state_inner_escape; } else if (utf8.byte[0] == '\a' && terminal->state == escape_state_osc) { terminal->state = escape_state_normal; handle_osc(terminal); } else { escape_append_utf8(terminal, utf8); if (terminal->escape_length >= MAX_ESCAPE) terminal->state = escape_state_normal; } continue; case escape_state_special: escape_append_utf8(terminal, utf8); terminal->state = escape_state_normal; if (isdigit(utf8.byte[0]) || isalpha(utf8.byte[0])) { handle_special_escape(terminal, terminal->escape[1], utf8.byte[0]); } continue; default: break; } /* this is valid, because ASCII characters are never used to * introduce a multibyte sequence in UTF-8 */ if (utf8.byte[0] == '\e') { terminal->state = escape_state_escape; terminal->outer_state = escape_state_normal; terminal->escape[0] = '\e'; terminal->escape_length = 1; terminal->escape_flags = 0; } else { handle_char(terminal, utf8); } /* if */ } /* for */ window_schedule_redraw(terminal->window); } static void data_source_target(void *data, struct wl_data_source *source, const char *mime_type) { fprintf(stderr, "data_source_target, %s\n", mime_type); } static void data_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd) { struct terminal *terminal = data; terminal_send_selection(terminal, fd); } static void data_source_cancelled(void *data, struct wl_data_source *source) { wl_data_source_destroy(source); } static const struct wl_data_source_listener data_source_listener = { data_source_target, data_source_send, data_source_cancelled }; static const char text_mime_type[] = "text/plain;charset=utf-8"; static void data_handler(struct window *window, struct input *input, float x, float y, const char **types, void *data) { int i, has_text = 0; if (!types) return; for (i = 0; types[i]; i++) if (strcmp(types[i], text_mime_type) == 0) has_text = 1; if (!has_text) { input_accept(input, NULL); } else { input_accept(input, text_mime_type); } } static void drop_handler(struct window *window, struct input *input, int32_t x, int32_t y, void *data) { struct terminal *terminal = data; input_receive_drag_data_to_fd(input, text_mime_type, terminal->master); } static void fullscreen_handler(struct window *window, void *data) { struct terminal *terminal = data; window_set_fullscreen(window, !window_is_fullscreen(terminal->window)); } static void close_handler(void *data) { struct terminal *terminal = data; terminal_destroy(terminal); } static void terminal_copy(struct terminal *terminal, struct input *input) { terminal->selection = display_create_data_source(terminal->display); wl_data_source_offer(terminal->selection, "text/plain;charset=utf-8"); wl_data_source_add_listener(terminal->selection, &data_source_listener, terminal); input_set_selection(input, terminal->selection, display_get_serial(terminal->display)); } static void terminal_paste(struct terminal *terminal, struct input *input) { input_receive_selection_data_to_fd(input, "text/plain;charset=utf-8", terminal->master); } static void terminal_new_instance(struct terminal *terminal) { struct terminal *new_terminal; new_terminal = terminal_create(terminal->display); if (terminal_run(new_terminal, option_shell)) terminal_destroy(new_terminal); } static int handle_bound_key(struct terminal *terminal, struct input *input, uint32_t sym, uint32_t time) { switch (sym) { case XKB_KEY_X: /* Cut selection; terminal doesn't do cut, fall * through to copy. */ case XKB_KEY_C: terminal_copy(terminal, input); return 1; case XKB_KEY_V: terminal_paste(terminal, input); return 1; case XKB_KEY_N: terminal_new_instance(terminal); return 1; case XKB_KEY_Up: if (!terminal->scrolling) terminal->saved_start = terminal->start; if (terminal->start == terminal->end - terminal->log_size) return 1; terminal->scrolling = 1; terminal->start--; terminal->row++; terminal->selection_start_row++; terminal->selection_end_row++; widget_schedule_redraw(terminal->widget); return 1; case XKB_KEY_Down: if (!terminal->scrolling) terminal->saved_start = terminal->start; if (terminal->start == terminal->saved_start) return 1; terminal->scrolling = 1; terminal->start++; terminal->row--; terminal->selection_start_row--; terminal->selection_end_row--; widget_schedule_redraw(terminal->widget); return 1; default: return 0; } } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct terminal *terminal = data; char ch[MAX_RESPONSE]; uint32_t modifiers, serial; int ret, len = 0, d; bool convert_utf8 = true; modifiers = input_get_modifiers(input); if ((modifiers & MOD_CONTROL_MASK) && (modifiers & MOD_SHIFT_MASK) && state == WL_KEYBOARD_KEY_STATE_PRESSED && handle_bound_key(terminal, input, sym, time)) return; /* Map keypad symbols to 'normal' equivalents before processing */ switch (sym) { case XKB_KEY_KP_Space: sym = XKB_KEY_space; break; case XKB_KEY_KP_Tab: sym = XKB_KEY_Tab; break; case XKB_KEY_KP_Enter: sym = XKB_KEY_Return; break; case XKB_KEY_KP_Left: sym = XKB_KEY_Left; break; case XKB_KEY_KP_Up: sym = XKB_KEY_Up; break; case XKB_KEY_KP_Right: sym = XKB_KEY_Right; break; case XKB_KEY_KP_Down: sym = XKB_KEY_Down; break; case XKB_KEY_KP_Equal: sym = XKB_KEY_equal; break; case XKB_KEY_KP_Multiply: sym = XKB_KEY_asterisk; break; case XKB_KEY_KP_Add: sym = XKB_KEY_plus; break; case XKB_KEY_KP_Separator: /* Note this is actually locale-dependent and should mostly be * a comma. But leave it as period until we one day start * doing the right thing. */ sym = XKB_KEY_period; break; case XKB_KEY_KP_Subtract: sym = XKB_KEY_minus; break; case XKB_KEY_KP_Decimal: sym = XKB_KEY_period; break; case XKB_KEY_KP_Divide: sym = XKB_KEY_slash; break; case XKB_KEY_KP_0: case XKB_KEY_KP_1: case XKB_KEY_KP_2: case XKB_KEY_KP_3: case XKB_KEY_KP_4: case XKB_KEY_KP_5: case XKB_KEY_KP_6: case XKB_KEY_KP_7: case XKB_KEY_KP_8: case XKB_KEY_KP_9: sym = (sym - XKB_KEY_KP_0) + XKB_KEY_0; break; default: break; } switch (sym) { case XKB_KEY_BackSpace: if (modifiers & MOD_ALT_MASK) ch[len++] = 0x1b; ch[len++] = 0x7f; break; case XKB_KEY_Tab: case XKB_KEY_Linefeed: case XKB_KEY_Clear: case XKB_KEY_Pause: case XKB_KEY_Scroll_Lock: case XKB_KEY_Sys_Req: case XKB_KEY_Escape: ch[len++] = sym & 0x7f; break; case XKB_KEY_Return: if (terminal->mode & MODE_LF_NEWLINE) { ch[len++] = 0x0D; ch[len++] = 0x0A; } else { ch[len++] = 0x0D; } break; case XKB_KEY_Shift_L: case XKB_KEY_Shift_R: case XKB_KEY_Control_L: case XKB_KEY_Control_R: case XKB_KEY_Alt_L: case XKB_KEY_Alt_R: case XKB_KEY_Meta_L: case XKB_KEY_Meta_R: case XKB_KEY_Super_L: case XKB_KEY_Super_R: case XKB_KEY_Hyper_L: case XKB_KEY_Hyper_R: break; case XKB_KEY_Insert: len = function_key_response('[', 2, modifiers, '~', ch); break; case XKB_KEY_Delete: if (terminal->mode & MODE_DELETE_SENDS_DEL) { ch[len++] = '\x04'; } else { len = function_key_response('[', 3, modifiers, '~', ch); } break; case XKB_KEY_Page_Up: len = function_key_response('[', 5, modifiers, '~', ch); break; case XKB_KEY_Page_Down: len = function_key_response('[', 6, modifiers, '~', ch); break; case XKB_KEY_F1: len = function_key_response('O', 1, modifiers, 'P', ch); break; case XKB_KEY_F2: len = function_key_response('O', 1, modifiers, 'Q', ch); break; case XKB_KEY_F3: len = function_key_response('O', 1, modifiers, 'R', ch); break; case XKB_KEY_F4: len = function_key_response('O', 1, modifiers, 'S', ch); break; case XKB_KEY_F5: len = function_key_response('[', 15, modifiers, '~', ch); break; case XKB_KEY_F6: len = function_key_response('[', 17, modifiers, '~', ch); break; case XKB_KEY_F7: len = function_key_response('[', 18, modifiers, '~', ch); break; case XKB_KEY_F8: len = function_key_response('[', 19, modifiers, '~', ch); break; case XKB_KEY_F9: len = function_key_response('[', 20, modifiers, '~', ch); break; case XKB_KEY_F10: len = function_key_response('[', 21, modifiers, '~', ch); break; case XKB_KEY_F12: len = function_key_response('[', 24, modifiers, '~', ch); break; default: /* Handle special keys with alternate mappings */ len = apply_key_map(terminal->key_mode, sym, modifiers, ch); if (len != 0) break; if (modifiers & MOD_CONTROL_MASK) { if (sym >= '3' && sym <= '7') sym = (sym & 0x1f) + 8; if (!((sym >= '!' && sym <= '/') || (sym >= '8' && sym <= '?') || (sym >= '0' && sym <= '2'))) sym = sym & 0x1f; else if (sym == '2') sym = 0x00; else if (sym == '/') sym = 0x1F; else if (sym == '8' || sym == '?') sym = 0x7F; } if (modifiers & MOD_ALT_MASK) { if (terminal->mode & MODE_ALT_SENDS_ESC) { ch[len++] = 0x1b; } else { sym = sym | 0x80; convert_utf8 = false; } } if ((sym < 128) || (!convert_utf8 && sym < 256)) { ch[len++] = sym; } else { ret = xkb_keysym_to_utf8(sym, ch + len, MAX_RESPONSE - len); if (ret < 0) fprintf(stderr, "Warning: buffer too small to encode " "UTF8 character\n"); else len += ret; } break; } if (state == WL_KEYBOARD_KEY_STATE_PRESSED && len > 0) { if (terminal->scrolling) { d = terminal->saved_start - terminal->start; terminal->row -= d; terminal->selection_start_row -= d; terminal->selection_end_row -= d; terminal->start = terminal->saved_start; terminal->scrolling = 0; widget_schedule_redraw(terminal->widget); } terminal_write(terminal, ch, len); /* Hide cursor, except if this was coming from a * repeating key press. */ serial = display_get_serial(terminal->display); if (terminal->hide_cursor_serial != serial) { input_set_pointer_image(input, CURSOR_BLANK); terminal->hide_cursor_serial = serial; } } } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct terminal *terminal = data; window_schedule_redraw(terminal->window); } static int wordsep(int ch) { const char extra[] = "-,./?%&#:_=+@~"; if (ch > 127 || ch < 0) return 1; return ch == 0 || !(isalpha(ch) || isdigit(ch) || strchr(extra, ch)); } static int recompute_selection(struct terminal *terminal) { struct rectangle allocation; int col, x, width, height; int start_row, end_row; int word_start, eol; int side_margin, top_margin; int start_x, end_x; int cw, ch; union utf8_char *data; cw = terminal->average_width; ch = terminal->extents.height; widget_get_allocation(terminal->widget, &allocation); width = terminal->width * cw; height = terminal->height * ch; side_margin = allocation.x + (allocation.width - width) / 2; top_margin = allocation.y + (allocation.height - height) / 2; start_row = (terminal->selection_start_y - top_margin + ch) / ch - 1; end_row = (terminal->selection_end_y - top_margin + ch) / ch - 1; if (start_row < end_row || (start_row == end_row && terminal->selection_start_x < terminal->selection_end_x)) { terminal->selection_start_row = start_row; terminal->selection_end_row = end_row; start_x = terminal->selection_start_x; end_x = terminal->selection_end_x; } else { terminal->selection_start_row = end_row; terminal->selection_end_row = start_row; start_x = terminal->selection_end_x; end_x = terminal->selection_start_x; } eol = 0; if (terminal->selection_start_row < 0) { terminal->selection_start_row = 0; terminal->selection_start_col = 0; } else { x = side_margin + cw / 2; data = terminal_get_row(terminal, terminal->selection_start_row); word_start = 0; for (col = 0; col < terminal->width; col++, x += cw) { if (col == 0 || wordsep(data[col - 1].ch)) word_start = col; if (data[col].ch != 0) eol = col + 1; if (start_x < x) break; } switch (terminal->dragging) { case SELECT_LINE: terminal->selection_start_col = 0; break; case SELECT_WORD: terminal->selection_start_col = word_start; break; case SELECT_CHAR: terminal->selection_start_col = col; break; } } if (terminal->selection_end_row >= terminal->height) { terminal->selection_end_row = terminal->height; terminal->selection_end_col = 0; } else { x = side_margin + cw / 2; data = terminal_get_row(terminal, terminal->selection_end_row); for (col = 0; col < terminal->width; col++, x += cw) { if (terminal->dragging == SELECT_CHAR && end_x < x) break; if (terminal->dragging == SELECT_WORD && end_x < x && wordsep(data[col].ch)) break; } terminal->selection_end_col = col; } if (terminal->selection_end_col != terminal->selection_start_col || terminal->selection_start_row != terminal->selection_end_row) { col = terminal->selection_end_col; if (col > 0 && data[col - 1].ch == 0) terminal->selection_end_col = terminal->width; data = terminal_get_row(terminal, terminal->selection_start_row); if (data[terminal->selection_start_col].ch == 0) terminal->selection_start_col = eol; } return 1; } static void terminal_minimize(struct terminal *terminal) { window_set_minimized(terminal->window); } static void menu_func(void *data, struct input *input, int index) { struct window *window = data; struct terminal *terminal = window_get_user_data(window); fprintf(stderr, "picked entry %d\n", index); switch (index) { case 0: terminal_new_instance(terminal); break; case 1: terminal_copy(terminal, input); break; case 2: terminal_paste(terminal, input); break; case 3: terminal_minimize(terminal); break; } } static void show_menu(struct terminal *terminal, struct input *input, uint32_t time) { int32_t x, y; static const char *entries[] = { "Open Terminal", "Copy", "Paste", "Minimize" }; input_get_position(input, &x, &y); window_show_menu(terminal->display, input, time, terminal->window, x - 10, y - 10, menu_func, entries, ARRAY_LENGTH(entries)); } static void click_handler(struct widget *widget, struct terminal *terminal, struct input *input, int32_t x, int32_t y, uint32_t time) { if (time - terminal->click_time < 500) terminal->click_count++; else terminal->click_count = 1; terminal->click_time = time; terminal->dragging = (terminal->click_count - 1) % 3 + SELECT_CHAR; terminal->selection_end_x = terminal->selection_start_x = x; terminal->selection_end_y = terminal->selection_start_y = y; if (recompute_selection(terminal)) widget_schedule_redraw(widget); } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct terminal *terminal = data; int32_t x, y; switch (button) { case BTN_LEFT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) { input_get_position(input, &x, &y); click_handler(widget, terminal, input, x, y, time); } else { terminal->dragging = SELECT_NONE; } break; case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) show_menu(terminal, input, time); break; } } static int enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { return CURSOR_IBEAM; } static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct terminal *terminal = data; if (terminal->dragging) { input_get_position(input, &terminal->selection_end_x, &terminal->selection_end_y); if (recompute_selection(terminal)) widget_schedule_redraw(widget); } return CURSOR_IBEAM; } /* This magnitude is chosen rather arbitrarily. Really, the scrolling * should happen on a (fractional) pixel basis, not a line basis. */ #define AXIS_UNITS_PER_LINE 256 static void axis_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t axis, wl_fixed_t value, void *data) { struct terminal *terminal = data; int lines; if (axis != WL_POINTER_AXIS_VERTICAL_SCROLL) return; terminal->smooth_scroll += value; lines = terminal->smooth_scroll / AXIS_UNITS_PER_LINE; terminal->smooth_scroll -= lines * AXIS_UNITS_PER_LINE; if (lines > 0) { if (terminal->scrolling) { if ((uint32_t)lines > terminal->saved_start - terminal->start) lines = terminal->saved_start - terminal->start; } else { lines = 0; } } else if (lines < 0) { uint32_t neg_lines = -lines; if (neg_lines > terminal->log_size + terminal->start - terminal->end) lines = terminal->end - terminal->log_size - terminal->start; } if (lines) { if (!terminal->scrolling) terminal->saved_start = terminal->start; terminal->scrolling = 1; terminal->start += lines; terminal->row -= lines; terminal->selection_start_row -= lines; terminal->selection_end_row -= lines; widget_schedule_redraw(widget); } } static void output_handler(struct window *window, struct output *output, int enter, void *data) { if (enter) window_set_buffer_transform(window, output_get_transform(output)); window_set_buffer_scale(window, window_get_output_scale(window)); window_schedule_redraw(window); } static void touch_down_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct terminal *terminal = data; if (id == 0) click_handler(widget, terminal, input, x, y, time); } static void touch_up_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, void *data) { struct terminal *terminal = data; if (id == 0) terminal->dragging = SELECT_NONE; } static void touch_motion_handler(struct widget *widget, struct input *input, uint32_t time, int32_t id, float x, float y, void *data) { struct terminal *terminal = data; if (terminal->dragging && id == 0) { terminal->selection_end_x = (int)x; terminal->selection_end_y = (int)y; if (recompute_selection(terminal)) widget_schedule_redraw(widget); } } #ifndef howmany #define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif static struct terminal * terminal_create(struct display *display) { struct terminal *terminal; cairo_surface_t *surface; cairo_t *cr; cairo_text_extents_t text_extents; terminal = xzalloc(sizeof *terminal); terminal->color_scheme = &DEFAULT_COLORS; terminal_init(terminal); terminal->margin_top = 0; terminal->margin_bottom = -1; terminal->window = window_create(display); terminal->widget = window_frame_create(terminal->window, terminal); terminal->title = xstrdup("Wayland Terminal"); window_set_title(terminal->window, terminal->title); widget_set_transparent(terminal->widget, 0); init_state_machine(&terminal->state_machine); init_color_table(terminal); terminal->display = display; terminal->margin = 5; terminal->buffer_height = 1024; terminal->end = 1; window_set_user_data(terminal->window, terminal); window_set_key_handler(terminal->window, key_handler); window_set_keyboard_focus_handler(terminal->window, keyboard_focus_handler); window_set_fullscreen_handler(terminal->window, fullscreen_handler); window_set_output_handler(terminal->window, output_handler); window_set_close_handler(terminal->window, close_handler); window_set_state_changed_handler(terminal->window, state_changed_handler); window_set_data_handler(terminal->window, data_handler); window_set_drop_handler(terminal->window, drop_handler); widget_set_redraw_handler(terminal->widget, redraw_handler); widget_set_resize_handler(terminal->widget, resize_handler); widget_set_button_handler(terminal->widget, button_handler); widget_set_enter_handler(terminal->widget, enter_handler); widget_set_motion_handler(terminal->widget, motion_handler); widget_set_axis_handler(terminal->widget, axis_handler); widget_set_touch_up_handler(terminal->widget, touch_up_handler); widget_set_touch_down_handler(terminal->widget, touch_down_handler); widget_set_touch_motion_handler(terminal->widget, touch_motion_handler); surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0); cr = cairo_create(surface); cairo_set_font_size(cr, option_font_size); cairo_select_font_face (cr, option_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); terminal->font_bold = cairo_get_scaled_font (cr); cairo_scaled_font_reference(terminal->font_bold); cairo_select_font_face (cr, option_font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); terminal->font_normal = cairo_get_scaled_font (cr); cairo_scaled_font_reference(terminal->font_normal); cairo_font_extents(cr, &terminal->extents); /* Compute the average ascii glyph width */ cairo_text_extents(cr, TERMINAL_DRAW_SINGLE_WIDE_CHARACTERS, &text_extents); terminal->average_width = howmany (text_extents.width, strlen(TERMINAL_DRAW_SINGLE_WIDE_CHARACTERS)); terminal->average_width = ceil(terminal->average_width); cairo_destroy(cr); cairo_surface_destroy(surface); terminal_resize(terminal, 20, 5); /* Set minimum size first */ terminal_resize(terminal, 80, 25); wl_list_insert(terminal_list.prev, &terminal->link); return terminal; } static void terminal_destroy(struct terminal *terminal) { display_unwatch_fd(terminal->display, terminal->master); window_destroy(terminal->window); close(terminal->master); wl_list_remove(&terminal->link); if (wl_list_empty(&terminal_list)) display_exit(terminal->display); free(terminal->title); free(terminal); } static void io_handler(struct task *task, uint32_t events) { struct terminal *terminal = container_of(task, struct terminal, io_task); char buffer[256]; int len; if (events & EPOLLHUP) { terminal_destroy(terminal); return; } len = read(terminal->master, buffer, sizeof buffer); if (len < 0) terminal_destroy(terminal); else terminal_data(terminal, buffer, len); } static int terminal_run(struct terminal *terminal, const char *path) { int master; pid_t pid; pid = forkpty(&master, NULL, NULL, NULL); if (pid == 0) { setenv("TERM", option_term, 1); setenv("COLORTERM", option_term, 1); if (execl(path, path, NULL)) { printf("exec failed: %m\n"); exit(EXIT_FAILURE); } } else if (pid < 0) { fprintf(stderr, "failed to fork and create pty (%m).\n"); return -1; } terminal->master = master; fcntl(master, F_SETFL, O_NONBLOCK); terminal->io_task.run = io_handler; display_watch_fd(terminal->display, terminal->master, EPOLLIN | EPOLLHUP, &terminal->io_task); if (option_fullscreen) window_set_fullscreen(terminal->window, 1); else terminal_resize(terminal, 80, 24); return 0; } static const struct weston_option terminal_options[] = { { WESTON_OPTION_BOOLEAN, "fullscreen", 'f', &option_fullscreen }, { WESTON_OPTION_STRING, "font", 0, &option_font }, { WESTON_OPTION_INTEGER, "font-size", 0, &option_font_size }, { WESTON_OPTION_STRING, "shell", 0, &option_shell }, }; int main(int argc, char *argv[]) { struct display *d; struct terminal *terminal; const char *config_file; struct weston_config *config; struct weston_config_section *s; /* as wcwidth is locale-dependent, wcwidth needs setlocale call to function properly. */ setlocale(LC_ALL, ""); option_shell = getenv("SHELL"); if (!option_shell) option_shell = "/bin/bash"; config_file = weston_config_get_name_from_env(); config = weston_config_parse(config_file); s = weston_config_get_section(config, "terminal", NULL, NULL); weston_config_section_get_string(s, "font", &option_font, "mono"); weston_config_section_get_int(s, "font-size", &option_font_size, 14); weston_config_section_get_string(s, "term", &option_term, "xterm"); weston_config_destroy(config); if (parse_options(terminal_options, ARRAY_LENGTH(terminal_options), &argc, argv) > 1) { printf("Usage: %s [OPTIONS]\n" " --fullscreen or -f\n" " --font=NAME\n" " --font-size=SIZE\n" " --shell=NAME\n", argv[0]); return 1; } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } wl_list_init(&terminal_list); terminal = terminal_create(d); if (terminal_run(terminal, option_shell)) exit(EXIT_FAILURE); display_run(d); return 0; } weston-1.9.0/clients/nested.c0000664000175000017500000007207112537664710013074 00000000000000/* * Copyright © 2013 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define WL_HIDE_DEPRECATED #include #include "shared/helpers.h" #include "window.h" #ifndef EGL_WL_create_wayland_buffer_from_image #define EGL_WL_create_wayland_buffer_from_image 1 #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); #endif typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); #endif static int option_blit; struct nested { struct display *display; struct window *window; struct widget *widget; struct wl_display *child_display; struct task child_task; EGLDisplay egl_display; struct program *texture_program; struct wl_list surface_list; const struct nested_renderer *renderer; }; struct nested_region { struct wl_resource *resource; pixman_region32_t region; }; struct nested_buffer_reference { struct nested_buffer *buffer; struct wl_listener destroy_listener; }; struct nested_buffer { struct wl_resource *resource; struct wl_signal destroy_signal; struct wl_listener destroy_listener; uint32_t busy_count; /* A buffer in the parent compositor representing the same * data. This is created on-demand when the subsurface * renderer is used */ struct wl_buffer *parent_buffer; /* This reference is used to mark when the parent buffer has * been attached to the subsurface. It will be unrefenced when * we receive a buffer release event. That way we won't inform * the client that the buffer is free until the parent * compositor is also finished with it */ struct nested_buffer_reference parent_ref; }; struct nested_surface { struct wl_resource *resource; struct nested *nested; EGLImageKHR *image; struct wl_list link; struct wl_list frame_callback_list; struct { /* wl_surface.attach */ int newly_attached; struct nested_buffer *buffer; struct wl_listener buffer_destroy_listener; /* wl_surface.frame */ struct wl_list frame_callback_list; /* wl_surface.damage */ pixman_region32_t damage; } pending; void *renderer_data; }; /* Data used for the blit renderer */ struct nested_blit_surface { struct nested_buffer_reference buffer_ref; GLuint texture; cairo_surface_t *cairo_surface; }; /* Data used for the subsurface renderer */ struct nested_ss_surface { struct widget *widget; struct wl_surface *surface; struct wl_subsurface *subsurface; struct wl_callback *frame_callback; }; struct nested_frame_callback { struct wl_resource *resource; struct wl_list link; }; struct nested_renderer { void (* surface_init)(struct nested_surface *surface); void (* surface_fini)(struct nested_surface *surface); void (* render_clients)(struct nested *nested, cairo_t *cr); void (* surface_attach)(struct nested_surface *surface, struct nested_buffer *buffer); }; static const struct weston_option nested_options[] = { { WESTON_OPTION_BOOLEAN, "blit", 'b', &option_blit }, }; static const struct nested_renderer nested_blit_renderer; static const struct nested_renderer nested_ss_renderer; static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d; static PFNEGLCREATEIMAGEKHRPROC create_image; static PFNEGLDESTROYIMAGEKHRPROC destroy_image; static PFNEGLBINDWAYLANDDISPLAYWL bind_display; static PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display; static PFNEGLQUERYWAYLANDBUFFERWL query_buffer; static PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL create_wayland_buffer_from_image; static void nested_buffer_destroy_handler(struct wl_listener *listener, void *data) { struct nested_buffer *buffer = container_of(listener, struct nested_buffer, destroy_listener); wl_signal_emit(&buffer->destroy_signal, buffer); if (buffer->parent_buffer) wl_buffer_destroy(buffer->parent_buffer); free(buffer); } static struct nested_buffer * nested_buffer_from_resource(struct wl_resource *resource) { struct nested_buffer *buffer; struct wl_listener *listener; listener = wl_resource_get_destroy_listener(resource, nested_buffer_destroy_handler); if (listener) return container_of(listener, struct nested_buffer, destroy_listener); buffer = zalloc(sizeof *buffer); if (buffer == NULL) return NULL; buffer->resource = resource; wl_signal_init(&buffer->destroy_signal); buffer->destroy_listener.notify = nested_buffer_destroy_handler; wl_resource_add_destroy_listener(resource, &buffer->destroy_listener); return buffer; } static void nested_buffer_reference_handle_destroy(struct wl_listener *listener, void *data) { struct nested_buffer_reference *ref = container_of(listener, struct nested_buffer_reference, destroy_listener); assert((struct nested_buffer *)data == ref->buffer); ref->buffer = NULL; } static void nested_buffer_reference(struct nested_buffer_reference *ref, struct nested_buffer *buffer) { if (buffer == ref->buffer) return; if (ref->buffer) { ref->buffer->busy_count--; if (ref->buffer->busy_count == 0) { assert(wl_resource_get_client(ref->buffer->resource)); wl_resource_queue_event(ref->buffer->resource, WL_BUFFER_RELEASE); } wl_list_remove(&ref->destroy_listener.link); } if (buffer) { buffer->busy_count++; wl_signal_add(&buffer->destroy_signal, &ref->destroy_listener); ref->destroy_listener.notify = nested_buffer_reference_handle_destroy; } ref->buffer = buffer; } static void flush_surface_frame_callback_list(struct nested_surface *surface, uint32_t time) { struct nested_frame_callback *nc, *next; wl_list_for_each_safe(nc, next, &surface->frame_callback_list, link) { wl_callback_send_done(nc->resource, time); wl_resource_destroy(nc->resource); } wl_list_init(&surface->frame_callback_list); /* FIXME: toytoolkit need a pre-block handler where we can * call this. */ wl_display_flush_clients(surface->nested->child_display); } static void redraw_handler(struct widget *widget, void *data) { struct nested *nested = data; cairo_surface_t *surface; cairo_t *cr; struct rectangle allocation; widget_get_allocation(nested->widget, &allocation); surface = window_get_surface(nested->window); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_set_source_rgba(cr, 0, 0, 0, 0.8); cairo_fill(cr); nested->renderer->render_clients(nested, cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct nested *nested = data; window_schedule_redraw(nested->window); } static void handle_child_data(struct task *task, uint32_t events) { struct nested *nested = container_of(task, struct nested, child_task); struct wl_event_loop *loop; loop = wl_display_get_event_loop(nested->child_display); wl_event_loop_dispatch(loop, -1); wl_display_flush_clients(nested->child_display); } struct nested_client { struct wl_client *client; pid_t pid; }; static struct nested_client * launch_client(struct nested *nested, const char *path) { int sv[2]; pid_t pid; struct nested_client *client; client = malloc(sizeof *client); if (client == NULL) return NULL; if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sv) < 0) { fprintf(stderr, "launch_client: " "socketpair failed while launching '%s': %m\n", path); free(client); return NULL; } pid = fork(); if (pid == -1) { close(sv[0]); close(sv[1]); free(client); fprintf(stderr, "launch_client: " "fork failed while launching '%s': %m\n", path); return NULL; } if (pid == 0) { int clientfd; char s[32]; /* SOCK_CLOEXEC closes both ends, so we dup the fd to * get a non-CLOEXEC fd to pass through exec. */ clientfd = dup(sv[1]); if (clientfd == -1) { fprintf(stderr, "compositor: dup failed: %m\n"); exit(-1); } snprintf(s, sizeof s, "%d", clientfd); setenv("WAYLAND_SOCKET", s, 1); execl(path, path, NULL); fprintf(stderr, "compositor: executing '%s' failed: %m\n", path); exit(-1); } close(sv[1]); client->client = wl_client_create(nested->child_display, sv[0]); if (!client->client) { close(sv[0]); free(client); fprintf(stderr, "launch_client: " "wl_client_create failed while launching '%s'.\n", path); return NULL; } client->pid = pid; return client; } static void destroy_surface(struct wl_resource *resource) { struct nested_surface *surface = wl_resource_get_user_data(resource); struct nested *nested = surface->nested; struct nested_frame_callback *cb, *next; wl_list_for_each_safe(cb, next, &surface->frame_callback_list, link) wl_resource_destroy(cb->resource); wl_list_for_each_safe(cb, next, &surface->pending.frame_callback_list, link) wl_resource_destroy(cb->resource); pixman_region32_fini(&surface->pending.damage); nested->renderer->surface_fini(surface); wl_list_remove(&surface->link); free(surface); } static void surface_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void surface_attach(struct wl_client *client, struct wl_resource *resource, struct wl_resource *buffer_resource, int32_t sx, int32_t sy) { struct nested_surface *surface = wl_resource_get_user_data(resource); struct nested *nested = surface->nested; struct nested_buffer *buffer = NULL; if (buffer_resource) { int format; if (!query_buffer(nested->egl_display, (void *) buffer_resource, EGL_TEXTURE_FORMAT, &format)) { wl_resource_post_error(buffer_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "attaching non-egl wl_buffer"); return; } switch (format) { case EGL_TEXTURE_RGB: case EGL_TEXTURE_RGBA: break; default: wl_resource_post_error(buffer_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid format"); return; } buffer = nested_buffer_from_resource(buffer_resource); if (buffer == NULL) { wl_client_post_no_memory(client); return; } } if (surface->pending.buffer) wl_list_remove(&surface->pending.buffer_destroy_listener.link); surface->pending.buffer = buffer; surface->pending.newly_attached = 1; if (buffer) { wl_signal_add(&buffer->destroy_signal, &surface->pending.buffer_destroy_listener); } } static void nested_surface_attach(struct nested_surface *surface, struct nested_buffer *buffer) { struct nested *nested = surface->nested; if (surface->image != EGL_NO_IMAGE_KHR) destroy_image(nested->egl_display, surface->image); surface->image = create_image(nested->egl_display, NULL, EGL_WAYLAND_BUFFER_WL, buffer->resource, NULL); if (surface->image == EGL_NO_IMAGE_KHR) { fprintf(stderr, "failed to create img\n"); return; } nested->renderer->surface_attach(surface, buffer); } static void surface_damage(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct nested_surface *surface = wl_resource_get_user_data(resource); pixman_region32_union_rect(&surface->pending.damage, &surface->pending.damage, x, y, width, height); } static void destroy_frame_callback(struct wl_resource *resource) { struct nested_frame_callback *callback = wl_resource_get_user_data(resource); wl_list_remove(&callback->link); free(callback); } static void surface_frame(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct nested_frame_callback *callback; struct nested_surface *surface = wl_resource_get_user_data(resource); callback = malloc(sizeof *callback); if (callback == NULL) { wl_resource_post_no_memory(resource); return; } callback->resource = wl_resource_create(client, &wl_callback_interface, 1, id); wl_resource_set_implementation(callback->resource, NULL, callback, destroy_frame_callback); wl_list_insert(surface->pending.frame_callback_list.prev, &callback->link); } static void surface_set_opaque_region(struct wl_client *client, struct wl_resource *resource, struct wl_resource *region_resource) { fprintf(stderr, "surface_set_opaque_region\n"); } static void surface_set_input_region(struct wl_client *client, struct wl_resource *resource, struct wl_resource *region_resource) { fprintf(stderr, "surface_set_input_region\n"); } static void surface_commit(struct wl_client *client, struct wl_resource *resource) { struct nested_surface *surface = wl_resource_get_user_data(resource); struct nested *nested = surface->nested; /* wl_surface.attach */ if (surface->pending.newly_attached) nested_surface_attach(surface, surface->pending.buffer); if (surface->pending.buffer) { wl_list_remove(&surface->pending.buffer_destroy_listener.link); surface->pending.buffer = NULL; } surface->pending.newly_attached = 0; /* wl_surface.damage */ pixman_region32_clear(&surface->pending.damage); /* wl_surface.frame */ wl_list_insert_list(&surface->frame_callback_list, &surface->pending.frame_callback_list); wl_list_init(&surface->pending.frame_callback_list); /* FIXME: For the subsurface renderer we don't need to * actually redraw the window. However we do want to cause a * commit because the subsurface is synchronized. Ideally we * would just queue the commit */ window_schedule_redraw(nested->window); } static void surface_set_buffer_transform(struct wl_client *client, struct wl_resource *resource, int transform) { fprintf(stderr, "surface_set_buffer_transform\n"); } static const struct wl_surface_interface surface_interface = { surface_destroy, surface_attach, surface_damage, surface_frame, surface_set_opaque_region, surface_set_input_region, surface_commit, surface_set_buffer_transform }; static void surface_handle_pending_buffer_destroy(struct wl_listener *listener, void *data) { struct nested_surface *surface = container_of(listener, struct nested_surface, pending.buffer_destroy_listener); surface->pending.buffer = NULL; } static void compositor_create_surface(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct nested *nested = wl_resource_get_user_data(resource); struct nested_surface *surface; surface = zalloc(sizeof *surface); if (surface == NULL) { wl_resource_post_no_memory(resource); return; } surface->nested = nested; wl_list_init(&surface->frame_callback_list); wl_list_init(&surface->pending.frame_callback_list); surface->pending.buffer_destroy_listener.notify = surface_handle_pending_buffer_destroy; pixman_region32_init(&surface->pending.damage); display_acquire_window_surface(nested->display, nested->window, NULL); nested->renderer->surface_init(surface); display_release_window_surface(nested->display, nested->window); surface->resource = wl_resource_create(client, &wl_surface_interface, 1, id); wl_resource_set_implementation(surface->resource, &surface_interface, surface, destroy_surface); wl_list_insert(nested->surface_list.prev, &surface->link); } static void destroy_region(struct wl_resource *resource) { struct nested_region *region = wl_resource_get_user_data(resource); pixman_region32_fini(®ion->region); free(region); } static void region_destroy(struct wl_client *client, struct wl_resource *resource) { wl_resource_destroy(resource); } static void region_add(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct nested_region *region = wl_resource_get_user_data(resource); pixman_region32_union_rect(®ion->region, ®ion->region, x, y, width, height); } static void region_subtract(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { struct nested_region *region = wl_resource_get_user_data(resource); pixman_region32_t rect; pixman_region32_init_rect(&rect, x, y, width, height); pixman_region32_subtract(®ion->region, ®ion->region, &rect); pixman_region32_fini(&rect); } static const struct wl_region_interface region_interface = { region_destroy, region_add, region_subtract }; static void compositor_create_region(struct wl_client *client, struct wl_resource *resource, uint32_t id) { struct nested_region *region; region = malloc(sizeof *region); if (region == NULL) { wl_resource_post_no_memory(resource); return; } pixman_region32_init(®ion->region); region->resource = wl_resource_create(client, &wl_region_interface, 1, id); wl_resource_set_implementation(region->resource, ®ion_interface, region, destroy_region); } static const struct wl_compositor_interface compositor_interface = { compositor_create_surface, compositor_create_region }; static void compositor_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id) { struct nested *nested = data; struct wl_resource *resource; resource = wl_resource_create(client, &wl_compositor_interface, MIN(version, 3), id); wl_resource_set_implementation(resource, &compositor_interface, nested, NULL); } static int nested_init_compositor(struct nested *nested) { const char *extensions; struct wl_event_loop *loop; int use_ss_renderer = 0; int fd, ret; wl_list_init(&nested->surface_list); nested->child_display = wl_display_create(); loop = wl_display_get_event_loop(nested->child_display); fd = wl_event_loop_get_fd(loop); nested->child_task.run = handle_child_data; display_watch_fd(nested->display, fd, EPOLLIN, &nested->child_task); if (!wl_global_create(nested->child_display, &wl_compositor_interface, 1, nested, compositor_bind)) return -1; wl_display_init_shm(nested->child_display); nested->egl_display = display_get_egl_display(nested->display); extensions = eglQueryString(nested->egl_display, EGL_EXTENSIONS); if (strstr(extensions, "EGL_WL_bind_wayland_display") == NULL) { fprintf(stderr, "no EGL_WL_bind_wayland_display extension\n"); return -1; } bind_display = (void *) eglGetProcAddress("eglBindWaylandDisplayWL"); unbind_display = (void *) eglGetProcAddress("eglUnbindWaylandDisplayWL"); create_image = (void *) eglGetProcAddress("eglCreateImageKHR"); destroy_image = (void *) eglGetProcAddress("eglDestroyImageKHR"); query_buffer = (void *) eglGetProcAddress("eglQueryWaylandBufferWL"); image_target_texture_2d = (void *) eglGetProcAddress("glEGLImageTargetTexture2DOES"); ret = bind_display(nested->egl_display, nested->child_display); if (!ret) { fprintf(stderr, "failed to bind wl_display\n"); return -1; } if (display_has_subcompositor(nested->display)) { const char *func = "eglCreateWaylandBufferFromImageWL"; const char *ext = "EGL_WL_create_wayland_buffer_from_image"; if (strstr(extensions, ext)) { create_wayland_buffer_from_image = (void *) eglGetProcAddress(func); use_ss_renderer = 1; } } if (option_blit) use_ss_renderer = 0; if (use_ss_renderer) { printf("Using subsurfaces to render client surfaces\n"); nested->renderer = &nested_ss_renderer; } else { printf("Using local compositing with blits to " "render client surfaces\n"); nested->renderer = &nested_blit_renderer; } return 0; } static struct nested * nested_create(struct display *display) { struct nested *nested; nested = zalloc(sizeof *nested); if (nested == NULL) return nested; nested->window = window_create(display); nested->widget = window_frame_create(nested->window, nested); window_set_title(nested->window, "Wayland Nested"); nested->display = display; window_set_user_data(nested->window, nested); widget_set_redraw_handler(nested->widget, redraw_handler); window_set_keyboard_focus_handler(nested->window, keyboard_focus_handler); nested_init_compositor(nested); widget_schedule_resize(nested->widget, 400, 400); return nested; } static void nested_destroy(struct nested *nested) { widget_destroy(nested->widget); window_destroy(nested->window); free(nested); } /*** blit renderer ***/ static void blit_surface_init(struct nested_surface *surface) { struct nested_blit_surface *blit_surface = xzalloc(sizeof *blit_surface); glGenTextures(1, &blit_surface->texture); glBindTexture(GL_TEXTURE_2D, blit_surface->texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); surface->renderer_data = blit_surface; } static void blit_surface_fini(struct nested_surface *surface) { struct nested_blit_surface *blit_surface = surface->renderer_data; nested_buffer_reference(&blit_surface->buffer_ref, NULL); glDeleteTextures(1, &blit_surface->texture); free(blit_surface); } static void blit_frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct nested *nested = data; struct nested_surface *surface; wl_list_for_each(surface, &nested->surface_list, link) flush_surface_frame_callback_list(surface, time); if (callback) wl_callback_destroy(callback); } static const struct wl_callback_listener blit_frame_listener = { blit_frame_callback }; static void blit_render_clients(struct nested *nested, cairo_t *cr) { struct nested_surface *s; struct rectangle allocation; struct wl_callback *callback; widget_get_allocation(nested->widget, &allocation); wl_list_for_each(s, &nested->surface_list, link) { struct nested_blit_surface *blit_surface = s->renderer_data; display_acquire_window_surface(nested->display, nested->window, NULL); glBindTexture(GL_TEXTURE_2D, blit_surface->texture); image_target_texture_2d(GL_TEXTURE_2D, s->image); display_release_window_surface(nested->display, nested->window); cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_set_source_surface(cr, blit_surface->cairo_surface, allocation.x + 10, allocation.y + 10); cairo_rectangle(cr, allocation.x + 10, allocation.y + 10, allocation.width - 10, allocation.height - 10); cairo_fill(cr); } callback = wl_surface_frame(window_get_wl_surface(nested->window)); wl_callback_add_listener(callback, &blit_frame_listener, nested); } static void blit_surface_attach(struct nested_surface *surface, struct nested_buffer *buffer) { struct nested *nested = surface->nested; struct nested_blit_surface *blit_surface = surface->renderer_data; EGLint width, height; cairo_device_t *device; nested_buffer_reference(&blit_surface->buffer_ref, buffer); if (blit_surface->cairo_surface) cairo_surface_destroy(blit_surface->cairo_surface); query_buffer(nested->egl_display, (void *) buffer->resource, EGL_WIDTH, &width); query_buffer(nested->egl_display, (void *) buffer->resource, EGL_HEIGHT, &height); device = display_get_cairo_device(nested->display); blit_surface->cairo_surface = cairo_gl_surface_create_for_texture(device, CAIRO_CONTENT_COLOR_ALPHA, blit_surface->texture, width, height); } static const struct nested_renderer nested_blit_renderer = { .surface_init = blit_surface_init, .surface_fini = blit_surface_fini, .render_clients = blit_render_clients, .surface_attach = blit_surface_attach }; /*** subsurface renderer ***/ static void ss_surface_init(struct nested_surface *surface) { struct nested *nested = surface->nested; struct wl_compositor *compositor = display_get_compositor(nested->display); struct nested_ss_surface *ss_surface = xzalloc(sizeof *ss_surface); struct rectangle allocation; struct wl_region *region; ss_surface->widget = window_add_subsurface(nested->window, nested, SUBSURFACE_SYNCHRONIZED); widget_set_use_cairo(ss_surface->widget, 0); ss_surface->surface = widget_get_wl_surface(ss_surface->widget); ss_surface->subsurface = widget_get_wl_subsurface(ss_surface->widget); /* The toy toolkit gets confused about the pointer position * when it gets motion events for a subsurface so we'll just * disable input on it */ region = wl_compositor_create_region(compositor); wl_surface_set_input_region(ss_surface->surface, region); wl_region_destroy(region); widget_get_allocation(nested->widget, &allocation); wl_subsurface_set_position(ss_surface->subsurface, allocation.x + 10, allocation.y + 10); surface->renderer_data = ss_surface; } static void ss_surface_fini(struct nested_surface *surface) { struct nested_ss_surface *ss_surface = surface->renderer_data; widget_destroy(ss_surface->widget); if (ss_surface->frame_callback) wl_callback_destroy(ss_surface->frame_callback); free(ss_surface); } static void ss_render_clients(struct nested *nested, cairo_t *cr) { /* The clients are composited by the parent compositor so we * don't need to do anything here */ } static void ss_buffer_release(void *data, struct wl_buffer *wl_buffer) { struct nested_buffer *buffer = data; nested_buffer_reference(&buffer->parent_ref, NULL); } static struct wl_buffer_listener ss_buffer_listener = { ss_buffer_release }; static void ss_frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct nested_surface *surface = data; struct nested_ss_surface *ss_surface = surface->renderer_data; flush_surface_frame_callback_list(surface, time); if (callback) wl_callback_destroy(callback); ss_surface->frame_callback = NULL; } static const struct wl_callback_listener ss_frame_listener = { ss_frame_callback }; static void ss_surface_attach(struct nested_surface *surface, struct nested_buffer *buffer) { struct nested *nested = surface->nested; struct nested_ss_surface *ss_surface = surface->renderer_data; struct wl_buffer *parent_buffer; const pixman_box32_t *rects; int n_rects, i; if (buffer) { /* Create a representation of the buffer in the parent * compositor if we haven't already */ if (buffer->parent_buffer == NULL) { EGLDisplay *edpy = nested->egl_display; EGLImageKHR image = surface->image; buffer->parent_buffer = create_wayland_buffer_from_image(edpy, image); wl_buffer_add_listener(buffer->parent_buffer, &ss_buffer_listener, buffer); } parent_buffer = buffer->parent_buffer; /* We'll take a reference to the buffer while the parent * compositor is using it so that we won't report the release * event until the parent has also finished with it */ nested_buffer_reference(&buffer->parent_ref, buffer); } else { parent_buffer = NULL; } wl_surface_attach(ss_surface->surface, parent_buffer, 0, 0); rects = pixman_region32_rectangles(&surface->pending.damage, &n_rects); for (i = 0; i < n_rects; i++) { const pixman_box32_t *rect = rects + i; wl_surface_damage(ss_surface->surface, rect->x1, rect->y1, rect->x2 - rect->x1, rect->y2 - rect->y1); } if (ss_surface->frame_callback) wl_callback_destroy(ss_surface->frame_callback); ss_surface->frame_callback = wl_surface_frame(ss_surface->surface); wl_callback_add_listener(ss_surface->frame_callback, &ss_frame_listener, surface); wl_surface_commit(ss_surface->surface); } static const struct nested_renderer nested_ss_renderer = { .surface_init = ss_surface_init, .surface_fini = ss_surface_fini, .render_clients = ss_render_clients, .surface_attach = ss_surface_attach }; int main(int argc, char *argv[]) { struct display *display; struct nested *nested; if (parse_options(nested_options, ARRAY_LENGTH(nested_options), &argc, argv) > 1) { printf("Usage: %s [OPTIONS]\n --blit or -b\n", argv[0]); exit(1); } display = display_create(&argc, argv); if (display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } nested = nested_create(display); launch_client(nested, "weston-nested-client"); display_run(display); nested_destroy(nested); display_destroy(display); return 0; } weston-1.9.0/clients/resizor.c0000664000175000017500000001604512537627702013306 00000000000000/* * Copyright © 2010 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "window.h" struct spring { double current; double target; double previous; }; struct resizor { struct display *display; struct window *window; struct widget *widget; struct window *menu; struct spring width; struct spring height; struct wl_callback *frame_callback; }; static void spring_update(struct spring *spring) { double current, force; current = spring->current; force = (spring->target - current) / 20.0 + (spring->previous - current); spring->current = current + (current - spring->previous) + force; spring->previous = current; } static int spring_done(struct spring *spring) { return fabs(spring->previous - spring->target) < 0.1; } static const struct wl_callback_listener listener; static void frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct resizor *resizor = data; assert(!callback || callback == resizor->frame_callback); if (resizor->frame_callback) { wl_callback_destroy(resizor->frame_callback); resizor->frame_callback = NULL; } if (window_is_maximized(resizor->window)) return; spring_update(&resizor->width); spring_update(&resizor->height); widget_schedule_resize(resizor->widget, resizor->width.current + 0.5, resizor->height.current + 0.5); if (!spring_done(&resizor->width) || !spring_done(&resizor->height)) { resizor->frame_callback = wl_surface_frame( window_get_wl_surface(resizor->window)); wl_callback_add_listener(resizor->frame_callback, &listener, resizor); } } static const struct wl_callback_listener listener = { frame_callback }; static void redraw_handler(struct widget *widget, void *data) { struct resizor *resizor = data; cairo_surface_t *surface; cairo_t *cr; struct rectangle allocation; widget_get_allocation(resizor->widget, &allocation); surface = window_get_surface(resizor->window); cr = cairo_create(surface); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); cairo_rectangle(cr, allocation.x, allocation.y, allocation.width, allocation.height); cairo_set_source_rgba(cr, 0, 0, 0, 0.8); cairo_fill(cr); cairo_destroy(cr); cairo_surface_destroy(surface); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { struct resizor *resizor = data; window_schedule_redraw(resizor->window); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct resizor *resizor = data; struct rectangle allocation; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; window_get_allocation(resizor->window, &allocation); resizor->width.current = allocation.width; if (spring_done(&resizor->width)) resizor->width.target = allocation.width; resizor->height.current = allocation.height; if (spring_done(&resizor->height)) resizor->height.target = allocation.height; switch (sym) { case XKB_KEY_Up: if (allocation.height < 400) break; resizor->height.target = allocation.height - 200; break; case XKB_KEY_Down: if (allocation.height > 1000) break; resizor->height.target = allocation.height + 200; break; case XKB_KEY_Left: if (allocation.width < 400) break; resizor->width.target = allocation.width - 200; break; case XKB_KEY_Right: if (allocation.width > 1000) break; resizor->width.target = allocation.width + 200; break; case XKB_KEY_Escape: display_exit(resizor->display); break; } if (!resizor->frame_callback) frame_callback(resizor, NULL, 0); } static void menu_func(void *data, struct input *input, int index) { fprintf(stderr, "picked entry %d\n", index); } static void show_menu(struct resizor *resizor, struct input *input, uint32_t time) { int32_t x, y; static const char *entries[] = { "Roy", "Pris", "Leon", "Zhora" }; input_get_position(input, &x, &y); window_show_menu(resizor->display, input, time, resizor->window, x - 10, y - 10, menu_func, entries, 4); } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct resizor *resizor = data; switch (button) { case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) show_menu(resizor, input, time); break; } } static struct resizor * resizor_create(struct display *display) { struct resizor *resizor; resizor = xzalloc(sizeof *resizor); resizor->window = window_create(display); resizor->widget = window_frame_create(resizor->window, resizor); window_set_title(resizor->window, "Wayland Resizor"); resizor->display = display; window_set_key_handler(resizor->window, key_handler); window_set_user_data(resizor->window, resizor); widget_set_redraw_handler(resizor->widget, redraw_handler); window_set_keyboard_focus_handler(resizor->window, keyboard_focus_handler); widget_set_button_handler(resizor->widget, button_handler); resizor->height.previous = 400; resizor->height.current = 400; resizor->height.target = 400; resizor->width.previous = 400; resizor->width.current = 400; resizor->width.target = 400; widget_schedule_resize(resizor->widget, 400, 400); return resizor; } static void resizor_destroy(struct resizor *resizor) { if (resizor->frame_callback) wl_callback_destroy(resizor->frame_callback); widget_destroy(resizor->widget); window_destroy(resizor->window); free(resizor); } int main(int argc, char *argv[]) { struct display *display; struct resizor *resizor; display = display_create(&argc, argv); if (display == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } resizor = resizor_create(display); display_run(display); resizor_destroy(resizor); display_destroy(display); return 0; } weston-1.9.0/clients/gears.c0000664000175000017500000003134612537627702012713 00000000000000/* * Copyright © 2008 Kristian Høgsberg * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "window.h" struct gears { struct window *window; struct widget *widget; struct display *d; EGLDisplay display; EGLDisplay config; EGLContext context; GLfloat angle; struct { GLfloat rotx; GLfloat roty; } view; int button_down; int last_x, last_y; GLint gear_list[3]; int fullscreen; int frames; uint32_t last_fps; }; struct gear_template { GLfloat material[4]; GLfloat inner_radius; GLfloat outer_radius; GLfloat width; GLint teeth; GLfloat tooth_depth; }; static const struct gear_template gear_templates[] = { { { 0.8, 0.1, 0.0, 1.0 }, 1.0, 4.0, 1.0, 20, 0.7 }, { { 0.0, 0.8, 0.2, 1.0 }, 0.5, 2.0, 2.0, 10, 0.7 }, { { 0.2, 0.2, 1.0, 1.0 }, 1.3, 2.0, 0.5, 10, 0.7 }, }; static GLfloat light_pos[4] = {5.0, 5.0, 10.0, 0.0}; static void die(const char *msg) { fprintf(stderr, "%s", msg); exit(EXIT_FAILURE); } static void make_gear(const struct gear_template *t) { GLint i; GLfloat r0, r1, r2; GLfloat angle, da; GLfloat u, v, len; glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, t->material); r0 = t->inner_radius; r1 = t->outer_radius - t->tooth_depth / 2.0; r2 = t->outer_radius + t->tooth_depth / 2.0; da = 2.0 * M_PI / t->teeth / 4.0; glShadeModel(GL_FLAT); glNormal3f(0.0, 0.0, 1.0); /* draw front face */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= t->teeth; i++) { angle = i * 2.0 * M_PI / t->teeth; glVertex3f(r0 * cos(angle), r0 * sin(angle), t->width * 0.5); glVertex3f(r1 * cos(angle), r1 * sin(angle), t->width * 0.5); if (i < t->teeth) { glVertex3f(r0 * cos(angle), r0 * sin(angle), t->width * 0.5); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), t->width * 0.5); } } glEnd(); /* draw front sides of teeth */ glBegin(GL_QUADS); da = 2.0 * M_PI / t->teeth / 4.0; for (i = 0; i < t->teeth; i++) { angle = i * 2.0 * M_PI / t->teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), t->width * 0.5); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), t->width * 0.5); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), t->width * 0.5); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), t->width * 0.5); } glEnd(); glNormal3f(0.0, 0.0, -1.0); /* draw back face */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= t->teeth; i++) { angle = i * 2.0 * M_PI / t->teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), -t->width * 0.5); glVertex3f(r0 * cos(angle), r0 * sin(angle), -t->width * 0.5); if (i < t->teeth) { glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -t->width * 0.5); glVertex3f(r0 * cos(angle), r0 * sin(angle), -t->width * 0.5); } } glEnd(); /* draw back sides of teeth */ glBegin(GL_QUADS); da = 2.0 * M_PI / t->teeth / 4.0; for (i = 0; i < t->teeth; i++) { angle = i * 2.0 * M_PI / t->teeth; glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -t->width * 0.5); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -t->width * 0.5); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -t->width * 0.5); glVertex3f(r1 * cos(angle), r1 * sin(angle), -t->width * 0.5); } glEnd(); /* draw outward faces of teeth */ glBegin(GL_QUAD_STRIP); for (i = 0; i < t->teeth; i++) { angle = i * 2.0 * M_PI / t->teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), t->width * 0.5); glVertex3f(r1 * cos(angle), r1 * sin(angle), -t->width * 0.5); u = r2 * cos(angle + da) - r1 * cos(angle); v = r2 * sin(angle + da) - r1 * sin(angle); len = sqrt(u * u + v * v); u /= len; v /= len; glNormal3f(v, -u, 0.0); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), t->width * 0.5); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -t->width * 0.5); glNormal3f(cos(angle), sin(angle), 0.0); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), t->width * 0.5); glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -t->width * 0.5); u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da); v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da); glNormal3f(v, -u, 0.0); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), t->width * 0.5); glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -t->width * 0.5); glNormal3f(cos(angle), sin(angle), 0.0); } glVertex3f(r1 * cos(0), r1 * sin(0), t->width * 0.5); glVertex3f(r1 * cos(0), r1 * sin(0), -t->width * 0.5); glEnd(); glShadeModel(GL_SMOOTH); /* draw inside radius cylinder */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= t->teeth; i++) { angle = i * 2.0 * M_PI / t->teeth; glNormal3f(-cos(angle), -sin(angle), 0.0); glVertex3f(r0 * cos(angle), r0 * sin(angle), -t->width * 0.5); glVertex3f(r0 * cos(angle), r0 * sin(angle), t->width * 0.5); } glEnd(); } static void update_fps(struct gears *gears, uint32_t time) { long diff_ms; static bool first_call = true; if (first_call) { gears->last_fps = time; first_call = false; } else gears->frames++; diff_ms = time - gears->last_fps; if (diff_ms > 5000) { float seconds = diff_ms / 1000.0; float fps = gears->frames / seconds; printf("%d frames in %6.3f seconds = %6.3f FPS\n", gears->frames, seconds, fps); fflush(stdout); gears->frames = 0; gears->last_fps = time; } } static void frame_callback(void *data, struct wl_callback *callback, uint32_t time) { struct gears *gears = data; update_fps(gears, time); gears->angle = (GLfloat) (time % 8192) * 360 / 8192.0; window_schedule_redraw(gears->window); if (callback) wl_callback_destroy(callback); } static const struct wl_callback_listener listener = { frame_callback }; static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct gears *gears = data; int offset_x, offset_y; float step = 0.5; if (gears->button_down) { offset_x = x - gears->last_x; offset_y = y - gears->last_y; gears->last_x = x; gears->last_y = y; gears->view.roty += offset_x * step; gears->view.rotx += offset_y * step; if (gears->view.roty >= 360) gears->view.roty = gears->view.roty - 360; if (gears->view.roty <= 0) gears->view.roty = gears->view.roty + 360; if (gears->view.rotx >= 360) gears->view.rotx = gears->view.rotx - 360; if (gears->view.rotx <= 0) gears->view.rotx = gears->view.rotx + 360; } return CURSOR_LEFT_PTR; } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct gears *gears = data; if (button == BTN_LEFT) { if (state == WL_POINTER_BUTTON_STATE_PRESSED) { gears->button_down = 1; input_get_position(input, &gears->last_x, &gears->last_y); } else { gears->button_down = 0; } } } static void redraw_handler(struct widget *widget, void *data) { struct rectangle window_allocation; struct rectangle allocation; struct wl_callback *callback; struct gears *gears = data; widget_get_allocation(gears->widget, &allocation); window_get_allocation(gears->window, &window_allocation); if (display_acquire_window_surface(gears->d, gears->window, gears->context) < 0) { die("Unable to acquire window surface, " "compiled without cairo-egl?\n"); } glViewport(allocation.x, window_allocation.height - allocation.height - allocation.y, allocation.width, allocation.height); glScissor(allocation.x, window_allocation.height - allocation.height - allocation.y, allocation.width, allocation.height); glEnable(GL_SCISSOR_TEST); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glTranslatef(0.0, 0.0, -50); glRotatef(gears->view.rotx, 1.0, 0.0, 0.0); glRotatef(gears->view.roty, 0.0, 1.0, 0.0); glPushMatrix(); glTranslatef(-3.0, -2.0, 0.0); glRotatef(gears->angle, 0.0, 0.0, 1.0); glCallList(gears->gear_list[0]); glPopMatrix(); glPushMatrix(); glTranslatef(3.1, -2.0, 0.0); glRotatef(-2.0 * gears->angle - 9.0, 0.0, 0.0, 1.0); glCallList(gears->gear_list[1]); glPopMatrix(); glPushMatrix(); glTranslatef(-3.1, 4.2, 0.0); glRotatef(-2.0 * gears->angle - 25.0, 0.0, 0.0, 1.0); glCallList(gears->gear_list[2]); glPopMatrix(); glPopMatrix(); glFlush(); display_release_window_surface(gears->d, gears->window); callback = wl_surface_frame(window_get_wl_surface(gears->window)); wl_callback_add_listener(callback, &listener, gears); } static void resize_handler(struct widget *widget, int32_t width, int32_t height, void *data) { struct gears *gears = data; int32_t size, big, small; /* Constrain child size to be square and at least 300x300 */ if (width < height) { small = width; big = height; } else { small = height; big = width; } if (gears->fullscreen) size = small; else size = big; widget_set_size(gears->widget, size, size); } static void keyboard_focus_handler(struct window *window, struct input *device, void *data) { window_schedule_redraw(window); } static void fullscreen_handler(struct window *window, void *data) { struct gears *gears = data; gears->fullscreen ^= 1; window_set_fullscreen(window, gears->fullscreen); } static struct gears * gears_create(struct display *display) { const int width = 450, height = 500; struct gears *gears; int i; gears = zalloc(sizeof *gears); gears->d = display; gears->window = window_create(display); gears->widget = window_frame_create(gears->window, gears); window_set_title(gears->window, "Wayland Gears"); gears->display = display_get_egl_display(gears->d); if (gears->display == NULL) die("failed to create egl display\n"); eglBindAPI(EGL_OPENGL_API); gears->config = display_get_argb_egl_config(gears->d); gears->context = eglCreateContext(gears->display, gears->config, EGL_NO_CONTEXT, NULL); if (gears->context == NULL) die("failed to create context\n"); if (!eglMakeCurrent(gears->display, NULL, NULL, gears->context)) die("failed to make context current\n"); for (i = 0; i < 3; i++) { gears->gear_list[i] = glGenLists(1); glNewList(gears->gear_list[i], GL_COMPILE); make_gear(&gear_templates[i]); glEndList(); } gears->button_down = 0; gears->last_x = 0; gears->last_y = 0; gears->view.rotx = 20.0; gears->view.roty = 30.0; printf("Warning: FPS count is limited by the wayland compositor or monitor refresh rate\n"); glEnable(GL_NORMALIZE); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 200.0); glMatrixMode(GL_MODELVIEW); glLightfv(GL_LIGHT0, GL_POSITION, light_pos); glEnable(GL_CULL_FACE); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); glClearColor(0, 0, 0, 0.92); window_set_user_data(gears->window, gears); widget_set_resize_handler(gears->widget, resize_handler); widget_set_redraw_handler(gears->widget, redraw_handler); widget_set_button_handler(gears->widget, button_handler); widget_set_motion_handler(gears->widget, motion_handler); window_set_keyboard_focus_handler(gears->window, keyboard_focus_handler); window_set_fullscreen_handler(gears->window, fullscreen_handler); window_schedule_resize(gears->window, width, height); return gears; } static void gears_destroy(struct gears *gears) { widget_destroy(gears->widget); window_destroy(gears->window); free(gears); } int main(int argc, char *argv[]) { struct display *d; struct gears *gears; d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } gears = gears_create(d); display_run(d); gears_destroy(gears); display_destroy(d); return 0; } weston-1.9.0/clients/fullscreen.c0000664000175000017500000003576312537627702013763 00000000000000/* * Copyright © 2008 Kristian Høgsberg * Copyright © 2012 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "window.h" #include "fullscreen-shell-client-protocol.h" struct fs_output { struct wl_list link; struct output *output; }; struct fullscreen { struct display *display; struct window *window; struct widget *widget; struct _wl_fullscreen_shell *fshell; enum _wl_fullscreen_shell_present_method present_method; int width, height; int fullscreen; float pointer_x, pointer_y; int draw_cursor; struct wl_list output_list; struct fs_output *current_output; }; static void fullscreen_handler(struct window *window, void *data) { struct fullscreen *fullscreen = data; fullscreen->fullscreen ^= 1; window_set_fullscreen(window, fullscreen->fullscreen); } static void draw_string(cairo_t *cr, const char *fmt, ...) { char buffer[4096]; char *p, *end; va_list argp; cairo_text_extents_t text_extents; cairo_font_extents_t font_extents; cairo_save(cr); cairo_select_font_face(cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(cr, 14); cairo_font_extents (cr, &font_extents); va_start(argp, fmt); vsnprintf(buffer, sizeof(buffer), fmt, argp); p = buffer; while (*p) { end = strchr(p, '\n'); if (end) *end = 0; cairo_show_text(cr, p); cairo_text_extents (cr, p, &text_extents); cairo_rel_move_to (cr, -text_extents.x_advance, font_extents.height); if (end) p = end + 1; else break; } va_end(argp); cairo_restore(cr); } static void redraw_handler(struct widget *widget, void *data) { struct fullscreen *fullscreen = data; struct rectangle allocation; cairo_surface_t *surface; cairo_t *cr; int i; double x, y, border; const char *method_name[] = { "default", "center", "zoom", "zoom_crop", "stretch"}; surface = window_get_surface(fullscreen->window); if (surface == NULL || cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { fprintf(stderr, "failed to create cairo egl surface\n"); return; } widget_get_allocation(fullscreen->widget, &allocation); cr = widget_cairo_create(widget); cairo_set_source_rgb(cr, 0, 0, 0); cairo_paint (cr); cairo_set_source_rgb(cr, 0, 0, 1); cairo_set_line_width (cr, 10); cairo_rectangle(cr, 5, 5, allocation.width - 10, allocation.height - 10); cairo_stroke (cr); cairo_move_to(cr, allocation.x + 15, allocation.y + 25); cairo_set_source_rgb(cr, 1, 1, 1); if (fullscreen->fshell) { draw_string(cr, "Surface size: %d, %d\n" "Scale: %d, transform: %d\n" "Pointer: %f,%f\n" "Output: %s, present method: %s\n" "Keys: (s)cale, (t)ransform, si(z)e, (m)ethod,\n" " (o)utput, modes(w)itch, (q)uit\n", fullscreen->width, fullscreen->height, window_get_buffer_scale (fullscreen->window), window_get_buffer_transform (fullscreen->window), fullscreen->pointer_x, fullscreen->pointer_y, method_name[fullscreen->present_method], fullscreen->current_output ? output_get_model(fullscreen->current_output->output): "null"); } else { draw_string(cr, "Surface size: %d, %d\n" "Scale: %d, transform: %d\n" "Pointer: %f,%f\n" "Fullscreen: %d\n" "Keys: (s)cale, (t)ransform, si(z)e, (f)ullscreen, (q)uit\n", fullscreen->width, fullscreen->height, window_get_buffer_scale (fullscreen->window), window_get_buffer_transform (fullscreen->window), fullscreen->pointer_x, fullscreen->pointer_y, fullscreen->fullscreen); } y = 100; i = 0; while (y + 60 < fullscreen->height) { border = (i++ % 2 == 0) ? 1 : 0.5; x = 50; cairo_set_line_width (cr, border); while (x + 70 < fullscreen->width) { if (window_has_focus(fullscreen->window) && fullscreen->pointer_x >= x && fullscreen->pointer_x < x + 50 && fullscreen->pointer_y >= y && fullscreen->pointer_y < y + 40) { cairo_set_source_rgb(cr, 1, 0, 0); cairo_rectangle(cr, x, y, 50, 40); cairo_fill(cr); } cairo_set_source_rgb(cr, 0, 1, 0); cairo_rectangle(cr, x + border/2.0, y + border/2.0, 50, 40); cairo_stroke(cr); x += 60; } y += 50; } if (window_has_focus(fullscreen->window) && fullscreen->draw_cursor) { cairo_set_source_rgb(cr, 1, 1, 1); cairo_set_line_width (cr, 8); cairo_move_to(cr, fullscreen->pointer_x - 12, fullscreen->pointer_y - 12); cairo_line_to(cr, fullscreen->pointer_x + 12, fullscreen->pointer_y + 12); cairo_stroke(cr); cairo_move_to(cr, fullscreen->pointer_x + 12, fullscreen->pointer_y - 12); cairo_line_to(cr, fullscreen->pointer_x - 12, fullscreen->pointer_y + 12); cairo_stroke(cr); cairo_set_source_rgb(cr, 0, 0, 0); cairo_set_line_width (cr, 4); cairo_move_to(cr, fullscreen->pointer_x - 10, fullscreen->pointer_y - 10); cairo_line_to(cr, fullscreen->pointer_x + 10, fullscreen->pointer_y + 10); cairo_stroke(cr); cairo_move_to(cr, fullscreen->pointer_x + 10, fullscreen->pointer_y - 10); cairo_line_to(cr, fullscreen->pointer_x - 10, fullscreen->pointer_y + 10); cairo_stroke(cr); } cairo_destroy(cr); } static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t sym, enum wl_keyboard_key_state state, void *data) { struct fullscreen *fullscreen = data; int transform, scale; static int current_size = 0; struct fs_output *fsout; struct wl_output *wl_output; int widths[] = { 640, 320, 800, 400 }; int heights[] = { 480, 240, 600, 300 }; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (sym) { case XKB_KEY_t: transform = window_get_buffer_transform (window); transform = (transform + 1) % 8; window_set_buffer_transform(window, transform); window_schedule_redraw(window); break; case XKB_KEY_s: scale = window_get_buffer_scale (window); if (scale == 1) scale = 2; else scale = 1; window_set_buffer_scale(window, scale); window_schedule_redraw(window); break; case XKB_KEY_z: current_size = (current_size + 1) % 4; fullscreen->width = widths[current_size]; fullscreen->height = heights[current_size]; window_schedule_resize(fullscreen->window, fullscreen->width, fullscreen->height); break; case XKB_KEY_m: if (!fullscreen->fshell) break; wl_output = NULL; if (fullscreen->current_output) wl_output = output_get_wl_output(fullscreen->current_output->output); fullscreen->present_method = (fullscreen->present_method + 1) % 5; _wl_fullscreen_shell_present_surface(fullscreen->fshell, window_get_wl_surface(fullscreen->window), fullscreen->present_method, wl_output); window_schedule_redraw(window); break; case XKB_KEY_o: if (!fullscreen->fshell) break; fsout = fullscreen->current_output; wl_output = fsout ? output_get_wl_output(fsout->output) : NULL; /* Clear the current presentation */ _wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL, 0, wl_output); if (fullscreen->current_output) { if (fullscreen->current_output->link.next == &fullscreen->output_list) fsout = NULL; else fsout = wl_container_of(fullscreen->current_output->link.next, fsout, link); } else { fsout = wl_container_of(fullscreen->output_list.next, fsout, link); } fullscreen->current_output = fsout; wl_output = fsout ? output_get_wl_output(fsout->output) : NULL; _wl_fullscreen_shell_present_surface(fullscreen->fshell, window_get_wl_surface(fullscreen->window), fullscreen->present_method, wl_output); window_schedule_redraw(window); break; case XKB_KEY_w: if (!fullscreen->fshell || !fullscreen->current_output) break; wl_output = NULL; if (fullscreen->current_output) wl_output = output_get_wl_output(fullscreen->current_output->output); _wl_fullscreen_shell_mode_feedback_destroy( _wl_fullscreen_shell_present_surface_for_mode(fullscreen->fshell, window_get_wl_surface(fullscreen->window), wl_output, 0)); window_schedule_redraw(window); break; case XKB_KEY_f: if (fullscreen->fshell) break; fullscreen->fullscreen ^= 1; window_set_fullscreen(window, fullscreen->fullscreen); break; case XKB_KEY_q: exit (0); break; } } static int motion_handler(struct widget *widget, struct input *input, uint32_t time, float x, float y, void *data) { struct fullscreen *fullscreen = data; fullscreen->pointer_x = x; fullscreen->pointer_y = y; widget_schedule_redraw(widget); return fullscreen->draw_cursor ? CURSOR_BLANK : CURSOR_LEFT_PTR; } static int enter_handler(struct widget *widget, struct input *input, float x, float y, void *data) { struct fullscreen *fullscreen = data; fullscreen->pointer_x = x; fullscreen->pointer_y = y; widget_schedule_redraw(widget); return fullscreen->draw_cursor ? CURSOR_BLANK : CURSOR_LEFT_PTR; } static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct fullscreen *fullscreen = data; switch (button) { case BTN_LEFT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) window_move(fullscreen->window, input, display_get_serial(fullscreen->display)); break; case BTN_RIGHT: if (state == WL_POINTER_BUTTON_STATE_PRESSED) window_show_frame_menu(fullscreen->window, input, time); break; } } static void touch_handler(struct widget *widget, struct input *input, uint32_t serial, uint32_t time, int32_t id, float x, float y, void *data) { struct fullscreen *fullscreen = data; window_move(fullscreen->window, input, display_get_serial(fullscreen->display)); } static void fshell_capability_handler(void *data, struct _wl_fullscreen_shell *fshell, uint32_t capability) { struct fullscreen *fullscreen = data; switch (capability) { case _WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE: fullscreen->draw_cursor = 0; break; default: break; } } struct _wl_fullscreen_shell_listener fullscreen_shell_listener = { fshell_capability_handler }; static void usage(int error_code) { fprintf(stderr, "Usage: fullscreen [OPTIONS]\n\n" " -w \tSet window width to \n" " -h \tSet window height to \n" " --help\tShow this help text\n\n"); exit(error_code); } static void output_handler(struct output *output, void *data) { struct fullscreen *fullscreen = data; struct fs_output *fsout; /* If we've already seen this one, don't add it to the list */ wl_list_for_each(fsout, &fullscreen->output_list, link) if (fsout->output == output) return; fsout = calloc(1, sizeof *fsout); fsout->output = output; wl_list_insert(&fullscreen->output_list, &fsout->link); } static void global_handler(struct display *display, uint32_t id, const char *interface, uint32_t version, void *data) { struct fullscreen *fullscreen = data; if (strcmp(interface, "_wl_fullscreen_shell") == 0) { fullscreen->fshell = display_bind(display, id, &_wl_fullscreen_shell_interface, 1); _wl_fullscreen_shell_add_listener(fullscreen->fshell, &fullscreen_shell_listener, fullscreen); } } int main(int argc, char *argv[]) { struct fullscreen fullscreen; struct display *d; int i; fullscreen.width = 640; fullscreen.height = 480; fullscreen.fullscreen = 0; fullscreen.present_method = _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT; wl_list_init(&fullscreen.output_list); fullscreen.current_output = NULL; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-w") == 0) { if (++i >= argc) usage(EXIT_FAILURE); fullscreen.width = atol(argv[i]); } else if (strcmp(argv[i], "-h") == 0) { if (++i >= argc) usage(EXIT_FAILURE); fullscreen.height = atol(argv[i]); } else if (strcmp(argv[i], "--help") == 0) usage(EXIT_SUCCESS); else usage(EXIT_FAILURE); } d = display_create(&argc, argv); if (d == NULL) { fprintf(stderr, "failed to create display: %m\n"); return -1; } fullscreen.display = d; fullscreen.fshell = NULL; display_set_user_data(fullscreen.display, &fullscreen); display_set_global_handler(fullscreen.display, global_handler); display_set_output_configure_handler(fullscreen.display, output_handler); if (fullscreen.fshell) { fullscreen.window = window_create_custom(d); _wl_fullscreen_shell_present_surface(fullscreen.fshell, window_get_wl_surface(fullscreen.window), fullscreen.present_method, NULL); /* If we get the CURSOR_PLANE capability, we'll change this */ fullscreen.draw_cursor = 1; } else { fullscreen.window = window_create(d); fullscreen.draw_cursor = 0; } fullscreen.widget = window_add_widget(fullscreen.window, &fullscreen); window_set_title(fullscreen.window, "Fullscreen"); widget_set_transparent(fullscreen.widget, 0); widget_set_default_cursor(fullscreen.widget, CURSOR_LEFT_PTR); widget_set_redraw_handler(fullscreen.widget, redraw_handler); widget_set_button_handler(fullscreen.widget, button_handler); widget_set_motion_handler(fullscreen.widget, motion_handler); widget_set_enter_handler(fullscreen.widget, enter_handler); widget_set_touch_down_handler(fullscreen.widget, touch_handler); window_set_key_handler(fullscreen.window, key_handler); window_set_fullscreen_handler(fullscreen.window, fullscreen_handler); window_set_user_data(fullscreen.window, &fullscreen); /* Hack to set minimum allocation so we can shrink later */ window_schedule_resize(fullscreen.window, 1, 1); window_schedule_resize(fullscreen.window, fullscreen.width, fullscreen.height); display_run(d); widget_destroy(fullscreen.widget); window_destroy(fullscreen.window); display_destroy(d); return 0; } weston-1.9.0/clients/simple-touch.c0000664000175000017500000002102212537664701014211 00000000000000/* * Copyright © 2011 Benjamin Franzke * Copyright © 2011 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include "shared/helpers.h" #include "shared/os-compatibility.h" struct seat { struct touch *touch; struct wl_seat *seat; struct wl_touch *wl_touch; }; struct touch { struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shell *shell; struct wl_shm *shm; struct wl_pointer *pointer; struct wl_keyboard *keyboard; struct wl_surface *surface; struct wl_shell_surface *shell_surface; struct wl_buffer *buffer; int has_argb; int width, height; void *data; }; static void create_shm_buffer(struct touch *touch) { struct wl_shm_pool *pool; int fd, size, stride; stride = touch->width * 4; size = stride * touch->height; fd = os_create_anonymous_file(size); if (fd < 0) { fprintf(stderr, "creating a buffer file for %d B failed: %m\n", size); exit(1); } touch->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (touch->data == MAP_FAILED) { fprintf(stderr, "mmap failed: %m\n"); close(fd); exit(1); } pool = wl_shm_create_pool(touch->shm, fd, size); touch->buffer = wl_shm_pool_create_buffer(pool, 0, touch->width, touch->height, stride, WL_SHM_FORMAT_ARGB8888); wl_shm_pool_destroy(pool); close(fd); } static void shm_format(void *data, struct wl_shm *wl_shm, uint32_t format) { struct touch *touch = data; if (format == WL_SHM_FORMAT_ARGB8888) touch->has_argb = 1; } struct wl_shm_listener shm_listener = { shm_format }; static void touch_paint(struct touch *touch, int32_t x, int32_t y, int32_t id) { uint32_t *p, c; static const uint32_t colors[] = { 0xffff0000, 0xffffff00, 0xff0000ff, 0xffff00ff, 0xff00ff00, 0xff00ffff, }; if (id < (int32_t) ARRAY_LENGTH(colors)) c = colors[id]; else c = 0xffffffff; if (x < 2 || x >= touch->width - 2 || y < 2 || y >= touch->height - 2) return; p = (uint32_t *) touch->data + (x - 2) + (y - 2) * touch->width; p[2] = c; p += touch->width; p[1] = c; p[2] = c; p[3] = c; p += touch->width; p[0] = c; p[1] = c; p[2] = c; p[3] = c; p[4] = c; p += touch->width; p[1] = c; p[2] = c; p[3] = c; p += touch->width; p[2] = c; wl_surface_attach(touch->surface, touch->buffer, 0, 0); wl_surface_damage(touch->surface, x - 2, y - 2, 5, 5); /* todo: We could queue up more damage before committing, if there * are more input events to handle. */ wl_surface_commit(touch->surface); } static void touch_handle_down(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, struct wl_surface *surface, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct touch *touch = data; float x = wl_fixed_to_double(x_w); float y = wl_fixed_to_double(y_w); touch_paint(touch, x, y, id); } static void touch_handle_up(void *data, struct wl_touch *wl_touch, uint32_t serial, uint32_t time, int32_t id) { } static void touch_handle_motion(void *data, struct wl_touch *wl_touch, uint32_t time, int32_t id, wl_fixed_t x_w, wl_fixed_t y_w) { struct touch *touch = data; float x = wl_fixed_to_double(x_w); float y = wl_fixed_to_double(y_w); touch_paint(touch, x, y, id); } static void touch_handle_frame(void *data, struct wl_touch *wl_touch) { } static void touch_handle_cancel(void *data, struct wl_touch *wl_touch) { } static const struct wl_touch_listener touch_listener = { touch_handle_down, touch_handle_up, touch_handle_motion, touch_handle_frame, touch_handle_cancel, }; static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, enum wl_seat_capability caps) { struct seat *seat = data; struct touch *touch = seat->touch; if ((caps & WL_SEAT_CAPABILITY_TOUCH) && !seat->wl_touch) { seat->wl_touch = wl_seat_get_touch(wl_seat); wl_touch_set_user_data(seat->wl_touch, touch); wl_touch_add_listener(seat->wl_touch, &touch_listener, touch); } else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && seat->wl_touch) { wl_touch_destroy(seat->wl_touch); seat->wl_touch = NULL; } } static const struct wl_seat_listener seat_listener = { seat_handle_capabilities, }; static void add_seat(struct touch *touch, uint32_t name, uint32_t version) { struct seat *seat; seat = malloc(sizeof *seat); assert(seat); seat->touch = touch; seat->wl_touch = NULL; seat->seat = wl_registry_bind(touch->registry, name, &wl_seat_interface, 1); wl_seat_add_listener(seat->seat, &seat_listener, seat); } static void handle_ping(void *data, struct wl_shell_surface *shell_surface, uint32_t serial) { wl_shell_surface_pong(shell_surface, serial); } static void handle_configure(void *data, struct wl_shell_surface *shell_surface, uint32_t edges, int32_t width, int32_t height) { } static void handle_popup_done(void *data, struct wl_shell_surface *shell_surface) { } static const struct wl_shell_surface_listener shell_surface_listener = { handle_ping, handle_configure, handle_popup_done }; static void handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) { struct touch *touch = data; if (strcmp(interface, "wl_compositor") == 0) { touch->compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 1); } else if (strcmp(interface, "wl_shell") == 0) { touch->shell = wl_registry_bind(registry, name, &wl_shell_interface, 1); } else if (strcmp(interface, "wl_shm") == 0) { touch->shm = wl_registry_bind(registry, name, &wl_shm_interface, 1); wl_shm_add_listener(touch->shm, &shm_listener, touch); } else if (strcmp(interface, "wl_seat") == 0) { add_seat(touch, name, version); } } static void handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { } static const struct wl_registry_listener registry_listener = { handle_global, handle_global_remove }; static struct touch * touch_create(int width, int height) { struct touch *touch; touch = malloc(sizeof *touch); if (touch == NULL) { fprintf(stderr, "out of memory\n"); exit(1); } touch->display = wl_display_connect(NULL); assert(touch->display); touch->has_argb = 0; touch->registry = wl_display_get_registry(touch->display); wl_registry_add_listener(touch->registry, ®istry_listener, touch); wl_display_dispatch(touch->display); wl_display_roundtrip(touch->display); if (!touch->has_argb) { fprintf(stderr, "WL_SHM_FORMAT_ARGB32 not available\n"); exit(1); } touch->width = width; touch->height = height; touch->surface = wl_compositor_create_surface(touch->compositor); touch->shell_surface = wl_shell_get_shell_surface(touch->shell, touch->surface); create_shm_buffer(touch); if (touch->shell_surface) { wl_shell_surface_add_listener(touch->shell_surface, &shell_surface_listener, touch); wl_shell_surface_set_toplevel(touch->shell_surface); } wl_surface_set_user_data(touch->surface, touch); wl_shell_surface_set_title(touch->shell_surface, "simple-touch"); memset(touch->data, 64, width * height * 4); wl_surface_attach(touch->surface, touch->buffer, 0, 0); wl_surface_damage(touch->surface, 0, 0, width, height); wl_surface_commit(touch->surface); return touch; } int main(int argc, char **argv) { struct touch *touch; int ret = 0; touch = touch_create(600, 500); while (ret != -1) ret = wl_display_dispatch(touch->display); return 0; }