From a45fb89be74548d263cd0c3c8a36b05c0b310e31 Mon Sep 17 00:00:00 2001 From: Victor ADASCALITEI Date: Wed, 25 Jul 2012 01:02:41 +0300 Subject: [PATCH] Started working on issue #3. This is done using the 'poppler' pdf library which suports the glib front-end. We are temporarely using a test pdf that replaces the book beeing still in revision. The book-viewer can be activated through a new button that was added onto the main form. --- src/psale/Makefile | 6 +- src/psale/cartulie_fis_test.pdf | Bin 0 -> 18831 bytes src/psale/date.sqlite | Bin 1900544 -> 1900544 bytes src/psale/db.c | 6 + src/psale/db.h | 4 +- src/psale/fprin.c | 24 ++ .../bt_icoana_cartulie_pag_precedenta.png | Bin 0 -> 863 bytes .../bt_icoana_cartulie_pag_urmatoare.png | Bin 0 -> 832 bytes .../bt_icoana_cartulie_sari_la_cuprins.png | Bin 0 -> 1313 bytes .../media/bt_icoana_cartulie_sari_la_pag.png | Bin 0 -> 733 bytes src/psale/vc.c | 285 ++++++++++++++++++ src/psale/vc.h | 37 +++ 12 files changed, 358 insertions(+), 4 deletions(-) create mode 100644 src/psale/cartulie_fis_test.pdf create mode 100644 src/psale/media/bt_icoana_cartulie_pag_precedenta.png create mode 100644 src/psale/media/bt_icoana_cartulie_pag_urmatoare.png create mode 100644 src/psale/media/bt_icoana_cartulie_sari_la_cuprins.png create mode 100644 src/psale/media/bt_icoana_cartulie_sari_la_pag.png create mode 100644 src/psale/vc.c create mode 100644 src/psale/vc.h diff --git a/src/psale/Makefile b/src/psale/Makefile index 7badcb7..0f95820 100644 --- a/src/psale/Makefile +++ b/src/psale/Makefile @@ -1,13 +1,13 @@ PROJ_NAME := psale CC := gcc CFLAGS := -Wall -g -OBJS := fprin.o db.o finfo.o fcod.o dl.o al.o +OBJS := fprin.o db.o finfo.o fcod.o dl.o al.o vc.o .c.o : - $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 gtksourceview-2.0 sqlite3` -c $< -o $@ + $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0 gtksourceview-2.0 sqlite3 poppler-glib` -c $< -o $@ all : $(OBJS) - $(CC) $(CFLAGS) $(OBJS) main.c -o $(PROJ_NAME) `pkg-config --cflags --libs gtk+-2.0 gtksourceview-2.0 sqlite3 libcurl` + $(CC) $(CFLAGS) $(OBJS) main.c -o $(PROJ_NAME) `pkg-config --cflags --libs gtk+-2.0 gtksourceview-2.0 sqlite3 libcurl poppler-glib` win : $(OBJS) $(CC) -mwindows $(CFLAGS) $(OBJS) main.c -o $(PROJ_NAME) `pkg-config --cflags --libs gtk+-2.0 gtksourceview-2.0 sqlite3 libcurl` diff --git a/src/psale/cartulie_fis_test.pdf b/src/psale/cartulie_fis_test.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cfafb12393f134d161222aa24069ff6a0480e50a GIT binary patch literal 18831 zcmc({bwC_R*Ds8_yF0;|8Qk67C0LNb-8F;|B)AjYEl6+z1PB@=IE3JC!Grr9vb)dj zv%By2e)q52Ow-+^r_MQ5-Ss=Cie61hh7H8dg+kw5*!`)yu{#Hag9=FHWM+#ZBm__b zJ6gG0Q*lBR;fQ-GVJ6H;A?qmTL5kYZtcLkd|pm=9S#|fi$0kJ|a?;^Yi zl#bXb9dg~V@ZDM9$a>@}6C>Ck0umc@6ASmp6V z9*ul1Mc=mrWrE;qRWa!QsHoU-%NDw8lBzWMw$*Hh7VFNaM!g5XOQMR=gcCC^(!YGw;IcL!*Cn7Kba%R87_fdRTU77)&XKtL*h9N5On+MNo-%}oW6uyJ=& z1G`E(IXF8xf*swd_^1GqPWDc&n$D)?V1N|Z)5aXEAuI6*x1}Vte&h9jWWmV~q5^0t zo4VOiaX-n0>Q5;=et%qn!cvftmw|$YhJu2I{6Rg=LrFrx!oWQJAO{@e2af~~4+jU2 zf{2KKgoc8KhKhoUijIMUg^q!Zfr^SnfQ5~VhmVhshDk_7fJcObhmZGE2sA7t4;(x) zJUlWUIx0He|Ml_M1%-_Sl>y}l3rzzBgAEOf4gJ^yMfyZ4Ec6q-e;n{Iuy6>_NKcW_ zP%!@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JCG?ejW}h_t(ZNUB7v`3K&0>>%psB{x+u)u~4;0YcIaN%>>BDOcig> z@9frVjJJKc^4W<60Weo;uJqrBCIjF*;qaY(9VL*R5~GTPlQLcYH;+Hl&F@%7s{I*= z8WRTjcOhNglk_)ajIusMqP5!nd(Z5}O7{_c=e%r_xD7w(X%*tmY7IXP3U~O#e$<-i zP{Duij>us_CgE=jUN}m6PnI?eLEIeC31~_-X6u12B3``y2XbdW z%_Q7iAP|_=*E3O!uw+W-sW~%_p(7F66*c~kzV~7t9!SWjf8r9_>s) zc)!*jF%~0qbgFrW=F*P3l*|?w$YiLKroZ@z=lD1ks};i;LsCzCA6(;yVS;UqvD@PD zS~9{QdQx3ET(&WqsWGe?6auLdj<3`(?s?U7>Q*Vjs+%88`}#Ixm{iRm-zJV_kX4oT z#c}wBd&7E$g?tWob*#Hs4-bsQNKDt=7m056Dq^j9kokcNUPKaBl0#oQ6dfFiwqvba z3$A644J`h?%g&Np z9TqX}GE}6}d0`T~+HBv!f8EUaOu$jGt9RIR1DeswNp{72G5XdxER?cqO`_@F-S?-^ z%sxU-sSbx4!wH3_x3zThde02zb7JlML~EvsoaY2T76%tY-WzIduFn9$KO|WeNo7t~ z{8R58^IgfCFN=5kd%V~_PjPAu&JJ>N7U)K_wYs#5Cdcx^5^N5+g>u8k5|%ul**+^v zNN(8);FIk}rg-Tpam0`~D7xxS%>Fy4U!5i{$Hs}OTizm>@Y-eQPRrTOv`d!`%`CRt z+*+-qB>W_E4)V@h+YlJikfN^pFfW sAQl5+aUhleVo4yD+HU_>`e+jyqZA{96eF@@r#oz9k=V{SOXhzn0IMxwtN;K2 diff --git a/src/psale/db.c b/src/psale/db.c index bd2fc06..8092347 100644 --- a/src/psale/db.c +++ b/src/psale/db.c @@ -155,6 +155,12 @@ db_obtine_imagine_media_scalata(db_media_type tp, gint w, gint h) { case DB_IMG_INFO: vMem = db_obtine_img_info_aleatoare(TB_NUME_TABEL_MEDIA, &dimMem); break; + case DB_IMG_PAG_PREC: + vMem = db_obtine_blob(TB_NUME_TABEL_MEDIA, "vc_img_bt_pag_prec", &dimMem); + break; + case DB_IMG_PAG_URM: + vMem = db_obtine_blob(TB_NUME_TABEL_MEDIA, "vc_img_bt_pag_urm", &dimMem); + break; default: /* nu ar trebui să ajungem aici */ break; diff --git a/src/psale/db.h b/src/psale/db.h index d81be67..82fca6c 100644 --- a/src/psale/db.h +++ b/src/psale/db.h @@ -18,7 +18,9 @@ typedef enum { DB_IMG_SALVEAZA_COD, DB_IMG_TRIMITE_LA_ALE, DB_IMG_LICENTA, - DB_IMG_INFO + DB_IMG_INFO, + DB_IMG_PAG_PREC, + DB_IMG_PAG_URM } db_media_type; extern int diff --git a/src/psale/fprin.c b/src/psale/fprin.c index 15c15a3..51a36d5 100644 --- a/src/psale/fprin.c +++ b/src/psale/fprin.c @@ -10,6 +10,7 @@ #include "db.h" #include "al.h" +#include "vc.h" #include "finfo.h" #include "fcod.h" #include "fprin.h" @@ -21,6 +22,7 @@ static gboolean estePlacutaConectata; static gboolean dlgCodForteazaActualizConex; +static VizualizatorCartulie *vizAle; static GSList *listaDlgCod = NULL; static void @@ -93,6 +95,20 @@ cmbxCodCarte_selectat(GtkComboBox *widget, gpointer user_data) { } } +static void +btCartulie_click(GtkWidget *widget, GtkWindow *fereastraParinte) { + if(NULL == vizAle) { + vizAle = vc_initializeaza(); + + if(NULL != vizAle) { + vc_sari_la_pagina(vizAle, 0); + gtk_widget_show_all(vizAle->frm); + } + } else { + gtk_widget_show(GTK_WIDGET(vizAle->frm)); + } +} + static void btInfo_click(GtkWidget *widget, gpointer data) { GtkWidget *dlgInfo = initializeaza_formular_info(); @@ -178,6 +194,7 @@ fp_initializeaza_formular_principal() { GtkWidget *imgLogo = NULL; GtkWidget *cmbxCodNou = NULL; GtkWidget *cmbxCodCarte = NULL; + GtkWidget *btCartulie = NULL; GtkWidget *btInfo = NULL; GtkWidget *btIesire = NULL; @@ -223,6 +240,13 @@ fp_initializeaza_formular_principal() { g_signal_connect(cmbxCodCarte, "changed", G_CALLBACK(cmbxCodCarte_selectat), NULL); gtk_container_add(GTK_CONTAINER(cadruFormPrincipal), cmbxCodCarte); + /* inițializăm butonul de citire a cărțuliei */ + btCartulie = gtk_button_new_with_label("Vizitează cărțulia"); + gtk_button_set_relief(GTK_BUTTON(btCartulie), GTK_RELIEF_HALF); + gtk_button_set_focus_on_click(GTK_BUTTON(btCartulie), FALSE); + g_signal_connect(btCartulie, "clicked", G_CALLBACK(btCartulie_click), (gpointer)frm); + gtk_container_add(GTK_CONTAINER(cadruFormPrincipal), btCartulie); + /* inițializăm butonul de informații */ btInfo = gtk_button_new_with_label("Ce avem aici?"); gtk_button_set_relief(GTK_BUTTON(btInfo), GTK_RELIEF_NONE); diff --git a/src/psale/media/bt_icoana_cartulie_pag_precedenta.png b/src/psale/media/bt_icoana_cartulie_pag_precedenta.png new file mode 100644 index 0000000000000000000000000000000000000000..63e63c27a20c807dddbf31857c9b2847d4c96f82 GIT binary patch literal 863 zcmV-l1EBngP)L(*5it3Gl;o zT3=sVgXaqi&}y})Po5M35&Rtnk3=G(!y+&d6Lx|}qfxji7Tew#lLv!df|qXZKviq- z0+-;S(SXBLssK{AtF3QI0)~(f@vSWddkn8xK*7yyHfvJ5ySq29uYU`8X@x?;OyW3$ zGDac-#B$io%jF7GR2AQ2Vv3_um!2*yM&Zle9(>;2g?v5_KhMu$Cm!!nf{l{BQc z6pJM>-uqY#l2}KaB%B0z(h(|GeE*SvS zbq(IGtO#_sR-1tAR6wR+7@N)O16D>Vagdg4fUH=jo=$gbgefYp0kh zxm*rHAq7I=kZ`eIh-?rU;kajPU@5L5{(OwbH%~7v1PMjv5Kt zI7m=lD++g=f^INuGwMr%q~n|qme>PmLiRo}Y%ievTtaL(_X12I(`YmV9-2+_DJ_-B zP|%lyc0*eUs@QGx2_-z1F*csR6mCc9kVtHAZ~izt^Sx2IJrNCC4wC(qWj;S1coG4d p#H^!)8>tH7@YDbR002ovPDHLkV1gvQc)kDt literal 0 HcmV?d00001 diff --git a/src/psale/media/bt_icoana_cartulie_pag_urmatoare.png b/src/psale/media/bt_icoana_cartulie_pag_urmatoare.png new file mode 100644 index 0000000000000000000000000000000000000000..7022515f5079bbdd6cf72a7c6221f55cc6bbbf9a GIT binary patch literal 832 zcmV-G1Hb%k7RCwCtS9@;~K@gwaJr1zYq}C8f zjEPC(XP`8FsehVSiKem9PiHNC00q*-Pk?DZg^6u>DA*#8-j%>PyWG*^&EgsV=p>UI zdp9$`c`w8;4EUc!?mYl-0Dzh~IWbb13|FMe3R4Gsm}|9Kuo{U#;`msX1>pn$SG(PY zhl`6435Ve*nUn(I1OVUwI0b`2Sdj$b2mq^!O64+yLLn&-%D8uj@pzmu_PWgr)hbpp zXua8NipN^50hF>H5bvT=+?E>~W7E2b3MMH+p&o2aDUsuHMTrOuIh_T%v<^Ul* zZn521?C8bD#v7i~-Mu~du(Jafx%`0h1ImORf=;!;@AJX@ydU!UJY-K#VN@jgYd{!( zzP>Ju|GK&YLOY)@3@xSu6h#@y{5@k-Jl7iys8(weYl8NKeScqg&V_!KO5pW+yIwO! zgmOyBRIDfr8d?MEqCOUc1we@%9Hd@uZgxHQVFI|^+p#&ybpxc z1zuHEUj+gI_=Gv97pG^AbU-XGLo$`pqgz{|CM*D+w%H9I zvEcgYM%PdQgBk6M7S=Q!9$-p&gw4*IvjZSjpI53?A;7&gOkt}AW?y&!ZncxnLZM(q z(lvAtG3v;0>|GYB3*0VMwB%Q8$+yvH7>}Dn0r28+l2kO#+tM}<*6{cexjq~KCC+*7 za*5f{XZ#!T4{InXwlUUe3q(81C8b}6>*1X<&Ug<1YUZ8`&O$9*$<|s{7!!py$+#VW z@w-yVCe!H^1CYT*etdp{{Aj|89-8XIMB)n?>K^2CImn)! zO*C$gzzyKuO`^N`*Zq7fB^sybEX9JP)pfA^ew&hPg* zzwTP-nBrJwUY*bUK|}T}=%G5W@4}1qUD+9XDP790*{qsS%{*ivUoh z#XbQ5u~%0!{yl&Y#WjF5J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_la_pag.png b/src/psale/media/bt_icoana_cartulie_sari_la_pag.png new file mode 100644 index 0000000000000000000000000000000000000000..f3fc53f207c3a6f7dd7ca5f141bf98564872804c GIT binary patch literal 733 zcmV<30wVp1P)Qj_c48=z2J;0x;GFV2nME#YjYwu!+*ydad>V0L2pnu7yG}#MTUe z_-sBNCy`(f6O$7`}jb5CKWHvhR|@kOTPU`wExsY%@c z2tfX)M@t~@#8nv`E<^1@fZ9BH_di3!tC1uA22#(6%K$MeO)N>0V7t6 z_(BALH^mYkaM>~-9H3+%S1R)Xj=?@d=0Lvuo)571Ul0sX>%ey9BOhS9Xf~u07CwC9 z11_0+4XK3hcK7%I>-io-3Q_U%J|AE?*DW3ZtDv-3Zue^qoCr2%vKCy$SdWx}ZuhhEnbM P00000NkvXXu0mjf6%azE literal 0 HcmV?d00001 diff --git a/src/psale/vc.c b/src/psale/vc.c new file mode 100644 index 0000000..278c561 --- /dev/null +++ b/src/psale/vc.c @@ -0,0 +1,285 @@ +#include +#include +#include + +#include +#include + +#include "db.h" +#include "vc.h" + +static void +reseteazaIndicatorSoricel(VizualizatorCartulie *vc) { + gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(vc->frm)), gdk_cursor_new(GDK_ARROW)); +} + +static void +vc_destroy_frm(GtkWidget *window, gpointer data) { + gtk_widget_hide(window); +} + +static gboolean +vc_delete_event_frm(GtkWidget *window, GdkEvent *event, gpointer data) { + gtk_widget_hide(window); + return TRUE; +} + +static gboolean +pdfviz_mouse_click_event(GtkWidget *widget, GdkEventButton *e, VizualizatorCartulie *vc) { + switch(e->button) { + case 1: /* butonul din stânga a șoricelului a fost apăsat */ + if(NULL != vc->actiune_salt_proxim) { + switch(vc->actiune_salt_proxim->type) { + case POPPLER_ACTION_GOTO_DEST: + vc_sari_la_pagina(vc, vc->actiune_salt_proxim->goto_dest.dest->page_num - 1); + reseteazaIndicatorSoricel(vc); + break; + default: + break; + } + + vc->actiune_salt_proxim = NULL; + } + break; + } + + return TRUE; +} + +static gboolean +pdfviz_mouse_misc_event(GtkWidget *widget, GdkEventMotion *e, VizualizatorCartulie *vc) { + GList *l = NULL; + gboolean actiuneGasita = FALSE; + PopplerLinkMapping *lmapping = NULL; + PopplerAction *action = NULL; + gint x1Rendat, y1Rendat; + gint x2Rendat, y2Rendat; + + if(NULL != vc && NULL != vc->salturi_curente) { + for (l = vc->salturi_curente; l && actiuneGasita == FALSE; l = g_list_next(l)) { + lmapping = (PopplerLinkMapping *)l->data; + action = poppler_action_copy(lmapping->action); + x1Rendat = vc->x_start_rendare + lmapping->area.x1 * vc->x_pag_scale; + x2Rendat = vc->x_start_rendare + lmapping->area.x2 * vc->x_pag_scale; + /* "pag_height - y[1,2]" este un artificiu tare ciudat, dar necesar dacă dorim ca coordonatele să fie bune */ + y1Rendat = vc->y_start_rendare + (vc->pag_height - lmapping->area.y1) * vc->y_pag_scale; + y2Rendat = vc->y_start_rendare + (vc->pag_height - lmapping->area.y2) * vc->y_pag_scale; + + switch(action->type) { + case POPPLER_ACTION_GOTO_DEST: + if(e->x >= x1Rendat && e->y <= y1Rendat && + e->x <= x2Rendat && e->y >= y2Rendat && + vc->actiune_salt_proxim != action) { + vc->actiune_salt_proxim = action; + gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(vc->frm)), gdk_cursor_new(GDK_HAND2)); + actiuneGasita = TRUE; + } + break; + default: + break; + } + } + + if(actiuneGasita == FALSE && NULL != vc->actiune_salt_proxim) { + /* regiunea prosimă a fost părăsită, resetăm cursorul șoricelului */ + vc->actiune_salt_proxim = NULL; + reseteazaIndicatorSoricel(vc); + } + } + + return TRUE; +} + +static gboolean +pdfviz_vscrol_modif_event(GtkWidget *widget, GdkEventScroll *e, VizualizatorCartulie *vc) { + gdouble pozCurentaVScrol = gtk_adjustment_get_value(vc->pdfScrolBVertical); + gdouble dimPagina = gtk_adjustment_get_page_size(vc->pdfScrolBVertical); + gdouble inaltimePdfReala = vc->x_pag_scale * vc->pag_height; + gdouble navIncrement = (inaltimePdfReala - dimPagina) / SCROLURI_PER_PAG; + + if((e->state & GDK_CONTROL_MASK) != 0) { + /* "CTRL" a fost apasat deci se dorește o scalare a documentului */ + switch(e->direction) { + case GDK_SCROLL_UP: + vc->x_pag_scale += INCREMENT_MARIRE; + vc->y_pag_scale += INCREMENT_MARIRE; + break; + case GDK_SCROLL_DOWN: + vc->x_pag_scale -= INCREMENT_MARIRE; + vc->y_pag_scale -= INCREMENT_MARIRE; + break; + default: + break; + } + /* redesenează pagina */ + vc_sari_la_pagina(vc, vc->nr_pag_curenta); + } else { + switch(e->direction) { + case GDK_SCROLL_UP: + if(pozCurentaVScrol < 1e-7) { + if(vc->nr_pag_curenta != 0) { + vc_sari_la_pagina(vc, vc->nr_pag_curenta - 1); + gtk_adjustment_set_value(vc->pdfScrolBVertical, inaltimePdfReala - dimPagina); + } + } else { + gtk_adjustment_set_value(vc->pdfScrolBVertical, pozCurentaVScrol - navIncrement); + } + break; + case GDK_SCROLL_DOWN: + if(dimPagina + pozCurentaVScrol >= inaltimePdfReala) { + vc_sari_la_pagina(vc, vc->nr_pag_curenta + 1); + gtk_adjustment_set_value(vc->pdfScrolBVertical, 0); + } else { + gtk_adjustment_set_value(vc->pdfScrolBVertical, pozCurentaVScrol + navIncrement); + } + break; + default: + break; + } + gtk_widget_queue_draw(widget); + } + + return TRUE; +} + +static void +pdfviz_expose_event(GtkWidget *widget, GdkEventExpose *event, VizualizatorCartulie *vc) { + gint w, h; + cairo_t *cr = NULL; + + gtk_window_get_size(GTK_WINDOW(vc->frm), &w, &h); + gdk_window_clear(vc->pdfviz->window); + cr = gdk_cairo_create(vc->pdfviz->window); + + vc->x_start_rendare = (w - vc->pag_width * vc->x_pag_scale) / 2; + vc->y_start_rendare = (h - vc->pag_height * vc->y_pag_scale) / 2; + + if(vc->x_start_rendare < 0) vc->x_start_rendare = 0; + if(vc->y_start_rendare < 0) vc->y_start_rendare = 0; + + cairo_set_source_surface(cr, vc->suprafataPag, vc->x_start_rendare, vc->y_start_rendare); + cairo_paint(cr); + cairo_destroy(cr); +} + +static void +btPrecPag_clicked(GtkToolItem *tooleditcut, VizualizatorCartulie *vc) { + vc_sari_la_pagina(vc, vc->nr_pag_curenta - 1); + gtk_adjustment_set_value(vc->pdfScrolBVertical, 0); +} + +static void +btUrmPag_clicked(GtkToolItem *tooleditcopy, VizualizatorCartulie *vc) { + vc_sari_la_pagina(vc, vc->nr_pag_curenta + 1); + gtk_adjustment_set_value(vc->pdfScrolBVertical, 0); +} + +static void +btCuprins_clicked(GtkToolItem *tooleditpaste, VizualizatorCartulie *vc) { + vc_sari_la_pagina(vc, PAGINA_CUPRINS); +} + +VizualizatorCartulie * +vc_initializeaza() { + VizualizatorCartulie *deRet = NULL; + GtkWidget *frmVbox = NULL; + GtkWidget *pdfHVbox = NULL; + GtkWidget *cadruPdfViz = NULL; + GtkWidget *btPrecPag = NULL; + GtkWidget *btUrmPag = NULL; + GtkWidget *btCuprins = NULL; + + /* inițializăm structura principală a vizualizatorului */ + deRet = g_new(VizualizatorCartulie, 1); + deRet->doc = poppler_document_new_from_file(g_file_get_uri(g_file_new_for_commandline_arg("./cartulie_fis_test.pdf")), NULL, NULL); + if(NULL == deRet->doc) { + g_free(deRet); + return NULL; + } + deRet->nr_pag_totale = poppler_document_get_n_pages(deRet->doc); + + /* inițializează formularul principal */ + deRet->frm = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(deRet->frm), "~electro~ cărțulia"); + gtk_window_set_default_size(GTK_WINDOW(deRet->frm), 800, 600); + gtk_window_maximize(GTK_WINDOW(deRet->frm)); + + frmVbox = gtk_vbox_new(FALSE, 0); + gtk_container_add(GTK_CONTAINER(deRet->frm), frmVbox); + + btPrecPag = gtk_button_new(); + gtk_button_set_relief(GTK_BUTTON(btPrecPag), GTK_RELIEF_NONE); + gtk_button_set_focus_on_click(GTK_BUTTON(btPrecPag), FALSE); + GdkPixbuf *imgPagPrecPixBuf = db_obtine_imagine_media_scalata(DB_IMG_PAG_PREC, 28, 28); + GtkWidget *imgPagPrec = gtk_image_new_from_pixbuf(imgPagPrecPixBuf); + gtk_button_set_image(GTK_BUTTON(btPrecPag), imgPagPrec); + + btUrmPag = gtk_button_new(); + gtk_button_set_relief(GTK_BUTTON(btUrmPag), GTK_RELIEF_NONE); + gtk_button_set_focus_on_click(GTK_BUTTON(btUrmPag), FALSE); + GdkPixbuf *imgPagUrmPixBuf = db_obtine_imagine_media_scalata(DB_IMG_PAG_URM, 28, 28); + GtkWidget *imgPagUrm = gtk_image_new_from_pixbuf(imgPagUrmPixBuf); + gtk_button_set_image(GTK_BUTTON(btUrmPag), imgPagUrm); + + btCuprins = gtk_button_new_with_label("C"); + + pdfHVbox = gtk_hbox_new(FALSE, 0); + cadruPdfViz = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(cadruPdfViz), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + deRet->pdfScrolBVertical = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(cadruPdfViz)); + deRet->pdfviz = gtk_drawing_area_new(); + gtk_widget_add_events(deRet->pdfviz, GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK); + gtk_box_pack_start(GTK_BOX(pdfHVbox), btPrecPag, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(pdfHVbox), deRet->pdfviz, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(pdfHVbox), btUrmPag, FALSE, FALSE, 0); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(cadruPdfViz), pdfHVbox); + gtk_box_pack_start(GTK_BOX(frmVbox), cadruPdfViz, TRUE, TRUE, 0); + + /* atașăm evenimentele */ + g_signal_connect(G_OBJECT(deRet->frm), "destroy", G_CALLBACK(vc_destroy_frm), NULL); + g_signal_connect(G_OBJECT(deRet->frm), "delete_event", G_CALLBACK(vc_delete_event_frm), NULL); + g_signal_connect(G_OBJECT(btPrecPag), "clicked", G_CALLBACK(btPrecPag_clicked), (gpointer)deRet); + g_signal_connect(G_OBJECT(btUrmPag), "clicked", G_CALLBACK(btUrmPag_clicked), (gpointer)deRet); + g_signal_connect(G_OBJECT(btCuprins), "clicked", G_CALLBACK(btCuprins_clicked), (gpointer)deRet); + g_signal_connect(G_OBJECT(deRet->pdfviz), "scroll-event", G_CALLBACK(pdfviz_vscrol_modif_event), (gpointer)deRet); + g_signal_connect(G_OBJECT(deRet->pdfviz), "motion-notify-event", G_CALLBACK(pdfviz_mouse_misc_event), (gpointer)deRet); + g_signal_connect(G_OBJECT(deRet->pdfviz), "button-press-event", G_CALLBACK(pdfviz_mouse_click_event), (gpointer)deRet); + g_signal_connect(G_OBJECT(deRet->pdfviz), "expose_event", G_CALLBACK(pdfviz_expose_event), (gpointer)deRet); + + /* finalizăm inițializarea structurii principale */ + deRet->suprafataPag = NULL; + deRet->salturi_curente = NULL; + deRet->actiune_salt_proxim = NULL; + deRet->x_pag_scale = deRet->y_pag_scale = 1.3; + + return deRet; +} + +void +vc_sari_la_pagina(VizualizatorCartulie *vc, int nrPag) { + PopplerPage *ppage = NULL; + int w, h; + cairo_t *cr = NULL; + + /* validăm parametrii */ + if(nrPag < 0 || nrPag > vc->nr_pag_totale) return; + else vc->nr_pag_curenta = nrPag; + + /* navigăm la pagina dorită */ + ppage = poppler_document_get_page(vc->doc, nrPag); + poppler_page_get_size(ppage, &vc->pag_width, &vc->pag_height); + w = (int)ceil(vc->pag_width) * vc->x_pag_scale; + h = (int)ceil(vc->pag_height) * vc->y_pag_scale; + if(NULL != vc->suprafataPag) cairo_surface_destroy(vc->suprafataPag); + vc->suprafataPag = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h); + cr = cairo_create(vc->suprafataPag); + cairo_scale(cr, vc->x_pag_scale, vc->y_pag_scale); + poppler_page_render(ppage, cr); + cairo_destroy(cr); + gtk_widget_set_size_request(vc->pdfviz, w, h); + gtk_widget_queue_draw(vc->pdfviz); + + if(NULL != vc->salturi_curente) poppler_page_free_link_mapping(vc->salturi_curente); + vc->salturi_curente = poppler_page_get_link_mapping(ppage); +} diff --git a/src/psale/vc.h b/src/psale/vc.h new file mode 100644 index 0000000..1d67a65 --- /dev/null +++ b/src/psale/vc.h @@ -0,0 +1,37 @@ +#ifndef _VC_H_ +#define _VC_H_ + +#include +#include + +#define SCROLURI_PER_PAG 20 +#define INCREMENT_MARIRE 0.05 +#define PAGINA_CUPRINS 5 + +typedef struct { + GtkWidget *frm; + GtkWidget *pdfviz; + GtkAdjustment *pdfScrolBVertical; + PopplerDocument *doc; + cairo_surface_t *suprafataPag; + + GList *salturi_curente; + PopplerAction *actiune_salt_proxim; + + gint x_start_rendare; + gint y_start_rendare; + double x_pag_scale; + double y_pag_scale; + double pag_height; + double pag_width; + gint nr_pag_curenta; + gint nr_pag_totale; +} VizualizatorCartulie; + +extern VizualizatorCartulie * +vc_initializeaza(); + +extern void +vc_sari_la_pagina(VizualizatorCartulie *vc, int nrPag); + +#endif