pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include <stdio.h>
#include "crosshair.h"
#include "clip.h"
#include "../hidint.h"
#include "gui.h"
#include "gui-pinout-preview.h"
#include <gtk/gtkgl.h>
#include "hid/common/hidgl.h"
#include "hid/common/draw_helpers.h"
#include "hid/common/trackball.h"
Go to the source code of this file.
Data Structures | |
struct | render_priv |
struct | hid_gc_struct |
struct | ColorCache |
Defines | |
#define | GL_GLEXT_PROTOTYPES 1 |
#define | USE_GC(gc) if (!use_gc(gc)) return |
#define | MAX_ELAPSED (50. / 1000.) |
#define | Z_NEAR 3.0 |
#define | LEAD_USER_WIDTH 0.2 |
#define | LEAD_USER_PERIOD (1000 / 20) |
#define | LEAD_USER_VELOCITY 3. |
#define | LEAD_USER_ARC_COUNT 3 |
#define | LEAD_USER_ARC_SEPARATION 3. |
#define | LEAD_USER_INITIAL_RADIUS 10. |
#define | LEAD_USER_COLOR_R 1. |
#define | LEAD_USER_COLOR_G 1. |
#define | LEAD_USER_COLOR_B 0. |
Typedefs | |
typedef struct render_priv | render_priv |
typedef struct hid_gc_struct | hid_gc_struct |
Functions | |
static void | draw_lead_user (render_priv *priv) |
static void | ghid_unproject_to_z_plane (int ex, int ey, Coord pcb_z, Coord *pcb_x, Coord *pcb_y) |
static void | start_subcomposite (void) |
static void | end_subcomposite (void) |
int | ghid_set_layer (const char *name, int group, int empty) |
static void | ghid_end_layer (void) |
void | ghid_destroy_gc (hidGC gc) |
hidGC | ghid_make_gc (void) |
void | ghid_draw_grid (BoxType *drawn_area) |
Draw the grid on the 2D canvas. | |
static void | ghid_draw_bg_image (void) |
void | ghid_use_mask (enum mask_mode mode) |
static void | set_special_grid_color (void) |
void | ghid_set_special_colors (HID_Attribute *ha) |
static void | set_gl_color_for_gc (hidGC gc) |
void | ghid_set_color (hidGC gc, const char *name) |
void | ghid_set_alpha_mult (hidGC gc, double alpha_mult) |
void | ghid_set_line_cap (hidGC gc, EndCapStyle style) |
void | ghid_set_line_width (hidGC gc, Coord width) |
void | ghid_set_draw_xor (hidGC gc, int xor) |
void | ghid_set_draw_faded (hidGC gc, int faded) |
void | ghid_set_line_cap_angle (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
static void | ghid_invalidate_current_gc (void) |
static int | use_gc (hidGC gc) |
void | ghid_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
void | ghid_draw_arc (hidGC gc, Coord cx, Coord cy, Coord xradius, Coord yradius, Angle start_angle, Angle delta_angle) |
void | ghid_draw_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
void | ghid_fill_circle (hidGC gc, Coord cx, Coord cy, Coord radius) |
void | ghid_fill_polygon (hidGC gc, int n_coords, Coord *x, Coord *y) |
void | ghid_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box) |
void | ghid_thindraw_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box) |
void | ghid_fill_rect (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2) |
void | ghid_invalidate_lr (Coord left, Coord right, Coord top, Coord bottom) |
void | ghid_invalidate_all () |
void | ghid_notify_crosshair_change (bool changes_complete) |
void | ghid_notify_mark_change (bool changes_complete) |
static void | draw_right_cross (gint x, gint y, gint z) |
static void | draw_slanted_cross (gint x, gint y, gint z) |
static void | draw_dozen_cross (gint x, gint y, gint z) |
static void | draw_crosshair (render_priv *priv) |
void | ghid_init_renderer (int *argc, char ***argv, GHidPort *port) |
void | ghid_shutdown_renderer (GHidPort *port) |
void | ghid_init_drawing_widget (GtkWidget *widget, GHidPort *port) |
void | ghid_drawing_area_configure_hook (GHidPort *port) |
gboolean | ghid_start_drawing (GHidPort *port, GtkWidget *widget) |
void | ghid_end_drawing (GHidPort *port, GtkWidget *widget) |
void | ghid_screen_update (void) |
gboolean | ghid_drawing_area_expose_cb (GtkWidget *widget, GdkEventExpose *ev, GHidPort *port) |
void | ghid_port_drawing_realize_cb (GtkWidget *widget, gpointer data) |
gboolean | ghid_pinout_preview_expose (GtkWidget *widget, GdkEventExpose *ev) |
GdkPixmap * | ghid_render_pixmap (int cx, int cy, double zoom, int width, int height, int depth) |
HID_DRAW * | ghid_request_debug_draw (void) |
void | ghid_flush_debug_draw (void) |
void | ghid_finish_debug_draw (void) |
static float | determinant_2x2 (float m[2][2]) |
static void | invert_2x2 (float m[2][2], float out[2][2]) |
bool | ghid_event_to_pcb_coords (int event_x, int event_y, Coord *pcb_x, Coord *pcb_y) |
bool | ghid_pcb_to_event_coords (Coord pcb_x, Coord pcb_y, int *event_x, int *event_y) |
void | ghid_view_2d (void *ball, gboolean view_2d, gpointer userdata) |
void | ghid_port_rotate (void *ball, float *quarternion, gpointer userdata) |
gboolean | lead_user_cb (gpointer data) |
void | ghid_lead_user_to_location (Coord x, Coord y) |
void | ghid_cancel_lead_user (void) |
Variables | |
HID | ghid_hid |
HID_DRAW | ghid_graphics |
static hidGC | current_gc = NULL |
static enum mask_mode | cur_mask = HID_MASK_OFF |
static GLfloat | view_matrix [4][4] |
static GLfloat | last_modelview_matrix [4][4] |
static int | global_view_2d = 1 |
#define GL_GLEXT_PROTOTYPES 1 |
Definition at line 18 of file gtkhid-gl.c.
#define LEAD_USER_ARC_COUNT 3 |
Definition at line 1597 of file gtkhid-gl.c.
Referenced by draw_lead_user().
#define LEAD_USER_ARC_SEPARATION 3. |
Definition at line 1598 of file gtkhid-gl.c.
Referenced by draw_lead_user().
#define LEAD_USER_COLOR_B 0. |
Definition at line 1602 of file gtkhid-gl.c.
Referenced by draw_lead_user().
#define LEAD_USER_COLOR_G 1. |
Definition at line 1601 of file gtkhid-gl.c.
Referenced by draw_lead_user().
#define LEAD_USER_COLOR_R 1. |
Definition at line 1600 of file gtkhid-gl.c.
Referenced by draw_lead_user().
#define LEAD_USER_INITIAL_RADIUS 10. |
Definition at line 1599 of file gtkhid-gl.c.
Referenced by draw_lead_user(), ghid_lead_user_to_location(), and lead_user_cb().
#define LEAD_USER_PERIOD (1000 / 20) |
Definition at line 1595 of file gtkhid-gl.c.
Referenced by ghid_lead_user_to_location().
#define LEAD_USER_VELOCITY 3. |
Definition at line 1596 of file gtkhid-gl.c.
Referenced by lead_user_cb().
#define LEAD_USER_WIDTH 0.2 |
Definition at line 1594 of file gtkhid-gl.c.
Referenced by draw_lead_user().
#define MAX_ELAPSED (50. / 1000.) |
Definition at line 617 of file gtkhid-gl.c.
Referenced by ghid_invalidate_all().
#define USE_GC | ( | gc | ) | if (!use_gc(gc)) return |
Definition at line 50 of file gtkhid-gl.c.
Referenced by ghid_draw_arc(), ghid_draw_line(), ghid_draw_rect(), ghid_fill_circle(), ghid_fill_pcb_polygon(), ghid_fill_polygon(), and ghid_fill_rect().
#define Z_NEAR 3.0 |
Definition at line 870 of file gtkhid-gl.c.
Referenced by ghid_pinout_preview_expose(), ghid_render_pixmap(), and ghid_request_debug_draw().
typedef struct hid_gc_struct hid_gc_struct |
typedef struct render_priv render_priv |
static float determinant_2x2 | ( | float | m[2][2] | ) | [static] |
Definition at line 1372 of file gtkhid-gl.c.
References det().
Referenced by invert_2x2().
static void draw_crosshair | ( | render_priv * | priv | ) | [static] |
Definition at line 741 of file gtkhid-gl.c.
References SettingType::CrossColor, Crosshair, GHidPort::crosshair_x, GHidPort::crosshair_y, Dozen_Crosshair_Shape, draw_dozen_cross(), draw_right_cross(), draw_slanted_cross(), ghid_map_color_string(), gport, Settings, CrosshairType::shape, Union_Jack_Crosshair_Shape, x, and y.
Referenced by ghid_drawing_area_expose_cb().
static void draw_dozen_cross | ( | gint | x, |
gint | y, | ||
gint | z | ||
) | [static] |
Definition at line 690 of file gtkhid-gl.c.
References MAX, PCBType::MaxHeight, PCBType::MaxWidth, MIN, PCB, x, and y.
Referenced by draw_crosshair().
static void draw_lead_user | ( | render_priv * | priv | ) | [static] |
Definition at line 1605 of file gtkhid-gl.c.
References buffer, view_data::coord_per_px, gport, hidgl_draw_arc(), hidgl_flush_triangles(), render_priv::lead_user, LEAD_USER_ARC_COUNT, LEAD_USER_ARC_SEPARATION, LEAD_USER_COLOR_B, LEAD_USER_COLOR_G, LEAD_USER_COLOR_R, LEAD_USER_INITIAL_RADIUS, render_priv::lead_user_radius, LEAD_USER_WIDTH, render_priv::lead_user_x, render_priv::lead_user_y, MM_TO_COORD, and GHidPort::view.
Referenced by ghid_drawing_area_expose_cb().
static void draw_right_cross | ( | gint | x, |
gint | y, | ||
gint | z | ||
) | [static] |
Definition at line 653 of file gtkhid-gl.c.
References PCBType::MaxHeight, PCBType::MaxWidth, and PCB.
Referenced by draw_crosshair().
static void draw_slanted_cross | ( | gint | x, |
gint | y, | ||
gint | z | ||
) | [static] |
Definition at line 662 of file gtkhid-gl.c.
References MAX, PCBType::MaxHeight, PCBType::MaxWidth, MIN, PCB, x, and y.
Referenced by draw_crosshair().
static void end_subcomposite | ( | void | ) | [static] |
Definition at line 120 of file gtkhid-gl.c.
References buffer, gport, hidgl_flush_triangles(), hidgl_return_stencil_bit(), GHidPort::render_priv, and render_priv::subcomposite_stencil_bit.
Referenced by ghid_end_layer(), and ghid_set_layer().
void ghid_cancel_lead_user | ( | void | ) |
Definition at line 1676 of file gtkhid-gl.c.
References ghid_invalidate_all(), gport, render_priv::lead_user, render_priv::lead_user_timeout, render_priv::lead_user_timer, and GHidPort::render_priv.
void ghid_destroy_gc | ( | hidGC | gc | ) |
Definition at line 199 of file gtkhid-gl.c.
References hid_gc_struct::gc.
void ghid_draw_arc | ( | hidGC | gc, |
Coord | cx, | ||
Coord | cy, | ||
Coord | xradius, | ||
Coord | yradius, | ||
Angle | start_angle, | ||
Angle | delta_angle | ||
) |
Definition at line 551 of file gtkhid-gl.c.
References view_data::coord_per_px, GHidPort::drawable, view_data::flip_x, view_data::flip_y, gport, GHidPort::height, hidgl_draw_arc(), NormalizeAngle(), GHidPort::render_priv, SIDE_X, SIDE_Y, start_angle, render_priv::u_gc, USE_GC, GHidPort::view, Vx(), Vy(), Vz(), hid_gc_struct::width, GHidPort::width, view_data::x0, and view_data::y0.
static void ghid_draw_bg_image | ( | void | ) | [static] |
Definition at line 242 of file gtkhid-gl.c.
References GhidGui::bg_pixbuf, ghidgui, PCBType::MaxHeight, PCBType::MaxWidth, and PCB.
Referenced by ghid_drawing_area_expose_cb().
void ghid_draw_grid | ( | BoxType * | drawn_area | ) |
Draw the grid on the 2D canvas.
Definition at line 217 of file gtkhid-gl.c.
References GHidPort::bg_color, GHidPort::colormap, GHidPort::drawable, SettingType::DrawGrid, gport, PCBType::Grid, GHidPort::grid_color, render_priv::grid_gc, SettingType::GridColor, GridFit(), PCBType::GridOffsetX, PCBType::GridOffsetY, GHidPort::height, view_data::height, hidgl_draw_grid(), n, PCB, realloc(), GHidPort::render_priv, set_clip(), Settings, SIDE_X, SIDE_Y, GHidPort::view, Vx(), Vy(), Vz(), GHidPort::width, view_data::width, x, view_data::x0, y, and view_data::y0.
Definition at line 543 of file gtkhid-gl.c.
References hid_gc_struct::cap, ClipLine(), view_data::coord_per_px, GHidPort::drawable, gport, GHidPort::height, hidgl_draw_line(), GHidPort::render_priv, render_priv::u_gc, USE_GC, GHidPort::view, Vx(), Vy(), hid_gc_struct::width, and GHidPort::width.
Definition at line 561 of file gtkhid-gl.c.
References view_data::coord_per_px, GHidPort::drawable, FALSE, gport, GHidPort::height, hidgl_draw_rect(), GHidPort::render_priv, SIDE_X, SIDE_Y, render_priv::u_gc, USE_GC, GHidPort::view, Vx(), Vy(), GHidPort::width, hid_gc_struct::width, view_data::x0, and view_data::y0.
void ghid_drawing_area_configure_hook | ( | GHidPort * | port | ) |
Definition at line 830 of file gtkhid-gl.c.
References GHidPort::bg_color, render_priv::bg_gc, GHidPort::drawable, GHidPort::height, GHidPort::mask, GHidPort::offlimits_color, render_priv::offlimits_gc, GHidPort::render_priv, and GHidPort::width.
gboolean ghid_drawing_area_expose_cb | ( | GtkWidget * | widget, |
GdkEventExpose * | ev, | ||
GHidPort * | port | ||
) |
Definition at line 872 of file gtkhid-gl.c.
References GHidPort::bg_color, render_priv::bg_gc, buffer, common_fill_pcb_polygon(), view_data::coord_per_px, render_priv::crosshair_gc, draw_crosshair(), hid_draw_st::draw_grid, draw_lead_user(), DrawAttached(), GHidPort::drawing_area, DrawMark(), FALSE, hid_draw_st::fill_pcb_polygon, view_data::flip_x, view_data::flip_y, ghid_draw_bg_image(), ghid_end_drawing(), ghid_invalidate_current_gc(), ghid_start_drawing(), ghid_unproject_to_z_plane(), gport, hid_expose_callback(), hidgl_finish_render(), hidgl_flush_triangles(), hidgl_reset_stencil_usage(), hidgl_start_render(), hidgl_stencil_bits(), last_modelview_matrix, MAX, PCBType::MaxHeight, PCBType::MaxWidth, MIN, GHidPort::offlimits_color, PCB, GHidPort::pixmap, region, GHidPort::render_priv, render_priv::time_since_expose, GHidPort::view, view_matrix, window, view_data::x0, BoxType::X1, BoxType::X2, view_data::y0, BoxType::Y1, and BoxType::Y2.
void ghid_end_drawing | ( | GHidPort * | port, |
GtkWidget * | widget | ||
) |
Definition at line 850 of file gtkhid-gl.c.
References render_priv::in_context, and GHidPort::render_priv.
Referenced by ghid_drawing_area_expose_cb(), ghid_finish_debug_draw(), and ghid_pinout_preview_expose().
static void ghid_end_layer | ( | void | ) | [static] |
Definition at line 193 of file gtkhid-gl.c.
References end_subcomposite().
Referenced by ghid_init_renderer().
Definition at line 1535 of file gtkhid-gl.c.
References EVENT_TO_PCB_X, EVENT_TO_PCB_Y, and ghid_unproject_to_z_plane().
Definition at line 570 of file gtkhid-gl.c.
References view_data::coord_per_px, GHidPort::drawable, gport, GHidPort::height, hidgl_fill_circle(), GHidPort::render_priv, SIDE_X, SIDE_Y, TRUE, render_priv::u_gc, USE_GC, GHidPort::view, Vx(), Vy(), Vz(), GHidPort::width, view_data::x0, and view_data::y0.
void ghid_fill_pcb_polygon | ( | hidGC | gc, |
PolygonType * | poly, | ||
const BoxType * | clip_box | ||
) |
Definition at line 587 of file gtkhid-gl.c.
References view_data::coord_per_px, gport, hidgl_fill_pcb_polygon(), USE_GC, and GHidPort::view.
Referenced by ghid_init_renderer().
Definition at line 579 of file gtkhid-gl.c.
References GHidPort::drawable, gport, hidgl_fill_polygon(), realloc(), GHidPort::render_priv, render_priv::u_gc, USE_GC, Vx(), and Vy().
Definition at line 604 of file gtkhid-gl.c.
References view_data::coord_per_px, GHidPort::drawable, gport, GHidPort::height, hidgl_fill_rect(), GHidPort::render_priv, SIDE_X, SIDE_Y, TRUE, render_priv::u_gc, USE_GC, GHidPort::view, Vx(), Vy(), GHidPort::width, hid_gc_struct::width, view_data::x0, and view_data::y0.
void ghid_finish_debug_draw | ( | void | ) |
Definition at line 1362 of file gtkhid-gl.c.
References buffer, GHidPort::drawing_area, ghid_end_drawing(), ghid_flush_debug_draw(), gport, hidgl_finish_render(), and hidgl_flush_triangles().
void ghid_flush_debug_draw | ( | void | ) |
Definition at line 1348 of file gtkhid-gl.c.
References buffer, GHidPort::drawing_area, ghid_screen_update(), gport, and hidgl_flush_triangles().
void ghid_init_drawing_widget | ( | GtkWidget * | widget, |
GHidPort * | port | ||
) |
Definition at line 818 of file gtkhid-gl.c.
References render_priv::glconfig, GHidPort::render_priv, and TRUE.
void ghid_init_renderer | ( | int * | argc, |
char *** | argv, | ||
GHidPort * | port | ||
) |
Definition at line 779 of file gtkhid-gl.c.
References render_priv::crosshair_gc, hid_st::end_layer, hid_draw_st::fill_pcb_polygon, ghid_end_layer(), ghid_fill_pcb_polygon(), ghid_thindraw_pcb_polygon(), render_priv::glconfig, hid_st::graphics, gui, hid_draw_st::make_gc, GHidPort::render_priv, hid_draw_st::thindraw_pcb_polygon, and render_priv::time_since_expose.
void ghid_invalidate_all | ( | ) |
Definition at line 619 of file gtkhid-gl.c.
References ghid_draw_area_update(), ghid_screen_update(), gport, MAX_ELAPSED, redraw_region(), GHidPort::render_priv, and render_priv::time_since_expose.
static void ghid_invalidate_current_gc | ( | void | ) | [static] |
Definition at line 519 of file gtkhid-gl.c.
Referenced by ghid_drawing_area_expose_cb(), ghid_pinout_preview_expose(), ghid_render_pixmap(), and ghid_request_debug_draw().
Definition at line 612 of file gtkhid-gl.c.
References ghid_invalidate_all(), ghid_screen_update(), MAX, maxx, maxy, MIN, minx, miny, redraw_region(), Vx(), and Vy().
Definition at line 1661 of file gtkhid-gl.c.
References ghid_cancel_lead_user(), gport, render_priv::lead_user, lead_user_cb(), LEAD_USER_INITIAL_RADIUS, LEAD_USER_PERIOD, render_priv::lead_user_radius, render_priv::lead_user_timeout, render_priv::lead_user_timer, render_priv::lead_user_x, render_priv::lead_user_y, MM_TO_COORD, GHidPort::render_priv, x, and y.
hidGC ghid_make_gc | ( | void | ) |
Definition at line 205 of file gtkhid-gl.c.
References hid_gc_struct::alpha_mult, SettingType::BackgroundColor, hid_gc_struct::colorname, hid_gc_struct::me_pointer, and Settings.
void ghid_notify_crosshair_change | ( | bool | changes_complete | ) |
Definition at line 631 of file gtkhid-gl.c.
References render_priv::attached_invalidate_depth, render_priv::crosshair_gc, DrawAttached(), GHidPort::drawing_area, ghid_draw_area_update(), ghid_invalidate_all(), gport, and GHidPort::render_priv.
void ghid_notify_mark_change | ( | bool | changes_complete | ) |
Definition at line 642 of file gtkhid-gl.c.
References render_priv::crosshair_gc, GHidPort::drawing_area, DrawMark(), ghid_draw_area_update(), ghid_invalidate_all(), gport, render_priv::mark_invalidate_depth, and GHidPort::render_priv.
Definition at line 1543 of file gtkhid-gl.c.
References DRAW_X, DRAW_Y, and last_modelview_matrix.
gboolean ghid_pinout_preview_expose | ( | GtkWidget * | widget, |
GdkEventExpose * | ev | ||
) |
Definition at line 1059 of file gtkhid-gl.c.
References GHidPort::bg_color, render_priv::bg_gc, buffer, view_data::coord_per_px, GHidPort::drawable, _GhidPinoutPreview::element, f, FALSE, view_data::flip_x, view_data::flip_y, ghid_end_drawing(), ghid_invalidate_current_gc(), GHID_PINOUT_PREVIEW, ghid_start_drawing(), gport, view_data::height, GHidPort::height, hid_expose_callback(), hidgl_finish_render(), hidgl_flush_triangles(), hidgl_reset_stencil_usage(), hidgl_start_render(), PCBType::MaxHeight, PCBType::MaxWidth, PCB, pinout, GHidPort::render_priv, TRUE, GHidPort::view, view_data::width, GHidPort::width, window, view_data::x0, _GhidPinoutPreview::x_max, view_data::y0, _GhidPinoutPreview::y_max, and Z_NEAR.
void ghid_port_drawing_realize_cb | ( | GtkWidget * | widget, |
gpointer | data | ||
) |
Definition at line 1046 of file gtkhid-gl.c.
void ghid_port_rotate | ( | void * | ball, |
float * | quarternion, | ||
gpointer | userdata | ||
) |
Definition at line 1571 of file gtkhid-gl.c.
References build_rotmatrix(), ghid_invalidate_all(), and view_matrix.
Referenced by ghid_build_pcb_top_window().
GdkPixmap* ghid_render_pixmap | ( | int | cx, |
int | cy, | ||
double | zoom, | ||
int | width, | ||
int | height, | ||
int | depth | ||
) |
Definition at line 1189 of file gtkhid-gl.c.
References GHidPort::bg_color, render_priv::bg_gc, buffer, view_data::coord_per_px, cx, cy, GHidPort::drawable, f, view_data::flip_x, view_data::flip_y, ghid_invalidate_current_gc(), gport, view_data::height, GHidPort::height, hid_expose_callback(), hidgl_finish_render(), hidgl_flush_triangles(), hidgl_reset_stencil_usage(), hidgl_start_render(), render_priv::in_context, MAX, PCBType::MaxHeight, PCBType::MaxWidth, MIN, PCB, pixmap, Px(), Py(), region, GHidPort::render_priv, TRUE, GHidPort::view, view_data::width, GHidPort::width, view_data::x0, BoxType::X1, BoxType::X2, view_data::y0, BoxType::Y1, BoxType::Y2, and Z_NEAR.
HID_DRAW* ghid_request_debug_draw | ( | void | ) |
Definition at line 1310 of file gtkhid-gl.c.
References view_data::coord_per_px, GHidPort::drawing_area, f, view_data::flip_x, view_data::flip_y, ghid_invalidate_current_gc(), ghid_start_drawing(), gport, hid_st::graphics, hidgl_start_render(), PCBType::MaxHeight, PCBType::MaxWidth, PCB, GHidPort::view, view_data::x0, view_data::y0, and Z_NEAR.
void ghid_screen_update | ( | void | ) |
Definition at line 866 of file gtkhid-gl.c.
References render_priv::bg_gc, draw_crosshair(), GHidPort::drawing_area, gport, GHidPort::height, GHidPort::pixmap, GHidPort::render_priv, GHidPort::width, and window.
void ghid_set_alpha_mult | ( | hidGC | gc, |
double | alpha_mult | ||
) |
Definition at line 478 of file gtkhid-gl.c.
References hid_gc_struct::alpha_mult, and set_gl_color_for_gc().
Referenced by ghid_thindraw_pcb_polygon().
void ghid_set_color | ( | hidGC | gc, |
const char * | name | ||
) |
Definition at line 471 of file gtkhid-gl.c.
References __FUNCTION__, GHidPort::bg_color, GHidPort::colormap, hid_gc_struct::colorname, hid_gc_struct::gc, gport, hid_cache_color(), malloc(), GHidPort::offlimits_color, hidval::ptr, set_gl_color_for_gc(), GHidPort::top_window, and hid_gc_struct::xor_mask.
void ghid_set_draw_faded | ( | hidGC | gc, |
int | faded | ||
) |
Definition at line 507 of file gtkhid-gl.c.
void ghid_set_draw_xor | ( | hidGC | gc, |
int | xor | ||
) |
Definition at line 498 of file gtkhid-gl.c.
References hid_gc_struct::colorname, hid_gc_struct::gc, ghid_set_color(), and hid_gc_struct::xor_mask.
int ghid_set_layer | ( | const char * | name, |
int | group, | ||
int | empty | ||
) |
Definition at line 138 of file gtkhid-gl.c.
References PCBType::Data, PCBType::ElementOn, end_subcomposite(), LayerGroupType::Entries, gport, PCBType::InvisibleObjectsOn, DataType::Layer, PCBType::LayerGroups, max_copper_layer, max_group, n, LayerGroupType::Number, LayerType::On, PCB, PCBType::RatOn, GHidPort::render_priv, SILK_LAYER, SL_ASSY, SL_INVISIBLE, SL_MASK, SL_MYSIDE, SL_PDRILL, SL_RATS, SL_SILK, SL_TYPE, SL_UDRILL, start_subcomposite(), TEST_FLAG, and render_priv::trans_lines.
void ghid_set_line_cap | ( | hidGC | gc, |
EndCapStyle | style | ||
) |
Definition at line 485 of file gtkhid-gl.c.
References Beveled_Cap, hid_gc_struct::cap, hid_gc_struct::gc, gport, hid_gc_struct::join, GHidPort::render_priv, Round_Cap, Square_Cap, style, Trace_Cap, Vz(), WHICH_GC, and hid_gc_struct::width.
Definition at line 513 of file gtkhid-gl.c.
Definition at line 491 of file gtkhid-gl.c.
References hid_gc_struct::cap, hid_gc_struct::gc, gport, hid_gc_struct::join, GHidPort::render_priv, Vz(), WHICH_GC, and hid_gc_struct::width.
void ghid_set_special_colors | ( | HID_Attribute * | ha | ) |
Definition at line 356 of file gtkhid-gl.c.
References GHidPort::bg_color, render_priv::bg_gc, ghid_map_color_string(), gport, GHidPort::grid_color, render_priv::grid_gc, HID_Attribute::name, GHidPort::offlimits_color, render_priv::offlimits_gc, GHidPort::render_priv, set_special_grid_color(), and HID_Attribute::value.
void ghid_shutdown_renderer | ( | GHidPort * | port | ) |
Definition at line 807 of file gtkhid-gl.c.
References render_priv::crosshair_gc, hid_draw_st::destroy_gc, ghid_cancel_lead_user(), hid_st::graphics, gui, and GHidPort::render_priv.
gboolean ghid_start_drawing | ( | GHidPort * | port, |
GtkWidget * | widget | ||
) |
Definition at line 835 of file gtkhid-gl.c.
References FALSE, render_priv::in_context, GHidPort::render_priv, and TRUE.
Referenced by ghid_drawing_area_expose_cb(), ghid_pinout_preview_expose(), and ghid_request_debug_draw().
void ghid_thindraw_pcb_polygon | ( | hidGC | gc, |
PolygonType * | poly, | ||
const BoxType * | clip_box | ||
) |
Definition at line 595 of file gtkhid-gl.c.
References common_thindraw_pcb_polygon(), hid_draw_st::fill_pcb_polygon, ghid_set_alpha_mult(), hid_st::graphics, and gui.
Referenced by ghid_init_renderer().
static void ghid_unproject_to_z_plane | ( | int | ex, |
int | ey, | ||
Coord | pcb_z, | ||
Coord * | pcb_x, | ||
Coord * | pcb_y | ||
) | [static] |
Definition at line 1470 of file gtkhid-gl.c.
References invert_2x2(), last_modelview_matrix, x, and y.
Referenced by ghid_drawing_area_expose_cb(), and ghid_event_to_pcb_coords().
void ghid_use_mask | ( | enum mask_mode | mode | ) |
Definition at line 299 of file gtkhid-gl.c.
References buffer, cur_mask, GHidPort::drawable, gport, GHidPort::height, HID_MASK_AFTER, HID_MASK_BEFORE, HID_MASK_CLEAR, HID_MASK_OFF, hidgl_assign_clear_stencil_bit(), hidgl_flush_triangles(), hidgl_return_stencil_bit(), GHidPort::mask, render_priv::mask_gc, mask_seq, GHidPort::pixmap, GHidPort::render_priv, set_clip(), TRUE, and GHidPort::width.
void ghid_view_2d | ( | void * | ball, |
gboolean | view_2d, | ||
gpointer | userdata | ||
) |
Definition at line 1564 of file gtkhid-gl.c.
References ghid_invalidate_all(), and global_view_2d.
Referenced by ghid_build_pcb_top_window().
static void invert_2x2 | ( | float | m[2][2], |
float | out[2][2] | ||
) | [static] |
Definition at line 1402 of file gtkhid-gl.c.
References determinant_2x2(), and scale.
Referenced by ghid_unproject_to_z_plane().
gboolean lead_user_cb | ( | gpointer | data | ) |
Definition at line 1638 of file gtkhid-gl.c.
References ghid_invalidate_all(), LEAD_USER_INITIAL_RADIUS, render_priv::lead_user_radius, render_priv::lead_user_timer, LEAD_USER_VELOCITY, MM_TO_COORD, and TRUE.
static void set_gl_color_for_gc | ( | hidGC | gc | ) | [static] |
Definition at line 386 of file gtkhid-gl.c.
References hid_gc_struct::alpha_mult, GHidPort::bg_color, ColorCache::blue, ColorCache::color, ColorCache::color_set, GHidPort::colormap, hid_gc_struct::colorname, render_priv::current_alpha_mult, render_priv::current_colorname, gport, ColorCache::green, hid_cache_color(), malloc(), GHidPort::offlimits_color, hidval::ptr, ColorCache::red, GHidPort::render_priv, and GHidPort::top_window.
Referenced by ghid_set_alpha_mult(), ghid_set_color(), and use_gc().
static void set_special_grid_color | ( | void | ) | [static] |
Definition at line 346 of file gtkhid-gl.c.
References GHidPort::bg_color, GHidPort::colormap, gport, and GHidPort::grid_color.
Referenced by ghid_set_special_colors().
static void start_subcomposite | ( | void | ) | [static] |
Definition at line 101 of file gtkhid-gl.c.
References buffer, gport, hidgl_assign_clear_stencil_bit(), hidgl_flush_triangles(), GHidPort::render_priv, and render_priv::subcomposite_stencil_bit.
Referenced by ghid_set_layer().
static int use_gc | ( | hidGC | gc | ) | [static] |
Definition at line 525 of file gtkhid-gl.c.
References hid_gc_struct::me_pointer, and set_gl_color_for_gc().
Definition at line 52 of file gtkhid-gl.c.
Referenced by ghid_use_mask().
hidGC current_gc = NULL [static] |
Definition at line 46 of file gtkhid-gl.c.
int global_view_2d = 1 [static] |
Definition at line 61 of file gtkhid-gl.c.
Referenced by ghid_view_2d().
GLfloat last_modelview_matrix[4][4] [static] |
{{1.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 1.0}}
Definition at line 57 of file gtkhid-gl.c.
Referenced by ghid_drawing_area_expose_cb(), ghid_pcb_to_event_coords(), and ghid_unproject_to_z_plane().
GLfloat view_matrix[4][4] [static] |
{{1.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0}, {0.0, 0.0, 0.0, 1.0}}
Definition at line 53 of file gtkhid-gl.c.
Referenced by ghid_drawing_area_expose_cb(), and ghid_port_rotate().