diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-07-17 17:05:21 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-07-17 17:05:21 +0200 |
commit | ae46674dd69cc4e65f595dc364a8c35c8d6aee30 (patch) | |
tree | 917210687fb1e6869ecc902bbb6cffa70ec1ef72 /src | |
parent | cb6b53e20ab7f7450d10a27a987a6ccbfeb4fe1e (diff) |
--debug-level → --debug
Diffstat (limited to 'src')
-rw-r--r-- | src/collage.c | 12 | ||||
-rw-r--r-- | src/debug.h | 30 | ||||
-rw-r--r-- | src/events.c | 60 | ||||
-rw-r--r-- | src/filelist.c | 28 | ||||
-rw-r--r-- | src/imlib.c | 14 | ||||
-rw-r--r-- | src/index.c | 8 | ||||
-rw-r--r-- | src/keyevents.c | 4 | ||||
-rw-r--r-- | src/main.c | 14 | ||||
-rw-r--r-- | src/menu.c | 40 | ||||
-rw-r--r-- | src/multiwindow.c | 2 | ||||
-rw-r--r-- | src/options.c | 34 | ||||
-rw-r--r-- | src/options.h | 2 | ||||
-rw-r--r-- | src/slideshow.c | 2 | ||||
-rw-r--r-- | src/support.c | 41 | ||||
-rw-r--r-- | src/thumbnail.c | 16 | ||||
-rw-r--r-- | src/timers.c | 24 | ||||
-rw-r--r-- | src/winwidget.c | 35 |
17 files changed, 181 insertions, 185 deletions
diff --git a/src/collage.c b/src/collage.c index d221ca1..782d5f8 100644 --- a/src/collage.c +++ b/src/collage.c @@ -50,7 +50,7 @@ void init_collage_mode(void) trans_bg = 1; else { - D(4, ("Time to apply a background to blend onto\n")); + D(("Time to apply a background to blend onto\n")); if (feh_load_image_char(&bg_im, opt.bg_file) != 0) { bg_w = gib_imlib_image_get_width(bg_im); bg_h = gib_imlib_image_get_height(bg_im); @@ -82,7 +82,7 @@ void init_collage_mode(void) w = opt.limit_w; h = opt.limit_h; - D(4, ("Limiting width to %d and height to %d\n", w, h)); + D(("Limiting width to %d and height to %d\n", w, h)); im_main = imlib_create_image(w, h); @@ -119,9 +119,9 @@ void init_collage_mode(void) filelist = feh_file_remove_from_list(filelist, last); last = NULL; } - D(3, ("About to load image %s\n", file->filename)); + D(("About to load image %s\n", file->filename)); if (feh_load_image(&im_temp, file) != 0) { - D(3, ("Successfully loaded %s\n", file->filename)); + D(("Successfully loaded %s\n", file->filename)); if (opt.verbose) feh_display_status('.'); www = opt.thumb_w; @@ -150,7 +150,7 @@ void init_collage_mode(void) /* pick random coords for thumbnail */ xxx = ((w - www) * ((double) rand() / RAND_MAX)); yyy = ((h - hhh) * ((double) rand() / RAND_MAX)); - D(5, ("image going on at x=%d, y=%d\n", xxx, yyy)); + D(("image going on at x=%d, y=%d\n", xxx, yyy)); im_thumb = gib_imlib_create_cropped_scaled_image(im_temp, 0, 0, ww, hh, www, hhh, 1); @@ -159,7 +159,7 @@ void init_collage_mode(void) if (opt.alpha) { DATA8 atab[256]; - D(4, ("Applying alpha options\n")); + D(("Applying alpha options\n")); gib_imlib_image_set_has_alpha(im_thumb, 1); memset(atab, opt.alpha_level, sizeof(atab)); gib_imlib_apply_color_modifier_to_rectangle(im_thumb, diff --git a/src/debug.h b/src/debug.h index 156bf1c..93cb6bf 100644 --- a/src/debug.h +++ b/src/debug.h @@ -39,28 +39,26 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifdef DEBUG #ifdef __GNUC__ -#define D(i, a) \ +#define D(a) \ { \ - if(i <= opt.debug_level) \ - { \ - printf("%-12s +%-4u %-20s : ",__FILE__,__LINE__,__FUNCTION__); \ - printf a; \ - fflush(stdout); \ - } \ + if (opt.debug) { \ + printf("%-12s +%-4u %-20s : ",__FILE__,__LINE__,__FUNCTION__); \ + printf a; \ + fflush(stdout); \ + } \ } #else /* __GNUC__ */ -#define D(i, a) \ +#define D(a) \ { \ - if(i <= opt.debug_level) \ - { \ - printf("%-12s +%-4u : ",__FILE__,__LINE__); \ - printf a; \ - } \ - fflush(stdout); \ - } + if (opt.debug) { \ + printf("%-12s +%-4u : ",__FILE__,__LINE__); \ + printf a; \ + fflush(stdout); \ + } \ +} #endif /* __GNUC__ */ #else /* DEBUG */ -#define D(i,a) +#define D(a) #endif /* DEBUG */ #endif /* DEBUG_H */ diff --git a/src/events.c b/src/events.c index de2e3c0..5a4a059 100644 --- a/src/events.c +++ b/src/events.c @@ -74,7 +74,7 @@ static void feh_event_handle_ButtonPress(XEvent * ev) } if (!opt.no_menus && EV_IS_MENU_BUTTON(ev)) { - D(3, ("Menu Button Press event\n")); + D(("Menu Button Press event\n")); if (winwid != NULL) { winwidget_show_menu(winwid); } @@ -84,7 +84,7 @@ static void feh_event_handle_ButtonPress(XEvent * ev) if (winwid != NULL) { opt.mode = MODE_ROTATE; winwid->mode = MODE_ROTATE; - D(3, ("rotate starting at %d, %d\n", ev->xbutton.x, ev->xbutton.y)); + D(("rotate starting at %d, %d\n", ev->xbutton.x, ev->xbutton.y)); } } else if ((ev->xbutton.button == opt.blur_button) && ((opt.no_blur_ctrl_mask) @@ -92,25 +92,25 @@ static void feh_event_handle_ButtonPress(XEvent * ev) if (winwid != NULL) { opt.mode = MODE_BLUR; winwid->mode = MODE_BLUR; - D(3, ("blur starting at %d, %d\n", ev->xbutton.x, ev->xbutton.y)); + D(("blur starting at %d, %d\n", ev->xbutton.x, ev->xbutton.y)); } } else if (ev->xbutton.button == opt.pan_button) { - D(3, ("Pan Button Press event\n")); + D(("Pan Button Press event\n")); if (winwid != NULL) { - D(3, ("Next button, but could be pan mode\n")); + D(("Next button, but could be pan mode\n")); opt.mode = MODE_NEXT; winwid->mode = MODE_NEXT; - D(3, ("click offset is %d,%d\n", ev->xbutton.x, ev->xbutton.y)); + D(("click offset is %d,%d\n", ev->xbutton.x, ev->xbutton.y)); winwid->click_offset_x = ev->xbutton.x - winwid->im_x; winwid->click_offset_y = ev->xbutton.y - winwid->im_y; } } else if (ev->xbutton.button == opt.zoom_button) { - D(3, ("Zoom Button Press event\n")); + D(("Zoom Button Press event\n")); if (winwid != NULL) { - D(3, ("Zoom mode baby!\n")); + D(("Zoom mode baby!\n")); opt.mode = MODE_ZOOM; winwid->mode = MODE_ZOOM; - D(3, ("click offset is %d,%d\n", ev->xbutton.x, ev->xbutton.y)); + D(("click offset is %d,%d\n", ev->xbutton.x, ev->xbutton.y)); winwid->click_offset_x = ev->xbutton.x; winwid->click_offset_y = ev->xbutton.y; winwid->old_zoom = winwid->zoom; @@ -126,21 +126,21 @@ static void feh_event_handle_ButtonPress(XEvent * ev) winwidget_render_image(winwid, 0, 0); } } else if (ev->xbutton.button == opt.reload_button) { - D(3, ("Reload Button Press event\n")); + D(("Reload Button Press event\n")); if (winwid != NULL) feh_reload_image(winwid, 0, 0); } else if (ev->xbutton.button == opt.prev_button) { - D(3, ("Prev Button Press event\n")); + D(("Prev Button Press event\n")); if ((winwid != NULL) && (winwid->type == WIN_TYPE_SLIDESHOW)) slideshow_change_image(winwid, SLIDE_PREV); } else if (ev->xbutton.button == opt.next_button) { - D(3, ("Next Button Press event\n")); + D(("Next Button Press event\n")); if ((winwid != NULL) && (winwid->type == WIN_TYPE_SLIDESHOW)) slideshow_change_image(winwid, SLIDE_NEXT); } else { - D(3, ("Received other ButtonPress event\n")); + D(("Received other ButtonPress event\n")); } return; } @@ -182,7 +182,7 @@ static void feh_event_handle_ButtonRelease(XEvent * ev) else if (ev->xbutton.button == opt.pan_button) { if (opt.mode == MODE_PAN) { if (winwid != NULL) { - D(3, ("Disabling pan mode\n")); + D(("Disabling pan mode\n")); opt.mode = MODE_NORMAL; winwid->mode = MODE_NORMAL; winwidget_sanitise_offsets(winwid); @@ -237,9 +237,9 @@ static void feh_event_handle_ButtonRelease(XEvent * ev) } } else if ((ev->xbutton.button == opt.rotate_button) || (ev->xbutton.button == opt.zoom_button)) { - D(3, ("Mode-based Button Release event\n")); + D(("Mode-based Button Release event\n")); if (winwid != NULL) { - D(3, ("Disabling mode\n")); + D(("Disabling mode\n")); opt.mode = MODE_NORMAL; winwid->mode = MODE_NORMAL; winwidget_sanitise_offsets(winwid); @@ -248,9 +248,9 @@ static void feh_event_handle_ButtonRelease(XEvent * ev) } else if ((ev->xbutton.button == opt.blur_button) && ((opt.no_blur_ctrl_mask) || (ev->xbutton.state & ControlMask))) { - D(3, ("Blur Button Release event\n")); + D(("Blur Button Release event\n")); if (winwid != NULL) { - D(3, ("Disabling Blur mode\n")); + D(("Disabling Blur mode\n")); opt.mode = MODE_NORMAL; winwid->mode = MODE_NORMAL; } @@ -265,10 +265,10 @@ static void feh_event_handle_ConfigureNotify(XEvent * ev) winwidget w = winwidget_get_from_window(ev->xconfigure.window); if (w) { - D(3, ("configure size %dx%d\n", ev->xconfigure.width, ev->xconfigure.height)); + D(("configure size %dx%d\n", ev->xconfigure.width, ev->xconfigure.height)); if ((w->w != ev->xconfigure.width) || (w->h != ev->xconfigure.height)) { - D(3, ("assigning size and rerendering\n")); + D(("assigning size and rerendering\n")); w->w = ev->xconfigure.width; w->h = ev->xconfigure.height; w->had_resize = 1; @@ -289,10 +289,10 @@ static void feh_event_handle_LeaveNotify(XEvent * ev) if ((menu_root) && (ev->xcrossing.window == menu_root->win)) { feh_menu_item *ii; - D(4, ("It is for a menu\n")); + D(("It is for a menu\n")); for (ii = menu_root->items; ii; ii = ii->next) { if (MENU_ITEM_IS_SELECTED(ii)) { - D(4, ("Unselecting menu\n")); + D(("Unselecting menu\n")); MENU_ITEM_SET_NORMAL(ii); menu_root->updates = imlib_update_append_rect(menu_root->updates, ii->x, ii->y, ii->w, ii->h); @@ -324,7 +324,7 @@ static void feh_event_handle_MotionNotify(XEvent * ev) feh_menu *m; feh_menu_item *selected_item, *mouseover_item; - D(3, ("motion notify with menus open\n")); + D(("motion notify with menus open\n")); while (XCheckTypedWindowEvent(disp, ev->xmotion.window, MotionNotify, ev)); if (ev->xmotion.window == menu_cover) { @@ -334,7 +334,7 @@ static void feh_event_handle_MotionNotify(XEvent * ev) mouseover_item = feh_menu_find_at_xy(m, ev->xmotion.x, ev->xmotion.y); if (selected_item != mouseover_item) { - D(4, ("selecting a menu item\n")); + D(("selecting a menu item\n")); if (selected_item) feh_menu_deselect_selected(m); if ((mouseover_item) @@ -411,7 +411,7 @@ static void feh_event_handle_MotionNotify(XEvent * ev) opt.mode = MODE_PAN; winwid->mode = MODE_PAN; } - D(5, ("Panning\n")); + D(("Panning\n")); orig_x = winwid->im_x; orig_y = winwid->im_y; @@ -420,7 +420,7 @@ static void feh_event_handle_MotionNotify(XEvent * ev) winwidget_sanitise_offsets(winwid); - D(4, ("im_x %d, im_w %d, off %d, mx %d\n", winwid->im_x, + D(("im_x %d, im_w %d, off %d, mx %d\n", winwid->im_x, winwid->im_w, winwid->click_offset_x, ev->xmotion.x)); /* XWarpPointer generates a MotionNotify event which we will @@ -464,7 +464,7 @@ static void feh_event_handle_MotionNotify(XEvent * ev) while (XCheckTypedWindowEvent(disp, ev->xmotion.window, MotionNotify, ev)); winwid = winwidget_get_from_window(ev->xmotion.window); if (winwid) { - D(5, ("Rotating\n")); + D(("Rotating\n")); if (!winwid->has_rotated) { Imlib_Image temp; @@ -477,7 +477,7 @@ static void feh_event_handle_MotionNotify(XEvent * ev) winwid->has_rotated = 1; } winwid->im_angle = (ev->xmotion.x - winwid->w / 2) / ((double) winwid->w / 2) * 3.1415926535; - D(5, ("angle: %f\n", winwid->im_angle)); + D(("angle: %f\n", winwid->im_angle)); winwidget_render_image(winwid, 0, 0); } } else if (opt.mode == MODE_BLUR) { @@ -487,11 +487,11 @@ static void feh_event_handle_MotionNotify(XEvent * ev) Imlib_Image temp, ptr; signed int blur_radius; - D(5, ("Blurring\n")); + D(("Blurring\n")); temp = gib_imlib_clone_image(winwid->im); blur_radius = (((double) ev->xmotion.x / winwid->w) * 20) - 10; - D(5, ("angle: %d\n", blur_radius)); + D(("angle: %d\n", blur_radius)); if (blur_radius > 0) gib_imlib_image_sharpen(temp, blur_radius); else diff --git a/src/filelist.c b/src/filelist.c index 0a41fee..5c0777d 100644 --- a/src/filelist.c +++ b/src/filelist.c @@ -106,7 +106,7 @@ gib_list *feh_file_rm_and_free(gib_list * list, gib_list * l) gib_list *feh_file_remove_from_list(gib_list * list, gib_list * l) { feh_file_free(FEH_FILE(l->data)); - D(4, ("filelist_len %d -> %d\n", filelist_len, filelist_len - 1)); + D(("filelist_len %d -> %d\n", filelist_len, filelist_len - 1)); filelist_len--; return(gib_list_remove(list, l)); } @@ -121,7 +121,7 @@ void add_file_to_filelist_recursively(char *origpath, unsigned char level) return; path = estrdup(origpath); - D(4, ("file is %s\n", path)); + D(("file is %s\n", path)); if (level == FILELIST_FIRST) { /* First time through, sort out pathname */ @@ -135,7 +135,7 @@ void add_file_to_filelist_recursively(char *origpath, unsigned char level) || (!strncmp(path, "https://", 8)) || (!strncmp(path, "ftp://", 6))) { /* Its a url */ - D(3, ("Adding url %s to filelist\n", path)); + D(("Adding url %s to filelist\n", path)); filelist = gib_list_add_front(filelist, feh_file_new(path)); /* We'll download it later... */ free(path); @@ -178,7 +178,7 @@ void add_file_to_filelist_recursively(char *origpath, unsigned char level) struct dirent *de; DIR *dir; - D(4, ("It is a directory\n")); + D(("It is a directory\n")); if ((dir = opendir(path)) == NULL) { if (!opt.quiet) @@ -207,7 +207,7 @@ void add_file_to_filelist_recursively(char *origpath, unsigned char level) } closedir(dir); } else if (S_ISREG(st.st_mode)) { - D(5, ("Adding regular file %s to filelist\n", path)); + D(("Adding regular file %s to filelist\n", path)); filelist = gib_list_add_front(filelist, feh_file_new(path)); } free(path); @@ -240,9 +240,9 @@ gib_list *feh_file_info_preload(gib_list * list) for (l = list; l; l = l->next) { file = FEH_FILE(l->data); - D(5, ("file %p, file->next %p, file->name %s\n", l, l->next, file->name)); + D(("file %p, file->next %p, file->name %s\n", l, l->next, file->name)); if (feh_file_info_load(file, NULL)) { - D(3, ("Failed to load file %p\n", file)); + D(("Failed to load file %p\n", file)); remove_list = gib_list_add_front(remove_list, l); if (opt.verbose) feh_display_status('x'); @@ -268,7 +268,7 @@ int feh_file_info_load(feh_file * file, Imlib_Image im) int need_free = 1; Imlib_Image im1; - D(4, ("im is %p\n", im)); + D(("im is %p\n", im)); if (im) need_free = 0; @@ -369,7 +369,7 @@ void feh_prepare_filelist(void) show_mini_usage(); } - D(3, ("sort mode requested is: %d\n", opt.sort)); + D(("sort mode requested is: %d\n", opt.sort)); switch (opt.sort) { case SORT_NONE: if (opt.randomize) { @@ -407,7 +407,7 @@ void feh_prepare_filelist(void) /* no point reversing a random list */ if (opt.reverse && (opt.sort != SORT_NONE)) { - D(3, ("Reversing filelist as requested\n")); + D(("Reversing filelist as requested\n")); filelist = gib_list_reverse(filelist); } @@ -467,12 +467,12 @@ gib_list *feh_read_filelist(char *filename) } for (; fgets(s, sizeof(s), fp);) { - D(5, ("Got line '%s'\n", s)); + D(("Got line '%s'\n", s)); s1[0] = '\0'; sscanf(s, "%[^\n]", (char *) &s1); if (!(*s1) || (*s1 == '\n')) continue; - D(5, ("Got filename %s from filelist file\n", s1)); + D(("Got filename %s from filelist file\n", s1)); /* Add it to the new list */ list = gib_list_add_front(list, feh_file_new(s1)); } @@ -495,7 +495,7 @@ char *feh_absolute_path(char *path) /* This path is not relative. We're gonna convert it, so that a filelist file can be saved anywhere and feh will still find the images */ - D(4, ("Need to convert %s to an absolute form\n", path)); + D(("Need to convert %s to an absolute form\n", path)); /* I SHOULD be able to just use a simple realpath() here, but dumb * old Solaris's realpath doesn't return an absolute path if the path you give it is relative. Linux and BSD get this right... */ @@ -506,7 +506,7 @@ char *feh_absolute_path(char *path) } else { ret = estrdup(temp); } - D(4, ("Converted path to %s\n", ret)); + D(("Converted path to %s\n", ret)); return(ret); } diff --git a/src/imlib.c b/src/imlib.c index 7b063c0..206282a 100644 --- a/src/imlib.c +++ b/src/imlib.c @@ -116,7 +116,7 @@ int feh_load_image(Imlib_Image * im, feh_file * file) { Imlib_Load_Error err; - D(3, ("filename is %s, image is %p\n", file->filename, im)); + D(("filename is %s, image is %p\n", file->filename, im)); if (!file || !file->filename) return(0); @@ -220,11 +220,11 @@ int feh_load_image(Imlib_Image * im, feh_file * file) file->filename, err); break; } - D(3, ("Load *failed*\n")); + D(("Load *failed*\n")); return(0); } - D(3, ("Loaded ok\n")); + D(("Loaded ok\n")); return(1); } @@ -271,7 +271,7 @@ char *feh_http_load_image(char *url) char accept_string[] = "Accept: image/*"; FILE *fp; - D(4, ("using builtin http collection\n")); + D(("using builtin http collection\n")); fp = fopen(tmpname, "w"); if (!fp) { weprintf("couldn't write to file %s:", tmpname); @@ -288,7 +288,7 @@ char *feh_http_load_image(char *url) return(NULL); } - D(4, ("trying hostname %s\n", hostname)); + D(("trying hostname %s\n", hostname)); if (!(hptr = feh_gethostbyname(hostname))) { weprintf("error resolving host %s:", hostname); @@ -635,7 +635,7 @@ char *build_caption_filename(feh_file * file) caption_dir = estrjoin("/", dir, opt.caption_path, NULL); - D(4, ("dir %s, cp %s, cdir %s\n", dir, opt.caption_path, caption_dir)) + D(("dir %s, cp %s, cdir %s\n", dir, opt.caption_path, caption_dir)) if (stat(caption_dir, &cdir_stat) == -1) { if (mkdir(caption_dir, 0755) == -1) @@ -789,7 +789,7 @@ void feh_display_status(char stat) static int init_len = 0; int j = 0; - D(5, ("filelist %p, filelist->next %p\n", filelist, filelist->next)); + D(("filelist %p, filelist->next %p\n", filelist, filelist->next)); if (!init_len) init_len = gib_list_length(filelist); diff --git a/src/index.c b/src/index.c index 2ef86eb..15dcea1 100644 --- a/src/index.c +++ b/src/index.c @@ -101,7 +101,7 @@ void init_index_mode(void) if (!strcmp(opt.bg_file, "trans")) trans_bg = 1; else { - D(3, ("Time to apply a background to blend onto\n")); + D(("Time to apply a background to blend onto\n")); if (feh_load_image_char(&bg_im, opt.bg_file) != 0) { bg_w = gib_imlib_image_get_width(bg_im); bg_h = gib_imlib_image_get_height(bg_im); @@ -310,11 +310,11 @@ void init_index_mode(void) filelist = feh_file_remove_from_list(filelist, last); last = NULL; } - D(4, ("About to load image %s\n", file->filename)); + D(("About to load image %s\n", file->filename)); if (feh_load_image(&im_temp, file) != 0) { if (opt.verbose) feh_display_status('.'); - D(4, ("Successfully loaded %s\n", file->filename)); + D(("Successfully loaded %s\n", file->filename)); www = opt.thumb_w; hhh = opt.thumb_h; ww = gib_imlib_image_get_width(im_temp); @@ -345,7 +345,7 @@ void init_index_mode(void) if (opt.alpha) { DATA8 atab[256]; - D(3, ("Applying alpha options\n")); + D(("Applying alpha options\n")); gib_imlib_image_set_has_alpha(im_thumb, 1); memset(atab, opt.alpha_level, sizeof(atab)); gib_imlib_apply_color_modifier_to_rectangle diff --git a/src/keyevents.c b/src/keyevents.c index 3166e9a..2c8890e 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -31,8 +31,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void feh_event_invoke_action(winwidget winwid, char *action) { - D(4, ("action is '%s'\n", action)); - D(4, ("winwid is '%p'\n", winwid)); + D(("action is '%s'\n", action)); + D(("winwid is '%p'\n", winwid)); if (action) { if (opt.slideshow) { feh_action_run(FEH_FILE(winwid->file->data), action); @@ -126,14 +126,14 @@ int feh_main_iteration(int block) ft = first_timer; /* Don't do timers if we're zooming/panning/etc or if we are paused */ if (ft && (opt.mode == MODE_NORMAL) && !opt.paused) { - D(5, ("There are timers in the queue\n")); + D(("There are timers in the queue\n")); if (ft->just_added) { - D(5, ("The first timer has just been added\n")); - D(5, ("ft->in = %f\n", ft->in)); + D(("The first timer has just been added\n")); + D(("ft->in = %f\n", ft->in)); ft->just_added = 0; t1 = ft->in; } else { - D(5, ("The first timer was not just added\n")); + D(("The first timer was not just added\n")); t1 = ft->in - t2; if (t1 < 0.0) t1 = 0.0; @@ -141,7 +141,7 @@ int feh_main_iteration(int block) } XSync(disp, False); - D(5, ("I next need to action a timer in %f seconds\n", t1)); + D(("I next need to action a timer in %f seconds\n", t1)); /* Only do a blocking select if there's a timer due, or no events waiting */ if (t1 == 0.0 || (block && !XPending(disp))) { @@ -152,7 +152,7 @@ int feh_main_iteration(int block) if (tval.tv_usec <= 1000) tval.tv_usec = 1000; errno = 0; - D(5, ("Performing blocking select - waiting for timer or event\n")); + D(("Performing blocking select - waiting for timer or event\n")); count = select(fdsize, &fdset, NULL, NULL, &tval); if ((count < 0) && ((errno == ENOMEM) || (errno == EINVAL) @@ -169,7 +169,7 @@ int feh_main_iteration(int block) /* Don't block if there are events in the queue. That's a bit rude ;-) */ if (block && !XPending(disp)) { errno = 0; - D(5, ("Performing blocking select - no timers, or zooming\n")); + D(("Performing blocking select - no timers, or zooming\n")); count = select(fdsize, &fdset, NULL, NULL, NULL); if ((count < 0) && ((errno == ENOMEM) || (errno == EINVAL) @@ -173,7 +173,7 @@ feh_menu_item *feh_menu_find_selected(feh_menu * m) { feh_menu_item *i; - D(5, ("menu %p\n", m)); + D(("menu %p\n", m)); for (i = m->items; i; i = i->next) { if (MENU_ITEM_IS_SELECTED(i)) @@ -187,7 +187,7 @@ feh_menu_item *feh_menu_find_selected_r(feh_menu * m, feh_menu ** parent) feh_menu_item *i, *ii; feh_menu *mm; - D(5, ("menu %p\n", m)); + D(("menu %p\n", m)); for (i = m->items; i; i = i->next) { if (MENU_ITEM_IS_SELECTED(i)) { @@ -299,14 +299,14 @@ feh_menu_item *feh_menu_find_at_xy(feh_menu * m, int x, int y) { feh_menu_item *i; - D(4, ("looking for menu item at %d,%d\n", x, y)); + D(("looking for menu item at %d,%d\n", x, y)); for (i = m->items; i; i = i->next) { if (XY_IN_RECT(x, y, i->x, i->y, i->w, i->h)) { - D(4, ("Found an item\n")); + D(("Found an item\n")); return(i); } } - D(4, ("didn't find an item\n")); + D(("didn't find an item\n")); return(NULL); } @@ -319,7 +319,7 @@ void feh_menu_deselect_selected(feh_menu * m) i = feh_menu_find_selected(m); if (i) { - D(4, ("found a selected menu, deselecting it\n")); + D(("found a selected menu, deselecting it\n")); MENU_ITEM_SET_NORMAL(i); m->updates = imlib_update_append_rect(m->updates, i->x, i->y, i->w, i->h); m->needs_redraw = 1; @@ -356,7 +356,7 @@ void feh_menu_show_at(feh_menu * m, int x, int y) if (!menu_cover) { XSetWindowAttributes attr; - D(4, ("creating menu cover window\n")); + D(("creating menu cover window\n")); attr.override_redirect = True; attr.do_not_propagate_mask = True; menu_cover = XCreateWindow( @@ -491,7 +491,7 @@ void feh_menu_hide(feh_menu * m, int func_free) } if (m == menu_root) { if (menu_cover) { - D(4, ("DESTROYING menu cover\n")); + D(("DESTROYING menu cover\n")); XDestroyWindow(disp, menu_cover); menu_cover = 0; } @@ -664,7 +664,7 @@ void feh_menu_calc_size(feh_menu * m) XResizeWindow(disp, m->win, m->w, m->h); m->updates = imlib_update_append_rect(m->updates, 0, 0, m->w, m->h); } - D(4, ("menu size calculated. w=%d h=%d\n", m->w, m->h)); + D(("menu size calculated. w=%d h=%d\n", m->w, m->h)); /* Make sure bg is same size */ if (m->bg) { @@ -676,7 +676,7 @@ void feh_menu_calc_size(feh_menu * m) if (m->w != bg_w || m->h != bg_h) { Imlib_Image newim = imlib_create_image(m->w, m->h); - D(3, ("resizing bg to %dx%d\n", m->w, m->h)); + D(("resizing bg to %dx%d\n", m->w, m->h)); gib_imlib_blend_image_onto_image(newim, m->bg, 0, 0, 0, bg_w, bg_h, 0, 0, m->w, m->h, 0, 0, 1); gib_imlib_free_image_and_decache(m->bg); @@ -689,16 +689,16 @@ void feh_menu_calc_size(feh_menu * m) void feh_menu_draw_item(feh_menu_item * i, Imlib_Image im, int ox, int oy) { - D(5, ("drawing item %p (text %s)\n", i, i->text)); + D(("drawing item %p (text %s)\n", i, i->text)); if (i->text) { - D(5, ("text item\n")); + D(("text item\n")); if (MENU_ITEM_IS_SELECTED(i)) { - D(5, ("selected item\n")); + D(("selected item\n")); /* draw selected image */ feh_menu_item_draw_at(i->x, i->y, i->w, i->h, im, ox, oy, 1); } else { - D(5, ("unselected item\n")); + D(("unselected item\n")); /* draw unselected image */ feh_menu_item_draw_at(i->x, i->y, i->w, i->h, im, ox, oy, 0); } @@ -710,7 +710,7 @@ void feh_menu_draw_item(feh_menu_item * i, Imlib_Image im, int ox, int oy) if (i->icon) { Imlib_Image im2; - D(5, ("icon item\n")); + D(("icon item\n")); im2 = i->icon; if (im2) { @@ -741,7 +741,7 @@ void feh_menu_draw_item(feh_menu_item * i, Imlib_Image im, int ox, int oy) } } if (i->submenu) { - D(5, ("submenu item\n")); + D(("submenu item\n")); feh_menu_draw_submenu_at(i->x + i->sub_x, i->y + FEH_MENUITEM_PAD_TOP + @@ -753,7 +753,7 @@ void feh_menu_draw_item(feh_menu_item * i, Imlib_Image im, int ox, int oy) 2), im, ox, oy); } if (i->is_toggle) { - D(5, ("toggleable item\n")); + D(("toggleable item\n")); feh_menu_draw_toggle_at(i->x + i->toggle_x, i->y + FEH_MENUITEM_PAD_TOP + @@ -764,7 +764,7 @@ void feh_menu_draw_item(feh_menu_item * i, Imlib_Image im, int ox, int oy) FEH_MENU_TOGGLE_W, FEH_MENU_TOGGLE_H, im, ox, oy, MENU_ITEM_IS_ON(i)); } } else { - D(5, ("separator item\n")); + D(("separator item\n")); feh_menu_draw_separator_at(i->x, i->y, i->w, i->h, im, ox, oy); } return; @@ -784,13 +784,13 @@ void feh_menu_redraw(feh_menu * m) u = imlib_updates_merge_for_rendering(m->updates, m->w, m->h); m->updates = NULL; if (u) { - D(5, ("I have updates to render\n")); + D(("I have updates to render\n")); for (uu = u; u; u = imlib_updates_get_next(u)) { int x, y, w, h; Imlib_Image im; imlib_updates_get_coordinates(u, &x, &y, &w, &h); - D(5, ("update coords %d,%d %d*%d\n", x, y, w, h)); + D(("update coords %d,%d %d*%d\n", x, y, w, h)); im = imlib_create_image(w, h); gib_imlib_image_fill_rectangle(im, 0, 0, w, h, 0, 0, 0, 0); if (im) { diff --git a/src/multiwindow.c b/src/multiwindow.c index 4fab4ee..c46e453 100644 --- a/src/multiwindow.c +++ b/src/multiwindow.c @@ -58,7 +58,7 @@ void init_multiwindow_mode(void) if (!feh_main_iteration(0)) exit(0); } else { - D(3, ("EEEK. Couldn't load image in multiwindow mode. " + D(("EEEK. Couldn't load image in multiwindow mode. " "I 'm not sure if this is a problem\n")); } free(s); diff --git a/src/options.c b/src/options.c index 0ad6a1f..606e2ee 100644 --- a/src/options.c +++ b/src/options.c @@ -85,15 +85,15 @@ void init_parse_options(int argc, char **argv) opt.xinerama = 1; #endif /* HAVE_LIBXINERAMA */ - D(3, ("About to parse env options (if any)\n")); + D(("About to parse env options (if any)\n")); /* Check for and parse any options in FEH_OPTIONS */ feh_parse_environment_options(); - D(3, ("About to parse commandline options\n")); + D(("About to parse commandline options\n")); /* Parse the cmdline args */ feh_parse_option_array(argc, argv); - D(3, ("About to check for theme configuration\n")); + D(("About to check for theme configuration\n")); feh_check_theme_options(argc, argv); /* If we have a filelist to read, do it now */ @@ -101,11 +101,11 @@ void init_parse_options(int argc, char **argv) /* joining two reverse-sorted lists in this manner works nicely for us here, as files specified on the commandline end up at the *end* of the combined filelist, in the specified order. */ - D(3, ("About to load filelist from file\n")); + D(("About to load filelist from file\n")); filelist = gib_list_cat(filelist, feh_read_filelist(opt.filelistfile)); } - D(4, ("Options parsed\n")); + D(("Options parsed\n")); if (opt.bgmode) return; @@ -131,7 +131,7 @@ static void feh_check_theme_options(int arg, char **argv) else theme = estrdup(argv[0]); } - D(3, ("Theme name is %s\n", theme)); + D(("Theme name is %s\n", theme)); feh_load_options_for_theme(theme); @@ -160,7 +160,7 @@ static void feh_load_options_for_theme(char *theme) eprintf("D'oh! Please define HOME in your environment! " "It would really help me out...\n"); rcpath = estrjoin("/", home, ".fehrc", NULL); - D(3, ("Trying %s for config\n", rcpath)); + D(("Trying %s for config\n", rcpath)); fp = fopen(rcpath, "r"); if (!fp && ((fp = fopen("/etc/fehrc", "r")) == NULL)) { @@ -182,14 +182,14 @@ static void feh_load_options_for_theme(char *theme) sscanf(s, " %[^\n]\n", (char *) &s2); if (!*s2) break; - D(5, ("Got continued options %s\n", s2)); + D(("Got continued options %s\n", s2)); } else { sscanf(s, "%s %[^\n]\n", (char *) &s1, (char *) &s2); if (!(*s1) || (!*s2) || (*s1 == '\n') || (*s1 == '#')) { cont = 0; continue; } - D(5, ("Got theme/options pair %s/%s\n", s1, s2)); + D(("Got theme/options pair %s/%s\n", s1, s2)); } if (!strcmp(s1, theme) || cont) { @@ -197,7 +197,7 @@ static void feh_load_options_for_theme(char *theme) bspos = strlen(s2)-1; if (s2[bspos] == '\\') { - D(5, ("Continued line\n")); + D(("Continued line\n")); s2[bspos] = '\0'; cont = 1; /* A trailing whitespace confuses the option parser */ @@ -206,7 +206,7 @@ static void feh_load_options_for_theme(char *theme) } else cont = 0; - D(4, ("A match. Using options %s\n", s2)); + D(("A match. Using options %s\n", s2)); feh_parse_options_from_string(s2); if (!cont) @@ -288,7 +288,7 @@ char *feh_string_normalize(char *str) int i = 0; char last = 0; - D(4, ("normalizing %s\n", str)); + D(("normalizing %s\n", str)); ret[0] = '\0'; for (s = str;; s++) { @@ -308,7 +308,7 @@ char *feh_string_normalize(char *str) ret[i - 1] = '\0'; else ret[i] = '\0'; - D(4, ("normalized to %s\n", ret)); + D(("normalized to %s\n", ret)); return(estrdup(ret)); } @@ -391,7 +391,7 @@ static void feh_parse_option_array(int argc, char **argv) {"blur-button" , 1, 0, '9'}, {"start-at" , 1, 0, '|'}, {"rcfile" , 1, 0, '_'}, - {"debug-level" , 1, 0, '+'}, + {"debug" , 0, 0, '+'}, {"output-dir" , 1, 0, 'j'}, {"bg-tile" , 1, 0, 200}, {"bg-center" , 1, 0, 201}, @@ -422,7 +422,7 @@ static void feh_parse_option_array(int argc, char **argv) /* Now to pass some optionarinos */ while ((optch = getopt_long(argc, argv, stropts, lopts, &cmdx)) != EOF) { - D(5, ("Got option, getopt calls it %d, or %c\n", optch, optch)); + D(("Got option, getopt calls it %d, or %c\n", optch, optch)); switch (optch) { case 0: break; @@ -472,7 +472,7 @@ static void feh_parse_option_array(int argc, char **argv) opt.menu_font = estrdup(optarg); break; case '+': - opt.debug_level = atoi(optarg); + opt.debug = 1; break; case 'n': opt.reverse = 1; @@ -564,7 +564,7 @@ static void feh_parse_option_array(int argc, char **argv) theme = estrdup(optarg); break; case 'C': - D(3, ("adding fontpath %s\n", optarg)); + D(("adding fontpath %s\n", optarg)); imlib_add_path_to_font_path(optarg); break; case 'e': diff --git a/src/options.h b/src/options.h index 3aa6dc1..6ef4f64 100644 --- a/src/options.h +++ b/src/options.h @@ -111,7 +111,7 @@ struct __fehoptions { unsigned int thumb_redraw; int reload; int sort; - int debug_level; + int debug; int geom_flags; int geom_x; int geom_y; diff --git a/src/slideshow.c b/src/slideshow.c index 255e7d6..19ab6a6 100644 --- a/src/slideshow.c +++ b/src/slideshow.c @@ -311,7 +311,7 @@ void feh_action_run(feh_file * file, char *action) { if (action) { char *sys; - D(3, ("Running action %s\n", action)); + D(("Running action %s\n", action)); sys = feh_printf(action, file); if (opt.verbose && !opt.list && !opt.customlist) diff --git a/src/support.c b/src/support.c index 004e3d3..3e80828 100644 --- a/src/support.c +++ b/src/support.c @@ -88,10 +88,10 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, imlib_context_set_image(im); imlib_image_set_format("png"); gib_imlib_save_image(im, bgfil); - D(3, ("bg saved as %s\n", bgfil)); + D(("bg saved as %s\n", bgfil)); fil = bgfil; } - D(3, ("Setting bg %s\n", fil)); + D(("Setting bg %s\n", fil)); if (feh_wm_get_wm_is_e() && (enl_ipc_get_win() != None)) { snprintf(sendbuf, sizeof(sendbuf), "background %s bg.file %s", bgname, fil); @@ -148,7 +148,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, GC gc; int in, out, w, h; - D(3, ("Falling back to XSetRootWindowPixmap\n")); + D(("Falling back to XSetRootWindowPixmap\n")); /* Put the filename in filbuf between ' and escape ' in the filename */ out = 0; @@ -183,7 +183,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, GC gc; int x, y; - D(3, ("centering\n")); + D(("centering\n")); w = scr->width; h = scr->height; @@ -316,10 +316,10 @@ signed char feh_wm_get_wm_is_e(void) /* XXX: This only covers E17 prior to 6/22/05 */ if ((XInternAtom(disp, "ENLIGHTENMENT_COMMS", True) != None) && (XInternAtom(disp, "ENLIGHTENMENT_VERSION", True) != None)) { - D(3, ("Enlightenment detected.\n")); + D(("Enlightenment detected.\n")); e = 1; } else { - D(3, ("Enlightenment not detected.\n")); + D(("Enlightenment not detected.\n")); e = 0; } } @@ -337,7 +337,7 @@ int feh_wm_get_num_desks(void) buf = enl_send_and_wait("num_desks ?"); if (buf == IPC_FAKE) /* Fake E17 IPC */ return(-1); - D(3, ("Got from E IPC: %s\n", buf)); + D(("Got from E IPC: %s\n", buf)); ptr = buf; while (ptr && !isdigit(*ptr)) ptr++; @@ -357,7 +357,7 @@ Window enl_ipc_get_win(void) int dummy_int; unsigned int dummy_uint; - D(3, ("Searching for IPC window.\n")); + D(("Searching for IPC window.\n")); /* * Shortcircuit this entire func @@ -368,14 +368,14 @@ Window enl_ipc_get_win(void) prop = XInternAtom(disp, "ENLIGHTENMENT_COMMS", True); if (prop == None) { - D(3, ("Enlightenment is not running.\n")); + D(("Enlightenment is not running.\n")); return(None); } else { /* XXX: This will only work with E17 prior to 6/22/2005 */ ever = XInternAtom(disp, "ENLIGHTENMENT_VERSION", True); if (ever == None) { /* This is an E without ENLIGHTENMENT_VERSION */ - D(3, ("E16 IPC Protocol not supported")); + D(("E16 IPC Protocol not supported")); return(None); } } @@ -388,7 +388,7 @@ Window enl_ipc_get_win(void) if (!XGetGeometry (disp, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) { - D(3, (" -> IPC Window property is valid, but the window doesn't exist.\n")); + D((" -> IPC Window property is valid, but the window doesn't exist.\n")); ipc_win = None; } str = NULL; @@ -398,7 +398,7 @@ Window enl_ipc_get_win(void) if (str) { XFree(str); } else { - D(3, (" -> IPC Window lacks the proper atom. I can't talk to fake IPC windows....\n")); + D((" -> IPC Window lacks the proper atom. I can't talk to fake IPC windows....\n")); ipc_win = None; } } @@ -416,14 +416,13 @@ Window enl_ipc_get_win(void) * -- richlowe 2005-06-22 */ XFree(str); - D(3, (" -> Found a fake E17 IPC window, ignoring")); + D((" -> Found a fake E17 IPC window, ignoring")); ipc_win = None; e17_fake_ipc = 1; return(ipc_win); } - D(3, - (" -> IPC Window found and verified as 0x%08x. Registering feh as an IPC client.\n", (int) ipc_win)); + D((" -> IPC Window found and verified as 0x%08x. Registering feh as an IPC client.\n", (int) ipc_win)); XSelectInput(disp, ipc_win, StructureNotifyMask | SubstructureNotifyMask); enl_ipc_send("set clientname " PACKAGE); enl_ipc_send("set version " VERSION); @@ -451,24 +450,24 @@ void enl_ipc_send(char *str) if (last_msg == NULL) eprintf("eeek"); str = last_msg; - D(4, ("Resending last message \"%s\" to Enlightenment.\n", str)); + D(("Resending last message \"%s\" to Enlightenment.\n", str)); } else { if (last_msg != NULL) { free(last_msg); } last_msg = estrdup(str); - D(4, ("Sending \"%s\" to Enlightenment.\n", str)); + D(("Sending \"%s\" to Enlightenment.\n", str)); } if (ipc_win == None) { if ((ipc_win = enl_ipc_get_win()) == None) { - D(3, ("Hrm. Enlightenment doesn't seem to be running. No IPC window, no IPC.\n")); + D(("Hrm. Enlightenment doesn't seem to be running. No IPC window, no IPC.\n")); return; } } len = strlen(str); ipc_atom = XInternAtom(disp, "ENL_MSG", False); if (ipc_atom == None) { - D(3, ("IPC error: Unable to find/create ENL_MSG atom.\n")); + D(("IPC error: Unable to find/create ENL_MSG atom.\n")); return; } for (; XCheckTypedWindowEvent(disp, my_ipc_win, ClientMessage, &ev);); /* Discard any out-of-sync messages */ @@ -552,7 +551,7 @@ char *enl_ipc_get(const char *msg_data) if (blen < 12) { ret_msg = message; message = NULL; - D(4, ("Received complete reply: \"%s\"\n", ret_msg)); + D(("Received complete reply: \"%s\"\n", ret_msg)); } return(ret_msg); } @@ -586,7 +585,7 @@ char *enl_send_and_wait(char *msg) for (; !(reply = enl_ipc_get(enl_wait_for_reply()));); if (reply == IPC_TIMEOUT) { /* We timed out. The IPC window must be AWOL. Reset and resend message. */ - D(3, ("IPC timed out. IPC window has gone. Clearing ipc_win.\n")); + D(("IPC timed out. IPC window has gone. Clearing ipc_win.\n")); XSelectInput(disp, ipc_win, None); ipc_win = None; } diff --git a/src/thumbnail.c b/src/thumbnail.c index 74cc033..ed4e0fb 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -127,7 +127,7 @@ void init_thumbnail_mode(void) trans_bg = 1; else { - D(3, ("Time to apply a background to blend onto\n")); + D(("Time to apply a background to blend onto\n")); if (feh_load_image_char(&td.im_bg, opt.bg_file) != 0) { td.bg_w = gib_imlib_image_get_width(td.im_bg); td.bg_h = gib_imlib_image_get_height(td.im_bg); @@ -202,12 +202,12 @@ void init_thumbnail_mode(void) filelist = feh_file_remove_from_list(filelist, last); last = NULL; } - D(4, ("About to load image %s\n", file->filename)); + D(("About to load image %s\n", file->filename)); /* if (feh_load_image(&im_temp, file) != 0) */ if (feh_thumbnail_get_thumbnail(&im_temp, file) != 0) { if (opt.verbose) feh_display_status('.'); - D(4, ("Successfully loaded %s\n", file->filename)); + D(("Successfully loaded %s\n", file->filename)); www = opt.thumb_w; hhh = opt.thumb_h; ww = gib_imlib_image_get_width(im_temp); @@ -243,7 +243,7 @@ void init_thumbnail_mode(void) if (opt.alpha) { DATA8 atab[256]; - D(3, ("Applying alpha options\n")); + D(("Applying alpha options\n")); gib_imlib_image_set_has_alpha(im_thumb, 1); memset(atab, opt.alpha_level, sizeof(atab)); gib_imlib_apply_color_modifier_to_rectangle @@ -471,7 +471,7 @@ feh_file *feh_thumbnail_get_file_from_coords(int x, int y) } } } - D(4, ("No matching %d %d\n", x, y)); + D(("No matching %d %d\n", x, y)); return(NULL); } @@ -488,7 +488,7 @@ feh_thumbnail *feh_thumbnail_get_thumbnail_from_coords(int x, int y) } } } - D(4, ("No matching %d %d\n", x, y)); + D(("No matching %d %d\n", x, y)); return(NULL); } @@ -505,7 +505,7 @@ feh_thumbnail *feh_thumbnail_get_from_file(feh_file * file) } } } - D(4, ("No match\n")); + D(("No match\n")); return(NULL); } @@ -733,7 +733,7 @@ int feh_thumbnail_get_thumbnail(Imlib_Image * image, feh_file * file) if (!status) status = feh_thumbnail_generate(image, file, thumb_file, uri); - D(1, ("uri is %s, thumb_file is %s\n", uri, thumb_file)); + D(("uri is %s, thumb_file is %s\n", uri, thumb_file)); free(uri); free(thumb_file); } else diff --git a/src/timers.c b/src/timers.c index 578b7d9..cba0716 100644 --- a/src/timers.c +++ b/src/timers.c @@ -34,14 +34,14 @@ void feh_handle_timer(void) fehtimer ft; if (!first_timer) { - D(3, ("No timer to handle, returning\n")); + D(("No timer to handle, returning\n")); return; } ft = first_timer; first_timer = first_timer->next; - D(3, ("Executing timer function now\n")); + D(("Executing timer function now\n")); (*(ft->func)) (ft->data); - D(3, ("Freeing the timer\n")); + D(("Freeing the timer\n")); if (ft && ft->name) free(ft->name); if (ft) @@ -61,14 +61,14 @@ void feh_remove_timer(char *name) { fehtimer ft, ptr, pptr; - D(3, ("removing %s\n", name)); + D(("removing %s\n", name)); pptr = NULL; ptr = first_timer; while (ptr) { - D(3, ("Stepping through event list\n")); + D(("Stepping through event list\n")); ft = ptr; if (!strcmp(ft->name, name)) { - D(3, ("Found it. Removing\n")); + D(("Found it. Removing\n")); if (pptr) pptr->next = ft->next; else @@ -92,7 +92,7 @@ void feh_add_timer(void (*func) (void *data), void *data, double in, char *name) fehtimer ft, ptr, pptr; double tally; - D(3, ("adding timer %s for %f seconds time\n", name, in)); + D(("adding timer %s for %f seconds time\n", name, in)); feh_remove_timer(name); ft = malloc(sizeof(_fehtimer)); ft->next = NULL; @@ -101,13 +101,13 @@ void feh_add_timer(void (*func) (void *data), void *data, double in, char *name) ft->name = estrdup(name); ft->just_added = 1; ft->in = in; - D(3, ("ft->in = %f\n", ft->in)); + D(("ft->in = %f\n", ft->in)); tally = 0.0; if (!first_timer) { - D(3, ("No first timer\n")); + D(("No first timer\n")); first_timer = ft; } else { - D(3, ("There is a first timer\n")); + D(("There is a first timer\n")); pptr = NULL; ptr = first_timer; tally = 0.0; @@ -134,7 +134,7 @@ void feh_add_timer(void (*func) (void *data), void *data, double in, char *name) first_timer = ft; ft->in -= tally; } - D(3, ("ft->in = %f\n", ft->in)); + D(("ft->in = %f\n", ft->in)); return; } @@ -144,7 +144,7 @@ void feh_add_unique_timer(void (*func) (void *data), void *data, double in) char evname[20]; snprintf(evname, sizeof(evname), "T_%ld", i); - D(4, ("adding timer with unique name %s\n", evname)); + D(("adding timer with unique name %s\n", evname)); feh_add_timer(func, data, in, evname); i++; /* Mega paranoia ;) */ diff --git a/src/winwidget.c b/src/winwidget.c index fdd86e2..d1c9e80 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -127,7 +127,7 @@ winwidget winwidget_create_from_file(gib_list * list, char *name, char type) if (!ret->win) { ret->w = ret->im_w = gib_imlib_image_get_width(ret->im); ret->h = ret->im_h = gib_imlib_image_get_height(ret->im); - D(3, ("image is %dx%d pixels, format %s\n", ret->w, ret->h, gib_imlib_image_format(ret->im))); + D(("image is %dx%d pixels, format %s\n", ret->w, ret->h, gib_imlib_image_format(ret->im))); if (opt.full_screen) ret->full_screen = True; winwidget_create_window(ret, ret->w, ret->h); @@ -147,7 +147,7 @@ void winwidget_create_window(winwidget ret, int w, int h) int x = 0; int y = 0; - D(4, ("winwidget_create_window %dx%d\n", w, h)); + D(("winwidget_create_window %dx%d\n", w, h)); if (ret->full_screen) { w = scr->width; @@ -290,7 +290,7 @@ void winwidget_update_title(winwidget ret) { char *name; - D(4, ("winwid->name = %s\n", ret->name)); + D(("winwid->name = %s\n", ret->name)); name = ret->name ? ret->name : "feh"; XStoreName(disp, ret->win, name); XSetIconName(disp, ret->win, name); @@ -313,7 +313,7 @@ void winwidget_setup_pixmaps(winwidget winwid) XFillRectangle(disp, winwid->bg_pmap, winwid->gc, 0, 0, scr->width, scr->height); } else { if (!winwid->bg_pmap || winwid->had_resize) { - D(4, ("recreating background pixmap (%dx%d)\n", winwid->w, winwid->h)); + D(("recreating background pixmap (%dx%d)\n", winwid->w, winwid->h)); if (winwid->bg_pmap) XFreePixmap(disp, winwid->bg_pmap); @@ -344,17 +344,17 @@ void winwidget_render_image(winwidget winwid, int resize, int alias) if (winwid->im_y > winwid->h) winwid->im_y = winwid->h; - D(2, ("winwidget_render_image resize %d alias %d im %dx%d\n", + D(("winwidget_render_image resize %d alias %d im %dx%d\n", resize, alias, winwid->im_w, winwid->im_h)); winwidget_setup_pixmaps(winwid); if (!winwid->full_screen && opt.scale_down && ((winwid->w < winwid->im_w) || (winwid->h < winwid->im_h))) { - D(2, ("scaling down image %dx%d\n", winwid->w, winwid->h)); + D(("scaling down image %dx%d\n", winwid->w, winwid->h)); feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, winwid->w, winwid->h); - D(2, ("after scaling down image %dx%d\n", winwid->w, winwid->h)); + D(("after scaling down image %dx%d\n", winwid->w, winwid->h)); } if (!winwid->full_screen && ((gib_imlib_image_has_alpha(winwid->im)) || (opt.geom_flags) @@ -385,7 +385,7 @@ void winwidget_render_image(winwidget winwid, int resize, int alias) } } - D(4, ("Calculating for fullscreen/fixed geom render\n")); + D(("Calculating for fullscreen/fixed geom render\n")); smaller = ((winwid->im_w < max_w) && (winwid->im_h < max_h)); @@ -484,11 +484,10 @@ void winwidget_render_image(winwidget winwid, int resize, int alias) sw = lround(dw / winwid->zoom); sh = lround(dh / winwid->zoom); - D(5, - ("sx: %d sy: %d sw: %d sh: %d dx: %d dy: %d dw: %d dh: %d zoom: %f\n", + D(("sx: %d sy: %d sw: %d sh: %d dx: %d dy: %d dw: %d dh: %d zoom: %f\n", sx, sy, sw, sh, dx, dy, dw, dh, winwid->zoom)); - D(5, ("winwidget_render(): winwid->im_angle = %f\n", winwid->im_angle)); + D(("winwidget_render(): winwid->im_angle = %f\n", winwid->im_angle)); if (winwid->has_rotated) gib_imlib_render_image_part_on_drawable_at_size_with_rotation (winwid->bg_pmap, winwid->im, sx, sy, sw, sh, dx, dy, dw, dh, winwid->im_angle, 1, 1, alias); @@ -681,7 +680,7 @@ winwidget winwidget_get_first_window_of_type(unsigned int type) int winwidget_loadimage(winwidget winwid, feh_file * file) { - D(4, ("filename %s\n", file->filename)); + D(("filename %s\n", file->filename)); return(feh_load_image(&(winwid->im), file)); } @@ -695,9 +694,9 @@ void winwidget_show(winwidget winwid) if (opt.full_screen) XMoveWindow(disp, winwid->win, 0, 0); /* wait for the window to map */ - D(4, ("Waiting for window to map\n")); + D(("Waiting for window to map\n")); XMaskEvent(disp, StructureNotifyMask, &ev); - D(4, ("Window mapped\n")); + D(("Window mapped\n")); winwid->visible = 1; } return; @@ -713,7 +712,7 @@ void winwidget_move(winwidget winwid, int x, int y) XMoveWindow(disp, winwid->win, winwid->x, winwid->y); XFlush(disp); } else { - D(4, ("No move actually needed\n")); + D(("No move actually needed\n")); } return; } @@ -729,7 +728,7 @@ void winwidget_resize(winwidget winwid, int w, int h) return; } if (winwid && ((winwid->w != w) || (winwid->h != h))) { - D(4, ("Really doing a resize\n")); + D(("Really doing a resize\n")); /* winwidget_clear_background(winwid); */ if (opt.screen_clip) { winwid->w = (w > scr->width) ? scr->width : w; @@ -767,7 +766,7 @@ void winwidget_resize(winwidget winwid, int w, int h) #endif /* HAVE_LIBXINERAMA */ } else { - D(4, ("No resize actually needed\n")); + D(("No resize actually needed\n")); } return; @@ -782,7 +781,7 @@ void winwidget_hide(winwidget winwid) static void winwidget_register(winwidget win) { - D(5, ("window %p\n", win)); + D(("window %p\n", win)); window_num++; if (windows) windows = erealloc(windows, window_num * sizeof(winwidget)); |