예제 #1
0
result_t create_hsi_window(handle_t parent, memid_t key, handle_t *hwnd)
  {
  result_t result;

  // create our window
  if (failed(result = create_child_widget(parent, key, widget_wndproc, hwnd)))
    return result;

  // create the window data.
  hsi_window_t *wnd = (hsi_window_t *)neutron_malloc(sizeof(hsi_window_t));
  memset(wnd, 0, sizeof(hsi_window_t));

  wnd->version = sizeof(hsi_window_t);

  if (failed(lookup_color(key, "background-color", &wnd->background_color)))
    wnd->background_color = color_black;

  reg_get_bool(key, "draw-border", &wnd->draw_border);

  if (failed(lookup_font(key, "font", &wnd->font)))
    {
    // we always have the neo font.
    if (failed(result = open_font("neo", 9, &wnd->font)))
      return result;
    }

  // store the parameters for the window
  set_wnddata(*hwnd, wnd);

  rect_t rect;
  get_window_rect(*hwnd, &rect);
  invalidate_rect(*hwnd, &rect);

  return s_ok;
  }
예제 #2
0
파일: Canvas.cpp 프로젝트: makhles/MyIGS
void Canvas::invalidate() {
    std::cout << "Invalidating canvas..." << std::endl;
    auto win = get_window();
    if (win) {
        Gdk::Rectangle r(0, 0, get_allocation().get_width(), get_allocation().get_height());
        win->invalidate_rect(r, false);
    }
}
예제 #3
0
bool ClockDrawArea::on_time_out(){
	//When timer time out, this function will be triggered

	//Invalidate the clock area so that the clock will be re-draw
	auto window = get_window();
	if(window){
		Gdk::Rectangle rect(0, 0, window->get_width(), window->get_height());
		window->invalidate_rect(rect, false);
	}

	return true;

}
예제 #4
0
// Engine interface 12 and above are below
void IAGSEngine::MarkRegionDirty(int32 left, int32 top, int32 right, int32 bottom) {
  invalidate_rect(left, top, right, bottom);
  plugins[this->pluginId].invalidatedRegion++;
}
예제 #5
0
void IAGSEngine::BlitBitmap (int x, int y, BITMAP *bmp, int masked) {
  wputblock (x, y, bmp, masked);
  invalidate_rect(x, y, x + bmp->w, y + bmp->h);
}
예제 #6
0
result_t widget_wndproc(handle_t hwnd, const canmsg_t *msg)
  {
  bool changed = false;
  hsi_window_t *wnd;
  get_wnddata(hwnd, (void **)&wnd);

  switch (msg->id)
    {
    case id_magnetic_heading:
    {
    int16_t direction;
    get_param_int16(msg, 0, &direction);

    while (direction < 0)
      direction += 360;
    while (direction > 359)
      direction -= 360;

    changed = wnd->direction != direction;
    wnd->direction = direction;
    }
    break;
    case id_heading:
    {
    int16_t value;
    get_param_int16(msg, 0, &value);
    changed = wnd->heading_bug != value;
    wnd->heading_bug = value;
    }
    break;
    case id_heading_angle:
    {
    int16_t value;
    get_param_int16(msg, 0, &value);
    changed = wnd->heading != value;
    wnd->heading = value;
    }
    break;
    case id_deviation:
    {
    int16_t value;
    get_param_int16(msg, 0, &value);
    changed = wnd->deviation != value;
    wnd->deviation = value;
    // the deviation is +/- * 10
    }
    break;
    case id_selected_course:
    {
    int16_t value;
    get_param_int16(msg, 0, &value);
    changed = wnd->course != value;
    wnd->course = value;
    }
    break;
    case id_track:
    {
    int16_t value;
    get_param_int16(msg, 0, &value);
    changed = wnd->track != value;
    wnd->track = value;
    }
    break;
    case id_wind_speed:
    {
    float v;
    get_param_float(msg, &v);
    int16_t value = (int16_t)meters_per_second_to_knots(v);
    changed = wnd->wind_speed != value;
    wnd->wind_speed = value;
    }
    break;
    case id_wind_direction:
    {
    float v;
    get_param_float(msg, &v);
    int16_t value = (int16_t)radians_to_degrees(v);
    changed = wnd->wind_direction != value;
    wnd->wind_direction != value;
    }
    break;
    case id_distance_to_next:
    {
    float v;
    get_param_float(msg, &v);
    int16_t value = (int16_t)meters_to_nm(v);
    changed = wnd->distance_to_waypoint != value;
    wnd->distance_to_waypoint = value;
    }
    break;
    case id_magnetic_variation:
    {
    float v;
    get_param_float(msg, &v);
    int16_t value = (int16_t)radians_to_degrees(v);
    changed = wnd->magnetic_variation != value;
    wnd->magnetic_variation = value;
    }
    break;
    case id_estimated_time_to_next:
    {
    int16_t value;
    get_param_int16(msg, 0, &value);
    changed = wnd->time_to_waypoint != value;
    wnd->time_to_waypoint = value;
    }
    break;
    case id_paint:
      begin_paint(hwnd);
      update_window(hwnd, wnd);
      end_paint(hwnd);
      break;
    default:
      return defwndproc(hwnd, msg);
    }

  if (changed)
    invalidate_rect(hwnd, 0);

  return s_ok;
  }
예제 #7
0
파일: main.c 프로젝트: kotuku-aero/diy-efis
void bsp_invalidate_framebuffer()
  {
  invalidate_rect(main_window, 0);
  }