summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/common.h38
-rw-r--r--gui/glabel.c14
-rw-r--r--gui/gui.c26
-rw-r--r--gui/history.c20
-rw-r--r--gui/index.c32
-rw-r--r--gui/progress.c6
-rw-r--r--gui/render.c14
-rw-r--r--gui/sheet.c54
8 files changed, 102 insertions, 102 deletions
diff --git a/gui/common.h b/gui/common.h
index a64ab70..5148041 100644
--- a/gui/common.h
+++ b/gui/common.h
@@ -26,12 +26,12 @@
#include "gui/over.h"
-struct gui_ctx;
+struct gui;
struct gui_hist;
struct gui_sheet {
const struct sheet *sch;
- struct gui_ctx *gui; /* back link */
+ struct gui *gui; /* back link */
struct gui_hist *hist; /* back link */
struct gfx *gfx;
struct gfx *gfx_extra;
@@ -55,7 +55,7 @@ struct gui_sheet {
};
struct gui_hist {
- struct gui_ctx *gui; /* back link */
+ struct gui *gui; /* back link */
struct hist *vcs_hist; /* NULL if not from repo */
struct overlay *over; /* current overlay */
struct gui_sheet *sheets; /* NULL if failed */
@@ -73,7 +73,7 @@ struct gui_hist {
struct gui_hist *next;
};
-struct gui_ctx {
+struct gui {
GtkWidget *da;
float scale; /* pixels = eeschema * scale */
@@ -137,8 +137,8 @@ struct gui_ctx {
/* progress.c */
-void setup_progress_bar(struct gui_ctx *gui, GtkWidget *window);
-void progress_update(struct gui_ctx *gui);
+void setup_progress_bar(struct gui *gui, GtkWidget *window);
+void progress_update(struct gui *gui);
/* render.c */
@@ -146,37 +146,37 @@ extern bool use_delta;
extern bool show_extra;
-void redraw(const struct gui_ctx *gui);
+void redraw(const struct gui *gui);
void render_sheet(struct gui_sheet *sheet);
-void render_delta(struct gui_ctx *gui);
-void render_setup(struct gui_ctx *gui);
+void render_delta(struct gui *gui);
+void render_setup(struct gui *gui);
/* glabel.c */
-void dehover_glabel(struct gui_ctx *gui);
+void dehover_glabel(struct gui *gui);
void add_glabel_aoi(struct gui_sheet *sheet, const struct sch_obj *obj);
/* sheet.c */
-void go_to_sheet(struct gui_ctx *gui, struct gui_sheet *sheet);
-void zoom_to_extents(struct gui_ctx *gui);
-void do_revision_overlays(struct gui_ctx *gui);
-void sheet_setup(struct gui_ctx *gui);
+void go_to_sheet(struct gui *gui, struct gui_sheet *sheet);
+void zoom_to_extents(struct gui *gui);
+void do_revision_overlays(struct gui *gui);
+void sheet_setup(struct gui *gui);
/* history.c */
-void show_history(struct gui_ctx *gui, enum selecting sel);
+void show_history(struct gui *gui, enum selecting sel);
/* index.c */
-void index_draw_event(const struct gui_ctx *gui, cairo_t *cr);
-void index_resize(struct gui_ctx *gui);
-void show_index(struct gui_ctx *gui);
+void index_draw_event(const struct gui *gui, cairo_t *cr);
+void index_resize(struct gui *gui);
+void show_index(struct gui *gui);
/* gui.c */
struct gui_sheet *find_corresponding_sheet(struct gui_sheet *pick_from,
struct gui_sheet *ref_in, const struct gui_sheet *ref);
-void mark_aois(struct gui_ctx *gui, struct gui_sheet *sheet);
+void mark_aois(struct gui *gui, struct gui_sheet *sheet);
#endif /* !GUI_COMMON_H */
diff --git a/gui/glabel.c b/gui/glabel.c
index fb0cc82..9b8481d 100644
--- a/gui/glabel.c
+++ b/gui/glabel.c
@@ -43,7 +43,7 @@ struct glabel_aoi_ctx {
/* ----- Tools ------------------------------------------------------------- */
-static void eeschema_coord(const struct gui_ctx *gui,
+static void eeschema_coord(const struct gui *gui,
int x, int y, int *rx, int *ry)
{
GtkAllocation alloc;
@@ -65,7 +65,7 @@ static void glabel_dest_click(void *user)
}
-void dehover_glabel(struct gui_ctx *gui)
+void dehover_glabel(struct gui *gui)
{
overlay_remove_all(&gui->pop_overlays);
overlay_remove_all(&gui->pop_underlays);
@@ -74,7 +74,7 @@ void dehover_glabel(struct gui_ctx *gui)
}
-static void add_dest_header(struct gui_ctx *gui, const char *label)
+static void add_dest_header(struct gui *gui, const char *label)
{
struct overlay_style style = {
.font = BOLD_FONT,
@@ -96,7 +96,7 @@ static void add_dest_header(struct gui_ctx *gui, const char *label)
}
-static void add_dest_overlay(struct gui_ctx *gui, const char *label,
+static void add_dest_overlay(struct gui *gui, const char *label,
struct gui_sheet *sheet, unsigned n)
{
struct overlay_style style = {
@@ -134,7 +134,7 @@ static void add_dest_overlay(struct gui_ctx *gui, const char *label,
static bool pop_hover(void *user, bool on, int dx, int dy)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
if (!on)
dehover_glabel(gui);
@@ -142,7 +142,7 @@ static bool pop_hover(void *user, bool on, int dx, int dy)
}
-static void add_dest_frame(struct gui_ctx *gui)
+static void add_dest_frame(struct gui *gui)
{
int w, h;
@@ -187,7 +187,7 @@ static void add_dest_frame(struct gui_ctx *gui)
static bool hover_glabel(void *user, bool on, int dx, int dy)
{
struct glabel_aoi_ctx *aoi_ctx = user;
- struct gui_ctx *gui = aoi_ctx->sheet->gui;
+ struct gui *gui = aoi_ctx->sheet->gui;
const struct gui_sheet *curr_sheet = gui->curr_sheet;
const struct dwg_bbox *bbox = &aoi_ctx->bbox;
diff --git a/gui/gui.c b/gui/gui.c
index e3ee4c4..19e9c78 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -78,7 +78,7 @@ struct gui_sheet *find_corresponding_sheet(struct gui_sheet *pick_from,
struct sheet_aoi_ctx {
- struct gui_ctx *gui_ctx;
+ struct gui *gui;
const struct sch_obj *obj;
};
@@ -86,7 +86,7 @@ struct sheet_aoi_ctx {
static void select_subsheet(void *user)
{
const struct sheet_aoi_ctx *aoi_ctx = user;
- struct gui_ctx *gui = aoi_ctx->gui_ctx;
+ struct gui *gui = aoi_ctx->gui;
const struct sch_obj *obj = aoi_ctx->obj;
struct gui_sheet *sheet;
@@ -114,12 +114,12 @@ found:
}
-static void add_sheet_aoi(struct gui_ctx *gui, struct gui_sheet *parent,
+static void add_sheet_aoi(struct gui *gui, struct gui_sheet *parent,
const struct sch_obj *obj)
{
struct sheet_aoi_ctx *aoi_ctx = alloc_type(struct sheet_aoi_ctx);
- aoi_ctx->gui_ctx = gui;
+ aoi_ctx->gui = gui;
aoi_ctx->obj = obj;
struct aoi aoi = {
@@ -138,7 +138,7 @@ static void add_sheet_aoi(struct gui_ctx *gui, struct gui_sheet *parent,
/* ----- Load revisions ---------------------------------------------------- */
-void mark_aois(struct gui_ctx *gui, struct gui_sheet *sheet)
+void mark_aois(struct gui *gui, struct gui_sheet *sheet)
{
const struct sch_obj *obj;
@@ -156,7 +156,7 @@ void mark_aois(struct gui_ctx *gui, struct gui_sheet *sheet)
}
-static struct gui_sheet *get_sheets(struct gui_ctx *gui, struct gui_hist *hist,
+static struct gui_sheet *get_sheets(struct gui *gui, struct gui_hist *hist,
const struct sheet *sheets)
{
const struct sheet *sheet;
@@ -337,7 +337,7 @@ fail:
struct add_hist_ctx {
- struct gui_ctx *gui;
+ struct gui *gui;
const struct file_names *fn;
bool recurse;
unsigned limit;
@@ -347,7 +347,7 @@ struct add_hist_ctx {
static void add_hist(void *user, struct hist *h)
{
struct add_hist_ctx *ahc = user;
- struct gui_ctx *gui = ahc->gui;
+ struct gui *gui = ahc->gui;
struct gui_hist **anchor, *hist, *prev;
const struct sheet *sch;
unsigned age = 0;
@@ -381,7 +381,7 @@ static void add_hist(void *user, struct hist *h)
}
-static void get_revisions(struct gui_ctx *gui, const struct file_names *fn,
+static void get_revisions(struct gui *gui, const struct file_names *fn,
bool recurse, int limit)
{
struct add_hist_ctx add_hist_ctx = {
@@ -403,13 +403,13 @@ static void get_revisions(struct gui_ctx *gui, const struct file_names *fn,
static void count_history(void *user, struct hist *h)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
gui->hist_size++;
}
-static void get_history(struct gui_ctx *gui, const char *sch_name, int limit)
+static void get_history(struct gui *gui, const char *sch_name, int limit)
{
if (!vcs_git_try(sch_name)) {
gui->vcs_hist = NULL;
@@ -430,7 +430,7 @@ static void get_history(struct gui_ctx *gui, const char *sch_name, int limit)
static void size_allocate_event(GtkWidget *widget, GdkRectangle *allocation,
gpointer data)
{
- struct gui_ctx *gui = data;
+ struct gui *gui = data;
zoom_to_extents(gui);
if (gui->mode == showing_index)
@@ -445,7 +445,7 @@ int run_gui(const struct file_names *fn, bool recurse, int limit)
{
GtkWidget *window;
char *title;
- struct gui_ctx gui = {
+ struct gui gui = {
.scale = 1 / 16.0,
.hist = NULL,
.vcs_hist = NULL,
diff --git a/gui/history.c b/gui/history.c
index 0399878..218c346 100644
--- a/gui/history.c
+++ b/gui/history.c
@@ -28,7 +28,7 @@
#include "gui/common.h"
-static void hide_history(struct gui_ctx *gui)
+static void hide_history(struct gui *gui)
{
input_pop();
@@ -40,7 +40,7 @@ static void hide_history(struct gui_ctx *gui)
static void set_history_style(struct gui_hist *h, bool current)
{
- struct gui_ctx *gui = h->gui;
+ struct gui *gui = h->gui;
struct overlay_style style = overlay_style_dense;
const struct gui_hist *new = gui->new_hist;
const struct gui_hist *old = gui->old_hist;
@@ -109,7 +109,7 @@ static void set_history_style(struct gui_hist *h, bool current)
static bool hover_history(void *user, bool on, int dx, int dy)
{
struct gui_hist *h = user;
- struct gui_ctx *gui = h->gui;
+ struct gui *gui = h->gui;
char *s;
int before, after;
@@ -142,7 +142,7 @@ static bool hover_history(void *user, bool on, int dx, int dy)
static void click_history(void *user)
{
struct gui_hist *h = user;
- struct gui_ctx *gui = h->gui;
+ struct gui *gui = h->gui;
struct gui_sheet *sheet, *old_sheet;
hide_history(gui);
@@ -208,7 +208,7 @@ static void ignore_click(void *user)
}
-static struct gui_hist *skip_history(struct gui_ctx *gui, struct gui_hist *h)
+static struct gui_hist *skip_history(struct gui *gui, struct gui_hist *h)
{
struct overlay_style style = overlay_style_dense;
unsigned n;
@@ -243,7 +243,7 @@ static struct gui_hist *skip_history(struct gui_ctx *gui, struct gui_hist *h)
static bool history_click(void *user, int x, int y)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
if (aoi_click(&gui->aois, x, y))
return 1;
@@ -254,7 +254,7 @@ static bool history_click(void *user, int x, int y)
static bool history_hover_update(void *user, int x, int y)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
return aoi_hover(&gui->aois, x, y);
}
@@ -262,7 +262,7 @@ static bool history_hover_update(void *user, int x, int y)
static void history_drag_move(void *user, int dx, int dy)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
gui->hist_y_offset += dy;
redraw(gui);
@@ -271,7 +271,7 @@ static void history_drag_move(void *user, int dx, int dy)
static void history_key(void *user, int x, int y, int keyval)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
switch (keyval) {
case GDK_KEY_Escape:
@@ -297,7 +297,7 @@ static const struct input_ops history_input_ops = {
/* ----- Invocation -------------------------------------------------------- */
-void show_history(struct gui_ctx *gui, enum selecting sel)
+void show_history(struct gui *gui, enum selecting sel)
{
struct gui_hist *h = gui->hist;
diff --git a/gui/index.c b/gui/index.c
index 3673312..fb82ea4 100644
--- a/gui/index.c
+++ b/gui/index.c
@@ -33,7 +33,7 @@
#define INDEX_MARGIN 10 /* margin on each side */
-/* @@@ clean all this up and move into gui_ctx */
+/* @@@ clean all this up and move into struct gui */
static unsigned thumb_rows, thumb_cols;
static unsigned thumb_w, thumb_h;
static struct overlay *name_over = NULL;
@@ -43,7 +43,7 @@ static const struct gui_sheet *curr_sheet = NULL;
/* ----- Tools ------------------------------------------------------------- */
-static void thumbnail_pos(const struct gui_ctx *gui, GtkAllocation *alloc,
+static void thumbnail_pos(const struct gui *gui, GtkAllocation *alloc,
unsigned n, int *ix, int *iy)
{
*ix = alloc->width / 2 + (thumb_w + SHEET_GAP) *
@@ -56,7 +56,7 @@ static void thumbnail_pos(const struct gui_ctx *gui, GtkAllocation *alloc,
/* ----- Drawing ----------------------------------------------------------- */
-static struct gui_sheet *sheets(const struct gui_ctx *gui)
+static struct gui_sheet *sheets(const struct gui *gui)
{
if (gui->old_hist && gui->diff_mode == diff_old)
return gui->old_hist->sheets;
@@ -65,7 +65,7 @@ static struct gui_sheet *sheets(const struct gui_ctx *gui)
}
-void index_draw_event(const struct gui_ctx *gui, cairo_t *cr)
+void index_draw_event(const struct gui *gui, cairo_t *cr)
{
GtkAllocation alloc;
const struct gui_sheet *sheet;
@@ -109,7 +109,7 @@ void index_draw_event(const struct gui_ctx *gui, cairo_t *cr)
/* ----- Thumbnail actions ------------------------------------------------- */
-static void close_index(struct gui_ctx *gui)
+static void close_index(struct gui *gui)
{
overlay_remove_all(&gui->thumb_overlays);
name_over = NULL;
@@ -122,7 +122,7 @@ static void close_index(struct gui_ctx *gui)
static void thumb_click(void *user)
{
struct gui_sheet *sheet = user;
- struct gui_ctx *gui = sheet->gui;
+ struct gui *gui = sheet->gui;
go_to_sheet(gui, sheet);
close_index(gui);
@@ -153,7 +153,7 @@ static void thumb_set_style(struct gui_sheet *sheet, bool selected)
static bool thumb_hover(void *user, bool on, int dx, int dy)
{
struct gui_sheet *sheet = user;
- struct gui_ctx *gui = sheet->gui;
+ struct gui *gui = sheet->gui;
struct overlay_style style = overlay_style_default;
if (on) {
@@ -183,7 +183,7 @@ static bool thumb_hover(void *user, bool on, int dx, int dy)
/* ----- Rendering to cache ------------------------------------------------ */
-static bool best_ratio(const struct gui_ctx *gui)
+static bool best_ratio(const struct gui *gui)
{
GtkAllocation alloc;
const struct gui_sheet *sheet;
@@ -256,7 +256,7 @@ static void paint_yellow(uint32_t *data, int w, int h, int stride)
}
-static void index_render_sheet(const struct gui_ctx *gui,
+static void index_render_sheet(const struct gui *gui,
struct gui_sheet *sheet)
{
int xmin, ymin, w, h;
@@ -317,7 +317,7 @@ static void index_render_sheet(const struct gui_ctx *gui,
}
-static void index_add_overlay(struct gui_ctx *gui, struct gui_sheet *sheet)
+static void index_add_overlay(struct gui *gui, struct gui_sheet *sheet)
{
sheet->thumb_over = overlay_add(&gui->thumb_overlays, &gui->aois,
thumb_hover, thumb_click, sheet);
@@ -326,7 +326,7 @@ static void index_add_overlay(struct gui_ctx *gui, struct gui_sheet *sheet)
}
-static void index_render_sheets(struct gui_ctx *gui)
+static void index_render_sheets(struct gui *gui)
{
struct gui_sheet *sheet;
@@ -342,7 +342,7 @@ static void index_render_sheets(struct gui_ctx *gui)
static bool index_hover_update(void *user, int x, int y)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
if (aoi_hover(&gui->aois, x, y))
return 1;
@@ -352,7 +352,7 @@ static bool index_hover_update(void *user, int x, int y)
static bool index_click(void *user, int x, int y)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
if (aoi_click(&gui->aois, x, y))
return 1;
@@ -363,7 +363,7 @@ static bool index_click(void *user, int x, int y)
static void index_key(void *user, int x, int y, int keyval)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
switch (keyval) {
case GDK_KEY_Escape:
@@ -395,7 +395,7 @@ static const struct input_ops index_input_ops = {
/* ----- Resizing ---------------------------------------------------------- */
-void index_resize(struct gui_ctx *gui)
+void index_resize(struct gui *gui)
{
overlay_remove_all(&gui->thumb_overlays);
name_over = NULL;
@@ -410,7 +410,7 @@ void index_resize(struct gui_ctx *gui)
/* ----- Initialization ---------------------------------------------------- */
-void show_index(struct gui_ctx *gui)
+void show_index(struct gui *gui)
{
input_push(&index_input_ops, gui);
gui->mode = showing_index;
diff --git a/gui/progress.c b/gui/progress.c
index 07e4bb1..d20a4bf 100644
--- a/gui/progress.c
+++ b/gui/progress.c
@@ -36,7 +36,7 @@ static void progress_draw_event(GtkWidget *widget, cairo_t *cr,
gpointer user_data)
{
GtkAllocation alloc;
- struct gui_ctx *gui = user_data;
+ struct gui *gui = user_data;
unsigned w, x;
x = gui->progress >> gui->progress_scale;
@@ -67,7 +67,7 @@ static void progress_draw_event(GtkWidget *widget, cairo_t *cr,
}
-void setup_progress_bar(struct gui_ctx *gui, GtkWidget *window)
+void setup_progress_bar(struct gui *gui, GtkWidget *window)
{
GtkAllocation alloc;
@@ -86,7 +86,7 @@ void setup_progress_bar(struct gui_ctx *gui, GtkWidget *window)
}
-void progress_update(struct gui_ctx *gui)
+void progress_update(struct gui *gui)
{
unsigned mask = (1 << gui->progress_scale) - 1;
diff --git a/gui/render.c b/gui/render.c
index 6de8baa..c2a9622 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -49,7 +49,7 @@ bool show_extra = 0;
/* ----- Helper functions -------------------------------------------------- */
-void redraw(const struct gui_ctx *gui)
+void redraw(const struct gui *gui)
{
gtk_widget_queue_draw(gui->da);
}
@@ -82,7 +82,7 @@ static inline int cy(int y, int yo, float scale)
}
-static void highlight_glabel(const struct gui_ctx *gui,
+static void highlight_glabel(const struct gui *gui,
const struct gui_sheet *sheet, cairo_t *cr, int xo, int yo, float f)
{
const struct sch_obj *obj;
@@ -119,7 +119,7 @@ static void highlight_glabel(const struct gui_ctx *gui,
* delta.
*/
-static struct area *changed_sheets(const struct gui_ctx *gui,
+static struct area *changed_sheets(const struct gui *gui,
int xo, int yo, float f)
{
const struct gui_sheet *new = gui->curr_sheet;
@@ -152,7 +152,7 @@ static struct area *changed_sheets(const struct gui_ctx *gui,
}
-static void hack(const struct gui_ctx *gui, cairo_t *cr,
+static void hack(const struct gui *gui, cairo_t *cr,
int xo, int yo, float f)
{
const struct gui_sheet *new = gui->curr_sheet;
@@ -172,7 +172,7 @@ static void hack(const struct gui_ctx *gui, cairo_t *cr,
static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
gpointer user_data)
{
- struct gui_ctx *gui = user_data;
+ struct gui *gui = user_data;
const struct gui_sheet *sheet = gui->curr_sheet;
GtkAllocation alloc;
float f = gui->scale;
@@ -270,7 +270,7 @@ void render_sheet(struct gui_sheet *sheet)
}
-void render_delta(struct gui_ctx *gui)
+void render_delta(struct gui *gui)
{
#if 1
/* @@@ needs updating for curr/last vs. new/old */
@@ -316,7 +316,7 @@ void render_delta(struct gui_ctx *gui)
/* ----- Setup ------------------------------------------------------------- */
-void render_setup(struct gui_ctx *gui)
+void render_setup(struct gui *gui)
{
g_signal_connect(G_OBJECT(gui->da), "draw",
G_CALLBACK(on_draw_event), gui);
diff --git a/gui/sheet.c b/gui/sheet.c
index 9499908..df780ec 100644
--- a/gui/sheet.c
+++ b/gui/sheet.c
@@ -39,7 +39,7 @@
/* ----- Tools ------------------------------------------------------------- */
-static void canvas_coord(const struct gui_ctx *gui,
+static void canvas_coord(const struct gui *gui,
int ex, int ey, int *x, int *y)
{
GtkAllocation alloc;
@@ -56,7 +56,7 @@ static void canvas_coord(const struct gui_ctx *gui,
/* ----- Zoom -------------------------------------------------------------- */
-static bool zoom_in(struct gui_ctx *gui, int x, int y)
+static bool zoom_in(struct gui *gui, int x, int y)
{
float old = gui->scale;
@@ -72,7 +72,7 @@ static bool zoom_in(struct gui_ctx *gui, int x, int y)
}
-static bool zoom_out(struct gui_ctx *gui, int x, int y)
+static bool zoom_out(struct gui *gui, int x, int y)
{
float old = gui->scale;
@@ -90,7 +90,7 @@ static bool zoom_out(struct gui_ctx *gui, int x, int y)
}
-static void curr_sheet_size(struct gui_ctx *gui, int *w, int *h)
+static void curr_sheet_size(struct gui *gui, int *w, int *h)
{
const struct gui_sheet *sheet = gui->curr_sheet;
int ax1, ay1, bx1, by1;
@@ -119,7 +119,7 @@ static void curr_sheet_size(struct gui_ctx *gui, int *w, int *h)
}
-void zoom_to_extents(struct gui_ctx *gui)
+void zoom_to_extents(struct gui *gui)
{
GtkAllocation alloc;
int w, h;
@@ -145,7 +145,7 @@ void zoom_to_extents(struct gui_ctx *gui)
static bool show_history_details(void *user, bool on, int dx, int dy)
{
struct gui_hist *h = user;
- struct gui_ctx *gui = h->gui;
+ struct gui *gui = h->gui;
char *s;
if (on) {
@@ -160,7 +160,7 @@ static bool show_history_details(void *user, bool on, int dx, int dy)
}
-static void set_diff_mode(struct gui_ctx *gui, enum diff_mode mode)
+static void set_diff_mode(struct gui *gui, enum diff_mode mode)
{
gui->diff_mode = mode;
do_revision_overlays(gui);
@@ -171,7 +171,7 @@ static void set_diff_mode(struct gui_ctx *gui, enum diff_mode mode)
static void show_history_cb(void *user)
{
struct gui_hist *h = user;
- struct gui_ctx *gui = h->gui;
+ struct gui *gui = h->gui;
enum selecting sel = sel_only;
if (gui->old_hist) {
@@ -191,7 +191,7 @@ static void show_history_cb(void *user)
static void show_diff_cb(void *user)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
if (gui->old_hist)
set_diff_mode(gui,
@@ -201,13 +201,13 @@ static void show_diff_cb(void *user)
}
-static void toggle_old_new(struct gui_ctx *gui)
+static void toggle_old_new(struct gui *gui)
{
set_diff_mode(gui, gui->diff_mode == diff_new ? diff_old : diff_new);
}
-static void add_delta(struct gui_ctx *gui)
+static void add_delta(struct gui *gui)
{
struct overlay *over;
struct overlay_style style;
@@ -226,7 +226,7 @@ static void add_delta(struct gui_ctx *gui)
}
-static void revision_overlays_diff(struct gui_ctx *gui)
+static void revision_overlays_diff(struct gui *gui)
{
struct gui_hist *new = gui->new_hist;
struct gui_hist *old = gui->old_hist;
@@ -252,7 +252,7 @@ static void revision_overlays_diff(struct gui_ctx *gui)
}
-void do_revision_overlays(struct gui_ctx *gui)
+void do_revision_overlays(struct gui *gui)
{
overlay_remove_all(&gui->hist_overlays);
@@ -291,7 +291,7 @@ static struct gui_sheet *find_parent_sheet(struct gui_sheet *sheets,
static void close_subsheet(void *user)
{
struct gui_sheet *sheet = user;
- struct gui_ctx *gui = sheet->gui;
+ struct gui *gui = sheet->gui;
struct gui_sheet *parent;
parent = find_parent_sheet(gui->new_hist->sheets, sheet);
@@ -305,7 +305,7 @@ static void close_subsheet(void *user)
static bool hover_sheet(void *user, bool on, int dx, int dy)
{
struct gui_sheet *sheet = user;
- struct gui_ctx *gui = sheet->gui;
+ struct gui *gui = sheet->gui;
const char *title = sheet->sch->title;
if (!title)
@@ -329,7 +329,7 @@ static bool hover_sheet(void *user, bool on, int dx, int dy)
}
-static void sheet_selector_recurse(struct gui_ctx *gui, struct gui_sheet *sheet)
+static void sheet_selector_recurse(struct gui *gui, struct gui_sheet *sheet)
{
struct gui_sheet *parent;
@@ -342,7 +342,7 @@ static void sheet_selector_recurse(struct gui_ctx *gui, struct gui_sheet *sheet)
}
-static void do_sheet_overlays(struct gui_ctx *gui)
+static void do_sheet_overlays(struct gui *gui)
{
overlay_remove_all(&gui->sheet_overlays);
sheet_selector_recurse(gui, gui->curr_sheet);
@@ -352,7 +352,7 @@ static void do_sheet_overlays(struct gui_ctx *gui)
/* ----- Navigate sheets --------------------------------------------------- */
-void go_to_sheet(struct gui_ctx *gui, struct gui_sheet *sheet)
+void go_to_sheet(struct gui *gui, struct gui_sheet *sheet)
{
aoi_dehover();
overlay_remove_all(&gui->pop_overlays);
@@ -371,7 +371,7 @@ void go_to_sheet(struct gui_ctx *gui, struct gui_sheet *sheet)
}
-static bool go_up_sheet(struct gui_ctx *gui)
+static bool go_up_sheet(struct gui *gui)
{
struct gui_sheet *parent;
@@ -383,7 +383,7 @@ static bool go_up_sheet(struct gui_ctx *gui)
}
-static bool go_prev_sheet(struct gui_ctx *gui)
+static bool go_prev_sheet(struct gui *gui)
{
struct gui_sheet *sheet;
@@ -396,7 +396,7 @@ static bool go_prev_sheet(struct gui_ctx *gui)
}
-static bool go_next_sheet(struct gui_ctx *gui)
+static bool go_next_sheet(struct gui *gui)
{
if (!gui->curr_sheet->next)
return 0;
@@ -410,7 +410,7 @@ static bool go_next_sheet(struct gui_ctx *gui)
static bool sheet_click(void *user, int x, int y)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
const struct gui_sheet *curr_sheet = gui->curr_sheet;
int ex, ey;
@@ -435,7 +435,7 @@ static bool sheet_click(void *user, int x, int y)
static bool sheet_hover_update(void *user, int x, int y)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
const struct gui_sheet *curr_sheet = gui->curr_sheet;
int ex, ey;
@@ -461,7 +461,7 @@ static bool sheet_drag_begin(void *user, int x, int y)
static void sheet_drag_move(void *user, int dx, int dy)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
gui->x -= dx / gui->scale;
gui->y -= dy / gui->scale;
@@ -477,7 +477,7 @@ static void sheet_drag_end(void *user)
static void sheet_scroll(void *user, int x, int y, int dy)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
int ex, ey;
@@ -496,7 +496,7 @@ static void sheet_scroll(void *user, int x, int y, int dy)
static void sheet_key(void *user, int x, int y, int keyval)
{
- struct gui_ctx *gui = user;
+ struct gui *gui = user;
struct gui_sheet *sheet = gui->curr_sheet;
int ex, ey;
@@ -610,7 +610,7 @@ static const struct input_ops sheet_input_ops = {
/* ----- Initialization ---------------------------------------------------- */
-void sheet_setup(struct gui_ctx *gui)
+void sheet_setup(struct gui *gui)
{
input_push(&sheet_input_ops, gui);
}