r9500 MarkieB - /branches/MarkieB/windows/windows/localhistory.c
by netsurf@semichrome.net
Author: MarkieB
Date: Sat Aug 29 13:47:46 2009
New Revision: 9500
URL: http://source.netsurf-browser.org?rev=9500&view=rev
Log:
redraw local history
Modified:
branches/MarkieB/windows/windows/localhistory.c
Modified: branches/MarkieB/windows/windows/localhistory.c
URL: http://source.netsurf-browser.org/branches/MarkieB/windows/windows/localh...
==============================================================================
--- branches/MarkieB/windows/windows/localhistory.c (original)
+++ branches/MarkieB/windows/windows/localhistory.c Sat Aug 29 13:47:46 2009
@@ -108,9 +108,9 @@
RegisterClassEx(&we);
LOG(("creating local history window for hInstance %p", hinstance));
hwnd = CreateWindow(localhistorywindowclassname,
- "NetSurf History", WS_OVERLAPPEDWINDOW /*WS_THICKFRAME | WS_HSCROLL |
+ "NetSurf History",WS_THICKFRAME | WS_HSCROLL |
WS_VSCROLL | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |
- CS_DBLCLKS */ , r.left + margin/2, r.top + margin/2,
+ CS_DBLCLKS, r.left + margin/2, r.top + margin/2,
localhistory.guiwidth, localhistory.guiheight, NULL,
NULL, hinstance, NULL);
LOG(("gui_window %p width %d height %d hwnd %p", w,
@@ -159,7 +159,8 @@
voffset = gui_window_voffset(w);
GetWindowRect(hwnd, &r);
GetWindowRect(current_hwnd, &rmain);
- gui_window_redraw(w, MIN(r.top - rmain.top - voffset, 0),
+ gui_window_redraw(w,
+ MIN(r.top - rmain.top - voffset, 0),
MIN(r.left - rmain.left, 0),
gui_window_height(w) -
MIN(rmain.bottom - r.bottom, 0),
@@ -236,12 +237,18 @@
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
GetScrollInfo(hwnd, SB_VERT, &si);
if (si.nPos != mem) {
+ RECT r;
HDC hdc = GetDC(hwnd);
ScrollWindowEx(hwnd, 0, mem - si.nPos, NULL, NULL, NULL,
- NULL, 0);
+ &r, 0);
localhistory.vscroll += si.nPos - mem;
-/* history_redraw_rectangle();
-*/
+ history_redraw_rectangle(bw->history,
+ r.left + localhistory.hscroll,
+ r.top + localhistory.vscroll,
+ r.right + localhistory.hscroll,
+ r.bottom + localhistory.vscroll,
+ r.left, r.top);
+
ReleaseDC(hwnd, hdc);
}
break;
@@ -282,20 +289,32 @@
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);
GetScrollInfo(hwnd, SB_HORZ, &si);
if (si.nPos != mem) {
+ RECT r;
ScrollWindowEx(hwnd, mem - si.nPos, 0, NULL, NULL, NULL,
- NULL, 0);
+ &r, 0);
localhistory.hscroll += si.nPos - mem;
-/* history_redraw_rectangle();
-*/
+ if (bw == NULL)
+ break;
+ history_redraw_rectangle(bw->history,
+ r.left + localhistory.hscroll,
+ r.top + localhistory.vscroll,
+ r.right + localhistory.hscroll,
+ r.bottom + localhistory.vscroll,
+ r.left, r.top);
}
break;
}
case WM_PAINT: {
PAINTSTRUCT ps;
BeginPaint(hwnd, &ps);
-/* if (bw != NULL)
- history_redraw_rectangle(bw->history);
-*/ EndPaint(hwnd, &ps);
+ if (bw != NULL)
+ history_redraw_rectangle(bw->history,
+ localhistory.hscroll,
+ localhistory.vscroll,
+ localhistory.hscroll + localhistory.guiwidth,
+ localhistory.vscroll + localhistory.guiheight,
+ 0, 0);
+ EndPaint(hwnd, &ps);
return DefWindowProc(hwnd, msg, wparam, lparam);
break;
}
13 years, 9 months
r9497 chris_y - in /trunk/netsurf/amiga: history_local.c history_local.h
by netsurf@semichrome.net
Author: chris_y
Date: Sat Aug 29 09:41:24 2009
New Revision: 9497
URL: http://source.netsurf-browser.org?rev=9497&view=rev
Log:
Give local history own off-screen rendering bitmap
Modified:
trunk/netsurf/amiga/history_local.c
trunk/netsurf/amiga/history_local.h
Modified: trunk/netsurf/amiga/history_local.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/history_local.c?rev...
==============================================================================
--- trunk/netsurf/amiga/history_local.c (original)
+++ trunk/netsurf/amiga/history_local.c Sat Aug 29 09:41:24 2009
@@ -17,7 +17,7 @@
*/
/** \file
- * Browser history window (RISC OS implementation).
+ * Browser history window (AmigaOS implementation).
*
* There is only one history window, not one per browser window.
*/
@@ -82,6 +82,8 @@
{
hwindow = AllocVec(sizeof(struct history_window),MEMF_CLEAR | MEMF_PRIVATE);
+ ami_init_layers(&hwindow->gg, 0, 0);
+
hwindow->bw = bw;
history_size(history, &width, &height);
@@ -98,7 +100,7 @@
WA_SizeGadget, TRUE,
WA_CustomScreen,scrn,
WA_InnerWidth,width,
- WA_InnerHeight,height,
+ WA_InnerHeight,height + 10,
WINDOW_SharedPort,sport,
WINDOW_UserData,hwindow,
WINDOW_IconifyGadget, FALSE,
@@ -158,19 +160,18 @@
GetAttr(SCROLLER_Top,hw->objects[OID_HSCROLL],(ULONG *)&xs);
GetAttr(SCROLLER_Top,hw->objects[OID_VSCROLL],(ULONG *)&ys);
+ glob = &hw->gg;
ami_clg(0xffffff);
-// RefreshGadgets(hw->gadgets[GID_MAIN],hw->win,NULL);
-// currp = hw->win->RPort;
history_redraw_rectangle(history_current, xs, ys,
bbox->Width + xs, bbox->Height + ys, 0, 0);
-// currp = &glob.rp;
-
- ami_clearclipreg(&browserglob);
+ glob = &browserglob;
+
+ ami_clearclipreg(&hw->gg);
ami_history_update_extent(hw);
- BltBitMapRastPort(browserglob.bm, 0, 0, hw->win->RPort,
+ BltBitMapRastPort(hw->gg.bm, 0, 0, hw->win->RPort,
bbox->Left, bbox->Top, bbox->Width, bbox->Height, 0x0C0);
}
@@ -216,6 +217,7 @@
void ami_history_close(struct history_window *hw)
{
+ ami_free_layers(&hwindow->gg);
hw->bw->window->hw = NULL;
DisposeObject(hw->objects[OID_MAIN]);
DelObject(hw->node);
Modified: trunk/netsurf/amiga/history_local.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/history_local.h?rev...
==============================================================================
--- trunk/netsurf/amiga/history_local.h (original)
+++ trunk/netsurf/amiga/history_local.h Sat Aug 29 09:41:24 2009
@@ -31,6 +31,7 @@
struct browser_window *bw;
ULONG pad[4];
struct Hook scrollerhook;
+ struct gui_globals gg;
};
void ami_history_open(struct browser_window *bw, struct history *history);
13 years, 9 months
r9496 chris_y - in /trunk/netsurf/amiga: font.c gui.c plotters.c plotters.h print.c
by netsurf@semichrome.net
Author: chris_y
Date: Sat Aug 29 09:24:47 2009
New Revision: 9496
URL: http://source.netsurf-browser.org?rev=9496&view=rev
Log:
Font scaling - scaling now works for printing, need 2nd attempt at implementing it for
browsing.
Modified:
trunk/netsurf/amiga/font.c
trunk/netsurf/amiga/gui.c
trunk/netsurf/amiga/plotters.c
trunk/netsurf/amiga/plotters.h
trunk/netsurf/amiga/print.c
Modified: trunk/netsurf/amiga/font.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/font.c?rev=9496&r1=...
==============================================================================
--- trunk/netsurf/amiga/font.c (original)
+++ trunk/netsurf/amiga/font.c Sat Aug 29 09:24:47 2009
@@ -269,7 +269,7 @@
}
/* Scale to 16.16 fixed point */
- ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE);
+ ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE) * glob->scale;
if(ESetInfo(&ofont->olf_EEngine,
OT_DeviceDPI,(72<<16) | 72,
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=9496&r1=9...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Sat Aug 29 09:24:47 2009
@@ -2403,7 +2403,9 @@
if((x1-x0)+(xoffset+x0-sx)>(width)) x1 = (width-(x0-sx)+x0);
if((y1-y0)+(yoffset+y0-sy)>(height)) y1 = (height-(y0-sy)+y0);
- content_redraw(c,
+ glob->scale = g->shared->bw->scale;
+
+ content_redraw(c,
-sx,-sy,width-sx,height-sy,
floorf((x0 *
g->shared->bw->scale)-sx),
@@ -2541,6 +2543,7 @@
else
{
ami_clg(0xffffff);
+ glob->scale = g->bw->scale;
if(c->type == CONTENT_HTML)
{
Modified: trunk/netsurf/amiga/plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/plotters.c?rev=9496...
==============================================================================
--- trunk/netsurf/amiga/plotters.c (original)
+++ trunk/netsurf/amiga/plotters.c Sat Aug 29 09:24:47 2009
@@ -116,6 +116,7 @@
if(!width) width = scrn->Width;
if(!height) height = scrn->Width;
+ gg->scale = 1.0;
gg->layerinfo = NewLayerInfo();
gg->areabuf = AllocVec(100,MEMF_PRIVATE | MEMF_CLEAR);
gg->tmprasbuf = AllocVec(width*height,MEMF_PRIVATE | MEMF_CLEAR);
Modified: trunk/netsurf/amiga/plotters.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/plotters.h?rev=9496...
==============================================================================
--- trunk/netsurf/amiga/plotters.h (original)
+++ trunk/netsurf/amiga/plotters.h Sat Aug 29 09:24:47 2009
@@ -33,6 +33,7 @@
APTR areabuf;
APTR tmprasbuf;
struct Rectangle rect;
+ float scale;
#ifdef NS_AMIGA_CAIRO
cairo_surface_t *surface;
cairo_t *cr;
Modified: trunk/netsurf/amiga/print.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/print.c?rev=9496&r1...
==============================================================================
--- trunk/netsurf/amiga/print.c (original)
+++ trunk/netsurf/amiga/print.c Sat Aug 29 09:24:47 2009
@@ -141,6 +141,7 @@
ami_print_info.PED->ped_MaxXDots,
ami_print_info.PED->ped_MaxYDots);
+ ami_print_info.gg->scale = ps->scale;
ami_print_info.page = 0;
return true;
13 years, 9 months
r9495 chris_y - in /trunk/netsurf: !NetSurf/Resources/de/Messages !NetSurf/Resources/en/Messages !NetSurf/Resources/fr/Messages !NetSurf/Resources/it/Messages !NetSurf/Resources/nl/Messages amiga/gui.c amiga/print.c amiga/print.h
by netsurf@semichrome.net
Author: chris_y
Date: Sat Aug 29 09:00:57 2009
New Revision: 9495
URL: http://source.netsurf-browser.org?rev=9495&view=rev
Log:
Changes for asynchronous printing. Currently disabled, as NetSurf window doesn't
redraw while printing in progress
Modified:
trunk/netsurf/!NetSurf/Resources/de/Messages
trunk/netsurf/!NetSurf/Resources/en/Messages
trunk/netsurf/!NetSurf/Resources/fr/Messages
trunk/netsurf/!NetSurf/Resources/it/Messages
trunk/netsurf/!NetSurf/Resources/nl/Messages
trunk/netsurf/amiga/gui.c
trunk/netsurf/amiga/print.c
trunk/netsurf/amiga/print.h
Modified: trunk/netsurf/!NetSurf/Resources/de/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/de/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/de/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/de/Messages Sat Aug 29 09:00:57 2009
@@ -591,7 +591,7 @@
AWNotSeen:Please locate the AWViewer application and try again.
# Error messages for Amiga version only
-NoMode:No matching mode in screens database
+CompError:Unable to open
# Queries
# =======
Modified: trunk/netsurf/!NetSurf/Resources/en/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/en/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/en/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/en/Messages Sat Aug 29 09:00:57 2009
@@ -596,7 +596,7 @@
EncNotRec:Encoding type not recognised.
# Error messages for Amiga version only
-NoMode:No matching mode in screens database
+CompError:Unable to open
# Queries
# =======
Modified: trunk/netsurf/!NetSurf/Resources/fr/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/fr/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/fr/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/fr/Messages Sat Aug 29 09:00:57 2009
@@ -591,7 +591,7 @@
AWNotSeen:Localisez l'application AMViewer SVP puis réessayez.
# Error messages for Amiga version only
-NoMode:No matching mode in screens database
+CompError:Unable to open
# Queries
# =======
Modified: trunk/netsurf/!NetSurf/Resources/it/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/it/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/it/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/it/Messages Sat Aug 29 09:00:57 2009
@@ -598,7 +598,7 @@
EncNotRec:Tipo di codifica sconosciuta.
# Error messages for Amiga version only
-NoMode:Questa modalità non coincide nel database degli schermi
+CompError:Unable to open
# Queries
# =======
Modified: trunk/netsurf/!NetSurf/Resources/nl/Messages
URL: http://source.netsurf-browser.org/trunk/netsurf/%21NetSurf/Resources/nl/M...
==============================================================================
--- trunk/netsurf/!NetSurf/Resources/nl/Messages (original)
+++ trunk/netsurf/!NetSurf/Resources/nl/Messages Sat Aug 29 09:00:57 2009
@@ -591,7 +591,7 @@
AWNotSeen:Please locate the AWViewer application and try again.
# Error messages for Amiga version only
-NoMode:No matching mode in screens database
+CompError:Unable to open
# Queries
# =======
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=9495&r1=9...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Sat Aug 29 09:00:57 2009
@@ -261,6 +261,8 @@
if(!(sport = AllocSysObjectTags(ASOT_PORT,
ASO_NoTrack,FALSE,
TAG_DONE))) die(messages_get("NoMemory"));
+
+ ami_print_init();
if(PopupMenuBase = OpenLibrary("popupmenu.class",0))
{
@@ -1406,9 +1408,11 @@
ULONG winsignal = 1L << sport->mp_SigBit;
ULONG appsig = 1L << appport->mp_SigBit;
ULONG schedulesig = 1L << msgport->mp_SigBit;
- ULONG signalmask = winsignal | appsig | schedulesig | rxsig;
ULONG signal;
struct Message *timermsg = NULL;
+ struct MsgPort *printmsgport = ami_print_get_msgport();
+ ULONG printsig = 1L << printmsgport->mp_SigBit;
+ ULONG signalmask = winsignal | appsig | schedulesig | rxsig | printsig;
signal = Wait(signalmask);
@@ -1423,6 +1427,11 @@
else if(signal & rxsig)
{
ami_arexx_handle();
+ }
+ else if(signal & printsig)
+ {
+ while(GetMsg(printmsgport)); //ReplyMsg
+ ami_print_cont();
}
else if(signal & schedulesig)
{
@@ -1582,6 +1591,7 @@
}
ami_clipboard_free();
+ ami_print_free();
FreeSysObject(ASOT_PORT,appport);
FreeSysObject(ASOT_PORT,sport);
@@ -2382,6 +2392,7 @@
yoffset=bbox->Top;
plot=amiplot;
+ glob = &browserglob;
if((y1<sy) || (y0>sy+height)) return;
if((x1<sx) || (x0>sx+width)) return;
@@ -2481,6 +2492,7 @@
xoffset=bbox->Left;
yoffset=bbox->Top;
plot = amiplot;
+ glob = &browserglob;
if(g->bw->reformat_pending)
{
Modified: trunk/netsurf/amiga/print.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/print.c?rev=9495&r1...
==============================================================================
--- trunk/netsurf/amiga/print.c (original)
+++ trunk/netsurf/amiga/print.c Sat Aug 29 09:00:57 2009
@@ -21,8 +21,8 @@
#include "render/font.h"
#include "amiga/gui.h"
#include "amiga/options.h"
+#include "amiga/print.h"
-#include <proto/exec.h>
#include <proto/Picasso96API.h>
#include <devices/printer.h>
#include <devices/prtbase.h>
@@ -46,18 +46,19 @@
struct PrinterData *PD;
struct PrinterExtendedData *PED;
struct MsgPort *msgport;
+ struct content *c;
+ struct print_settings *ps;
int page;
+ int pages;
};
struct ami_printer_info ami_print_info;
void ami_print(struct content *c)
{
- struct print_settings *ps;
+ double height, print_height;
- if(!(ami_print_info.msgport = AllocSysObjectTags(ASOT_PORT,
- ASO_NoTrack,FALSE,
- TAG_DONE))) return;
+ if(!ami_print_info.msgport) return;
if(!(ami_print_info.PReq =
(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
@@ -67,21 +68,67 @@
TAG_DONE))) return;
if(OpenDevice("printer.device", option_printer_unit,
- (struct IORequest *)ami_print_info.PReq, 0)) return;
+ (struct IORequest *)ami_print_info.PReq, 0))
+ {
+ warn_user("CompError","printer.device");
+ return;
+ }
ami_print_info.PD = (struct PrinterData *)ami_print_info.PReq->io_Device;
ami_print_info.PED = &ami_print_info.PD->pd_SegmentData->ps_PED;
- ps = print_make_settings(PRINT_DEFAULT, c->url, &nsfont);
- ps->page_width = ami_print_info.PED->ped_MaxXDots;
- ps->page_height = ami_print_info.PED->ped_MaxYDots;
- ps->scale = 1.0;
+ ami_print_info.ps = print_make_settings(PRINT_DEFAULT, c->url, &nsfont);
+ ami_print_info.ps->page_width = ami_print_info.PED->ped_MaxXDots;
+ ami_print_info.ps->page_height = ami_print_info.PED->ped_MaxYDots;
+ ami_print_info.ps->scale = 1.0;
- print_basic_run(c, &amiprinter, ps);
+ print_set_up(c, &amiprinter, ami_print_info.ps, &height);
- CloseDevice(ami_print_info.PReq);
- FreeSysObject(ASOT_IOREQUEST,ami_print_info.PReq);
+ height *= ami_print_info.ps->scale;
+ ami_print_info.pages = height / ami_print_info.ps->page_height;
+ ami_print_info.c = c;
+
+ while(ami_print_cont()); /* remove while() for async printing */
+}
+
+bool ami_print_cont(void)
+{
+ bool ret = false;
+
+ if(ami_print_info.page <= ami_print_info.pages)
+ {
+ glob = ami_print_info.gg;
+ print_draw_next_page(&amiprinter, ami_print_info.ps);
+ ami_print_dump();
+ glob = &browserglob;
+ ret = true;
+ }
+ else
+ {
+ print_cleanup(ami_print_info.c, &amiprinter, ami_print_info.ps);
+ ret = false;
+ }
+
+ return ret;
+}
+
+struct MsgPort *ami_print_init(void)
+{
+ ami_print_info.msgport = AllocSysObjectTags(ASOT_PORT,
+ ASO_NoTrack,FALSE,
+ TAG_DONE);
+
+ return ami_print_info.msgport;
+}
+
+void ami_print_free(void)
+{
FreeSysObject(ASOT_PORT,ami_print_info.msgport);
+}
+
+struct MsgPort *ami_print_get_msgport(void)
+{
+ return ami_print_info.msgport;
}
bool ami_print_begin(struct print_settings *ps)
@@ -94,7 +141,6 @@
ami_print_info.PED->ped_MaxXDots,
ami_print_info.PED->ped_MaxYDots);
- glob = ami_print_info.gg;
ami_print_info.page = 0;
return true;
@@ -102,20 +148,19 @@
bool ami_print_next_page(void)
{
- bool ret = true;
-
- if(ami_print_info.page > 0) ret = ami_print_dump();
ami_print_info.page++;
- return ret;
+ return true;
}
void ami_print_end(void)
{
- ami_print_dump();
ami_free_layers(ami_print_info.gg);
FreeVec(ami_print_info.gg);
glob = &browserglob;
+
+ CloseDevice(ami_print_info.PReq);
+ FreeSysObject(ASOT_IOREQUEST,ami_print_info.PReq);
}
bool ami_print_dump(void)
@@ -134,7 +179,7 @@
ami_print_info.PReq->io_DestRows = ami_print_info.PED->ped_MaxYDots;
ami_print_info.PReq->io_Special = 0;
- DoIO(ami_print_info.PReq);
+ DoIO(ami_print_info.PReq); /* SendIO for async printing */
return true;
}
Modified: trunk/netsurf/amiga/print.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/print.h?rev=9495&r1...
==============================================================================
--- trunk/netsurf/amiga/print.h (original)
+++ trunk/netsurf/amiga/print.h Sat Aug 29 09:00:57 2009
@@ -18,7 +18,13 @@
#ifndef AMIGA_PRINT_H
#define AMIGA_PRINT_H
+#include <proto/exec.h>
+
struct content;
void ami_print(struct content *c);
+bool ami_print_cont(void);
+struct MsgPort *ami_print_init(void);
+void ami_print_free(void);
+struct MsgPort *ami_print_get_msgport(void);
#endif
13 years, 9 months
r9494 struggleyb - in /branches/struggleyb/libdom-html: include/dom/html/ src/html/
by netsurf@semichrome.net
Author: struggleyb
Date: Sat Aug 29 08:20:40 2009
New Revision: 9494
URL: http://source.netsurf-browser.org?rev=9494&view=rev
Log:
1. Form association related methods;
2. Add dom_html_form_element.
Modified:
branches/struggleyb/libdom-html/include/dom/html/html_form_element.h
branches/struggleyb/libdom-html/src/html/html_element.c
branches/struggleyb/libdom-html/src/html/html_element.h
branches/struggleyb/libdom-html/src/html/html_form_element.c
branches/struggleyb/libdom-html/src/html/html_form_element.h
branches/struggleyb/libdom-html/src/html/html_isindex_element.c
branches/struggleyb/libdom-html/src/html/html_isindex_element.h
Modified: branches/struggleyb/libdom-html/include/dom/html/html_form_element.h
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/include...
==============================================================================
--- branches/struggleyb/libdom-html/include/dom/html/html_form_element.h (original)
+++ branches/struggleyb/libdom-html/include/dom/html/html_form_element.h Sat Aug 29 08:20:40 2009
@@ -2,6 +2,13 @@
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
- * Copyright 2009 Bo Yang <struggleyb.nku(a)gmail.com>
+ * Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
+#ifndef dom_html_form_element_h_
+#define dom_html_form_element_h_
+
+typedef struct dom_html_form_element dom_html_form_element;
+
+#endif
+
Modified: branches/struggleyb/libdom-html/src/html/html_element.c
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/htm...
==============================================================================
--- branches/struggleyb/libdom-html/src/html/html_element.c (original)
+++ branches/struggleyb/libdom-html/src/html/html_element.c Sat Aug 29 08:20:40 2009
@@ -13,6 +13,29 @@
#include "core/attr.h"
#include "core/document.h"
#include "utils/utils.h"
+
+dom_exception _dom_html_element_initialise(struct dom_document *doc,
+ struct dom_html_element *el, struct lwc_string_s *name,
+ struct lwc_string_s *namespace, struct lwc_string_s *prefix)
+{
+ dom_exception err;
+
+ err = _dom_element_initialise(doc, &el->base, name, namespace, prefix);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ el->form = NULL;
+ return err;
+}
+
+void _dom_html_element_finalise(struct dom_document *doc,
+ struct dom_html_element *ele)
+{
+ dom_node_unref(ele->form);
+ ele->form = NULL;
+
+ _dom_element_finalise(doc, &ele->base);
+}
/*------------------------------------------------------------------------*/
/* The protected virtual functions */
@@ -150,3 +173,31 @@
return err;
}
+/**
+ * Get the form element if this element is a form control
+ *
+ * \param ele The element object
+ * \param form The form object
+ */
+void _dom_html_element_get_form(dom_html_element *ele,
+ struct dom_html_form_element **form)
+{
+ *form = ele->form;
+ dom_node_ref(*form);
+}
+
+/**
+ * Set the form element if this element is a form control
+ *
+ * \param ele The element object
+ * \param form The form object
+ */
+void _dom_html_element_associate_form(dom_html_element *ele,
+ struct dom_html_form_element *form)
+{
+ /* Unref the form if there is any */
+ dom_node_unref(form);
+ ele->form = form;
+ dom_node_ref(form);
+}
+
Modified: branches/struggleyb/libdom-html/src/html/html_element.h
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/htm...
==============================================================================
--- branches/struggleyb/libdom-html/src/html/html_element.h (original)
+++ branches/struggleyb/libdom-html/src/html/html_element.h Sat Aug 29 08:20:40 2009
@@ -12,6 +12,8 @@
#include "core/element.h"
+struct dom_html_form_element;
+
/**
* The dom_html_element class
*
@@ -22,11 +24,18 @@
struct dom_html_element {
struct dom_element base;
/**< The base class */
+ struct dom_html_form_element *form;
+ /**< The form element which contains this element if
+ * this element is a form control
+ */
};
-#define _dom_html_element_initialise(d, e, n, ns, p) _dom_element_initialise(d,\
- &(e)->base, n, ns, p)
-#define _dom_html_element_finalise(d, e) _dom_element_finalise(d, &(e)->base)
+dom_exception _dom_html_element_initialise(struct dom_document *doc,
+ struct dom_html_element *el, struct lwc_string_s *name,
+ struct lwc_string_s *namespace, struct lwc_string_s *prefix);
+
+void _dom_html_element_finalise(struct dom_document *doc,
+ struct dom_html_element *ele);
/* The protected virtual functions */
void _dom_virtual_html_element_destroy(dom_node_internal *node);
@@ -40,7 +49,10 @@
const char *name, unsigned long len, bool *has);
dom_exception dom_html_element_set_bool_property(dom_html_element *ele,
const char *name, unsigned long len, bool has);
-
+void _dom_html_element_get_form(dom_html_element *ele,
+ struct dom_html_form_element **form);
+void _dom_html_element_associate_form(dom_html_element *ele,
+ struct dom_html_form_element *form);
#endif
Modified: branches/struggleyb/libdom-html/src/html/html_form_element.c
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/htm...
==============================================================================
--- branches/struggleyb/libdom-html/src/html/html_form_element.c (original)
+++ branches/struggleyb/libdom-html/src/html/html_form_element.c Sat Aug 29 08:20:40 2009
@@ -2,6 +2,136 @@
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
- * Copyright 2009 Bo Yang <struggleyb.nku(a)gmail.com>
+ * Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
+#include "html/html_form_element.h"
+
+#include "core/node.h"
+#include "core/document.h"
+#include "utils/utils.h"
+
+static struct dom_element_protected_vtable _protect_vtable = {
+ {
+ DOM_NODE_PROTECT_VTABLE_HTML_FORM_ELEMENT
+ },
+ DOM_HTML_FORM_ELEMENT_PROTECT_VTABLE
+};
+
+/**
+ * Create a dom_html_form_element object
+ *
+ * \param doc The document object
+ * \param ele The returned element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_form_element_create(struct dom_document *doc,
+ struct dom_html_form_element **ele)
+{
+ *ele = _dom_document_alloc(doc, NULL, sizeof(dom_html_form_element));
+ if (*ele == NULL)
+ return DOM_NO_MEM_ERR;
+
+ /* Set up vtables */
+ struct dom_node_internal *node = (struct dom_node_internal *) *ele;
+ node->base.vtable = &_dom_element_vtable;
+ node->vtable = &_protect_vtable;
+
+ return _dom_html_form_element_initialise(doc, *ele);
+}
+
+/**
+ * Initialise a dom_html_form_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_form_element object
+ * \return DOM_NO_ERR on success, appropriate dom_exception on failure.
+ */
+dom_exception _dom_html_form_element_initialise(struct dom_document *doc,
+ struct dom_html_form_element *ele)
+{
+ const char *str = "FORM";
+ lwc_string *name = NULL;
+ dom_exception err;
+
+ err = _dom_document_create_lwcstring(doc, (const uint8_t *) str, SLEN(str),
+ &name);
+ if (err != DOM_NO_ERR)
+ return err;
+
+ err = _dom_html_element_initialise(doc, &ele->base, name, NULL, NULL);
+ _dom_document_unref_lwcstring(doc, name);
+
+ return err;
+}
+
+/**
+ * Finalise a dom_html_form_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_form_element object
+ */
+void _dom_html_form_element_finalise(struct dom_document *doc,
+ struct dom_html_form_element *ele)
+{
+ _dom_html_element_finalise(doc, &ele->base);
+}
+
+/**
+ * Destroy a dom_html_form_element object
+ *
+ * \param doc The document object
+ * \param ele The dom_html_form_element object
+ */
+void _dom_html_form_element_destroy(struct dom_document *doc,
+ struct dom_html_form_element *ele)
+{
+ _dom_html_form_element_finalise(doc, ele);
+ _dom_document_alloc(doc, ele, 0);
+}
+
+/*------------------------------------------------------------------------*/
+/* The protected virtual functions */
+
+/* The virtual function used to parse attribute value, see src/core/element.c
+ * for detail */
+dom_exception _dom_html_form_element_parse_attribute(dom_element *ele,
+ struct dom_string *name, struct dom_string *value,
+ struct dom_string **parsed)
+{
+ UNUSED(ele);
+ UNUSED(name);
+
+ dom_string_ref(value);
+ *parsed = value;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual destroy function, see src/core/node.c for detail */
+void _dom_virtual_html_form_element_destroy(dom_node_internal *node)
+{
+ struct dom_document *doc = dom_node_get_owner(node);
+ _dom_html_form_element_destroy(doc, (struct dom_html_form_element *) node);
+}
+
+/* The virtual allocation function, see src/core/node.c for detail */
+dom_exception _dom_html_form_element_alloc(struct dom_document *doc,
+ struct dom_node_internal *n, struct dom_node_internal **ret)
+{
+ UNUSED(n);
+
+ *ret = _dom_document_alloc(doc, NULL, sizeof(dom_html_form_element));
+ if (*ret == NULL)
+ return DOM_NO_MEM_ERR;
+
+ return DOM_NO_ERR;
+}
+
+/* The virtual copy function, see src/core/node.c for detail */
+dom_exception _dom_html_form_element_copy(struct dom_node_internal *new,
+ struct dom_node_internal *old)
+{
+ return _dom_html_element_copy(new, old);
+}
+
Modified: branches/struggleyb/libdom-html/src/html/html_form_element.h
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/htm...
==============================================================================
--- branches/struggleyb/libdom-html/src/html/html_form_element.h (original)
+++ branches/struggleyb/libdom-html/src/html/html_form_element.h Sat Aug 29 08:20:40 2009
@@ -2,6 +2,54 @@
* This file is part of libdom.
* Licensed under the MIT License,
* http://www.opensource.org/licenses/mit-license.php
- * Copyright 2009 Bo Yang <struggleyb.nku(a)gmail.com>
+ * Copyright 2009 Bo Yang <struggleyb.nku.com>
*/
+#ifndef dom_internal_html_form_element_h_
+#define dom_internal_html_form_element_h_
+
+#include <dom/html/html_form_element.h>
+
+#include "html/html_element.h"
+
+struct dom_html_form_element {
+ struct dom_html_element base;
+ /**< The base class */
+};
+
+/* Create a dom_html_form_element object */
+dom_exception _dom_html_form_element_create(struct dom_document *doc,
+ struct dom_html_form_element **ele);
+
+/* Initialise a dom_html_form_element object */
+dom_exception _dom_html_form_element_initialise(struct dom_document *doc,
+ struct dom_html_form_element *ele);
+
+/* Finalise a dom_html_form_element object */
+void _dom_html_form_element_finalise(struct dom_document *doc,
+ struct dom_html_form_element *ele);
+
+/* Destroy a dom_html_form_element object */
+void _dom_html_form_element_destroy(struct dom_document *doc,
+ struct dom_html_form_element *ele);
+
+/* The protected virtual functions */
+dom_exception _dom_html_form_element_parse_attribute(dom_element *ele,
+ struct dom_string *name, struct dom_string *value,
+ struct dom_string **parsed);
+void _dom_virtual_html_form_element_destroy(dom_node_internal *node);
+dom_exception _dom_html_form_element_alloc(struct dom_document *doc,
+ struct dom_node_internal *n, struct dom_node_internal **ret);
+dom_exception _dom_html_form_element_copy(struct dom_node_internal *new,
+ struct dom_node_internal *old);
+
+#define DOM_HTML_FORM_ELEMENT_PROTECT_VTABLE \
+ _dom_html_form_element_parse_attribute
+
+#define DOM_NODE_PROTECT_VTABLE_HTML_FORM_ELEMENT \
+ _dom_virtual_html_form_element_destroy, \
+ _dom_html_form_element_alloc, \
+ _dom_html_form_element_copy
+
+#endif
+
Modified: branches/struggleyb/libdom-html/src/html/html_isindex_element.c
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/htm...
==============================================================================
--- branches/struggleyb/libdom-html/src/html/html_isindex_element.c (original)
+++ branches/struggleyb/libdom-html/src/html/html_isindex_element.c Sat Aug 29 08:20:40 2009
@@ -66,7 +66,7 @@
err = _dom_html_element_initialise(doc, &ele->base, name, NULL, NULL);
_dom_document_unref_lwcstring(doc, name);
- ele->form = form;
+ ele->base.form = form;
dom_node_ref(form);
return err;
@@ -81,7 +81,6 @@
void _dom_html_isindex_element_finalise(struct dom_document *doc,
struct dom_html_isindex_element *ele)
{
- dom_node_unref(ele->form);
_dom_html_element_finalise(doc, &ele->base);
}
@@ -157,8 +156,7 @@
dom_exception dom_html_isindex_element_get_form(dom_html_isindex_element *ele,
struct dom_html_form_element **form)
{
- *form = ele->form;
- dom_node_ref(*form);
+ _dom_html_element_get_form(&ele->base, form);
return DOM_NO_ERR;
}
Modified: branches/struggleyb/libdom-html/src/html/html_isindex_element.h
URL: http://source.netsurf-browser.org/branches/struggleyb/libdom-html/src/htm...
==============================================================================
--- branches/struggleyb/libdom-html/src/html/html_isindex_element.h (original)
+++ branches/struggleyb/libdom-html/src/html/html_isindex_element.h Sat Aug 29 08:20:40 2009
@@ -15,9 +15,6 @@
struct dom_html_isindex_element {
struct dom_html_element base;
/**< The base class */
-
- struct dom_html_form_element *form;
- /**< The form which contains this element */
};
/* Create a dom_html_isindex_element object */
13 years, 9 months
r9493 chris_y - in /trunk/netsurf/amiga: gui.c gui.h
by netsurf@semichrome.net
Author: chris_y
Date: Sat Aug 29 05:16:19 2009
New Revision: 9493
URL: http://source.netsurf-browser.org?rev=9493&view=rev
Log:
Fix page dragging etc
Modified:
trunk/netsurf/amiga/gui.c
trunk/netsurf/amiga/gui.h
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=9493&r1=9...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Sat Aug 29 05:16:19 2009
@@ -2187,6 +2187,8 @@
gwin->win, NULL,
GA_Width, size1,
TAG_DONE);
+
+ RefreshWindowFrame(gwin->win);
}
ULONG ami_get_border_gadget_balance(struct gui_window_2 *gwin, ULONG *size1, ULONG *size2)
@@ -2285,6 +2287,7 @@
DisposeObject(g->shared->objects[OID_MAIN]);
+ ami_utf8_free(g->shared->status);
FreeVec(g->shared->svbuffer);
DelObject(g->shared->node);
@@ -2710,6 +2713,7 @@
void gui_window_set_status(struct gui_window *g, const char *text)
{
ULONG cur_tab = 0;
+ char *utf8text;
if(!g) return;
if(!text) return;
@@ -2718,12 +2722,20 @@
if((cur_tab == g->tab) || (g->shared->tabs == 0))
{
- SetGadgetAttrs(g->shared->gadgets[GID_STATUS],
+ utf8text = ami_utf8_easy(text);
+
+ if((g->shared->status == NULL) || (strcmp(utf8text,g->shared->status)))
+ {
+ SetGadgetAttrs(g->shared->gadgets[GID_STATUS],
g->shared->win, NULL,
- GA_Text, text,
+ GA_Text, utf8text,
TAG_DONE);
- RefreshWindowFrame(g->shared->win);
+ RefreshWindowFrame(g->shared->win);
+
+ if(g->shared->status) ami_utf8_free(g->shared->status);
+ g->shared->status = utf8text;
+ }
}
}
Modified: trunk/netsurf/amiga/gui.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.h?rev=9493&r1=9...
==============================================================================
--- trunk/netsurf/amiga/gui.h (original)
+++ trunk/netsurf/amiga/gui.h Sat Aug 29 05:16:19 2009
@@ -99,6 +99,7 @@
bool redraw_scroll;
bool new_content;
char *svbuffer;
+ char *status;
};
struct gui_window
13 years, 9 months
r9492 chris_y - in /branches/paulblokus/treeview/amiga: cookies.c history.c hotlist.c menu.c sslcert.c sslcert.h tree.c tree.h
by netsurf@semichrome.net
Author: chris_y
Date: Sat Aug 29 05:10:46 2009
New Revision: 9492
URL: http://source.netsurf-browser.org?rev=9492&view=rev
Log:
Fix for latest changes
Modified:
branches/paulblokus/treeview/amiga/cookies.c
branches/paulblokus/treeview/amiga/history.c
branches/paulblokus/treeview/amiga/hotlist.c
branches/paulblokus/treeview/amiga/menu.c
branches/paulblokus/treeview/amiga/sslcert.c
branches/paulblokus/treeview/amiga/sslcert.h (contents, props changed)
branches/paulblokus/treeview/amiga/tree.c
branches/paulblokus/treeview/amiga/tree.h
Modified: branches/paulblokus/treeview/amiga/cookies.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/cook...
==============================================================================
--- branches/paulblokus/treeview/amiga/cookies.c (original)
+++ branches/paulblokus/treeview/amiga/cookies.c Sat Aug 29 05:10:46 2009
@@ -23,16 +23,16 @@
void ami_cookies_initialise(void)
{
- cookies_window = AllocVec(sizeof(struct treeview_window),
- MEMF_PRIVATE | MEMF_CLEAR);
+ cookies_window = ami_tree_create(cookies_get_tree_flags(), NULL);
- cookies_window->tree = cookies_initialise(cookies_window,
- &ami_tree_callbacks);
+ if(!cookies_window) return;
+
+ cookies_initialise(ami_tree_get_tree(cookies_window));
}
void ami_cookies_free()
{
cookies_cleanup();
- FreeVec(cookies_window);
+ ami_tree_destroy(cookies_window);
cookies_window = NULL;
}
Modified: branches/paulblokus/treeview/amiga/history.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/hist...
==============================================================================
--- branches/paulblokus/treeview/amiga/history.c (original)
+++ branches/paulblokus/treeview/amiga/history.c Sat Aug 29 05:10:46 2009
@@ -24,17 +24,16 @@
void ami_global_history_initialise(void)
{
- global_history_window = AllocVec(sizeof(struct treeview_window),
- MEMF_PRIVATE | MEMF_CLEAR);
+ global_history_window = ami_tree_create(history_global_get_tree_flags(), NULL);
- global_history_window->tree = history_global_initialise(
- global_history_window,
- &ami_tree_callbacks);
+ if(!global_history_window) return;
+
+ history_global_initialise(ami_tree_get_tree(global_history_window));
}
void ami_global_history_free()
{
history_global_cleanup();
- FreeVec(global_history_window);
+ ami_tree_destroy(global_history_window);
global_history_window = NULL;
}
Modified: branches/paulblokus/treeview/amiga/hotlist.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/hotl...
==============================================================================
--- branches/paulblokus/treeview/amiga/hotlist.c (original)
+++ branches/paulblokus/treeview/amiga/hotlist.c Sat Aug 29 05:10:46 2009
@@ -24,17 +24,17 @@
void ami_hotlist_initialise(void)
{
- hotlist_window = AllocVec(sizeof(struct treeview_window),
- MEMF_PRIVATE | MEMF_CLEAR);
+ hotlist_window = ami_tree_create(hotlist_get_tree_flags(), NULL);
- hotlist_window->tree = hotlist_initialise(hotlist_window,
- &ami_tree_callbacks,
+ if(!hotlist_window) return;
+
+ hotlist_initialise(ami_tree_get_tree(hotlist_window),
option_hotlist_file);
}
void ami_hotlist_free()
{
hotlist_cleanup(option_hotlist_file);
- FreeVec(hotlist_window);
+ ami_tree_destroy(hotlist_window);
hotlist_window = NULL;
}
Modified: branches/paulblokus/treeview/amiga/menu.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/menu...
==============================================================================
--- branches/paulblokus/treeview/amiga/menu.c (original)
+++ branches/paulblokus/treeview/amiga/menu.c Sat Aug 29 05:10:46 2009
@@ -250,7 +250,7 @@
gwin->menu[7].nm_Flags = NM_ITEMDISABLED;
#endif
- ami_menu_scan(hotlist_window->tree, false, gwin);
+ ami_menu_scan(ami_tree_get_tree(hotlist_window), false, gwin);
ami_menu_arexx_scan(gwin);
if(!menualreadyinit)
Modified: branches/paulblokus/treeview/amiga/sslcert.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/sslc...
==============================================================================
--- branches/paulblokus/treeview/amiga/sslcert.c (original)
+++ branches/paulblokus/treeview/amiga/sslcert.c Sat Aug 29 05:10:46 2009
@@ -18,29 +18,25 @@
#include <proto/exec.h>
#include "amiga/tree.h"
-#include "desktop/sslcert.h"
+#include "amiga/sslcert.h"
void gui_cert_verify(struct browser_window *bw, struct content *c,
const struct ssl_cert_info *certs, unsigned long num)
{
struct sslcert_session_data *data;
-
- struct treeview_window *ssl_window =
- AllocVec(sizeof(struct treeview_window), MEMF_PRIVATE | MEMF_CLEAR);
+ struct treeview_window *ssl_window;
data = sslcert_create_session_data(num, bw, c->url);
- ssl_window->tree = sslcert_create_tree(ssl_window,
- &ami_tree_callbacks,
- certs,
- data);
+ ssl_window = ami_tree_create(sslcert_get_tree_flags(), data);
+ if(!ssl_window) return;
- ssl_window->ssl_data = data;
-// ssl_window->tree = data->tree;
+ sslcert_load_tree(ami_tree_get_tree(ssl_window), certs, data);
+
ami_tree_open(ssl_window, AMI_TREE_SSLCERT);
}
void ami_ssl_free(struct treeview_window *twin)
{
- FreeVec(twin);
+ ami_tree_destroy(twin);
}
Modified: branches/paulblokus/treeview/amiga/sslcert.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/sslc...
==============================================================================
--- branches/paulblokus/treeview/amiga/sslcert.h (original)
+++ branches/paulblokus/treeview/amiga/sslcert.h Sat Aug 29 05:10:46 2009
@@ -18,49 +18,7 @@
#ifndef AMIGA_SSLCERT_H
#define AMIGA_SSLCERT_H
+#include "desktop/sslcert.h"
+
void ami_ssl_free(struct treeview_window *twin);
#endif
-/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef AMIGA_SSLCERT_H
-#define AMIGA_SSLCERT_H
-void ami_ssl_free(struct treeview_window *twin);
-#endif
-/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef AMIGA_SSLCERT_H
-#define AMIGA_SSLCERT_H
-void ami_ssl_free(struct treeview_window *twin);
-#endif
Propchange: branches/paulblokus/treeview/amiga/sslcert.h
------------------------------------------------------------------------------
amiga:protection = ----rw-d ---- ----
Modified: branches/paulblokus/treeview/amiga/tree.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/tree...
==============================================================================
--- branches/paulblokus/treeview/amiga/tree.c (original)
+++ branches/paulblokus/treeview/amiga/tree.c Sat Aug 29 05:10:46 2009
@@ -50,9 +50,33 @@
#include "desktop/history_global_core.h"
#include "desktop/hotlist.h"
#include "amiga/sslcert.h"
+#include "utils/utils.h"
+
+#define AMI_TREE_MENU_ITEMS 19
+
+struct treeview_window {
+ struct Window *win;
+ Object *objects[OID_LAST];
+ struct Gadget *gadgets[GID_LAST];
+ struct nsObject *node;
+ ULONG pad[5];
+ int type;
+ struct NewMenu *menu;
+ char *menu_name[AMI_TREE_MENU_ITEMS];
+ struct tree *tree;
+ struct Hook scrollerhook;
+ uint32 key_state;
+ uint32 mouse_state;
+ int drag_x;
+ int drag_y;
+ struct timeval lastclick;
+ int max_width;
+ int max_height;
+ struct gui_globals globals;
+ struct sslcert_session_data *ssl_data;
+};
void ami_tree_draw(struct treeview_window *twin);
-
static void ami_tree_redraw_request(int x, int y, int width, int height,
void *data);
static void ami_tree_resized(struct tree *tree, int width,
@@ -66,6 +90,37 @@
.scroll_visible = ami_tree_scroll_visible,
.get_window_dimensions = ami_tree_get_window_dimensions
};
+
+struct treeview_window *ami_tree_create(uint8 flags,
+ struct sslcert_session_data *ssl_data)
+{
+ struct treeview_window *twin;
+
+ twin = AllocVec(sizeof(struct treeview_window),
+ MEMF_PRIVATE | MEMF_CLEAR);
+
+ if(!twin)
+ {
+ warn_user("NoMemory", 0);
+ return NULL;
+ }
+
+ twin->ssl_data = ssl_data;
+
+ twin->tree = tree_create(flags, &ami_tree_callbacks, twin);
+ return twin;
+}
+
+void ami_tree_destroy(struct treeview_window *twin)
+{
+ tree_delete(twin->tree);
+ FreeVec(twin);
+}
+
+struct tree *ami_tree_get_tree(struct treeview_window *twin)
+{
+ return twin->tree;
+}
void ami_tree_resized(struct tree *tree, int width, int height, void *data)
{
Modified: branches/paulblokus/treeview/amiga/tree.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/tree...
==============================================================================
--- branches/paulblokus/treeview/amiga/tree.h (original)
+++ branches/paulblokus/treeview/amiga/tree.h Sat Aug 29 05:10:46 2009
@@ -25,29 +25,7 @@
#include "desktop/tree.h"
#include "desktop/sslcert.h"
-#define AMI_TREE_MENU_ITEMS 19
-
-struct treeview_window {
- struct Window *win;
- Object *objects[OID_LAST];
- struct Gadget *gadgets[GID_LAST];
- struct nsObject *node;
- ULONG pad[5];
- int type;
- struct NewMenu *menu;
- char *menu_name[AMI_TREE_MENU_ITEMS];
- struct tree *tree;
- struct Hook scrollerhook;
- uint32 key_state;
- uint32 mouse_state;
- int drag_x;
- int drag_y;
- struct timeval lastclick;
- int max_width;
- int max_height;
- struct gui_globals globals;
- struct sslcert_session_data *ssl_data;
-};
+struct treeview_window;
enum
{
@@ -57,6 +35,11 @@
AMI_TREE_SSLCERT
};
+struct treeview_window *ami_tree_create(uint8 flags,
+ struct sslcert_session_data *ssl_data);
+void ami_tree_destroy(struct treeview_window *twin);
+struct tree *ami_tree_get_tree(struct treeview_window *twin);
+
void ami_tree_open(struct treeview_window *twin,int type);
void ami_tree_close(struct treeview_window *twin);
BOOL ami_tree_event(struct treeview_window *twin);
13 years, 9 months
r9491 chris_y - /trunk/netsurf/amiga/gui.c
by netsurf@semichrome.net
Author: chris_y
Date: Fri Aug 28 18:26:55 2009
New Revision: 9491
URL: http://source.netsurf-browser.org?rev=9491&view=rev
Log:
gadget tag/position tweaks
Modified:
trunk/netsurf/amiga/gui.c
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=9491&r1=9...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Fri Aug 28 18:26:55 2009
@@ -2117,9 +2117,8 @@
"scrollergclass",
GA_ID, GID_HSCROLL,
PGA_Freedom, FREEHORIZ,
- ICA_TARGET, ICTARGET_IDCMP,
// GA_Left, size1,
- GA_RelRight, - size2 - sz,
+ GA_RelRight, 1 - size2 - sz,
GA_Width, size2,
GA_BottomBorder, TRUE,
GA_RelVerify, TRUE,
@@ -2134,11 +2133,10 @@
"frbuttonclass",
GA_ID, GID_STATUS,
GA_Left, scrn->WBorLeft,
- GA_RelBottom, -((1 + sz - scrn->RastPort.TxHeight)/2),
+ GA_RelBottom, -((1 + sz + scrn->WBorBottom - scrn->RastPort.TxHeight)/2),
GA_Width, size1,
GA_DrawInfo, dri,
GA_BottomBorder, TRUE,
- GA_RelVerify, TRUE,
GA_Next, gwin->shared->gadgets[GID_HSCROLL],
TAG_DONE);
13 years, 9 months