vw != view_w || vh != view_h ) redraw = 1;
}
if( !redraw ) return;
- reposition_window(edl, x, y, w, y);
+ reposition_window(edl, x, y, w, h);
}
void Canvas::reposition_window(EDL *edl, int x, int y, int w, int h)
#include <sys/resource.h>
#ifdef LEAKER
-#define STRC(v) printf("==new %p from %p sz %jd\n", v, __builtin_return_address(0), n)
+#if 0 // track allocators
+#include <execinfo.h>
+#define BT_BUF_SIZE 100
+static void leaker()
+{
+ void *buffer[BT_BUF_SIZE];
+ int nptrs = backtrace(buffer, BT_BUF_SIZE);
+ char **trace = backtrace_symbols(buffer, nptrs);
+ if( !trace ) return;
+ for( int i=0; i<nptrs; ) printf("%s ", trace[i++]);
+ printf("\n");
+ free(trace);
+}
+#define STRB ;leaker()
+#else
+#define STRB
+#endif
+#define STRC(v) printf("==new %p from %p sz %jd\n", v, __builtin_return_address(0), n)STRB
#define STRD(v) printf("==del %p from %p\n", v, __builtin_return_address(0))
void *operator new(size_t n) { void *vp = malloc(n); STRC(vp); bzero(vp,n); return vp; }
void operator delete(void *t) { STRD(t); free(t); }
pankeyframe_pixmap,
modekeyframe_pixmap,
maskkeyframe_pixmap,
+ 0,
};
CLAMP(y1, ymin, ymax);
CLAMP(y2, ymin, ymax);
- if(y2 - 1 > y1)
- {
- set_color(BLACK);
- draw_box(x1 + 1, y1 + 1, x2 - x1, y2 - y1);
- set_color(color);
- draw_box(x1, y1, x2 - x1, y2 - y1);
+ if( y2-1 > y1 ) {
+ if( current->curve_mode == FloatAuto::LINEAR ) {
+ draw_box(x1, y1, x2 - x1, y2 - y1);
+ }
+ else {
+ ArrayList<int> polygon_x;
+ ArrayList<int> polygon_y;
+ polygon_x.append((x1 + x2) / 2 + 1);
+ polygon_y.append(y1 + 1);
+ polygon_x.append(x2 + 1);
+ polygon_y.append((y1 + y2) / 2 + 1);
+ polygon_x.append((x1 + x2) / 2 + 1);
+ polygon_y.append(y2 + 1);
+ polygon_x.append(x1 + 1);
+ polygon_y.append((y1 + y2) / 2 + 1);
+ fill_polygon(&polygon_x, &polygon_y);
+ }
}
// show bezier control points (only) if this
del_vframes(default_pot_images, 3);
del_vframes(default_progress_images, 2);
del_vframes(default_medium_7segment, 20);
+ del_vframes(default_vscroll_data, 10);
+ del_vframes(default_hscroll_data, 10);
if( fontlist ) {
fontlist->remove_all_objects();
delete fontlist;
init_lock->unlock();
// Handle common events
- while(!done)
- {
- dispatch_event(0);
+ while( !done ) {
+ dispatch_event();
}
unset_all_repeaters();
int locking_event = -1;
int locking_message = -1;
-int BC_WindowBase::dispatch_event(XEvent *event)
+int BC_WindowBase::dispatch_event()
{
Window tempwin;
int result;
XClientMessageEvent *ptr;
int cancel_resize, cancel_translation;
volatile static int debug = 0;
+ XEvent *event;
key_pressed = 0;
XFontSet get_fontset(int font);
XFontSet get_curr_fontset(void);
void set_fontset(int font);
- int dispatch_event(XEvent *event);
+ int dispatch_event();
int get_key_masks(unsigned int key_state);
{
int64_t adr, from, sz;
recd_map recds;
- char line[256];
+ char line[65536];
FILE *fp = stdin;
while( fgets(line,sizeof(line),fp) ) {
aging_server = 0;
pits_count = 0;
dust_count = 0;
+ memset(scratches, 0, sizeof(scratches));
}
AgingMain::~AgingMain()
for( i = 0; i < plugin->config.scratch_lines; i++ ) { \
if( plugin->scratches[i].life ) { \
plugin->scratches[i].x = plugin->scratches[i].x + plugin->scratches[i].dx; \
- if( plugin->scratches[i].x < 0 || plugin->scratches[i].x > w_256 ) { \
+ if( plugin->scratches[i].x < 0 || plugin->scratches[i].x >= w_256 ) { \
plugin->scratches[i].life = 0; \
break; \
} \
CWindowGUI *cwindow_gui = mwindow->cwindow->gui;
CWindowCanvas *canvas = cwindow_gui->canvas;
int cx, cy; cwindow_gui->get_relative_cursor(cx, cy);
- cx -= mwindow->theme->ccanvas_x;
- cy -= mwindow->theme->ccanvas_y;
+ cx -= canvas->view_x;
+ cy -= canvas->view_y;
if( !dragging ) {
- if( cx < 0 || cx >= mwindow->theme->ccanvas_w ||
- cy < 0 || cy >= mwindow->theme->ccanvas_h )
+ if( cx < 0 || cx >= canvas->view_w ||
+ cy < 0 || cy >= canvas->view_h )
return 0;
}
void SketcherWindow::done_event(int result)
{
+ ungrab(plugin->server->mwindow->cwindow->gui);
}
void SketcherWindow::send_configure_change()
CWindowGUI *cwindow_gui = mwindow->cwindow->gui;
CWindowCanvas *canvas = cwindow_gui->canvas;
int cx, cy; cwindow_gui->get_relative_cursor(cx, cy);
- cx -= mwindow->theme->ccanvas_x;
- cy -= mwindow->theme->ccanvas_y;
+ cx -= canvas->view_x;
+ cy -= canvas->view_y;
if( !dragging ) {
- if( cx < 0 || cx >= mwindow->theme->ccanvas_w ||
- cy < 0 || cy >= mwindow->theme->ccanvas_h )
+ if( cx < 0 || cx >= canvas->view_w ||
+ cy < 0 || cy >= canvas->view_h )
return 0;
}
+
switch( event->type ) {
case ButtonPress:
if( dragging ) return 0;